aminePlatform.guis.graphDrawing
Class VisualNode

java.lang.Object
  extended byaminePlatform.guis.graphDrawing.VisualNode
All Implemented Interfaces:
AmineConstants

public class VisualNode
extends java.lang.Object
implements AmineConstants

Title : VisualNode

Description : VisualNode represents a node in VisualGraph, both are visual wrappers for Node and Graph respectively: a VisualNode contains a reference to a Node with visual attributes and methods. In this way, visualization (or drawing) of a Graph is separeted from the structure Graph.

Copyright : Copyright (c) Adil KABBAJ 2004-2009


Field Summary
 boolean isBrowserView
           
 
Fields inherited from interface aminePlatform.util.AmineConstants
ANALOGY, B_ASSIGN, B_DSPLY_WT_DELAY, B_DSPLY_WTT_DELAY, B_TRIGGER, B_WTT_DSPLY, BLOCK_BACKWARD_PROPAGATION, BLOCK_FORWARD_PROPAGATION, CANON, CGIF, CGRAPHIC, CHECK_PRECONDITIONS, COMPARE, COMPOSED_GOAL, CONCEPT_TYPE_IDENT, CONTEXT, COVERED_BY, CPLTE_CONTRACT, DEFINITION, EQ_OR_MORE_SPCFQ, EQUAL, EXPAND, FALSE_FOCUS_LIST, FUNCTIONAL, GENERALISE, GENERALIZE, HAVE_AN_INTERSECTION, ID_ADD, ID_DIV, ID_EQ, ID_INF, ID_IS, ID_MESSAGE, ID_MUL, ID_NOT, ID_NULL, ID_OPER_AND, ID_OPER_OR, ID_SUB, ID_SUP, IN_ACTIVATION, IN_MODE, IN_MODE2, INDIVIDUAL, INDIVIDUAL_IDENT, INTEGRATED, IS_CANONIC, KEY_GLOBAL_RULE, LC_ADD, LC_AMINE_BOOLEAN, LC_AMINE_DOUBLE, LC_AMINE_INTEGER, LC_AND, LC_BOOLEAN, LC_CG, LC_CLOSE_BRKT, LC_CLOSE_PARENT, LC_CLOSE_SET, LC_COMMA, LC_COMMA_SEMI, LC_CONCEPT, LC_CONSTRUCTOR, LC_CS, LC_CUT, LC_DIFF, LC_DIV, LC_DOUBLE, LC_DSBL_BKWRD_PRPGTN, LC_DSBL_FRWRD_PRPGTN, LC_EOF, LC_EQ, LC_FOUR_POINTS, LC_IDENTIFIER, LC_IF, LC_INF, LC_INTEGER, LC_INTEROG, LC_IS, LC_JAVA_OBJECT, LC_LEFT_ARROW, LC_LIST, LC_NULL, LC_OPEN_BRKT, LC_OPEN_PARENT, LC_OPEN_SET, LC_OPER_AND, LC_OPER_OR, LC_POINT, LC_RELATION, LC_RGHT_ARROW, LC_SEMI_COMMA, LC_SET, LC_STAR, LC_STATE, LC_STRING, LC_SUB, LC_SUP, LC_TERM, LC_TWO_POINTS, LC_VAR_LIST_CONSTRUCTOR, LC_VARIABLE, LF, MAXIMAL_JOIN, MORE_GENERAL, MORE_SPECIFIC, NOTHING_TO_INTEGRATE, OPERS_WITH_RSLT, OUT_MODE, OUT_MODE2, PARTIAL_CONTRACT, PARTIAL_SUBSUME, PRJCT_OPERS, PROJECT, READ, READ_SENTENCE, RELATION_TYPE_IDENT, S_AND, S_BOOLEAN, S_CG, S_CLOSE_BRKT, S_CLOSE_PARENT, S_CLOSE_SET, S_COMMA, S_CONCEPT, S_CONSTRUCTOR, S_CUT, S_DIFF, S_DOUBLE, S_EOF, S_EQUAL, S_EXPAND, S_FALSE, S_FOUR_POINTS, S_GENERALISE, S_GENERALIZE, S_IDENTIFIER, S_IF, S_INTEGER, S_INTEROG, S_IS, S_IS_CANONIC, S_LEFT_ARROW, S_LIST, S_MAXIMAL_JOIN, S_OPEN_BRKT, S_OPEN_PARENT, S_OPEN_SET, S_POINT, S_RGHT_ARROW, S_SEMI_COMMA, S_SOURCE, S_SPECIALIZE, S_STATE, S_STRING, S_SUBSUME, S_SUBSUME_WITH_RESULT, S_SUPER, S_TARGET, S_TERM, S_THIS, S_TRUE, S_TWO_POINTS, S_UNIFY, S_VARIABLE, SITUATION, SPECIALIZE, STEADY, SUBSUME, SUBSUME_WITH_RSLT, TRIGGER, UNCOMPARABLE, UNIFY, VAR_SUPER, WAIT_ASSIGNMENT, WAIT_END_OF_ASSIGNMENT, WAIT_PRECONDITIONS, WAIT_VALUE
 
