JComponentPack 1.5.0

com.zfqjava.chart
Class AbstractLink

java.lang.Object
  extended by com.zfqjava.chart.AbstractNode
      extended by com.zfqjava.chart.AbstractLink
All Implemented Interfaces:
Link, Node, Cloneable
Direct Known Subclasses:
AxisNode, CurveLink, ElbowLink, LineLink, PathLink, PolygonLink, PolygonNode, PolylineLink, ShapeLink

public abstract class AbstractLink
extends AbstractNode
implements Link

AbstractLink provides a basic link implements.


Constructor Summary
protected AbstractLink()
           
 
Method Summary
 void addArrow(Arrow arrow)
          Adds the arrow to this node.
 void addPoint(int x, int y)
          Adds a point to this link.
protected  void configureLinkShape()
          Configure the shape when the link's location has been changed.
protected  void configureLinkShape(Shape s)
          Configure the shape when the link's location has been changed.
protected  void configureLinkShape(Shape s, int x1, int y1, int x2, int y2)
          Configure the shape when the link's location has been changed.
protected  List createHandles()
          Creates the handles for this node.
 void doLayout()
          Layout the children nodes.
protected  void drawShape(Graphics2D g, Shape s)
           
 int getArrowCount()
          Returns the number of the arrow added to this node.
 List getArrowList()
          Returns a read-only arrow list.
 Arrow getEndArrow()
          Returns the end arrow for this link.
 Node getEndNode()
          Returns the end node for this link.
 int getEndX()
          Returns the end x location.
 int getEndY()
          Returns the end y location.
 int getMaxPointCount()
          Returns the maximum point count of this link.
 int getMinPointCount()
          Returns the minimum point count of this link.
 int getPointCount()
          Returns the point count of this link.
 int getPointX(int index)
          Returns the poing x coordinate at the specified index.
 int getPointY(int index)
          Returns the poing y coordinate at the specified index.
 Arrow getStartArrow()
          Returns the start arrow for this link.
 Node getStartNode()
          Returns the start node for this link.
 int getStartX()
          Returns the start x location.
 int getStartY()
          Returns the start y location.
 void removeArrow(Arrow arrow)
          Removes the arrow from this node.
 void removePoint(int x, int y)
          Removes the point from this link.
 void reset()
          Resets the link path.
 void setEndArrow(Arrow endArrow)
          Sets the end arrow for this link.
 void setEndLocation(int x2, int y2)
          Sets the end location.
 void setEndNode(Node endNode)
          Sets the end node for this link.
 void setLocation(int x1, int y1, int x2, int y2)
          Sets the location for start coordinate and end coordinate.
 void setStartArrow(Arrow startArrow)
          Sets the start arrow for this link.
 void setStartLocation(int x1, int y1)
          Sets the start location.
 void setStartNode(Node startNode)
          Sets the start node for this link.
 String toString()
          Returns a string representation of this link.
 
