public class Arc
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Arc()
Builder
|
Arc(GraphPanel p)
Builder
|
Arc(int source,
int destination,
GraphPanel p)
Builder
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g2,
java.awt.Point source,
java.awt.Point destination,
boolean select)
Draws this component
|
int |
getDestination()
Gets the destination node
|
int |
getDestination2()
Gets the destination node
|
int |
getSource()
Gets the source node of this arc
|
int |
getSource2()
Gets the source node of this arc
|
boolean |
isInside(java.awt.Point point,
java.awt.Point source,
java.awt.Point destination)
Test if the provided point is inside
|
void |
setDestination(int destination)
Sets the destination node
|
void |
setDestination2(int destination)
Sets the destination node
|
void |
setSource(int source)
Sets the node source
|
void |
setSource2(int source)
Sets the node source
|
public Arc()
public Arc(GraphPanel p)
p
- Parent graphpublic Arc(int source, int destination, GraphPanel p)
source
- Source nodedestination
- Destination nodep
- Parent graphpublic int getSource()
public int getDestination()
public void setSource(int source)
source
- The new node sourcepublic void setDestination(int destination)
destination
- the new destination nodepublic int getSource2()
public int getDestination2()
public void setSource2(int source)
source
- The new node sourcepublic void setDestination2(int destination)
destination
- the new destination nodepublic void draw(java.awt.Graphics2D g2, java.awt.Point source, java.awt.Point destination, boolean select)
g2
- The graphic elementsource
- The point of origindestination
- The destination pointselect
- if this element is selectedpublic boolean isInside(java.awt.Point point, java.awt.Point source, java.awt.Point destination)
point
- Pointsource
- Source nodedestination
- Destination node