Package hec.gfx2d
Class G2dGraphicComponent
java.lang.Object
hec.gfx2d.G2dGraphicComponent
Base class for graphic components displayed the Gfx2d Viewport.
Graphic components have a rectangular region much like awt components which
are sized and positioned within the viewport using a gridbag-like strategy.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorConstruct a graphic component with given parent and container -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all child graphics.Returns the bounding rectangle in local coordinates.Get a reference to the position objectReturns the preferred size of this component.Returns the preferred size based on the current graphics display resolutionvoid
Draws the component to the specified graphics context.boolean
Set the local coordinate bounds and resize all child objects accordingly.void
Set the position object.void
-
Constructor Details
-
G2dGraphicComponent
public G2dGraphicComponent()Default Constructor -
G2dGraphicComponent
Construct a graphic component with given parent and container
-
-
Method Details
-
setPosition
Set the position object. -
getPosition
Get a reference to the position object -
paint
Draws the component to the specified graphics context. If paint is overridden by a subclass, this method should be called by super.paint(g) to traverse the tree of child graphic components. -
getPreferredSize
Returns the preferred size of this component. Should be overridden by sub-classes. -
getPreferredSize
Returns the preferred size based on the current graphics display resolution -
clear
public void clear()Removes all child graphics. -
setBounds
Set the local coordinate bounds and resize all child objects accordingly. -
getBounds
Returns the bounding rectangle in local coordinates. -
sizeChildren
public void sizeChildren()
-