Class 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 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 interface Figure
        Specified by:
        getShape in class AbstractFigure
        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 interface VisibleComponent
        Specified by:
        paint in class AbstractFigure
        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 interface Figure
        Specified by:
        transform in class AbstractFigure
        Parameters:
        at - an affine transformation