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

java.lang.Object
  extended by fr.esrf.tangoatk.widget.util.jdraw.JDObject
      extended by fr.esrf.tangoatk.widget.util.jdraw.JDRectangular
          extended by fr.esrf.tangoatk.widget.util.jdraw.JDEllipse

public class JDEllipse
extends JDRectangular

JDraw Ellipse graphic object.

Here is an example of few JDEllipse:

JDEllipse examples


Field Summary
static int ARC_CLOSED
          Closed arc
static int ARC_OPEN
          Opened arc
static int ARC_PIE
          Pie arc
 
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
JDEllipse(java.lang.String objectName, int x, int y, int w, int h)
          Construct a JDEllipse.
 
Method Summary
 JDPolyline convertToPolyline()
          Convert this object to a JDPolyline
 JDObject copy(int x, int y)
          Returns a copy of this object at the specified location.
 int getAngleExtent()
          Returns the arc angle extent.
 int getAngleStart()
          Returns the starting angle of the arc.
 int getArcType()
          Returns the current arc type.
 int getStep()
          Returns the interpolation step.
 boolean isInsideObject(int x, int y)
          Determines whether the specified point is inside this object.
 void paint(JDrawEditor parent, java.awt.Graphics g)
          Paints this object.
 void restoreTransform()
          Restore original shape previously backuped by saveTransform
 void rotate90(double x, double y)
          Rotate the object by 90deg.
 void saveTransform()
          Backup the shape.
 void setAngleExtent(int a)
          Sets the arc angle extent.
 void setAngleStart(int a)
          Sets the starting angle of the arc.
 void setArcType(int type)
          Sets the arc type for this ellipse.
 void setStep(int s)
          Sets the interpolation step of this ellispe.
 
Methods inherited from class fr.esrf.tangoatk.widget.util.jdraw.JDRectangular
moveSummit
 
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, hasShadow, hasVisibilityMapper, hasVTranslationMapper, isAntiAliased, isFixedExtendedParam, isInteractive, isProgrammed, isVisible, moveSummitH, moveSummitV, preRefresh, refresh, removeExtension, removeMouseListener, removeValueListener, scale, scaleTranslate, setAntiAlias, setBackground, setBackgroundMapper, setExtendedParam, setExtendedParam, setExtensionList, setFillStyle, setForeground, setForegroundMapper, setGradientFillParam, setHTranslationMapper, setInitValue, setInteractive, setInverseShadow, setInvertShadowMapper, setLineStyle, setLineWidth, 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

ARC_OPEN

public static final int ARC_OPEN
Opened arc

See Also:
Constant Field Values

ARC_CLOSED

public static final int ARC_CLOSED
Closed arc

See Also:
Constant Field Values

ARC_PIE

public static final int ARC_PIE
Pie arc

See Also:
Constant Field Values
Constructor Detail

JDEllipse

public JDEllipse(java.lang.String objectName,
                 int x,
                 int y,
                 int w,
                 int h)
Construct a JDEllipse.

Parameters:
objectName -
x - Up left corner x coordinate
y - Up left corner y coordinate
w - Ellipse width
h - Ellipse height
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.

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)

convertToPolyline

public JDPolyline convertToPolyline()
Convert this object to a JDPolyline


rotate90

public void rotate90(double x,
                     double y)
Description copied from class: JDObject
Rotate the object by 90deg. A call to refresh() is needed after transformation.

Overrides:
rotate90 in class JDRectangular
Parameters:
x - Rotation center horizontal pos
y - Rotation center vertical pos
See Also:
JDObject.refresh()

restoreTransform

public void restoreTransform()
Description copied from class: JDObject
Restore original shape previously backuped by saveTransform

Overrides:
restoreTransform in class JDObject
See Also:
JDObject.saveTransform()

saveTransform

public void saveTransform()
Description copied from class: JDObject
Backup the shape. This can be usefull when making scaling animation, after multiple scale the rounding may result in deformed shape. To avoid this you can use saveTransform() and restoreTransform(). Note: This is done once when JDrawEditor.loadFile() is called().

Overrides:
saveTransform in class JDObject
See Also:
JDObject.restoreTransform()

setStep

public void setStep(int s)
Sets the interpolation step of this ellispe.

Parameters:
s - Interpolation step (Default is 10)

getStep

public int getStep()
Returns the interpolation step.

See Also:
setStep(int)

setArcType

public void setArcType(int type)
Sets the arc type for this ellipse.

Parameters:
type - Arc type
See Also:
ARC_OPEN, ARC_CLOSED, ARC_PIE

getArcType

public int getArcType()
Returns the current arc type.

See Also:
setArcType(int)

setAngleStart

public void setAngleStart(int a)
Sets the starting angle of the arc.

Parameters:
a - Angle in degrees.

getAngleStart

public int getAngleStart()
Returns the starting angle of the arc.

See Also:
setAngleStart(int)

setAngleExtent

public void setAngleExtent(int a)
Sets the arc angle extent.

Parameters:
a - Angle extent in degrees.

getAngleExtent

public int getAngleExtent()
Returns the arc angle extent.

See Also:
setAngleExtent(int)

paint

public void paint(JDrawEditor parent,
                  java.awt.Graphics g)
Description copied from class: JDObject
Paints this object.

Overrides:
paint in class JDRectangular
Parameters:
parent - JdrawEditor parent (Can be null except for JDSwingObject)
g - the specified Graphics window