|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.hearc.I04_05s08.GUI.Graph.Element
ch.hearc.I04_05s08.GUI.Graph.Arrow
Arrow between nodes
Field Summary | |
private Polygon |
arrow
The arrow |
private Point2D[] |
contactPoints
Point of contact with the nodes |
private Line2D |
line
The line |
private Node[] |
nodes
Nodes connected |
private Rectangle2D |
rectangle
The rectangle (background of the title) |
Fields inherited from class ch.hearc.I04_05s08.GUI.Graph.Element |
|
Constructor Summary | |
Arrow()
Build a new arrow without anything |
|
Arrow(Arrow a)
Build a new arrow from another |
|
Arrow(Node from,
Node to)
Build a new arrow without a title |
|
Arrow(String title,
Node from,
Node to)
Build a new arrow |
Method Summary | |
void |
calcLine(Graphics2D g2d)
Caluculate the line |
boolean |
contains(Point2D p)
If the line is near (3) the point |
void |
draw(Graphics2D g2d)
Draw |
void |
drawLine(Graphics2D g2d)
Drawing the line between the two nodes |
void |
drawTitle(Graphics2D g2d)
Draw the title's Node |
double |
getAngle()
Get the angle of the line (between 0 and 2*PI) |
Point2D[] |
getContactPoints()
Get the point of contact with other nodes |
Line2D |
getLine()
Get the line |
Node[] |
getNodes()
Get the nodes |
void |
setArrow(Polygon arrow)
Define the arrow |
boolean |
setNodes(Node from,
Node to)
Set the nodes |
boolean |
unconnect()
Disconnect the arrow from its nodes |
Methods inherited from class ch.hearc.I04_05s08.GUI.Graph.Element |
clone, getBackgroundColor, getForegroundColor, getGraph, getPadding, getTitle, isSelected, select, setBackgroundColor, setForegroundColor, setPadding, setSelectedBackgroundColor, setSelectedForegroundColor, setTitle, showDialog, update |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Line2D line
private Rectangle2D rectangle
private Node[] nodes
private Point2D[] contactPoints
private Polygon arrow
Constructor Detail |
public Arrow(String title, Node from, Node to)
title
- the titlefrom
- the node where it comesto
- the node where it goespublic Arrow(Node from, Node to)
from
- the node where it comesto
- the node where it goespublic Arrow()
public Arrow(Arrow a)
a
- arrowMethod Detail |
public boolean setNodes(Node from, Node to)
from
- the node where it comesto
- the node where it goes
public Node[] getNodes()
public boolean contains(Point2D p)
contains
in class Element
p
- the point
public Point2D[] getContactPoints()
public Line2D getLine()
public void calcLine(Graphics2D g2d)
g2d
- Graphic contextpublic void draw(Graphics2D g2d)
draw
in class Element
g2d
- Graphic contextpublic void drawTitle(Graphics2D g2d)
g2d
- Graphic contextpublic void drawLine(Graphics2D g2d)
g2d
- Graphic contextpublic double getAngle()
public void setArrow(Polygon arrow)
arrow
- the arrowpublic boolean unconnect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A project by Blanc, Yoan – supervised by Dr. Ghorbel, Hatem.
2004 © Blanc, Yoan - HE-ARC