Class JDLine

java.lang.Object
fr.esrf.tangoatk.widget.util.jdraw.JDObject
fr.esrf.tangoatk.widget.util.jdraw.JDLine
All Implemented Interfaces:
JDRotatable

public class JDLine extends JDObject implements JDRotatable
JDraw Line graphic object.
  • Field Details

  • Constructor Details

    • JDLine

      public JDLine(String objectName, int x1, int y1, int x2, int y2)
      Construct a JDLine.
      Parameters:
      objectName - Line name
      x1 - X position First point
      y1 - Y position First point
      x2 - X position Second point
      y2 - Y position Second 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.
    • setArrow

      public void setArrow(int arrow)
      Sets the arrow for this line.
      Parameters:
      arrow - Arrow mode
      See Also:
    • getArrow

      public int getArrow()
      Returns:
      the current arrow of this line.
      See Also:
    • setArrowSize

      public void setArrowSize(int s)
      Sets the arrow size.
      Parameters:
      s - Arrow size.
    • getArrowSize

      public int getArrowSize()
      Returns:
      the current arrow width.
      See Also:
    • 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
    • hasShadow

      public boolean hasShadow()
      Overrides:
      hasShadow in class JDObject
      Returns:
      false, Line cannot be shadowed.
    • 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.
    • setLineWidth

      public void setLineWidth(int width)
      Description copied from class: JDObject
      Sets the line width of this object.
      Overrides:
      setLineWidth in class JDObject
      Parameters:
      width - Line width (pixel)
    • 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