public class Branch
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 |
protected java.util.List |
segments |
Constructor and Description |
---|
Branch()
Creates a branch instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSegment(Segment segment)
Add a segment into this branch.
|
void |
clearSegments()
Remove all segments from this branch.
|
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Fire a boolean property change event via the internal property change support object.
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a property change event via the internal property change support object.
|
java.awt.Color |
getBranchColor()
Gets the branch color.
|
java.util.Map |
getClientProperties()
Gets all client properties of this branch.
|
java.lang.Object |
getClientProperty(java.lang.Object key)
Gets a client property by given key.
|
PolyLine |
getPolyLine()
Gets the PolyLine object of this branch.
|
java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Get the PropertyChangeSupport object of this branch.
|
java.util.List |
getSegments()
Get all segments of this branch.
|
boolean |
isVisible()
Tells whether this branch is visible.
|
void |
putClientProperty(java.lang.Object key,
java.lang.Object value)
Put a new client property into this branch.
|
void |
removeSegment(Segment segment)
Remove a segment object from this branch.
|
void |
setBranchColor(java.awt.Color branchColor)
Set the branch paint color.
|
void |
setVisible(boolean visible)
Change the visible value of this branch.
|
protected java.util.List segments
protected java.beans.PropertyChangeSupport propertyChangeSupport
public java.util.List getSegments()
public void addSegment(Segment segment)
segment
- Segment the segment object need to addpublic void removeSegment(Segment segment)
segment
- Segment the segment need to be removed.public void clearSegments()
public java.beans.PropertyChangeSupport getPropertyChangeSupport()
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
propertyName
- String the propety name of the change.oldValue
- Object the old value of the change.newValue
- Object the new value of the change.public void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
propertyChangeSupport.firePropertyChange(propertyName, oldValue, newValue);
propertyName
- String the propety name of the change.oldValue
- boolean the old value of this propertynewValue
- boolean the new value of this property.public java.lang.Object getClientProperty(java.lang.Object key)
key
- Object the property keypublic java.util.Map getClientProperties()
public void putClientProperty(java.lang.Object key, java.lang.Object value)
key
- Object the key of this client property.value
- Object the value of this client property.public boolean isVisible()
public void setVisible(boolean visible)
visible
- boolean true visible, false invisible.public java.awt.Color getBranchColor()
public void setBranchColor(java.awt.Color branchColor)
branchColor
- Color the new branch paint color.public PolyLine getPolyLine()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.