public class LabelAttachment extends AbstractAttachment
getName()
method. This class can specified the font and other paint style.Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
background |
protected boolean |
border |
protected java.awt.Color |
borderColor |
protected java.awt.Stroke |
borderStroke |
protected java.awt.Color |
color |
protected java.awt.Font |
font |
protected boolean |
highlightable |
protected java.awt.Color |
highlightBackground |
protected java.awt.Color |
highlightForeground |
protected javax.swing.Icon |
icon |
protected int |
maxLength |
protected int |
orientation |
protected int |
position |
protected boolean |
selectable |
protected boolean |
underBody |
protected boolean |
underline |
protected java.awt.Color |
underlineColor |
protected java.awt.Stroke |
underlineStroke |
protected boolean |
visible |
protected int |
xGap |
protected int |
xOffset |
protected int |
yGap |
protected int |
yOffset |
element, network, ui
Constructor and Description |
---|
LabelAttachment(ElementUI ui)
Constructs attachment by given ui
|
Modifier and Type | Method and Description |
---|---|
void |
elementPropertyChange(java.beans.PropertyChangeEvent evt)
Invoked when the related element's any property change.
|
java.awt.Rectangle |
getBounds()
Return integer rectangle which completely encloses this attachment paint
area for this element.
|
java.awt.Color |
getColor()
Return specified element label paint color.
|
java.awt.Font |
getFont()
Return specified element label paint font.
|
java.awt.Point |
getLocation()
Get the attachement paint location for specified element.
|
RotatableLabel |
getRenderer() |
java.awt.Shape |
getShape()
Get the shape of this attachment.
|
java.lang.String |
getText(Element element) |
boolean |
isDrawBorder()
Return whether draw a rectangle bounds label for specified element.
|
boolean |
isSelectable()
Return true if this attachment is selectable.
|
boolean |
isShowUnderBody() |
boolean |
isVisible()
Determine whether this attachment is visible.
|
void |
paint(java.awt.Graphics2D g2d)
Paint specified element's name on specified graph.
|
void |
paintName(java.awt.Graphics2D g2d,
java.lang.String elementLabel)
Paint name on specified graphics.
|
void |
performAction(int gesture,
java.awt.event.MouseEvent e)
When user make interactive on this label.
|
void |
startLabelEditing()
Edit label
|
contains, getElementUI, getName, isShownOnTop
protected java.awt.Font font
protected boolean visible
protected java.awt.Color color
protected java.awt.Color background
protected boolean border
protected java.awt.Stroke borderStroke
protected java.awt.Color borderColor
protected boolean underline
protected java.awt.Stroke underlineStroke
protected java.awt.Color underlineColor
protected int yOffset
protected int xOffset
protected int yGap
protected int xGap
protected int position
protected boolean selectable
protected int orientation
protected boolean highlightable
protected java.awt.Color highlightBackground
protected java.awt.Color highlightForeground
protected int maxLength
protected javax.swing.Icon icon
protected boolean underBody
public LabelAttachment(ElementUI ui)
ui
- public RotatableLabel getRenderer()
public java.lang.String getText(Element element)
public java.awt.Point getLocation()
BottomCenter
.element
- element object.public void paint(java.awt.Graphics2D g2d)
g
- graph object.element
- element object.public void paintName(java.awt.Graphics2D g2d, java.lang.String elementLabel)
g2d
- public java.awt.Font getFont()
element
- element object.public java.awt.Color getColor()
element
- element object.public boolean isVisible()
public boolean isDrawBorder()
element
- element object.public void performAction(int gesture, java.awt.event.MouseEvent e)
performAction
in interface Attachment
performAction
in class AbstractAttachment
element
- interacted element.gesture
- interaction gesture.public void startLabelEditing()
public boolean isShowUnderBody()
public boolean isSelectable()
AbstractAttachment
isSelectable
in interface Attachment
isSelectable
in class AbstractAttachment
public java.awt.Shape getShape()
Attachment
getShape
in interface Attachment
getShape
in class AbstractAttachment
public java.awt.Rectangle getBounds()
Attachment
public void elementPropertyChange(java.beans.PropertyChangeEvent evt)
elementPropertyChange
in interface Attachment
elementPropertyChange
in class AbstractAttachment
evt
- property change eventCopyright © 2002 - 2010 Serva Software. All Rights Reserved.