Documentation of 'CH.ifa.draw.figures.PolyLineFigure' Java class
PolyLineFigure
CH.ifa.draw.figures

Class PolyLineFigure

    • Constructor Detail

      • PolyLineFigure

        public PolyLineFigure()
      • PolyLineFigure

        public PolyLineFigure(int size)
      • PolyLineFigure

        public PolyLineFigure(int x,
                              int y)
    • Method Detail

      • handles

        public java.util.Vector handles()
        Description copied from class: AbstractFigure
        Returns the handles of a Figure that can be used to manipulate some of its attributes.
        Specified by:
        handles in interface Figure
        Specified by:
        handles in class AbstractFigure
        Returns:
        a Vector of handles
        See Also:
        Handle
      • addPoint

        public void addPoint(int x,
                             int y)
        Adds a node to the list of points.
      • points

        public java.util.Enumeration points()
      • pointCount

        public int pointCount()
      • setPointAt

        public void setPointAt(java.awt.Point p,
                               int i)
        Changes the position of a node.
      • insertPointAt

        public void insertPointAt(java.awt.Point p,
                                  int i)
        Insert a node at the given point.
      • removePointAt

        public void removePointAt(int i)
      • splitSegment

        public int splitSegment(int x,
                                int y)
        Splits the segment at the given point if a segment was hit.
        Returns:
        the index of the segment or -1 if no segment was hit.
      • pointAt

        public java.awt.Point pointAt(int i)
      • joinSegments

        public boolean joinSegments(int x,
                                    int y)
        Joins to segments into one if the given point hits a node of the polyline.
        Returns:
        true if the two segments were joined.
      • setStartDecoration

        public void setStartDecoration(LineDecoration l)
        Sets the start decoration.
      • getStartDecoration

        public LineDecoration getStartDecoration()
        Returns the start decoration.
      • setEndDecoration

        public void setEndDecoration(LineDecoration l)
        Sets the end decoration.
      • getEndDecoration

        public LineDecoration getEndDecoration()
        Returns the end decoration.
      • draw

        public void draw(java.awt.Graphics g)
        Description copied from interface: Figure
        Draws the figure.
        Parameters:
        g - the Graphics to draw into
      • findSegment

        public int findSegment(int x,
                               int y)
        Gets the segment of the polyline that is hit by the given point.
        Returns:
        the index of the segment or -1 if no segment was hit.
      • getAttribute

        public java.lang.Object getAttribute(java.lang.String name)
        Gets the attribute with the given name. PolyLineFigure maps "ArrowMode"to a line decoration.
        Specified by:
        getAttribute in interface Figure
        Overrides:
        getAttribute in class AbstractFigure
      • setAttribute

        public void setAttribute(java.lang.String name,
                                 java.lang.Object value)
        Sets the attribute with the given name. PolyLineFigure interprets "ArrowMode"to set the line decoration.
        Specified by:
        setAttribute in interface Figure
        Overrides:
        setAttribute in class AbstractFigure
      • locator

        public static Locator locator(int pointIndex)
        Creates a locator for the point with the given index.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.