|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.draw2d.Figure | +--org.eclipse.draw2d.Viewport
A Viewport is a flexible window onto a ScrollPane
and represents the visible
portion of the ScrollPane.
Nested Class Summary |
Nested classes inherited from class org.eclipse.draw2d.Figure |
Figure.FigureIterator |
Nested classes inherited from class org.eclipse.draw2d.IFigure |
IFigure.NoInsets |
Field Summary | |
static String |
PROPERTY_VIEW_LOCATION
ID for the view location property |
Fields inherited from class org.eclipse.draw2d.Figure |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
Fields inherited from interface org.eclipse.draw2d.IFigure |
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
Constructor Summary | |
Viewport()
Constructs a new Viewport with the default values. |
|
Viewport(boolean setting)
Constructs a new Viewport. |
Method Summary | |
Rectangle |
getClientArea(Rectangle rect)
Copies the client area into the specificied Recangle, and returns that rectangle for convenience. |
IFigure |
getContents()
Returns the view, which is the contents of the ScrollPane associated with this
Viewport. |
boolean |
getContentsTracksHeight()
Returns true if the Viewport resizes itself in the vertical direction when
the available height of its view is decreased, false otherwise. |
boolean |
getContentsTracksWidth()
Returns true if the Viewport resizes itself in the horizontal direction
when the available width of its view is decreased, false otherwise. |
RangeModel |
getHorizontalRangeModel()
Returns the RangeModel associated with the horizontal motion of this Viewport |
RangeModel |
getVerticalRangeModel()
Returns the range model associated with the vertical motion of the Viewport. |
Point |
getViewLocation()
Returns the current location of this Viewport. |
protected void |
paintClientArea(Graphics g)
Paints this Figure's client area. |
void |
propertyChange(PropertyChangeEvent event)
Listens for either of the RangeModels to fire a property change
event and updates the view accordingly. |
protected void |
readjustScrollBars()
Sets extents of RangeModels to the client area of this Viewport.
|
void |
setContents(IFigure figure)
Sets this Viewport to be associated with the passed Figure. |
void |
setContentsTracksHeight(boolean track)
Toggles the Viewport's ability to resize itself automatically when its view is decreased in size in the vertical direction. |
void |
setContentsTracksWidth(boolean track)
Toggles the Viewport's ability to resize itself automatically when its view is decreased in size in the horizontal direction. |
void |
setHorizontalLocation(int value)
Sets the horizontal location of the Viewport's view to the passed value. |
void |
setHorizontalRangeModel(RangeModel rangeModel)
Sets the horizontal range model to the passed RangeModel. |
void |
setIgnoreScroll(boolean value)
If value is true , this viewport will ignore any scrolling that
occurs until this method is called again with false . |
void |
setVerticalLocation(int value)
Sets the vertical location of the Viewport's view to the passed value. |
void |
setVerticalRangeModel(RangeModel rangeModel)
Sets the vertical range model to the passed RangeModel. |
void |
setViewLocation(int x,
int y)
Sets the location of the Viewport's view to the passed values. |
void |
setViewLocation(Point p)
Sets the location of the Viewport's view to the passed Point. |
void |
translateFromParent(Translatable t)
Translates a Translatable from this IFigure's parent's coordinates to this IFigure's local coordinates. |
void |
translateToParent(Translatable t)
Translates a Translatable from this IFigure's coordinates to its parent's coordinates. |
boolean |
useGraphicsTranslate()
Returns true if this viewport uses graphics translation. |
void |
validate()
Causes this IFigure to layout itself, as well as its children. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String PROPERTY_VIEW_LOCATION
Constructor Detail |
public Viewport()
public Viewport(boolean setting)
true
, the viewport will
use graphics translation to paint.
setting
- whether to use graphics translationMethod Detail |
public Rectangle getClientArea(Rectangle rect)
IFigure
getClientArea
in interface IFigure
getClientArea
in class Figure
IFigure.getClientArea(Rectangle)
public IFigure getContents()
ScrollPane
associated with this
Viewport.
public RangeModel getHorizontalRangeModel()
public boolean getContentsTracksHeight()
true
if the Viewport resizes itself in the vertical direction when
the available height of its view is decreased, false otherwise. This option is turned
off by default, and can be activated by calling
setContentsTracksHeight(boolean)
and passing in true
.
public boolean getContentsTracksWidth()
true
if the Viewport resizes itself in the horizontal direction
when the available width of its view is decreased, false otherwise. This option is
turned off by default, and can be activated by calling
setContentsTracksWidth(boolean)
and passing in true
.
public RangeModel getVerticalRangeModel()
public Point getViewLocation()
protected void paintClientArea(Graphics g)
Figure
Border
or Insets
, and by default includes the
children of this Figure. On return, this method must leave the given Graphics in its
initial state.
paintClientArea
in class Figure
g
- The Graphics used to paintFigure.paintClientArea(Graphics)
public void propertyChange(PropertyChangeEvent event)
RangeModels
to fire a property change
event and updates the view accordingly.
propertyChange
in interface PropertyChangeListener
event
- the eventprotected void readjustScrollBars()
RangeModels
to the client area of this Viewport.
Sets RangeModel minimums to zero. Sets RangeModel maximums to this Viewport's
height/width.
public void setContents(IFigure figure)
figure
- the new contentspublic void setContentsTracksHeight(boolean track)
track
- whether this viewport should track its heightpublic void setContentsTracksWidth(boolean track)
track
- whether this viewport should track its widthpublic void setHorizontalLocation(int value)
value
- the new horizontal locationpublic void setHorizontalRangeModel(RangeModel rangeModel)
rangeModel
- the new horizontal range modelpublic void setIgnoreScroll(boolean value)
true
, this viewport will ignore any scrolling that
occurs until this method is called again with false
.
value
- whether this viewport should ignore future scrollspublic void setVerticalLocation(int value)
value
- the new vertical locationpublic void setVerticalRangeModel(RangeModel rangeModel)
rangeModel
- the new vertical RangeModelpublic void setViewLocation(int x, int y)
x
- The new x coordinate of the Viewport's view.y
- The new y coordinate of the Viewport's view.public void setViewLocation(Point p)
p
- The new location of the Viewport's view.public void translateFromParent(Translatable t)
IFigure
translateFromParent
in interface IFigure
translateFromParent
in class Figure
IFigure.translateFromParent(Translatable)
public void translateToParent(Translatable t)
IFigure
translateToParent
in interface IFigure
translateToParent
in class Figure
IFigure.translateToParent(Translatable)
public boolean useGraphicsTranslate()
true
if this viewport uses graphics translation.
public void validate()
IFigure
validate
in interface IFigure
validate
in class Figure
IFigure.validate()
|
Eclipse Draw2d 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |