Package ptolemy.vergil.kernel
Class RelativeLinkFigure
- java.lang.Object
-
- diva.canvas.AbstractFigure
-
- ptolemy.vergil.kernel.RelativeLinkFigure
-
- All Implemented Interfaces:
CanvasComponent
,Figure
,VisibleComponent
,UserObjectContainer
public class RelativeLinkFigure extends AbstractFigure
A figure for drawing a link between a relative locatable and its referenced object. The link is represented by a straight thin line. FIXME: Some artifacts are visible when the relative locatable object is dragged, because the clipping region seems not to be updated quickly enough.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Miro Spoenemann
- Pt.AcceptedRating:
- Red (msp)
- Pt.ProposedRating:
- Red (msp)
-
-
Constructor Summary
Constructors Constructor Description RelativeLinkFigure(RelativeLocation location)
Construct a figure to draw the link of a relative locatable object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Shape
getShape()
Get the outline shape of this figure.void
paint(java.awt.Graphics2D g)
Paint the figure.void
transform(java.awt.geom.AffineTransform at)
Set the given affine transformation for this figure.-
Methods inherited from class diva.canvas.AbstractFigure
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translate
-
-
-
-
Constructor Detail
-
RelativeLinkFigure
public RelativeLinkFigure(RelativeLocation location)
Construct a figure to draw the link of a relative locatable object.- Parameters:
location
- The location of the relative locatable object.
-
-
Method Detail
-
getShape
public java.awt.Shape getShape()
Get the outline shape of this figure. This implementation returns a line.- Specified by:
getShape
in interfaceFigure
- Specified by:
getShape
in classAbstractFigure
- Returns:
- A line, which may have length 0 if the related object has no valid reference.
-
paint
public void paint(java.awt.Graphics2D g)
Paint the figure. This implementation paints a line if the related object has a valid reference, and it paints nothing if it hasn't. If the length of the line exceeds a specific threshold, it is drawn with a different color to highlight that the reference will eventually be broken.- Specified by:
paint
in interfaceVisibleComponent
- Specified by:
paint
in classAbstractFigure
- Parameters:
g
- The graphics context used for painting.
-
transform
public void transform(java.awt.geom.AffineTransform at)
Set the given affine transformation for this figure.- Specified by:
transform
in interfaceFigure
- Specified by:
transform
in classAbstractFigure
- Parameters:
at
- an affine transformation
-
-