ch.hearc.I04_05s08.GUI.Graph
Class Node

java.lang.Object
  extended bych.hearc.I04_05s08.GUI.Graph.Element
      extended bych.hearc.I04_05s08.GUI.Graph.Node
Direct Known Subclasses:
RdfNode, RdfsNode

public abstract class Node
extends Element

Node element

Author:
Blanc, Yoan
Licence:
MIT
Copyright:
2005 Yoan Blanc, HE-ARC Ing�nierie

Field Summary
private  Rectangle2D rectangle
          Bound of the Node
 
Fields inherited from class ch.hearc.I04_05s08.GUI.Graph.Element
 
Constructor Summary
Node(Node n)
          A copy builder
Node(String title)
          Build the node
 
Method Summary
 void calcDimension(Graphics2D g2d)
          Calculate the dimension of the node
 boolean contains(Point2D p)
          Test if the Element contains the point
 void draw(Graphics2D g2d)
          Draw the Node
 void drawTitle(Graphics2D g2d)
          Draw the title's Node
 Rectangle2D getBounds()
          Get the bounds of the Node
 Point2D getGravityPoint(Graphics2D g2d)
          Return the point in the middle of the Node
 Point2D getPoint()
          Get the top left corner point
 Point2D getProximityPoint(Point2D p, Graphics2D g2d)
          Get the point touching the node between the givent point and the middle of the node
 void setPos(Point2D p)
          Move the Node
 void update()
          Update the values
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rectangle

private Rectangle2D rectangle
Bound of the Node

Constructor Detail

Node

public Node(String title)
Build the node

Parameters:
title - the title of the node

Node

public Node(Node n)
A copy builder

Parameters:
n - the node to copy
Method Detail

getPoint

public Point2D getPoint()
Get the top left corner point

Returns:
the point at the top left corner

getGravityPoint

public Point2D getGravityPoint(Graphics2D g2d)
Return the point in the middle of the Node

Parameters:
g2d - graphic context
Returns:
the point in the middle of the Node

getProximityPoint

public Point2D getProximityPoint(Point2D p,
                                 Graphics2D g2d)
Get the point touching the node between the givent point and the middle of the node

Parameters:
p - distant point
g2d - graphic context
Returns:
the closest point of the point touching the node

getBounds

public Rectangle2D getBounds()
Get the bounds of the Node

Returns:
the bounds

setPos

public void setPos(Point2D p)
Move the Node

Parameters:
p - the point

calcDimension

public void calcDimension(Graphics2D g2d)
Calculate the dimension of the node

Parameters:
g2d - graphic context

contains

public boolean contains(Point2D p)
Test if the Element contains the point

Specified by:
contains in class Element
Parameters:
p - the point
Returns:
if the Element contains this point

draw

public void draw(Graphics2D g2d)
Draw the Node

Specified by:
draw in class Element
Parameters:
g2d - Graphic context

drawTitle

public void drawTitle(Graphics2D g2d)
Draw the title's Node

Parameters:
g2d - Graphic context

update

public void update()
Update the values

Overrides:
update in class Element


A project by Blanc, Yoan – supervised by Dr. Ghorbel, Hatem.
2004 © Blanc, Yoan - HE-ARC