Class org.aswing.JViewport

Implemented Interfaces

Viewportable

Description

Field Index

ON_STATE_CHANGED

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Method Index

new JViewport()
addChangeListener(), append(), getExtentSize(), getHorizontalBlockIncrement(), getHorizontalUnitIncrement(), getUIClassID(), getVerticalBlockIncrement(), getVerticalUnitIncrement(), getView(), getViewportPane(), getViewPosition(), getViewSize(), insert(), scrollRectToVisible(), scrollToBottomLeft(), scrollToBottomRight(), scrollToTopLeft(), scrollToTopRight(), setHorizontalBlockIncrement(), setHorizontalUnitIncrement(), setLayout(), setUI(), setVerticalBlockIncrement(), setVerticalUnitIncrement(), setView(), setViewportTestSize(), setViewPosition(), toScreenCoordinatesLocation(), toScreenCoordinatesSize(), toViewCoordinatesLocation(), toViewCoordinatesSize(), updateUI()

Inherited from Container

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JViewport

public function JViewport(view:Component)


JViewport(view:Component)
JViewport()

Field Detail

ON_STATE_CHANGED

static public ON_STATE_CHANGED:String
When the viewport's state changed. View position changed, view changed, all related to scroll things changed.
onStateChanged Event{source:JViewport}

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.Component

setUI

public function setUI(newUI:ViewportUI):Void

Description copied from Component

Sets the look and feel delegate for this component. Component subclasses generally override this method to narrow the argument type. For example, in JSlider:

 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally Component subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Overrides

setUI() in org.aswing.Component

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

setLayout

public function setLayout(layout:LayoutManager):Void

Throws

Errorif the layout is not a ViewportLayout

Overrides

setLayout() in org.aswing.Container

setView

public function setView(view:Component):Void

Sets the view component.

The view is the visible content of the JViewPort.

JViewport use to manage the scroll view of a component. the component will be set size to its preferred size, then scroll in the viewport.

If the component's isTracksViewportWidth method is defined and return true, when the viewport's show size is larger than the component's, the component will be widen to the show size, otherwise, not widen. Same as isTracksViewportHeight method.

getView

public function getView():Component

setVerticalUnitIncrement

public function setVerticalUnitIncrement(increment:Number):Void

Sets the unit value for the Vertical scrolling.

setVerticalBlockIncrement

public function setVerticalBlockIncrement(increment:Number):Void

Sets the block value for the Vertical scrolling.

setHorizontalUnitIncrement

public function setHorizontalUnitIncrement(increment:Number):Void

Sets the unit value for the Horizontal scrolling.

setHorizontalBlockIncrement

public function setHorizontalBlockIncrement(increment:Number):Void

Sets the block value for the Horizontal scrolling.

append

public function append(com:Component, constraints:Object):Void

In fact just call setView(com) in this method

Overrides

append() in org.aswing.Container

See Also

insert

public function insert(i:Number, com:Component, constraints:Object):Void

In fact just call setView(com) in this method

Overrides

insert() in org.aswing.Container

See Also

getVerticalUnitIncrement

public function getVerticalUnitIncrement():Number

Returns the unit value for the Vertical scrolling.

Specified By

getVerticalUnitIncrement() in org.aswing.Viewportable

getVerticalBlockIncrement

public function getVerticalBlockIncrement():Number

Return the block value for the Vertical scrolling.

Specified By

getVerticalBlockIncrement() in org.aswing.Viewportable

getHorizontalUnitIncrement

public function getHorizontalUnitIncrement():Number

Returns the unit value for the Horizontal scrolling.

Specified By

getHorizontalUnitIncrement() in org.aswing.Viewportable

getHorizontalBlockIncrement

public function getHorizontalBlockIncrement():Number

Return the block value for the Horizontal scrolling.

Specified By

getHorizontalBlockIncrement() in org.aswing.Viewportable

setViewportTestSize

public function setViewportTestSize(s:Dimension):Void

Description copied from Viewportable

Before JScrollPane analyse the scroll properties(call getExtentSize and getViewSize), it will call this method to set the size of viewport will be to test.

Specified By

setViewportTestSize() in org.aswing.Viewportable

getExtentSize

public function getExtentSize():Dimension

Description copied from Viewportable

Returns the size of the visible part of the view in view logic coordinates.

Specified By

getExtentSize() in org.aswing.Viewportable

getViewSize

public function getViewSize():Dimension

Usually the view's preffered size.

Return

the view's size, (0, 0) if view is null.

Specified By

getViewSize() in org.aswing.Viewportable

getViewPosition

public function getViewPosition():Point

Returns the view's position, if there is not any view, return null.

Return

the view's position, null if view is null.

Specified By

getViewPosition() in org.aswing.Viewportable

setViewPosition

public function setViewPosition(p:Point):Void

Description copied from Viewportable

Sets the view coordinates that appear in the upper left hand corner of the viewport. in view logic coordinates.

Specified By

setViewPosition() in org.aswing.Viewportable

scrollRectToVisible

public function scrollRectToVisible(contentRect:Rectangle):Void

Description copied from Viewportable

Scrolls the view so that Rectangle within the view becomes visible. in view logic coordinates.

Note that this method will not scroll outside of the valid viewport; for example, if contentRect is larger than the viewport, scrolling will be confined to the viewport's bounds.

Specified By

scrollRectToVisible() in org.aswing.Viewportable

scrollToBottomLeft

public function scrollToBottomLeft():Void

Scrolls to view bottom left content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToBottomRight

public function scrollToBottomRight():Void

Scrolls to view bottom right content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToTopLeft

public function scrollToTopLeft():Void

Scrolls to view top left content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

scrollToTopRight

public function scrollToTopRight():Void

Scrolls to view to right content. This will make the scrollbars of JScrollPane scrolled automatically, if it is located in a JScrollPane.

toViewCoordinatesSize

public function toViewCoordinatesSize(size:Dimension):Dimension

Converts a size in screen pixel coordinates to view ligic coordinates. Subclasses of viewport that support "logical coordinates" will override this method.

Parameters

sizea Dimension object using screen pixel coordinates

Return

a Dimension object converted to view logic coordinates

toViewCoordinatesLocation

public function toViewCoordinatesLocation(p:Point):Point

Converts a point in screen pixel coordinates to view coordinates. Subclasses of viewport that support "logical coordinates" will override this method.

Parameters

pa Point object using screen pixel coordinates

Return

a Point object converted to view coordinates

toScreenCoordinatesSize

public function toScreenCoordinatesSize(size:Dimension):Dimension

Converts a size in view logic coordinates to screen pixel coordinates. Subclasses of viewport that support "logical coordinates" will override this method.

Parameters

sizea Dimension object using view logic coordinates

Return

a Dimension object converted to screen pixel coordinates

toScreenCoordinatesLocation

public function toScreenCoordinatesLocation(p:Point):Point

Converts a point in view logic coordinates to screen pixel coordinates. Subclasses of viewport that support "logical coordinates" will override this method.

Parameters

pa Point object using view logic coordinates

Return

a Point object converted to screen pixel coordinates

addChangeListener

public function addChangeListener(func:Function, obj:Object):Object

Description copied from Viewportable

Add a listener to listen the viewpoat state change event.

When the viewpoat's state changed, the state is all about:

  • viewPosition

onStateChanged Event{source:Viewportable}

Specified By

addChangeListener() in org.aswing.Viewportable

getViewportPane

public function getViewportPane():Component

Description copied from Viewportable

Return the component of the viewportable's pane which would added to displayed on the stage.

Specified By

getViewportPane() in org.aswing.Viewportable