public class TerminalFigure extends AbstractFigure implements Terminal
| Modifier and Type | Field and Description |
|---|---|
(package private) Site |
_attachSite |
protected Site |
_connectSite |
(package private) Figure |
_figure |
| Modifier | Constructor and Description |
|---|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
Site _attachSite
protected Site _connectSite
Figure _figure
public TerminalFigure(Figure figure, Site connectSite)
protected TerminalFigure(Figure figure)
public boolean contains(java.awt.geom.Point2D p)
contains in interface Figurecontains in class AbstractFigurep - The given pointpublic 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 AbstractFigureFigure.setInteractor(Interactor)public 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 AbstractFigureFigure.setParent(CanvasComponent)public 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 AbstractFigureFigure.setToolTipText(String)public 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 AbstractFigurer - The rectangle to be checked.public boolean intersects(java.awt.geom.Rectangle2D r)
intersects in interface Figureintersects in class AbstractFigurer - The rectangle to be checked.public boolean isVisible()
isVisible in interface VisibleComponentisVisible in class AbstractFigurepublic void paint(java.awt.Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigureg - The 2D graphics object that this object
it to be painted upon.public void paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
paint in interface VisibleComponentpaint in class AbstractFigureg - The 2D graphics object that this object
it to be painted upon.region - The region.public void relocate()
public void repaint()
repaint in interface CanvasComponentrepaint in class AbstractFigurepublic void repaint(DamageRegion d)
repaint in interface CanvasComponentrepaint in class AbstractFigured - The region where a repaint has occurred.public void setAttachSite(Site s)
setAttachSite in interface Terminalpublic void setInteractor(Interactor interactor)
setInteractor in interface FiguresetInteractor in class AbstractFigureinteractor - The interactor.Figure.getInteractor()public void setParent(CanvasComponent fc)
setParent in interface FiguresetParent in class AbstractFigurefc - The parent of the figure.Figure.getParent()public void setToolTipText(java.lang.String tip)
setToolTipText in interface FiguresetToolTipText in class AbstractFiguretip - The tool tip text.Figure.getToolTipText()public void transform(java.awt.geom.AffineTransform at)
transform in interface Figuretransform in class AbstractFigureat - The transform to be used.public void translate(double x,
double y)
translate in interface Figuretranslate in class AbstractFigurex - The x value to be moved.y - The y value to be moved.public void setUserObject(java.lang.Object o)
setUserObject in interface UserObjectContainersetUserObject in class AbstractFigureo - The user object.public void setVisible(boolean flag)
setVisible in interface VisibleComponentsetVisible in class AbstractFigureflag - True if this object is to be visible.