Package diva.canvas.tutorial
Class ConnectorTutorial.SitedRectangle
- java.lang.Object
-
- diva.canvas.AbstractFigure
-
- diva.canvas.toolbox.BasicFigure
-
- diva.canvas.toolbox.BasicRectangle
-
- diva.canvas.tutorial.ConnectorTutorial.SitedRectangle
-
- All Implemented Interfaces:
CanvasComponent
,Figure
,ShapedFigure
,VisibleComponent
,UserObjectContainer
- Enclosing class:
- ConnectorTutorial
public static class ConnectorTutorial.SitedRectangle extends BasicRectangle
SitedRectangle is a class that provides four sites that we use in the examples to attach connectors to. In this example, we make life easy by using an instance of the BoundsGeometry class, but in general, figures will want to define their own sites. One thing to note about this figure: it does not itself contain the code that re-routes the attached connectors. Although it could override transform() and translate, in general it is better for this kind of routing to be initiated by the interaction code.
-
-
Constructor Summary
Constructors Constructor Description SitedRectangle(double x, double y, double width, double height, java.awt.Color color)
Create a new instance of this figure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Site
getE()
Get the east site.Site
getN()
Get the north site.Site
getS()
Get the south site.Site
getW()
Get the west site.void
transform(java.awt.geom.AffineTransform at)
Update the geometryvoid
translate(double x, double y)
Update the geometry-
Methods inherited from class diva.canvas.toolbox.BasicFigure
getBounds, getComposite, getDashArray, getFillPaint, getLineWidth, getOrigin, getRotation, getShape, getStrokePaint, hit, isCentered, paint, setCentered, setComposite, setDashArray, setFillPaint, setLineWidth, setPrototypeShape, setRotation, setShape, setStroke, setStrokePaint
-
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface diva.canvas.CanvasComponent
getTransformContext, repaint, repaint
-
Methods inherited from interface diva.canvas.Figure
contains, getInteractor, getLayer, getParent, getToolTipText, intersects, setInteractor, setParent, setToolTipText
-
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
-
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, setVisible
-
-
-
-
Method Detail
-
getN
public Site getN()
Get the north site.
-
getS
public Site getS()
Get the south site.
-
getE
public Site getE()
Get the east site.
-
getW
public Site getW()
Get the west site.
-
transform
public void transform(java.awt.geom.AffineTransform at)
Update the geometry- Specified by:
transform
in interfaceFigure
- Overrides:
transform
in classBasicFigure
- Parameters:
at
- The transform to be used.
-
translate
public void translate(double x, double y)
Update the geometry- Specified by:
translate
in interfaceFigure
- Overrides:
translate
in classBasicRectangle
- Parameters:
x
- The x value to be moved.y
- The y value to be moved.
-
-