Constructor Summary
VisualNode()
          Create a VisualNode
VisualNode(Node node)
          Create a VisualNode for the specified Node
 
Method Summary
 void addIncomeEdge(VisualEdge vedge)
          Add the specified visualEdge to the income visualEdges of the current VisualNode
 void addOutcomeEdge(VisualEdge vedge)
          Add the specified visualEdge to the outcome visualEdges of the current VisualNode
(package private)  void computeRectangle(java.lang.String contenu, java.awt.Point pt)
          Compute the rectangle that will enclose the current VisualNode, according to the specified content sConcText, and having as leftTopPoint the specified point pt.
 VisualNode copy()
          Copy the current VisualNode
 void deplOffSet(java.awt.Point point)
          Do a translation of the current VisualNode according to the specified point
 java.lang.Object getCellWrapper()
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Get the CELL_WRAPPER values associated to the current VisualNode
 java.util.ArrayList getChild()
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* Get all child linked to the current VisualNode
 Int_DisplayFrame getDisplayFrame()
          Get the display frame associated to the current VisualNode
 java.util.ArrayList getIncomeEdges()
          Get the income visual edges linked to the current VisualNode
 Node getNode()
          Get the node associated to the current VisualNode
 java.awt.Rectangle getoriginalRectangle()
           
 java.util.ArrayList getOutcomeEdges()
          Get the outcome visual edges linked to the current VisualNode
 java.util.ArrayList getParents()
           
 java.awt.Rectangle getRectangle()
          Get the rectangle that encloses the current VisualNode
 int getScale()
          Get the VisualNode scale (associated with the zoom option only)
 boolean getSelected()
          /*This part of code is added by Nabil OURDANI for the purpose of automatic / drawing of ONTOLOGY by SYGIYAMA ALGORITHM * /** Get the Selected associated to the current VisualNode
 boolean getVisited()
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Get the Visited values associated to the current VisualNode
 boolean hasContentToDisplay()
          Check if the current VisualNode has a content to display (in a special frame) or not.
 boolean isInTracker(java.awt.Rectangle rct)
          Check if the rectangle of the current VisualNode is contained in the specified rectangle.
 void move(int dx, int dy)
          Translate the rectangle of the current VisualNode according to the specified dx and dy
(package private)  void move(java.awt.Point offSet, java.util.ArrayList selectedVNodes, Lexicon lexicon)
          Move selected vnodes according to the offset offSet.
 void moveAVNode(java.awt.Point p, Lexicon lexicon)
          Do a translation of the current VisualNode according to the specified point and update the related visualEdges
 void setCellWrapper(java.lang.Object cellwrapper)
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the CELL_WRAPPER value associated to the current VisualNode
 void setDisplayFrame(Int_DisplayFrame displayFrame)
          Set the display frame associated to the current VisualNode
 void setIncomeEdges(java.util.ArrayList vedges)
          Set the income visual edges linked to the current VisualNode
 void setNode(Node node)
          Set the node associated to the current VisualNode
 void setoriginalRectangle(java.awt.Rectangle rect)
           
 void setOutcomeEdges(java.util.ArrayList vedges)
          Set the outcome visual edges linked to the current VisualNode
 void setRectangle(java.awt.Graphics g, Lexicon lexicon)
          /** Determine (compute) and then set the rectangle that encloses the current VisualNode
 void setRectangle(java.awt.Rectangle rectangle)
          Set the rectangle that encloses the current VisualNode
 void setScale(int scale)
          set the VisualNode scale (associated with the zoom option only)
 void setSelected(boolean selected)
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the Selected associated to the current VisualNode
 void setVisited(boolean visited)
          CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the Visited value associated to the current VisualNode
 void setVisualRectangle(java.awt.Rectangle rectangle)
           
 java.lang.String toString(Lexicon lexicon)
          Return the string that formulate the content of the node associated to the current VisualNode
 void updateEdges(java.awt.Point pOff, java.util.ArrayList lstSelec, Lexicon lexicon)
          Update income and outcome edges of a visual node.
 void updateRectangle(java.awt.Rectangle rct, Lexicon lexicon)
          Update the rectangle of the current VisualNode, using the specified rectangle and update the related VisualEdges that are related to the current VisualNode.
 void updateRelatedVEdges(java.awt.Point offp, boolean deplacement, Lexicon lexicon)
          Update the VisualEdges that are related to the current VisualNode according to the specified point offp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isBrowserView

public boolean isBrowserView
Constructor Detail

VisualNode

public VisualNode()
Create a VisualNode


VisualNode

public VisualNode(Node node)
Create a VisualNode for the specified Node

Parameters:
node - A Node
Method Detail

copy

public VisualNode copy()
Copy the current VisualNode

Returns:
a copy the current VisualNode

getNode

public Node getNode()
Get the node associated to the current VisualNode

Returns:
the node associated to the current VisualNode

setNode

public void setNode(Node node)
Set the node associated to the current VisualNode

Parameters:
node - A Node

getRectangle

public java.awt.Rectangle getRectangle()
Get the rectangle that encloses the current VisualNode

Returns:
the rectangle that encloses the current VisualNode

getoriginalRectangle

public java.awt.Rectangle getoriginalRectangle()

setoriginalRectangle

public void setoriginalRectangle(java.awt.Rectangle rect)

setRectangle

public void setRectangle(java.awt.Rectangle rectangle)
Set the rectangle that encloses the current VisualNode

Parameters:
rectangle - A Rectangle

setVisualRectangle

public void setVisualRectangle(java.awt.Rectangle rectangle)

getSelected

public boolean getSelected()
/*This part of code is added by Nabil OURDANI for the purpose of automatic / drawing of ONTOLOGY by SYGIYAMA ALGORITHM * /** Get the Selected associated to the current VisualNode

Returns:
the Selected associated to the current VisualNode

setSelected

public void setSelected(boolean selected)
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the Selected associated to the current VisualNode

Parameters:
selected -

getVisited

public boolean getVisited()
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Get the Visited values associated to the current VisualNode

Returns:
the Visited value associated to the current VisualNode

setVisited

public void setVisited(boolean visited)
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the Visited value associated to the current VisualNode

Parameters:
visited -

getCellWrapper

public java.lang.Object getCellWrapper()
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Get the CELL_WRAPPER values associated to the current VisualNode

Returns:
the CELL_WRAPPER value associated to the current VisualNode

setCellWrapper

public void setCellWrapper(java.lang.Object cellwrapper)
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /** Set the CELL_WRAPPER value associated to the current VisualNode


setRectangle

public void setRectangle(java.awt.Graphics g,
                         Lexicon lexicon)
/** Determine (compute) and then set the rectangle that encloses the current VisualNode

Parameters:
g - A Graphics
lexicon - A Lexicon

getIncomeEdges

public java.util.ArrayList getIncomeEdges()
Get the income visual edges linked to the current VisualNode

Returns:
the income visual edges linked to the current VisualNode

setIncomeEdges

public void setIncomeEdges(java.util.ArrayList vedges)
Set the income visual edges linked to the current VisualNode

Parameters:
vedges - An ArrayList of VisualEdge

getOutcomeEdges

public java.util.ArrayList getOutcomeEdges()
Get the outcome visual edges linked to the current VisualNode

Returns:
the outcome visual edges linked to the current VisualNode

setOutcomeEdges

public void setOutcomeEdges(java.util.ArrayList vedges)
Set the outcome visual edges linked to the current VisualNode

Parameters:
vedges - An ArrayList of VisualEdge

getChild

public java.util.ArrayList getChild()
CODE ADDED BY Nabil OURDANI -*-*-*-*-*-*-*-*-*-*-*-*-*-*-* Get all child linked to the current VisualNode

Returns:
the child linked to the current VisualNode

getParents

public java.util.ArrayList getParents()

addIncomeEdge

public void addIncomeEdge(VisualEdge vedge)
Add the specified visualEdge to the income visualEdges of the current VisualNode

Parameters:
vedge - A VisualEdge

addOutcomeEdge

public void addOutcomeEdge(VisualEdge vedge)
Add the specified visualEdge to the outcome visualEdges of the current VisualNode

Parameters:
vedge - A VisualEdge

hasContentToDisplay

public boolean hasContentToDisplay()
Check if the current VisualNode has a content to display (in a special frame) or not.

Returns:
true if the current VisualNode has a content to display

getDisplayFrame

public Int_DisplayFrame getDisplayFrame()
Get the display frame associated to the current VisualNode

Returns:
the display frame associated to the current VisualNode

setDisplayFrame

public void setDisplayFrame(Int_DisplayFrame displayFrame)
Set the display frame associated to the current VisualNode

Parameters:
displayFrame - An Int_DisplayFrame

toString

public java.lang.String toString(Lexicon lexicon)
Return the string that formulate the content of the node associated to the current VisualNode

Parameters:
lexicon - A Lexicon
Returns:
the string that formulate the content of the node associated to the current VisualNode

deplOffSet

public void deplOffSet(java.awt.Point point)
Do a translation of the current VisualNode according to the specified point

Parameters:
point - A Point

moveAVNode

public void moveAVNode(java.awt.Point p,
                       Lexicon lexicon)
Do a translation of the current VisualNode according to the specified point and update the related visualEdges

Parameters:
p - A Point
lexicon - A Lexison

updateEdges

public void updateEdges(java.awt.Point pOff,
                        java.util.ArrayList lstSelec,
                        Lexicon lexicon)
Update income and outcome edges of a visual node.

Parameters:
pOff - Point pOff specifies the deplacement to perform
lstSelec - An ArrayList of selected vnodes that are concerned by the deplacement
lexicon - A Lexison

isInTracker

public boolean isInTracker(java.awt.Rectangle rct)
Check if the rectangle of the current VisualNode is contained in the specified rectangle.

Parameters:
rct - A Rectangle
Returns:
true if the rectangle of the current VisualNode is contained in the specified rectangle.

move

void move(java.awt.Point offSet,
          java.util.ArrayList selectedVNodes,
          Lexicon lexicon)
Move selected vnodes according to the offset offSet. Related vedges should be updated due to vnodes move.

Parameters:
offSet - A Point
selectedVNodes - An ArrayList of VisualNodes
lexicon - A Lexicon

move

public void move(int dx,
                 int dy)
Translate the rectangle of the current VisualNode according to the specified dx and dy

Parameters:
dx -
dy -

updateRelatedVEdges

public void updateRelatedVEdges(java.awt.Point offp,
                                boolean deplacement,
                                Lexicon lexicon)
Update the VisualEdges that are related to the current VisualNode according to the specified point offp.

Parameters:
offp - A Point
deplacement - A Boolean. True if the current change a consequence of a deplacement.
lexicon - A Lexicon

getScale

public int getScale()
Get the VisualNode scale (associated with the zoom option only)

Returns:
the zoom scale associated to the current VisualNode

setScale

public void setScale(int scale)
set the VisualNode scale (associated with the zoom option only)

Parameters:
scale - int

computeRectangle

void computeRectangle(java.lang.String contenu,
                      java.awt.Point pt)
Compute the rectangle that will enclose the current VisualNode, according to the specified content sConcText, and having as leftTopPoint the specified point pt.

Parameters:
contenu - A String
pt - A Point

updateRectangle

public void updateRectangle(java.awt.Rectangle rct,
                            Lexicon lexicon)
Update the rectangle of the current VisualNode, using the specified rectangle and update the related VisualEdges that are related to the current VisualNode.

Parameters:
rct - A Rectangle
lexicon - A Lexicon