Class JDGroup
java.lang.Object
fr.esrf.tangoatk.widget.util.jdraw.JDObject
fr.esrf.tangoatk.widget.util.jdraw.JDRectangular
fr.esrf.tangoatk.widget.util.jdraw.JDGroup
JDraw Group graphic object. A group can contains all JDObject including group.
If the group is scaled, all object within this group will also be scaled.
-
Field Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy(int x, int y) Returns a copy of this object at the specified location.voidGenerates a Java class capable to paint this object using only java awt functions.getChildAt(int idx) intvoidgetObjectsByName(Vector result, String name, boolean recurseGroup) Return all objects having the given name.booleanisInsideObject(int x, int y) booleanvoidmoveSummit(int id, double x, double y) Moves the specifed summit to the specified position.voidpaint(JDrawEditor parent, Graphics g) Paints this object.voidRestore original shape previously backuped by saveTransformvoidrotate90(double x, double y) Rotate the object by 90deg.voidBackup the shape.voidsetAntiAlias(boolean alias) Sets the anti aliasing for all objects of this groupvoidSets the background of this group, Apply it on all children.voidSets the children of this group.voidsetFillStyle(int s) Sets the fill style of this group, Apply it on all children.voidSets the foreground of this group, Apply it on all children.voidsetInitValue(int v) Sets the init value of this object.voidsetInverseShadow(boolean b) Sets the inverse shadow of this group, Apply it on all children.voidsetLineStyle(int s) Sets the line style of this group, Apply it on all children.voidsetLineWidth(int w) Sets the line width of this group, Apply it on all children.voidsetMaxValue(int v) Sets the max value of this object.voidsetMinValue(int v) Sets the minimum value of this object.voidsetShadow(boolean b) Sets the shadow of this group, Apply it on all children.voidsetShadowWidth(int w) Sets the shadow width of this group, Apply it on all children.voidsetVisible(boolean b) Shows or hides this object, Apply it on all children.Methods inherited from class fr.esrf.tangoatk.widget.util.jdraw.JDRectangular
getBottom, getHeight, getLeft, getRight, getTop, getWidth, setBottom, setHeight, setLeft, setRight, setTop, setWidthMethods 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, getOrigin, getShadowWidth, getSummit, getSummitNumber, getValue, getValueChangeMode, getVisibilityMapper, getVTranslationMapper, hasBackgroundMapper, hasExtendedParam, hasForegroundMapper, hasHTranslationMapper, hasInverseShadow, hasInvertShadowMapper, hasShadow, hasVisibilityMapper, hasVTranslationMapper, isAntiAliased, isDisabled, isFixedExtendedParam, isInteractive, isVisible, moveSummitH, moveSummitV, preRefresh, refresh, removeExtension, removeMouseListener, removeValueListener, scale, scaleTranslate, setBackgroundMapper, setDisabled, setExtendedParam, setExtendedParam, setExtensionList, setForegroundMapper, setGradientFillParam, setHTranslationMapper, setInteractive, setInvertShadowMapper, setName, setOrigin, setValue, setValueChangeMode, setVisibilityMapper, setVTranslationMapper, toString, translate
-
Constructor Details
-
JDGroup
Construct a group.- Parameters:
objectName- Group name.o- Vector of JDObject to be grouped.
-
-
Method Details
-
copy
Description copied from class:JDObjectReturns a copy of this object at the specified location. -
paint
Description copied from class:JDObjectPaints this object.- Overrides:
paintin classJDRectangular- Parameters:
parent- JdrawEditor parent (Can be null except for JDSwingObject)g- the specified Graphics window
-
isInsideObject
public boolean isInsideObject(int x, int y) - Overrides:
isInsideObjectin classJDObject- Parameters:
x- X coordinate (pixel)y- Y coordinate (pixel)- Returns:
- whether the specified point is inside this object.
-
restoreTransform
public void restoreTransform()Description copied from class:JDObjectRestore original shape previously backuped by saveTransform- Overrides:
restoreTransformin classJDObject- See Also:
-
saveTransform
public void saveTransform()Description copied from class:JDObjectBackup 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:
saveTransformin classJDObject- See Also:
-
rotate90
public void rotate90(double x, double y) Description copied from class:JDObjectRotate the object by 90deg. A call to refresh() is needed after transformation.- Overrides:
rotate90in classJDRectangular- Parameters:
x- Rotation center horizontal posy- Rotation center vertical pos- See Also:
-
moveSummit
public void moveSummit(int id, double x, double y) Description copied from class:JDObjectMoves the specifed summit to the specified position. When using moveSummit() to animate objects, A call to refresh() of this object may be needed.- Overrides:
moveSummitin classJDRectangular- Parameters:
id- Summit indexx- Absolute X positiony- Absolute Y position- See Also:
-
setBackground
Sets the background of this group, Apply it on all children.- Overrides:
setBackgroundin classJDObject- Parameters:
c- Background color.- See Also:
-
setForeground
Sets the foreground of this group, Apply it on all children.- Overrides:
setForegroundin classJDObject- Parameters:
c- Foreground color.- See Also:
-
setFillStyle
public void setFillStyle(int s) Sets the fill style of this group, Apply it on all children.- Overrides:
setFillStylein classJDObject- Parameters:
s- Fill style.- See Also:
-
setLineStyle
public void setLineStyle(int s) Sets the line style of this group, Apply it on all children.- Overrides:
setLineStylein classJDObject- Parameters:
s- Line style.- See Also:
-
setAntiAlias
public void setAntiAlias(boolean alias) Sets the anti aliasing for all objects of this group- Overrides:
setAntiAliasin classJDObject- Parameters:
alias- Anti alias- See Also:
-
setLineWidth
public void setLineWidth(int w) Sets the line width of this group, Apply it on all children.- Overrides:
setLineWidthin classJDObject- Parameters:
w- Line width.- See Also:
-
setShadow
public void setShadow(boolean b) Sets the shadow of this group, Apply it on all children. -
setVisible
public void setVisible(boolean b) Shows or hides this object, Apply it on all children.- Overrides:
setVisiblein classJDObject- Parameters:
b- True to show, false otherwise.
-
setInverseShadow
public void setInverseShadow(boolean b) Sets the inverse shadow of this group, Apply it on all children.- Overrides:
setInverseShadowin classJDObject- Parameters:
b- Invert shadow flag.- See Also:
-
setShadowWidth
public void setShadowWidth(int w) Sets the shadow width of this group, Apply it on all children.- Overrides:
setShadowWidthin classJDObject- Parameters:
w- Shadow width.- See Also:
-
setMinValue
public void setMinValue(int v) Description copied from class:JDObjectSets the minimum value of this object.- Overrides:
setMinValuein classJDObject- Parameters:
v- Min value- See Also:
-
setMaxValue
public void setMaxValue(int v) Description copied from class:JDObjectSets the max value of this object.- Overrides:
setMaxValuein classJDObject- Parameters:
v- Max value- See Also:
-
setInitValue
public void setInitValue(int v) Description copied from class:JDObjectSets the init value of this object.- Overrides:
setInitValuein classJDObject- Parameters:
v- Initial value object.- See Also:
-
getObjectsByName
Description copied from class:JDObjectReturn all objects having the given name.- Overrides:
getObjectsByNamein classJDObject- Parameters:
result- Result vector (must be constructed by the caller)name- JDObject name (Case sensitive)recurseGroup- true to perform a deep search whithin group, false otherwise.- See Also:
-
isProgrammed
public boolean isProgrammed()- Overrides:
isProgrammedin classJDObject- Returns:
- whether this object has a programmed behavior. If this object is a JDGroup, the function return true if at least one of grouped JDObject is programmed.
- See Also:
-
getChildAt
- Parameters:
idx- Child index- Returns:
- the child at the specifed position.
-
getChildrenNumber
public int getChildrenNumber()- Returns:
- the number of child of this group.
-
setChildrenList
Sets the children of this group.- Parameters:
o- Vector of JDObject to be grouped.
-
getChildren
- Returns:
- a Vector containing all children of this group.
-
generateJavaClass
Generates a Java class capable to paint this object using only java awt functions. It supports only Line and Polyline (or shape that can be converted to polyline) and not all functionality of the JDObject are suppported. Nevertheless, the code keeps the vectorial sizing behavior. Note: All objects named 'body' will have their background color overrided by the color passed to the generated paint() function.- Parameters:
f- file to be saved- Throws:
IOException- In case of failure
-