Methods inherited from class com.zfqjava.chart.AbstractNode
addHandle, addHandle, addLink, addNode, addNode, addNode, addNode, clone, configureShape, configureShape, contains, contains, contains, createPaintShape, fillShape, findNodeAt, getBounds, getCellBounds, getCenterX, getCenterY, getChart, getCursor, getDrawComposite, getDrawPaint, getFillComposite, getFillPaint, getFont, getHandleCount, getHandleList, getHeight, getLayout, getLinkCount, getLinkList, getLock, getMargin, getName, getNode, getNodeCount, getNodeList, getPaintBounds, getPaintShape, getPreferredSize, getShadowComposite, getShadowPaint, getShadowTransform, getStroke, getToolTipText, getToolTipText, getTransform, getUserObject, getWidth, getX, getY, indexOfNode, intersects, intersects, isAdjustable, isCellable, isDrawable, isEditable, isEmpty, isFillable, isGroupable, isLinkable, isMovable, isPreferredSizeSet, isResizable, isRotatable, isSelectable, isShadowable, isVisible, paint, paintNodes, paramString, removeAllNode, removeHandle, removeHandle, removeLink, removeNode, removeNode, removeNode, repaint, repaint, repaint, revalidate, setAdjustable, setBounds, setBounds, setCellable, setCenterLocation, setChart, setCursor, setDrawable, setDrawComposite, setDrawPaint, setEditable, setFillable, setFillComposite, setFillPaint, setFont, setGroupable, setLayout, setLinkable, setLocation, setMargin, setMovable, setName, setPaintShape, setPreferredSize, setResizable, setRotatable, setSelectable, setShadowable, setShadowComposite, setShadowPaint, setShadowTransform, setSize, setStroke, setToolTipText, setTransform, setUserObject, setVisible
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.zfqjava.chart.Node
addHandle, addHandle, addLink, addNode, addNode, addNode, addNode, contains, contains, contains, findNodeAt, getBounds, getCellBounds, getCenterX, getCenterY, getChart, getCursor, getDrawComposite, getDrawPaint, getFillComposite, getFillPaint, getFont, getHandleCount, getHandleList, getHeight, getLayout, getLinkCount, getLinkList, getLock, getMargin, getName, getNode, getNodeCount, getNodeList, getPaintBounds, getPreferredSize, getShadowComposite, getShadowPaint, getShadowTransform, getStroke, getToolTipText, getToolTipText, getTransform, getUserObject, getWidth, getX, getY, indexOfNode, intersects, intersects, isAdjustable, isCellable, isDrawable, isEditable, isEmpty, isFillable, isGroupable, isLinkable, isMovable, isPreferredSizeSet, isResizable, isRotatable, isSelectable, isShadowable, isVisible, paint, removeAllNode, removeHandle, removeHandle, removeLink, removeNode, removeNode, removeNode, repaint, repaint, repaint, revalidate, setAdjustable, setBounds, setBounds, setCellable, setCenterLocation, setChart, setCursor, setDrawable, setDrawComposite, setDrawPaint, setEditable, setFillable, setFillComposite, setFillPaint, setFont, setGroupable, setLayout, setLinkable, setLocation, setMargin, setMovable, setName, setPreferredSize, setResizable, setRotatable, setSelectable, setShadowable, setShadowComposite, setShadowPaint, setShadowTransform, setSize, setStroke, setToolTipText, setTransform, setUserObject, setVisible
 

Constructor Detail

AbstractLink

protected AbstractLink()
Method Detail

createHandles

protected List createHandles()
Description copied from class: AbstractNode
Creates the handles for this node.

Overrides:
createHandles in class AbstractNode
Returns:
the handles

drawShape

protected void drawShape(Graphics2D g,
                         Shape s)
Overrides:
drawShape in class AbstractNode

configureLinkShape

protected void configureLinkShape()
Configure the shape when the link's location has been changed.


configureLinkShape

protected void configureLinkShape(Shape s)
Configure the shape when the link's location has been changed.

Parameters:
s - the paint shape of this link.

configureLinkShape

protected void configureLinkShape(Shape s,
                                  int x1,
                                  int y1,
                                  int x2,
                                  int y2)
Configure the shape when the link's location has been changed.

Parameters:
s - the paint shape of this link.
x1 - the start x location
y1 - the start y location
x2 - the end x location
y2 - the end y location

doLayout

public void doLayout()
Description copied from interface: Node
Layout the children nodes.

Specified by:
doLayout in interface Node
Overrides:
doLayout in class AbstractNode

addArrow

public void addArrow(Arrow arrow)
Description copied from interface: Link
Adds the arrow to this node.

Specified by:
addArrow in interface Link
Parameters:
arrow - the arrow to add
See Also:
Link.removeArrow(com.zfqjava.chart.Arrow)

removeArrow

public void removeArrow(Arrow arrow)
Description copied from interface: Link
Removes the arrow from this node.

Specified by:
removeArrow in interface Link
Parameters:
arrow - the arrow to remove
See Also:
Link.addArrow(com.zfqjava.chart.Arrow)

getArrowCount

public int getArrowCount()
Description copied from interface: Link
Returns the number of the arrow added to this node.

Specified by:
getArrowCount in interface Link
Returns:
the number of the arrow

getArrowList

public List getArrowList()
Description copied from interface: Link
Returns a read-only arrow list.

Specified by:
getArrowList in interface Link
Returns:
a read-only arrow list

setStartNode

public void setStartNode(Node startNode)
Description copied from interface: Link
Sets the start node for this link.

Specified by:
setStartNode in interface Link
Parameters:
startNode - the start node
See Also:
Link.getStartNode()

getStartNode

public Node getStartNode()
Description copied from interface: Link
Returns the start node for this link.

Specified by:
getStartNode in interface Link
Returns:
the start node
See Also:
Link.setStartNode(com.zfqjava.chart.Node)

