|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.connector.TerminalFigure
public class TerminalFigure
A TerminalFigure decorates a figure to be a terminal as well. Using this class, any Figure can be made a terminal. As per the decorator pattern, the Figure should be not be accessed externally to this class.
| Field Summary | |
|---|---|
(package private) Site |
_attachSite
|
protected Site |
_connectSite
|
(package private) Figure |
_figure
|
| Constructor Summary | |
|---|---|
protected |
TerminalFigure(Figure figure)
Create a new TerminalFigure for the given figure. |
|
TerminalFigure(Figure figure,
Site connectSite)
Create a new TerminalFigure for the given figure, with the given site for connections. |
| Method Summary | |
|---|---|
boolean |
contains(java.awt.geom.Point2D p)
Test whether this figure contains the point given. |
Site |
getAttachSite()
Get the site that the terminal is attached to. |
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding box of this figure. |
Site |
getConnectSite()
Get the site that a connector can connect to. |
Figure |
getFigure()
Get the figure that this terminal figure is wrapping. |
Interactor |
getInteractor()
Return the interactor of this figure. |
CanvasLayer |
getLayer()
Get the most immediate layer containing this figure. |
java.awt.geom.Point2D |
getOrigin()
Return the origin of the wrapped figure in the enclosing transform context. |
CanvasComponent |
getParent()
Return the parent of this component. |
java.awt.Shape |
getShape()
Get the outline shape of this figure. |
java.lang.String |
getToolTipText()
Return the tooltip for this figure. |
TransformContext |
getTransformContext()
Return the transform context of the component. |
java.lang.Object |
getUserObject()
Return the user object. |
boolean |
hit(java.awt.geom.Rectangle2D r)
Test if this figure is "hit" by the given rectangle. |
boolean |
intersects(java.awt.geom.Rectangle2D r)
Test if this figure intersects the given rectangle. |
boolean |
isVisible()
Test the visibility flag of this object. |
void |
paint(java.awt.Graphics2D g)
Paint the figure. |
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
Paint this object onto a 2D graphics object, within the given region. |
void |
relocate()
Tell the terminal to relocate itself because the attachment site (or the figure that owns it) has moved. |
void |
repaint()
Schedule a repaint of the component. |
void |
repaint(DamageRegion d)
Accept notification that a repaint has occurred somewhere in the tree below this component. |
void |
setAttachSite(Site s)
Set the site that the terminal is attached to. |
void |
setInteractor(Interactor interactor)
Set the interactor of this figure. |
void |
setParent(CanvasComponent fc)
Set the parent of this figure. |
void |
setToolTipText(java.lang.String tip)
Set the tool tip for this figure. |
void |
setUserObject(java.lang.Object o)
Set the user object. |
void |
setVisible(boolean flag)
Set the visibility flag of this object. |
void |
transform(java.awt.geom.AffineTransform at)
Transform the figure with the supplied transform. |
void |
translate(double x,
double y)
Move the figure the indicated distance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
Site _attachSite
protected Site _connectSite
Figure _figure
| Constructor Detail |
|---|
public TerminalFigure(Figure figure,
Site connectSite)
protected TerminalFigure(Figure figure)
| Method Detail |
|---|
public boolean contains(java.awt.geom.Point2D p)
contains in interface Figurecontains in class AbstractFigurepublic java.awt.geom.Rectangle2D getBounds()
getBounds in interface FiguregetBounds in class AbstractFigurepublic Site getAttachSite()
getAttachSite in interface Terminalpublic Site getConnectSite()
getConnectSite in interface Terminalpublic Figure getFigure()
public Interactor getInteractor()
getInteractor in interface FiguregetInteractor in class AbstractFigurepublic CanvasLayer getLayer()
getLayer in interface FiguregetLayer in class AbstractFigurepublic java.awt.geom.Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public CanvasComponent getParent()
getParent in interface CanvasComponentgetParent in interface FiguregetParent in class AbstractFigurepublic TransformContext getTransformContext()
getTransformContext in interface CanvasComponentgetTransformContext in class AbstractFigurepublic java.awt.Shape getShape()
getShape in interface FiguregetShape in class AbstractFigurepublic java.lang.String getToolTipText()
getToolTipText in interface FiguregetToolTipText in class AbstractFigurepublic java.lang.Object getUserObject()
getUserObject in interface UserObjectContainergetUserObject in class AbstractFigurepublic boolean hit(java.awt.geom.Rectangle2D r)
(This method would be better named hits, but the name hit is consistent with java.awt.Graphics2D.)
hit in interface Figurehit in class AbstractFigurepublic boolean intersects(java.awt.geom.Rectangle2D r)
intersects in interface Figureintersects in class AbstractFigurepublic boolean isVisible()
isVisible in interface VisibleComponentisVisible in class AbstractFigurepublic void paint(java.awt.Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigure
public void paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
paint in interface VisibleComponentpaint in class AbstractFigurepublic void relocate()
relocate in interface Terminalpublic void repaint()
repaint in interface CanvasComponentrepaint in class AbstractFigurepublic void repaint(DamageRegion d)
repaint in interface CanvasComponentrepaint in class AbstractFigurepublic void setAttachSite(Site s)
setAttachSite in interface Terminalpublic void setInteractor(Interactor interactor)
setInteractor in interface FiguresetInteractor in class AbstractFigurepublic void setParent(CanvasComponent fc)
setParent in interface FiguresetParent in class AbstractFigurepublic void setToolTipText(java.lang.String tip)
setToolTipText in interface FiguresetToolTipText in class AbstractFigurepublic void transform(java.awt.geom.AffineTransform at)
transform in interface Figuretransform in class AbstractFigure
public void translate(double x,
double y)
translate in interface Figuretranslate in class AbstractFigurepublic void setUserObject(java.lang.Object o)
setUserObject in interface UserObjectContainersetUserObject in class AbstractFigurepublic void setVisible(boolean flag)
setVisible in interface VisibleComponentsetVisible in class AbstractFigure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||