JHotDraw 6.0b1

Class ComponentFigure

  extended by org.jhotdraw.standard.AbstractFigure
      extended by org.jhotdraw.figures.AttributeFigure
          extended by org.jhotdraw.contrib.ComponentFigure
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Figure, Storable

public class ComponentFigure
extends AttributeFigure

See Also:
Serialized Form

Constructor Summary
ComponentFigure(java.awt.Component newComponent)
Method Summary
 void basicDisplayBox(java.awt.Point origin, java.awt.Point corner)
          Changes the display box of a figure.
protected  void basicMoveBy(int dx, int dy)
          Moves the figure.
 java.awt.Rectangle displayBox()
          Gets the display box of a figure
 void draw(java.awt.Graphics g)
          Draws the figure.
 java.awt.Component getComponent()
          Getter for property component.
 HandleEnumeration handles()
          Returns the handles used to manipulate the figure.
protected  void setComponent(java.awt.Component newComponent)
          Setter for property component.
Methods inherited from class org.jhotdraw.figures.AttributeFigure
drawBackground, drawFrame, getAttribute, getAttribute, getDefaultAttribute, getDefaultAttribute, getFillColor, getFrameColor, initDefaultAttribute, read, setAttribute, setAttribute, setDefaultAttribute, write
Methods inherited from class org.jhotdraw.standard.AbstractFigure
addDependendFigure, addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, figures, findFigureInside, getDecoratedFigure, getDependendFigures, getTextHolder, getZValue, includes, invalidate, invalidateRectangle, isEmpty, listener, moveBy, release, removeDependendFigure, removeFigureChangeListener, removeFromContainer, setZValue, size, visit, willChange
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ComponentFigure(java.awt.Component newComponent)
newComponent - a lightweight component
Method Detail


public void basicDisplayBox(java.awt.Point origin,
                            java.awt.Point corner)
Changes the display box of a figure. This method is always implemented in figure subclasses. It only changes the displaybox and does not announce any changes. It is usually not called by the client. Clients typically call displayBox to change the display box.

Specified by:
basicDisplayBox in interface Figure
Specified by:
basicDisplayBox in class AbstractFigure
origin - the new origin
corner - the new corner
See Also:


protected void basicMoveBy(int dx,
                           int dy)
Moves the figure. This is the method that subclassers override. Clients usually call displayBox.

Specified by:
basicMoveBy in class AbstractFigure
See Also:
AbstractFigure.moveBy(int, int)


public java.awt.Rectangle displayBox()
Gets the display box of a figure

Specified by:
displayBox in interface Figure
Specified by:
displayBox in class AbstractFigure
See Also:
basicDisplayBox(java.awt.Point, java.awt.Point)


public HandleEnumeration handles()
Returns the handles used to manipulate the figure. Handles is a Factory Method for creating handle objects.

Specified by:
handles in interface Figure
Specified by:
handles in class AbstractFigure
a type-safe iterator of handles
See Also:


public java.awt.Component getComponent()
Getter for property component.

Value of property component.


protected void setComponent(java.awt.Component newComponent)
Setter for property component.

newComponent - New value of property component.


public void draw(java.awt.Graphics g)
Draws the figure.

Specified by:
draw in interface Figure
draw in class AttributeFigure
g - the Graphics to draw into

JHotDraw 6.0b1