|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
ch.hearc.I04_05s08.GUI.Graph.GraphPanel
Graph
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
static int |
ARROW_MODE
Mode drawing an arrow |
private LinkedList |
arrows
List of arrows |
private Element |
drawingElement
The element that will be drawing |
private LinkedList[] |
elements
List of lists |
private OntFile |
file
Ontology file |
private Line2D |
line
Temporary line before arrow |
private int |
mode
Mode of drawing |
static int |
NO_MODE
Mode drawing an arrow |
static int |
NODE_MODE
Mode drawing a node |
private LinkedList |
nodes
List of nodes |
private Point2D |
offset
Offset of the point inside the Node |
private Element |
oldElement
Last selected Element |
private Element |
selectedElement
Current selected Element |
Fields inherited from class javax.swing.JPanel |
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
GraphPanel()
Build the graph |
Method Summary | |
boolean |
add(Arrow a)
Add an arrow |
boolean |
add(Arrow[] a)
Add arrows |
boolean |
add(Element e)
Add an Element to the graph |
boolean |
add(Node n)
Add a node |
boolean |
add(Node[] n)
Add nodes |
boolean |
del(Arrow a)
Delete an arrow |
boolean |
del(Arrow[] a)
Delete some arrows |
boolean |
del(Element e)
Delete a element (node or arrow) |
boolean |
del(Node n)
Delete a node (and connected arrows) |
boolean |
del(Node[] n)
Delete some nodes (and connected arrows) |
OntFile |
getFile()
Get the file |
int |
getMode()
Get the drawing mode |
LinkedList |
getNodes()
Get the nodes |
Element |
getOldSelectedElement()
Get the last selected element |
Dimension |
getPreferredSize()
Get the size of the graph (used by the scroll area) |
Element |
getSelectedElement()
Get the selected element |
void |
modeAction(Point2D p)
Do the actions for the modes (ARROW_MODE here) |
void |
moveTo(Point2D p)
Move the selected element to the point |
void |
paintComponent(Graphics g)
Paint the panel |
void |
redraw()
Update the graph |
void |
select(Point2D p)
Select the Element at the choosen point |
void |
setDrawingElement(Element e)
Set the element that would be drawn |
void |
setFile(OntFile file)
Set the file |
void |
setMode(int mode)
Set the drawing mode |
void |
setMousePos(Point2D p)
Set the mouse position |
void |
showDialog(Point2D p)
Display a dialog box for the selected element |
private void |
showme()
|
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private LinkedList nodes
private LinkedList arrows
private LinkedList[] elements
private Element selectedElement
private Element oldElement
private Point2D offset
private Line2D line
private int mode
private Element drawingElement
private OntFile file
public static final int NO_MODE
public static final int ARROW_MODE
public static final int NODE_MODE
Constructor Detail |
public GraphPanel()
Method Detail |
public boolean add(Node n)
n
- Nodepublic boolean add(Node[] n)
n
- Nodespublic boolean add(Arrow a)
a
- Arrowpublic boolean add(Arrow[] a)
a
- Arrowpublic boolean add(Element e)
e
- the elementpublic boolean del(Arrow a)
a
- arrowpublic boolean del(Arrow[] a)
a
- arrowspublic boolean del(Node n)
n
- node to deleteprivate void showme()
public boolean del(Node[] n)
n
- node to deletepublic boolean del(Element e)
e
- elementpublic OntFile getFile()
public void setFile(OntFile file)
file
- a filepublic void paintComponent(Graphics g)
g
- Graphic contextpublic void select(Point2D p)
p
- the point clicked on screenpublic void showDialog(Point2D p)
p
- the point clicked on screenpublic void setDrawingElement(Element e)
e
- define the element that will be drawnpublic void modeAction(Point2D p)
p
- the point clicked on screenpublic void moveTo(Point2D p)
p
- the pointpublic void setMousePos(Point2D p)
public Dimension getPreferredSize()
public Element getSelectedElement()
public Element getOldSelectedElement()
public void setMode(int mode)
mode
- the modepublic int getMode()
public void redraw()
public LinkedList getNodes()
|
||||||||||
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