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 Figure
contains
in class AbstractFigure
p
- The given pointpublic java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Figure
getBounds
in class AbstractFigure
public Site getAttachSite()
getAttachSite
in interface Terminal
public Site getConnectSite()
getConnectSite
in interface Terminal
public Figure getFigure()
public Interactor getInteractor()
getInteractor
in interface Figure
getInteractor
in class AbstractFigure
Figure.setInteractor(Interactor)
public CanvasLayer getLayer()
getLayer
in interface Figure
getLayer
in class AbstractFigure
public java.awt.geom.Point2D getOrigin()
getOrigin
in interface Figure
getOrigin
in class AbstractFigure
AbstractFigure.getBounds()
public CanvasComponent getParent()
getParent
in interface CanvasComponent
getParent
in interface Figure
getParent
in class AbstractFigure
Figure.setParent(CanvasComponent)
public TransformContext getTransformContext()
getTransformContext
in interface CanvasComponent
getTransformContext
in class AbstractFigure
public java.awt.Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public java.lang.String getToolTipText()
getToolTipText
in interface Figure
getToolTipText
in class AbstractFigure
Figure.setToolTipText(String)
public java.lang.Object getUserObject()
getUserObject
in interface UserObjectContainer
getUserObject
in class AbstractFigure
public 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 Figure
hit
in class AbstractFigure
r
- The rectangle to be checked.public boolean intersects(java.awt.geom.Rectangle2D r)
intersects
in interface Figure
intersects
in class AbstractFigure
r
- The rectangle to be checked.public boolean isVisible()
isVisible
in interface VisibleComponent
isVisible
in class AbstractFigure
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
g
- 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 VisibleComponent
paint
in class AbstractFigure
g
- The 2D graphics object that this object
it to be painted upon.region
- The region.public void relocate()
public void repaint()
repaint
in interface CanvasComponent
repaint
in class AbstractFigure
public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
repaint
in class AbstractFigure
d
- The region where a repaint has occurred.public void setAttachSite(Site s)
setAttachSite
in interface Terminal
public void setInteractor(Interactor interactor)
setInteractor
in interface Figure
setInteractor
in class AbstractFigure
interactor
- The interactor.Figure.getInteractor()
public void setParent(CanvasComponent fc)
setParent
in interface Figure
setParent
in class AbstractFigure
fc
- The parent of the figure.Figure.getParent()
public void setToolTipText(java.lang.String tip)
setToolTipText
in interface Figure
setToolTipText
in class AbstractFigure
tip
- The tool tip text.Figure.getToolTipText()
public void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
at
- The transform to be used.public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
x
- The x value to be moved.y
- The y value to be moved.public void setUserObject(java.lang.Object o)
setUserObject
in interface UserObjectContainer
setUserObject
in class AbstractFigure
o
- The user object.public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
setVisible
in class AbstractFigure
flag
- True if this object is to be visible.