setEndNode

public void setEndNode(Node endNode)
Description copied from interface: Link
Sets the end node for this link.

Specified by:
setEndNode in interface Link
Parameters:
endNode - the end node
See Also:
Link.getEndNode()

getEndNode

public Node getEndNode()
Description copied from interface: Link
Returns the end node for this link.

Specified by:
getEndNode in interface Link
Returns:
the end node
See Also:
Link.setEndNode(com.zfqjava.chart.Node)

setStartArrow

public void setStartArrow(Arrow startArrow)
Description copied from interface: Link
Sets the start arrow for this link.

Specified by:
setStartArrow in interface Link
Parameters:
startArrow - the start arrow
See Also:
Link.getStartArrow()

getStartArrow

public Arrow getStartArrow()
Description copied from interface: Link
Returns the start arrow for this link.

Specified by:
getStartArrow in interface Link
Returns:
the start arrow
See Also:
Link.setStartArrow(com.zfqjava.chart.Arrow)

setEndArrow

public void setEndArrow(Arrow endArrow)
Description copied from interface: Link
Sets the end arrow for this link.

Specified by:
setEndArrow in interface Link
Parameters:
endArrow - the end arrow
See Also:
Link.getEndArrow()

getEndArrow

public Arrow getEndArrow()
Description copied from interface: Link
Returns the end arrow for this link.

Specified by:
getEndArrow in interface Link
Returns:
the end arrow
See Also:
Link.setEndArrow(com.zfqjava.chart.Arrow)

setStartLocation

public void setStartLocation(int x1,
                             int y1)
Description copied from interface: Link
Sets the start location.

Specified by:
setStartLocation in interface Link
Parameters:
x1 - the start x location
y1 - the start y location

getStartX

public int getStartX()
Description copied from interface: Link
Returns the start x location.

Specified by:
getStartX in interface Link
Returns:
the start x location

getStartY

public int getStartY()
Description copied from interface: Link
Returns the start y location.

Specified by:
getStartY in interface Link
Returns:
the start y location

setEndLocation

public void setEndLocation(int x2,
                           int y2)
Description copied from interface: Link
Sets the end location.

Specified by:
setEndLocation in interface Link
Parameters:
x2 - the end x location
y2 - the end y location

getEndX

public int getEndX()
Description copied from interface: Link
Returns the end x location.

Specified by:
getEndX in interface Link
Returns:
the end x location

getEndY

public int getEndY()
Description copied from interface: Link
Returns the end y location.

Specified by:
getEndY in interface Link
Returns:
the end y location

setLocation

public void setLocation(int x1,
                        int y1,
                        int x2,
                        int y2)
Description copied from interface: Link
Sets the location for start coordinate and end coordinate.

Specified by:
setLocation in interface Link
Parameters:
x1 - the start x location
y1 - the start y location
x2 - the end x location
y2 - the end y location

reset

public void reset()
Description copied from interface: Link
Resets the link path.

Specified by:
reset in interface Link

addPoint

public void addPoint(int x,
                     int y)
Description copied from interface: Link
Adds a point to this link.

Specified by:
addPoint in interface Link
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point

removePoint

public void removePoint(int x,
                        int y)
Description copied from interface: Link
Removes the point from this link.

Specified by:
removePoint in interface Link
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point

getPointX

public int getPointX(int index)
Description copied from interface: Link
Returns the poing x coordinate at the specified index.

Specified by:
getPointX in interface Link
Returns:
index the point index

getPointY

public int getPointY(int index)
Description copied from interface: Link
Returns the poing y coordinate at the specified index.

Specified by:
getPointY in interface Link
Returns:
index the point index

getPointCount

public int getPointCount()
Description copied from interface: Link
Returns the point count of this link.

Specified by:
getPointCount in interface Link
Returns:
the point count of this link

getMinPointCount

public int getMinPointCount()
Description copied from interface: Link
Returns the minimum point count of this link.

Specified by:
getMinPointCount in interface Link
Returns:
the minimum point count of this link

getMaxPointCount

public int getMaxPointCount()
Description copied from interface: Link
Returns the maximum point count of this link.

Specified by:
getMaxPointCount in interface Link
Returns:
the maximum point count of this link

toString

public String toString()
Returns a string representation of this link.

Overrides:
toString in class AbstractNode
Returns:
a string representation of this link

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.