fr.esrf.tangoatk.widget.util.jdraw
Class JDLine

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

public class JDLine
extends JDObject
implements JDRotatable

JDraw Line graphic object.

Here is an example of few JDLine:

JDLine examples


Field Summary
static int ARROW_NONE
          No arrow.
static int ARROW1_BOTH
          Left and right arrow type 1.
static int ARROW1_CENTER
          center arrow type 1.
static int ARROW1_LEFT
          Left arrow type 1.
static int ARROW1_RIGHT
          right arrow type 1.
static int ARROW2_BOTH
          Left and right arrow type 2.
static int ARROW2_CENTER
          center arrow type 2.
static int ARROW2_LEFT
          Left arrow type 2.
static int ARROW2_RIGHT
          right arrow type 2.
 
Fields inherited from class fr.esrf.tangoatk.widget.util.jdraw.JDObject
FILL_STYLE_DOT_PATTERN_1, FILL_STYLE_DOT_PATTERN_2, FILL_STYLE_DOT_PATTERN_3, FILL_STYLE_GRADIENT, FILL_STYLE_LARGE_CROSS_HATCH, FILL_STYLE_LARGE_LEFT_HATCH, FILL_STYLE_LARGE_RIGHT_HATCH, FILL_STYLE_NONE, FILL_STYLE_SMALL_CROSS_HATCH, FILL_STYLE_SMALL_LEFT_HATCH, FILL_STYLE_SMALL_RIGHT_HATCH, FILL_STYLE_SOLID, LINE_STYLE_DASH, LINE_STYLE_DASH_DOT, LINE_STYLE_DOT, LINE_STYLE_LONG_DASH, LINE_STYLE_SOLID, VALUE_CHANGE_ON_XDRAG_LEFT, VALUE_CHANGE_ON_XDRAG_RIGHT, VALUE_CHANGE_ON_YDRAG_BOTTOM, VALUE_CHANGE_ON_YDRAG_TOP, VALUE_INC_ON_CLICK, VALUE_INC_ON_PRESSRELEASE
 
Constructor Summary
JDLine(java.lang.String objectName, int x1, int y1, int x2, int y2)
          Construct a JDLine.
 
Method Summary
 JDObject copy(int x, int y)
          Returns a copy of this object at the specified location.
 int getArrow()
          Returns the current arrow of this line.
 int getArrowSize()
          Returns the current arrow width.
 boolean hasShadow()
          Returns false, Line cannot be shadowed.
 boolean isInsideObject(int x, int y)
          Determines whether the specified point is inside this object.
 void moveSummit(int id, double x, double y)
          Moves the specifed summit to the specified position.
 void paint(JDrawEditor parent, java.awt.Graphics g)
          Paints this object.
 void rotate(double angle, double xCenter, double yCenter)
          Rotates this object.
 void setArrow(int arrow)
          Sets the arrow for this line.
 void setArrowSize(int s)
          Sets the arrow size.
 void setLineWidth(int width)
          Sets the line width of this object.
 
Methods inherited from class fr.esrf.tangoatk.widget.util.jdraw.JDObject
addExtension, addMouseListener, addValueListener, centerOrigin, clearMouseListener, clearValueListener, getBackground, getBackgroundMapper, getBoundRect, getExtendedParam, getExtendedParam, getExtendedParamDesc, getExtendedParamIndex, getExtendedParamName, getExtendedParamNumber, getFillStyle, getForeground, getForegroundMapper, getHTranslationMapper, getInitValue, getInvertShadowMapper, getLineStyle, getLineWidth, getMaxValue, getMinValue, getName, getObjectsByName, getOrigin, getShadowWidth, getSummit, getSummitNumber, getValue, getValueChangeMode, getVisibilityMapper, getVTranslationMapper, hasBackgroundMapper, hasExtendedParam, hasForegroundMapper, hasHTranslationMapper, hasInverseShadow, hasInvertShadowMapper, hasVisibilityMapper, hasVTranslationMapper, isAntiAliased, isFixedExtendedParam, isInteractive, isProgrammed, isVisible, moveSummitH, moveSummitV, preRefresh, refresh, removeExtension, removeMouseListener, removeValueListener, restoreTransform, rotate90, saveTransform, scale, scaleTranslate, setAntiAlias, setBackground, setBackgroundMapper, setExtendedParam, setExtendedParam, setExtensionList, setFillStyle, setForeground, setForegroundMapper, setGradientFillParam, setHTranslationMapper, setInitValue, setInteractive, setInverseShadow, setInvertShadowMapper, setLineStyle, setMaxValue, setMinValue, setName, setOrigin, setShadow, setShadowWidth, setValue, setValueChangeMode, setVisibilityMapper, setVisible, setVTranslationMapper, toString, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARROW_NONE

public static final int ARROW_NONE
No arrow.

See Also:
Constant Field Values

ARROW1_LEFT

public static final int ARROW1_LEFT
Left arrow type 1.

See Also:
Constant Field Values

ARROW1_RIGHT

public static final int ARROW1_RIGHT
right arrow type 1.

See Also:
Constant Field Values

ARROW1_BOTH

public static final int ARROW1_BOTH
Left and right arrow type 1.

See Also:
Constant Field Values

ARROW1_CENTER

public static final int ARROW1_CENTER
center arrow type 1.

See Also:
Constant Field Values

ARROW2_LEFT

public static final int ARROW2_LEFT
Left arrow type 2.

See Also:
Constant Field Values

ARROW2_RIGHT

public static final int ARROW2_RIGHT
right arrow type 2.

See Also:
Constant Field Values

ARROW2_BOTH

public static final int ARROW2_BOTH
Left and right arrow type 2.

See Also:
Constant Field Values

ARROW2_CENTER

public static final int ARROW2_CENTER
center arrow type 2.

See Also:
Constant Field Values
Constructor Detail

JDLine

public JDLine(java.lang.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 Detail

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:
ARROW1_LEFT, ARROW1_RIGHT, ARROW1_BOTH, ARROW1_CENTER, ARROW2_LEFT, ARROW2_RIGHT, ARROW2_BOTH, ARROW2_CENTER

getArrow

public int getArrow()
Returns the current arrow of this line.

See Also:
setArrow(int)

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:
setArrowSize(int)

paint

public void paint(JDrawEditor parent,
                  java.awt.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()
Returns false, Line cannot be shadowed.

Overrides:
hasShadow in class JDObject

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:
JDObject.refresh()

isInsideObject

public boolean isInsideObject(int x,
                              int y)
Description copied from class: JDObject
Determines whether the specified point is inside this object.

Overrides:
isInsideObject in class JDObject
Parameters:
x - X coordinate (pixel)
y - Y coordinate (pixel)

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