public class LinkUI extends AbstractElementUI
AbstractElementUI
.
Link ui used to paint link element. And at the same time, it will listen
the from node/to node's position. When the position of these nodes changed,
this link ui will figour out new path and repainted.LinkUIPainter
. So if developers want customizes new style
links, they can extends the LinkUIPainter
.Modifier and Type | Field and Description |
---|---|
protected boolean |
antialias |
protected java.awt.Color |
blinkColor |
protected boolean |
bundleExpand |
protected int |
bundleIndex |
protected int |
bundleSize |
protected java.awt.Point |
centerPoint |
protected java.awt.Color |
color |
protected java.awt.Shape |
containShape |
protected BorderUI |
defaultBorder |
protected int |
extend |
protected boolean |
flowing |
protected java.awt.Color |
flowingColor |
protected int |
flowingWidth |
protected boolean |
fromArrow |
protected int |
fromPosition |
protected int |
fromXOffset |
protected int |
fromYOffset |
protected boolean |
hollow |
protected boolean |
is3d |
protected boolean |
isFlowingConverse |
protected boolean |
labelRotatable |
protected java.lang.Double |
linkAngle |
protected boolean |
linkBlinking |
protected int |
linkWidth |
protected java.awt.Color |
outlineColor |
protected int |
outlineWidth |
protected java.awt.geom.GeneralPath |
path |
protected double |
proportion |
protected java.awt.Shape |
shape |
protected double |
splitValue |
protected LinkStyleFactory |
styleFactory |
protected boolean |
toArrow |
protected int |
toPosition |
protected int |
toXOffset |
protected int |
toYOffset |
alarmAttachment, attachmentOrientation, attachmentPosition, attachments, attachmentXGap, attachmentXOffset, attachmentYGap, attachmentYOffset, borderInsets, element, labelAttachment, network, renderAlpha, stateOutlineInsets, textureFactory
Constructor and Description |
---|
LinkUI(TNetwork network,
Link link)
Constructs the link ui by network component
and link element object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int x,
int y)
Checks whether this ui "contains" the specified point,
where x and y are defined to be relative to the coordinate
system of this UI.
|
void |
flowForward() |
double |
getAngle() |
BorderUI |
getBorder()
Get the link border object.
|
int |
getBundleIndex()
Get this link's bundle index.
|
int |
getBundleSize()
Get the bundle size.
|
java.awt.Point |
getCenterPoint() |
java.awt.Shape |
getContainShape() |
int |
getDashPhase() |
int |
getExtend() |
twaver.base.obfuscate.network.FlexionStruct |
getFlexionStruct() |
java.awt.Color |
getFlowingColor()
Get the flowing color.
|
int |
getFlowingWidth()
Get the flowing dash width.
|
java.awt.Rectangle |
getFromAgentBounds() |
java.awt.Point |
getFromAnchorPoint(int xOffset,
int yOffset) |
java.awt.Shape |
getFromArrow() |
java.awt.Point |
getFromInflexion() |
java.awt.Point |
getFromPoint()
Get the link from point.
|
int |
getFromPosition() |
int |
getFromXOffset() |
int |
getFromYOffset() |
java.awt.Point |
getHotspot()
Get the link hotspot.
|
Link |
getLink()
Get the link object.
|
java.awt.Color |
getLinkColor()
Get the link color.
|
int |
getLinkWidth()
Get the link width.
|
java.awt.Point |
getOrthogonalPoint() |
java.awt.Color |
getOutlineColor()
Get the color of link outline.
|
int |
getOutlineWidth()
Get the outline width.
|
java.awt.geom.GeneralPath |
getPath()
Get the link ui's backbone path.
|
double |
getProportion() |
java.awt.Shape |
getShape()
Get the link shape.
|
double |
getSplitValue() |
java.awt.Stroke |
getStroke()
Get the link stroke.
|
java.awt.Rectangle |
getToAgentBounds() |
java.awt.Point |
getToAnchorPoint(int xOffset,
int yOffset) |
java.awt.Shape |
getToArrow() |
java.awt.Point |
getToInflexion() |
java.awt.Point |
getToPoint()
Get the to point.
|
int |
getToPosition() |
int |
getToXOffset() |
int |
getToYOffset() |
java.awt.Rectangle |
getUIBounds()
Get the ui bounds.
|
void |
installAttachments()
install the default attachments for this UI.
|
void |
invalidateRelatedLinkShapes() |
void |
invalidateShape()
Invalidate this link's path.
|
boolean |
is3D() |
boolean |
isBundleAgent()
Whether this link ui is the bundle agent.
|
boolean |
isBundleExpand()
Determine whether this this bundle is expanded.
|
boolean |
isFlowing()
Determine whether this link is paint as flowing
animating effect.
|
boolean |
isFlowingConverse()
Determine whether this link is paint as converse flowing.
|
boolean |
isFromArrow()
Determine whether this link has from arrow.
|
boolean |
isHollow() |
boolean |
isLabelRotatable() |
boolean |
isLinkBlinking()
Determines whether this link paint blinking effect.
|
boolean |
isToArrow()
Determine whether this link ui has to arrow.
|
void |
paint(java.awt.Graphics2D g2d)
Paint the whole link on specified graphics.
|
protected void |
paintArrows(java.awt.Graphics2D g2d)
Paint link arrows.
|
void |
paintBody(java.awt.Graphics2D g2d)
Paint the link body.
|
void |
performAction(int gesture,
java.awt.event.MouseEvent e)
Called when user do some interaction on me.
|
void |
reverseExpand()
Reverse the bundle expand status.
|
void |
setPath(java.awt.geom.GeneralPath path)
Set this link ui path.
|
void |
updateClientProperty(java.lang.String propertyName)
Update the specified client property.
|
addAttachment, attachments, containInAttachments, elementPropertyChange, getAlarmAttachment, getAttachementsArea, getAttachementsBounds, getAttachmentAt, getAttachmentOrientation, getAttachmentPosition, getAttachmentXGap, getAttachmentXOffset, getAttachmentYGap, getAttachmentYOffset, getBlinkStruct, getBorderShape, getDefaultBorderInset, getElement, getLabelAttachment, getNetwork, getPaintBodyColor, getSeletableAttachementsArea, getStateOutlineColor, isBodyDark, isOutlineDark, mouseClicked, paintAttachments, paintBorder, removeAttachment, setBodyPaint, setLabelAttachment, setStateOutline
protected LinkStyleFactory styleFactory
protected boolean hollow
protected int extend
protected double proportion
protected double splitValue
protected int linkWidth
protected java.awt.Color color
protected java.awt.Color outlineColor
protected int outlineWidth
protected boolean fromArrow
protected boolean toArrow
protected boolean flowing
protected boolean is3d
protected boolean isFlowingConverse
protected boolean linkBlinking
protected java.awt.Color blinkColor
protected java.awt.Color flowingColor
protected int flowingWidth
protected boolean labelRotatable
protected boolean antialias
protected boolean bundleExpand
protected int bundleIndex
protected int bundleSize
protected int toPosition
protected int toXOffset
protected int toYOffset
protected int fromPosition
protected int fromXOffset
protected int fromYOffset
protected BorderUI defaultBorder
protected java.awt.geom.GeneralPath path
protected java.awt.Point centerPoint
protected java.awt.Shape shape
protected java.awt.Shape containShape
protected java.lang.Double linkAngle
public twaver.base.obfuscate.network.FlexionStruct getFlexionStruct()
public void installAttachments()
AbstractElementUI
addAttachment
to add some new attachment.installAttachments
in class AbstractElementUI
public Link getLink()
public java.awt.Color getLinkColor()
public int getOutlineWidth()
public java.awt.Color getFlowingColor()
public void paintBody(java.awt.Graphics2D g2d)
public void paint(java.awt.Graphics2D g2d)
g2d
- the graphics.protected void paintArrows(java.awt.Graphics2D g2d)
g2d
- the graphics objectpublic java.awt.Shape getFromArrow()
public java.awt.Shape getToArrow()
public java.awt.Point getFromAnchorPoint(int xOffset, int yOffset)
public java.awt.Point getToAnchorPoint(int xOffset, int yOffset)
public int getLinkWidth()
public java.awt.Stroke getStroke()
public java.awt.Shape getShape()
public java.awt.geom.GeneralPath getPath()
public void invalidateShape()
public void setPath(java.awt.geom.GeneralPath path)
LinkUIPainter
or
other auto-layouter.path
- the new path object.public java.awt.Point getHotspot()
public java.awt.Point getCenterPoint()
public boolean contains(int x, int y)
x
- the x coordinate of the pointy
- the y coordinate of the pointpublic java.awt.Shape getContainShape()
public java.awt.Rectangle getUIBounds()
getUIBounds
in interface ElementUI
getUIBounds
in class AbstractElementUI
public java.awt.Rectangle getFromAgentBounds()
public java.awt.Rectangle getToAgentBounds()
public java.awt.Point getFromPoint()
public java.awt.Point getToPoint()
public java.awt.Point getFromInflexion()
public java.awt.Point getToInflexion()
public java.awt.Point getOrthogonalPoint()
public BorderUI getBorder()
public void performAction(int gesture, java.awt.event.MouseEvent e)
AbstractElementUI
performAction
in interface ElementUI
performAction
in class AbstractElementUI
e
- the gesture.public void invalidateRelatedLinkShapes()
public void reverseExpand()
public boolean isBundleAgent()
public double getAngle()
public void flowForward()
public void updateClientProperty(java.lang.String propertyName)
updateClientProperty
in interface ElementUI
updateClientProperty
in class AbstractElementUI
propertyName
- the property name which was changed.public java.awt.Color getOutlineColor()
public boolean isLabelRotatable()
public int getBundleSize()
public boolean isToArrow()
public boolean isFromArrow()
public boolean isFlowing()
public boolean isFlowingConverse()
public boolean isLinkBlinking()
public int getFlowingWidth()
public int getBundleIndex()
public boolean isBundleExpand()
public boolean isHollow()
public int getDashPhase()
public boolean is3D()
public int getFromPosition()
public int getFromXOffset()
public int getFromYOffset()
public int getToPosition()
public int getToXOffset()
public int getToYOffset()
public int getExtend()
public double getProportion()
public double getSplitValue()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.