JHotDraw 6.0b1

org.jhotdraw.contrib
Class ComponentFigure

java.lang.Object
  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

ComponentFigure

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

basicDisplayBox

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
Parameters:
origin - the new origin
corner - the new corner
See Also:
displayBox()

basicMoveBy

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)

displayBox

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)

handles

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
Returns:
a type-safe iterator of handles
See Also:
Handle

getComponent

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

Returns:
Value of property component.

setComponent

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

Parameters:
newComponent - New value of property component.

draw

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

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

JHotDraw 6.0b1