public class BaseElement extends AbstractElement implements java.lang.Cloneable
Generally developers do not use this class directly. Use twaver.Node
or twaver.Link
instead.
Modifier and Type | Field and Description |
---|---|
protected double |
xLocation |
protected double |
yLocation |
alarmState, businessObject, clientProperties, delegate, displayName, elements, iconUrl, id, imageUrl, name, parent, propertyChangeSupport, selected, toolTipText, userObject, userProperties, visible
Constructor and Description |
---|
BaseElement()
Default constructor.
|
BaseElement(java.lang.Object id)
Creates an instance with given id.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBodyColor()
Get body color.
|
java.awt.Rectangle |
getBounds()
Gets the current bounds of this element.
|
java.awt.Point |
getCenterLocation()
Gets the element's center point.
|
java.awt.Color |
getCustomDrawFillColor()
Get the custom draw fill color.
|
java.awt.Color |
getCustomDrawGradientColor()
Gets the custom draw gradient color.
|
int |
getCustomDrawGradientFactory()
Get the custom draw fill gradient factory.
|
java.awt.Color |
getCustomDrawOutlineColor()
Get the custom draw outline color.
|
java.awt.Stroke |
getCustomDrawOutlineStroke()
Get the custom draw outline stroke object.
|
int |
getCustomDrawShapeFactory()
Get the custom draw factory.
|
int |
getHeight()
Gets the current height of this element.
|
java.awt.Point |
getLocation()
Gets this element's current location.
|
java.lang.String |
getSVGUIClassID()
Returns a string that specifies the full qualified name of the ui class
that responsible for converting this element to svg content.
|
java.lang.String |
getUIClassID()
Returns a string that specifies the fully qualified name of
the ui class that renders this element in network canvas.
|
int |
getWidth()
Gets the current width of this element.
|
double |
getX()
Gets x coordinate of this element.
|
double |
getY()
Gets y coordinate of this element.
|
boolean |
isBodyFill()
Whether body is fill.
|
boolean |
isBodyRaised()
Gets whether need to paint raised body.
|
boolean |
isCustomDraw()
Whether use custom draw mode painting.
|
boolean |
isCustomDrawAntialias()
Whether use anti alias mode to paint the custom draw.
|
boolean |
isCustomDrawDefaultBorder()
Whether use default border (shape's bound rectangle) for the custom draw.
|
boolean |
isCustomDrawFill()
Whether fill the custom draw shape
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_FILL.
|
boolean |
isCustomDrawFill3D()
Whether fill the custom draw shape 3d
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_FILL_3D.
|
boolean |
isCustomDrawGradient()
Whether use gradient fill for the custom draw.
|
boolean |
isCustomDrawOutline()
Whether draw outline for the custom draw
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_OUTLINE.
|
boolean |
isCustomDrawOutline3D()
Whether draw outline 3d for the custom draw
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_OUTLINE_3D.
|
void |
putBodyColor(java.awt.Color color)
Set element body fill color.
|
void |
putBodyFill(boolean bodyFill)
Set value to tell the element whether the element body need to fill.
|
void |
putBodyRaised(boolean bodyRaised)
Set value to tell the element whether need to paint raised body.
|
void |
putCustomDraw(boolean customDraw)
Set 'custom draw' value for the element.
|
void |
putCustomDrawAntialias(boolean customDrawAntialias)
Set whether paint the custom draw in anti-alias mode.
|
void |
putCustomDrawDefaultBorder(boolean customDrawDefaultBorder)
Tells element whether use default selection border in custom draw mode.
|
void |
putCustomDrawFill(boolean customDrawFill)
Tells the element whether fill the custom draw shape during the custom draw paint.
|
void |
putCustomDrawFill3D(boolean customDrawFill3D)
Tells the element whether fill the custom draw shape 3d.
|
void |
putCustomDrawFillColor(java.awt.Color customDrawFillColor)
Set the element custom draw fill color.
|
void |
putCustomDrawGradient(boolean customDrawGradient)
Whether this custom draw shape will filled in gradient mode.
|
void |
putCustomDrawGradientColor(java.awt.Color customDrawGradientColor)
Set the custom draw gradient color.
|
void |
putCustomDrawGradientFactory(int customDrawGradientFactory)
Set the fill gradient factory.
|
void |
putCustomDrawOutline(boolean customDrawOutline)
Whether the element custom draw paint outline.
|
void |
putCustomDrawOutline3D(boolean customDrawOutline3D)
Whether the element custom draw paint outline 3d.
|
void |
putCustomDrawOutlineColor(java.awt.Color customDrawOutlineColor)
Set the element custom draw outline color.
|
void |
putCustomDrawOutlineStroke(java.lang.String customDrawOutlineStroke)
Change the outline stroke width for custom draw.
|
void |
putCustomDrawShapeFactory(int customDrawShapeFactory)
Set the custom draw shape.
|
void |
setCenterLocation(double x,
double y)
Sets the element's center point.
|
void |
setCenterLocation(java.awt.geom.Point2D location) |
void |
setLocation(double x,
double y)
Set element location via x double value and y double value.
|
void |
setLocation(int x,
int y)
Set element location via x int and y int.
|
void |
setLocation(java.awt.Point location)
Set new location of the element.
|
void |
setLocation(java.awt.geom.Point2D.Double location)
Set the location of the element.
|
addAttachment, addChartBubble, addChartValue, addChartValue, addChild, addChild, addPropertyChangeListener, addPropertyChangeListener, children, childrenSize, clearChartValues, clearChildren, containsAttachment, copy, copy, copy, copy, createAlarmState, createChildrenList, createChildrenMap, equals, exportValues, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlarmBalloonAlpha, getAlarmBalloonDirection, getAlarmBalloonOutlineColor, getAlarmBalloonPosition, getAlarmBalloonShadowColor, getAlarmBalloonShadowOffset, getAlarmBalloonTextColor, getAlarmBalloonTextFont, getAlarmBalloonXOffset, getAlarmBalloonYOffset, getAlarmState, getAttachmentOrientation, getAttachmentPosition, getAttachmentXGap, getAttachmentXOffset, getAttachmentYGap, getAttachmentYOffset, getBorderAntialias, getBorderColor, getBorderFillColor, getBorderInsets, getBorderShapeFactory, getBorderStroke, getBorderType, getBusinessObject, getChartBubbleShapeBubbleVisible, getChartBubbleShapeLineVisible, getChartBubbleStyle, getChartColor, getChartDialHandLength, getChartDialHandStyle, getChartFormat, getChartInflexionStyle, getChartMarkers, getChartMax, getChartMin, getChartPercentMarkerPostion, getChartPercentSpareColor, getChartPercentSpareCoverColor, getChartPercentSpareFill, getChartPercentStyle, getChartSectorDivisionPosition, getChartSectorStroke, getChartStroke, getChartValue, getChartValues, getChartValueTextPosition, getChildren, getChildrenByID, getClientProperties, getClientProperty, getDisplayName, getElementTreeIcon, getGeoCoordinate, getIcon, getIconURL, getID, getImage, getImageURL, getLabelBackground, getLabelBorderColor, getLabelBorderStroke, getLabelColor, getLabelFont, getLabelHighlightBackground, getLabelHighlightForeground, getLabelIcon, getLabelMaxLength, getLabelOrientation, getLabelPosition, getLabelUnderlineColor, getLabelUnderlineStroke, getLabelXGap, getLabelXOffset, getLabelYGap, getLabelYOffset, getLayerID, getMessageArc, getMessageBackground, getMessageBorderColor, getMessageBorderStroke, getMessageComponent, getMessageContent, getMessageDirection, getMessageFont, getMessageForeground, getMessageGradientColor, getMessageGradientFactory, getMessageHeight, getMessageMinimizedIcon, getMessagePosition, getMessageShadowColor, getMessageStyle, getMessageTail, getMessageWidth, getMessageXGap, getMessageXOffset, getMessageYGap, getMessageYOffset, getName, getParent, getPropertyChangeSupport, getPropertyValue, getRenderAlpha, getRenderColor, getStateOutlineColor, getStateOutlineInsets, getStateOutlineWidth, getTextureFactory, getToolTipText, getUserObject, getUserProperties, getUserProperty, isAdjustToBottom, isAlarmBalloonShownOnTop, isAlarmBalloonTextBlinkable, isAlarmBalloonVisible, isBorderFill, isBorderUnderneath, isBorderVisible, isBorderXormode, isDescendantOf, isDrawIconShape, isEmpty, isEnableAlarmPropagationFromChildren, isLabelBorder, isLabelHighlightable, isLabelSelectable, isLabelUnderline, isLabelVisible, isMessageAutoAdjustDirection, isMessageBorderVisible, isMessageClosable, isMessageGradient, isMessageMinimizable, isMessageMinimized, isMessageOpaque, isMessageShadowVisible, isMessageShownOnTop, isMessageShrinkable, isMessageShrinked, isParentOf, isSelected, isVisible, putAlarmBalloonAlpha, putAlarmBalloonDirection, putAlarmBalloonOutlineColor, putAlarmBalloonPosition, putAlarmBalloonShadowColor, putAlarmBalloonShadowOffset, putAlarmBalloonShownOnTop, putAlarmBalloonTextBlinkable, putAlarmBalloonTextColor, putAlarmBalloonTextFont, putAlarmBalloonVisible, putAlarmBalloonXoffset, putAlarmBalloonYoffset, putAttachmentOrientation, putAttachmentPosition, putAttachmentXGap, putAttachmentXOffset, putAttachmentYGap, putAttachmentYOffset, putBorderAntialias, putBorderColor, putBorderFill, putBorderFillColor, putBorderInsets, putBorderShapeFactory, putBorderStroke, putBorderType, putBorderUnderneath, putBorderVisible, putBorderXormode, putChartBubbleShapeBubbleVisible, putChartBubbleShapeLineVisible, putChartBubbleStyle, putChartColor, putChartDialHandLength, putChartDialHandStyle, putChartFormat, putChartInflexionStyle, putChartMarkers, putChartMax, putChartMin, putChartPercentMarkerPostion, putChartPercentSpareColor, putChartPercentSpareCoverColor, putChartPercentSpareFill, putChartPercentStyle, putChartSectorDivisionPosition, putChartSectorStroke, putChartStroke, putChartValue, putChartValues, putChartValueTextPosition, putClientProperty, putClientProperty, putClientProperty, putClientProperty, putDrawIconShape, putElementTreeIcon, putLabelBackground, putLabelBorder, putLabelBorderColor, putLabelBorderStroke, putLabelColor, putLabelFont, putLabelHighlightable, putLabelHighlightBackground, putLabelHighlightForeground, putLabelIcon, putLabelMaxLength, putLabelOrientation, putLabelPosition, putLabelSelectable, putLabelUnderline, putLabelUnderlineColor, putLabelUnderlineStroke, putLabelVisible, putLabelXGap, putLabelXOffset, putLabelYGap, putLabelYOffset, putMessageArc, putMessageAutoAdjustDirection, putMessageBackground, putMessageBorderColor, putMessageBorderStroke, putMessageBorderVisible, putMessageClosable, putMessageComponent, putMessageContent, putMessageDirection, putMessageFont, putMessageForeground, putMessageGradient, putMessageGradientColor, putMessageGradientFactory, putMessageHeight, putMessageMinimizable, putMessageMinimized, putMessageMinimizedIcon, putMessageOpaque, putMessagePosition, putMessageShadowColor, putMessageShadowVisible, putMessageShownOnTop, putMessageShrinkable, putMessageShrinked, putMessageStyle, putMessageTail, putMessageWidth, putMessageXGap, putMessageXOffset, putMessageYGap, putMessageYOffset, putRenderAlpha, putRenderColor, putStateOutlineColor, putStateOutlineInsets, putStateOutlineWidth, putTextureFactory, putUserProperty, putUserProperty, putUserProperty, removeAttachment, removeChild, removeFromParent, removePropertyChangeListener, removePropertyChangeListener, setAlarmState, setBusinessObject, setChartValues, setDisplayName, setEnableAlarmPropagationFromChildren, setGeoCoordinate, setIcon, setImage, setLayerID, setName, setParent, setPropertyValue, setSelected, setToolTipText, setUserObject, setVisible, toString, updateUI
public BaseElement()
public BaseElement(java.lang.Object id)
id
- Objectpublic java.awt.Rectangle getBounds()
public java.awt.Point getCenterLocation()
getCenterLocation
in interface Element
setCenterLocation(double, double)
public void setCenterLocation(double x, double y)
setCenterLocation
in interface Element
x
- new x value of center location.y
- new y value of center location.public void setCenterLocation(java.awt.geom.Point2D location)
setCenterLocation
in interface Element
public java.awt.Point getLocation()
getLocation
in interface Element
public void setLocation(java.awt.Point location)
Please note that element location is the left-top point of the element.
setLocation
in interface Element
location
- the new location.public void setLocation(int x, int y)
x
- int the x value of locationy
- int the y value of locationpublic void setLocation(double x, double y)
setLocation
in interface Element
x
- double the double value of x locationy
- double the double value of y locationpublic void setLocation(java.awt.geom.Point2D.Double location)
setLocation
in interface Element
location
- Double the new locationpublic double getX()
public double getY()
public int getWidth()
public int getHeight()
public java.lang.String getUIClassID()
getUIClassID
in interface Element
ElementUI
public java.lang.String getSVGUIClassID()
getSVGUIClassID
in interface Element
ElementSVGUI
,
TSVGNetwork
public void putBodyColor(java.awt.Color color)
twaver.Node
element, this color will be used to convert the original node image
and paint the node with the converted image.
Set it to null the BaseElement will use default color to fill,
and twaver.Node
will use original image to paint.
This method is a wrap for #putClientProperty with key of TWaverConst.PROPERTYNAME_BODY_COLOR.
color
- Color the new body colorpublic void putBodyRaised(boolean bodyRaised)
bodyRaised
- boolean the new raised body value.public void putBodyFill(boolean bodyFill)
bodyFill
- boolean the new body fill valuepublic void putCustomDraw(boolean customDraw)
Please note for Node element, if this set to true, the node image will be ignored during element painting. This method is a wrap for #putClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW.
customDraw
- boolean the new custom draw value.public void putCustomDrawShapeFactory(int customDrawShapeFactory)
TWaverConst.SHAPE_***
customDrawShapeFactory
- int the new custom draw shape.public void putCustomDrawDefaultBorder(boolean customDrawDefaultBorder)
customDrawDefaultBorder
- true if you want use the shape bound border as
the selection shape, false to use the shape factory defined one.public void putCustomDrawAntialias(boolean customDrawAntialias)
customDrawAntialias
- boolean the new anti-alias value.public void putCustomDrawFill(boolean customDrawFill)
customDrawFill
- boolean the new fill value.public void putCustomDrawFill3D(boolean customDrawFill3D)
customDrawFill3D
- boolean the new fill 3d value.public void putCustomDrawFillColor(java.awt.Color customDrawFillColor)
customDrawFillColor
- Color the new custom draw fill color.public void putCustomDrawOutline(boolean customDrawOutline)
customDrawOutline
- boolean true paint outline, false no outline.public void putCustomDrawOutline3D(boolean customDrawOutline3D)
customDrawOutline3d
- boolean true paint outline 3d, false no outline 3d.public void putCustomDrawOutlineColor(java.awt.Color customDrawOutlineColor)
customDrawOutlineColor
- Color the new outline color.public void putCustomDrawOutlineStroke(java.lang.String customDrawOutlineStroke)
customDrawOutlineStroke
- Stroke the new outline stroke type.public void putCustomDrawGradient(boolean customDrawGradient)
Please note that this is make sense only the customDrawFill set to true. Legal values are:
TWaverConst.GRADIENT_STROKE_***
customDrawGradient
- boolean true use gradient fill, false otherwise.public void putCustomDrawGradientFactory(int customDrawGradientFactory)
customDrawGradientFactory
- int the new gradient factory.public void putCustomDrawGradientColor(java.awt.Color customDrawGradientColor)
customDrawGradientColor
- Color the new gradient colorpublic java.awt.Color getBodyColor()
public boolean isBodyFill()
public boolean isCustomDraw()
public int getCustomDrawShapeFactory()
public boolean isCustomDrawDefaultBorder()
public boolean isCustomDrawAntialias()
public boolean isCustomDrawFill()
public boolean isCustomDrawFill3D()
public java.awt.Color getCustomDrawFillColor()
public boolean isCustomDrawOutline()
public boolean isCustomDrawOutline3D()
public java.awt.Color getCustomDrawOutlineColor()
public java.awt.Stroke getCustomDrawOutlineStroke()
public boolean isCustomDrawGradient()
public int getCustomDrawGradientFactory()
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_GRADIENT_FACTORY.
public java.awt.Color getCustomDrawGradientColor()
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_CUSTOM_DRAW_GRADIENT_COLOR.
public boolean isBodyRaised()
This method is a wrap for #getClientProperty with key of TWaverConst.PROPERTYNAME_BODY_RAISED.
If client property hasn't store the value, return the default value stored in TUIManger
putBodyRaised(boolean)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.