Class JDPolyline

java.lang.Object
fr.esrf.tangoatk.widget.util.jdraw.JDObject
fr.esrf.tangoatk.widget.util.jdraw.JDPolyline
All Implemented Interfaces:
JDRotatable
Direct Known Subclasses:
JDSpline

public class JDPolyline extends JDObject implements JDRotatable
JDraw Polyline graphic object.
  • Constructor Details

    • JDPolyline

      public JDPolyline(String objectName, Point[] p)
      Contructs a polyline.
      Parameters:
      objectName - Polyline name
      p - Array of control point.
  • Method Details

    • copy

      public JDObject copy(int x, int y)
      Description copied from class: JDObject
      Returns a copy of this object at the specified location.
      Specified by:
      copy in class JDObject
      Parameters:
      x - Horizontal position of the copied object (pixel)
      y - Vertical Position of the copied object (pixel)
      Returns:
      The copy of this object.
    • paint

      public void paint(JDrawEditor parent, Graphics g)
      Description copied from class: JDObject
      Paints this object.
      Specified by:
      paint in class JDObject
      Parameters:
      parent - JdrawEditor parent (Can be null except for JDSwingObject)
      g - the specified Graphics window
    • moveSummit

      public void moveSummit(int id, double x, double y)
      Description copied from class: JDObject
      Moves the specifed summit to the specified position. When using moveSummit() to animate objects, A call to refresh() of this object may be needed.
      Specified by:
      moveSummit in class JDObject
      Parameters:
      id - Summit index
      x - Absolute X position
      y - Absolute Y position
      See Also:
    • isInsideObject

      public boolean isInsideObject(int x, int y)
      Overrides:
      isInsideObject in class JDObject
      Parameters:
      x - X coordinate (pixel)
      y - Y coordinate (pixel)
      Returns:
      whether the specified point is inside this object.
    • rotate

      public void rotate(double angle, double xCenter, double yCenter)
      Description copied from interface: JDRotatable
      Rotates this object.
      Specified by:
      rotate in interface JDRotatable
      Parameters:
      angle - Angle value
      xCenter - Rotation center vertical pos
      yCenter - Rotation center horizontal pos
    • isClosed

      public boolean isClosed()
      Returns:
      whether this polyline is closed.
      See Also:
    • setClosed

      public void setClosed(boolean b)
      Close or Open the polyline.
      Parameters:
      b - True to close, false otherwise.
    • getStep

      public int getStep()
      Returns:
      the polyline interpolation step.
      See Also:
    • setStep

      public void setStep(int s)
      Sets the polyline interpolation step.
      Parameters:
      s - Interpolation step (must be greater or equal than 1).
    • setStartingPoint

      public void setStartingPoint(int idx)
      Rotate control points to make idx as stating point (index 0).
      Parameters:
      idx - Point index to be moved to the starting point.
    • connect

      public void connect(JDPolyline pline)
      Connects this polyline to an other polyline. Points are added to the end of this polyline.
      Parameters:
      pline - Polyline to be concatened.
    • invertSummitOrder

      public void invertSummitOrder()
      Invert control point order.