public abstract class AbstractElementUI extends java.lang.Object implements ElementUI
DefaultNetworkElementBorder
.
If subclasses want display a border like selection
border or alarm state border, it can call method paintBorder
directly after paint the element.Modifier and Type | Field and Description |
---|---|
protected AlarmAttachment |
alarmAttachment |
protected int |
attachmentOrientation |
protected int |
attachmentPosition |
protected java.util.List |
attachments
Save all attachments in this vector instance.
|
protected int |
attachmentXGap |
protected int |
attachmentXOffset |
protected int |
attachmentYGap |
protected int |
attachmentYOffset |
protected int |
borderInsets |
protected Element |
element |
protected LabelAttachment |
labelAttachment |
protected TNetwork |
network |
protected float |
renderAlpha |
protected int |
stateOutlineInsets |
protected twaver.base.obfuscate.network.texture.TextureFactory |
textureFactory |
Constructor and Description |
---|
AbstractElementUI(TNetwork network,
Element element) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(Attachment a)
Add the specified attachment into this element UI class.
|
java.util.Iterator |
attachments()
Return iterator of this ui's all attachments.
|
protected boolean |
containInAttachments(int x,
int y) |
void |
elementPropertyChange(java.beans.PropertyChangeEvent evt)
Invoked when the related element's any property change.
|
AlarmAttachment |
getAlarmAttachment() |
protected java.awt.geom.Area |
getAttachementsArea()
Get all attachments' area.
|
protected java.awt.Rectangle |
getAttachementsBounds() |
Attachment |
getAttachmentAt(java.awt.Point point)
Get for specified element, which attachment object this point
locate at.
|
int |
getAttachmentOrientation() |
int |
getAttachmentPosition() |
int |
getAttachmentXGap() |
int |
getAttachmentXOffset() |
int |
getAttachmentYGap() |
int |
getAttachmentYOffset() |
twaver.base.obfuscate.network.blink.BlinkStruct |
getBlinkStruct() |
java.awt.Shape |
getBorderShape() |
int |
getDefaultBorderInset()
Get the default border inset for border ui.
|
Element |
getElement()
Get the related element object of this UI class.
|
LabelAttachment |
getLabelAttachment()
Get the label attachment.
|
TNetwork |
getNetwork()
Obtains the network component this UI displayed on.
|
java.awt.Color |
getPaintBodyColor(java.awt.Color naturalBodyColor) |
protected java.awt.geom.Area |
getSeletableAttachementsArea()
Get all selectable attachments' area.
|
java.awt.Color |
getStateOutlineColor() |
java.awt.Rectangle |
getUIBounds()
For this abstract element UI, it return a rectangle box encloses
the element and it's border.
|
protected void |
installAttachments()
install the default attachments for this UI.
|
boolean |
isBodyDark() |
boolean |
isOutlineDark() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
paintAttachments(java.awt.Graphics2D g2d)
Paint each attachment of this element on specified graph.
|
void |
paintBorder(java.awt.Graphics2D g2d)
Paint specified element object border on specified graphics.
|
void |
performAction(int gesture,
java.awt.event.MouseEvent e)
Called when user do some interaction on me.
|
void |
removeAttachment(Attachment a)
Remove this attachment from this ui class so this attachment
will no longer displayed by this UI.
|
void |
setBodyPaint(java.awt.Graphics2D g2d,
java.awt.Color color) |
void |
setLabelAttachment(LabelAttachment label) |
protected void |
setStateOutline(java.awt.Graphics2D g,
java.awt.Color color) |
void |
updateClientProperty(java.lang.String propertyName)
Update all client properties of this element.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains, getBorder, getHotspot, paint
protected final TNetwork network
protected final Element element
protected int borderInsets
protected int stateOutlineInsets
protected float renderAlpha
protected twaver.base.obfuscate.network.texture.TextureFactory textureFactory
protected int attachmentPosition
protected int attachmentOrientation
protected int attachmentXOffset
protected int attachmentYOffset
protected int attachmentXGap
protected int attachmentYGap
protected java.util.List attachments
protected AlarmAttachment alarmAttachment
protected LabelAttachment labelAttachment
public int getAttachmentOrientation()
public int getAttachmentPosition()
public int getAttachmentXGap()
public int getAttachmentXOffset()
public int getAttachmentYGap()
public int getAttachmentYOffset()
public void addAttachment(Attachment a)
addAttachment
in interface ElementUI
a
- the attachment object.public void removeAttachment(Attachment a)
removeAttachment
in interface ElementUI
a
- the attachment to be removed.public TNetwork getNetwork()
getNetwork
in interface ElementUI
public Element getElement()
getElement
in interface ElementUI
protected void installAttachments()
addAttachment
to add some new attachment.public LabelAttachment getLabelAttachment()
getLabelAttachment
in interface ElementUI
public AlarmAttachment getAlarmAttachment()
getAlarmAttachment
in interface ElementUI
public void setLabelAttachment(LabelAttachment label)
public void paintBorder(java.awt.Graphics2D g2d)
g
- graphics object.element
- element object.public java.awt.Rectangle getUIBounds()
getUIBounds
in interface ElementUI
public Attachment getAttachmentAt(java.awt.Point point)
getAttachmentAt
in interface ElementUI
element
- the element object.point
- the point.public void paintAttachments(java.awt.Graphics2D g2d)
paintAttachments
in interface ElementUI
g
- the graph object.element
- the element object.public java.util.Iterator attachments()
attachments
in interface ElementUI
protected java.awt.geom.Area getSeletableAttachementsArea()
protected boolean containInAttachments(int x, int y)
protected java.awt.geom.Area getAttachementsArea()
protected java.awt.Rectangle getAttachementsBounds()
public java.awt.Color getStateOutlineColor()
getStateOutlineColor
in interface ElementUI
public java.awt.Color getPaintBodyColor(java.awt.Color naturalBodyColor)
public void setBodyPaint(java.awt.Graphics2D g2d, java.awt.Color color)
public int getDefaultBorderInset()
getDefaultBorderInset
in interface ElementUI
public void performAction(int gesture, java.awt.event.MouseEvent e)
performAction
in interface ElementUI
e
- the gesture.public void updateClientProperty(java.lang.String propertyName)
updateClientProperty
in interface ElementUI
propertyName
- the property name. This idendified
which property was changed.public void elementPropertyChange(java.beans.PropertyChangeEvent evt)
elementPropertyChange
in interface ElementUI
evt
- property change eventpublic java.awt.Shape getBorderShape()
getBorderShape
in interface ElementUI
public twaver.base.obfuscate.network.blink.BlinkStruct getBlinkStruct()
getBlinkStruct
in interface ElementUI
public final boolean isBodyDark()
isBodyDark
in interface ElementUI
public final boolean isOutlineDark()
isOutlineDark
in interface ElementUI
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface ElementUI
protected void setStateOutline(java.awt.Graphics2D g, java.awt.Color color)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.