Documentation of 'org.jhotdraw.draw.decoration.LineDecoration' Java class
LineDecoration
org.jhotdraw.draw.decoration

Interface LineDecoration

  • All Superinterfaces:
    java.lang.Cloneable, java.io.Serializable
    All Known Implementing Classes:
    AbstractLineDecoration, ArrowTip, CompositeLineDecoration, GeneralPathTip, PerpendicularBar


    public interface LineDecoration
    extends java.lang.Cloneable, java.io.Serializable
    A line decoration can be used to draw a decoration at the start or end of a line.

    Typically a line decoration is set as an attribute value to a BezierFigure using the attribute keys org.jhotdraw.draw.AttributeKeys.START_DECORATION and org.jhotdraw.draw.AttributeKeys.END_DECORATION.


    Design Patterns

    Decorator
    The start and end point of a BezierFigure can be decorated with a line decoration.
    Component: BezierFigure; Decorator: LineDecoration.


    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void draw(java.awt.Graphics2D g, Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)
      Draws the decoration in the direction specified by the two Points.
      double getDecorationRadius(Figure f)
      Returns the radius of the decorator.
      java.awt.geom.Rectangle2D.Double getDrawingArea(Figure f, java.awt.geom.Point2D.Double p1, java.awt.geom.Point2D.Double p2)
      Returns the drawing bounds of the decorator.
    • Method Detail

      • draw

        void draw(java.awt.Graphics2D g,
                  Figure f,
                  java.awt.geom.Point2D.Double p1,
                  java.awt.geom.Point2D.Double p2)
        Draws the decoration in the direction specified by the two Points.
      • getDecorationRadius

        double getDecorationRadius(Figure f)
        Returns the radius of the decorator. This is used to crop the end of the line, to prevent it from being drawn over the decorator.
      • getDrawingArea

        java.awt.geom.Rectangle2D.Double getDrawingArea(Figure f,
                                                        java.awt.geom.Point2D.Double p1,
                                                        java.awt.geom.Point2D.Double p2)
        Returns the drawing bounds of the decorator.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.