public class Segment
extends java.lang.Object
implements java.io.Serializable
Segments compose Branch, Segments or Branches compose PolyLine.
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyChangeSupport |
propertyChangeSupport |
Constructor and Description |
---|
Segment()
Create a segment instance
|
Segment(Node fromNode,
Node toNode)
Create a segment by given start node and end node
|
Segment(Node fromNode,
Node toNode,
java.awt.Point fromPoint,
java.awt.Point toPoint)
Create a segment by given information.
|
Segment(Node fromNode,
java.awt.Point toPoint)
Create segment by given node and point.
|
Segment(java.awt.Point fromPoint,
Node toNode)
Create a segment by given point and node.
|
Segment(java.awt.Point fromPoint,
java.awt.Point toPoint)
Create a segment by given points.
|
Modifier and Type | Method and Description |
---|---|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Fire a boolean type property change event.
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Call this method to fire property change event.
|
Branch |
getBranch()
Get the parent branch object
|
java.util.Map |
getClientProperties()
Get all client properties of this segment.
|
java.lang.Object |
getClientProperty(java.lang.Object key)
Get a client property value by specified key.
|
java.awt.Point |
getFromLocation()
Get the start location of this segment.
|
Node |
getFromNode()
Get the from node of this segment.
|
java.awt.Point |
getFromPoint()
Get the start point of this segment.
|
java.awt.Color |
getLineColor()
Get line color of this segment.
|
PolyLine |
getPolyLine()
Get the parent poly line object of this segment.
|
java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Get the JavaBean support object.
|
java.awt.Point |
getToLocation()
Get the end location of this segment.
|
Node |
getToNode()
Get the end node of this segment.
|
java.awt.Point |
getToPoint()
Get end point for this segment.
|
boolean |
isVisible()
Whether this segment is visible.
|
void |
putClientProperty(java.lang.Object key,
java.lang.Object value)
Change a client property
|
void |
setBranch(Branch branch)
Set the parent branch object
|
void |
setFromNode(Node fromNode)
Set the start node for this segment.
|
void |
setFromPoint(java.awt.Point fromPoint)
Set the from point for this segment.
|
void |
setLineColor(java.awt.Color lineColor)
Set the line color of this segment.
|
void |
setPolyLine(PolyLine polyLine)
Set the parent polyline element for this segment.
|
void |
setToNode(Node toNode)
Set the end node for this segment.
|
void |
setToPoint(java.awt.Point toPoint)
Set end point for this segment.
|
void |
setVisible(boolean visible)
Set whether this segment is visible.
|
public Segment()
public Segment(Node fromNode, Node toNode, java.awt.Point fromPoint, java.awt.Point toPoint)
fromNode
- Node the segment start nodetoNode
- Node the segment end nodefromPoint
- Point the segment from pointtoPoint
- Point the segment end pointpublic Segment(Node fromNode, Node toNode)
fromNode
- Node start node of this segmenttoNode
- Node end node of this segmentpublic Segment(java.awt.Point fromPoint, java.awt.Point toPoint)
fromPoint
- Point the start point of this segmenttoPoint
- Point the end point of this segmentpublic Segment(Node fromNode, java.awt.Point toPoint)
fromNode
- Node start node of this segment.toPoint
- Point the end point of this segment.public Segment(java.awt.Point fromPoint, Node toNode)
fromPoint
- Point the start pointtoNode
- Node the end nodepublic java.beans.PropertyChangeSupport getPropertyChangeSupport()
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- String property nameoldValue
- Object old value.newValue
- Object new valuepublic void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
propertyName
- String property nameoldValue
- boolean old valuenewValue
- boolean new valuepublic java.lang.Object getClientProperty(java.lang.Object key)
key
- Object the client property keypublic java.util.Map getClientProperties()
public void putClientProperty(java.lang.Object key, java.lang.Object value)
key
- Object client property keyvalue
- Object client property valuepublic boolean isVisible()
public void setVisible(boolean visible)
visible
- boolean true visible, false otherwise.public java.awt.Color getLineColor()
public void setLineColor(java.awt.Color lineColor)
lineColor
- Color the new line color for this segment.public Node getFromNode()
public void setFromNode(Node fromNode)
fromNode
- Node the from node of this segment.public java.awt.Point getFromPoint()
public void setFromPoint(java.awt.Point fromPoint)
fromPoint
- Point the from point for this segment.public Node getToNode()
public void setToNode(Node toNode)
toNode
- Node the end node for this segment.public java.awt.Point getToPoint()
public void setToPoint(java.awt.Point toPoint)
toPoint
- Point the end point for this segment.public PolyLine getPolyLine()
public void setPolyLine(PolyLine polyLine)
polyLine
- PolyLine the parent polyline element.public Branch getBranch()
public void setBranch(Branch branch)
branch
- Branch the parent branch object.public java.awt.Point getFromLocation()
public java.awt.Point getToLocation()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.