aminePlatform.guis.graphDrawing
Class GraphDrawPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byaminePlatform.guis.graphDrawing.GraphDrawPanel
All Implemented Interfaces:
javax.accessibility.Accessible, AmineConstants, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
CGDrawPanel, OntologyKBDrawPanel

public class GraphDrawPanel
extends javax.swing.JPanel
implements AmineConstants

Title : GraphDrawPanel

Description : GraphDrawPanel is the Panel for Graph Drawing. Draw methods are defined here, as well as mouse actions and other related UI components.

Copyright : Copyright (c) Adil KABBAJ 2004-2009

See Also:
Serialized Form

Nested Class Summary
 class GraphDrawPanel.CmdCtxtMenu
           
(package private)  class GraphDrawPanel.SelectCtxtMenu
           
 class GraphDrawPanel.TxtFldVEdge
          The textField of ListBox is editable ; user can specify his own name or he can select a primitive name (from the list) and change it.
 class GraphDrawPanel.TxtFldVNode
          Inner Classes : UIs
(package private)  class GraphDrawPanel.VEdgeCtxtMenu
           
 class GraphDrawPanel.VNodeCtxtMenu
          Title : NodeCtxtMenu Description : NodeCtxtMenu is a JPopupMenu for Node in a Graph.
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Point clickPoint
           
 GraphDrawPanel.CmdCtxtMenu cmdCtxtMenu
           
static byte cstbt_linkMode
           
static byte cstbt_ModeCmd
           
static byte cstbt_ModeEdit
           
static byte cstbt_ModePaste
           
static byte cstbt_ModeZoom
           
static byte cstbt_vedgeMode
           
static byte cstbt_vnodeMode
           
 Lexicon currentLexicon
           
 int currFontSize
           
static java.awt.Cursor curs_Crosshair
           
static java.awt.Cursor curs_default
           
static java.awt.Cursor curs_Hand
           
static java.awt.Cursor curs_Move
           
static java.awt.Cursor curs_North
           
static java.awt.Cursor curs_Text
           
static boolean dragMode
           
static java.awt.Font fontTxtFld
           
(package private) static java.awt.Point initPosOfVEdgeName
           
(package private)  java.awt.event.KeyListener keyListener
           
static java.awt.Color lemon_Chiffon
           
(package private)  java.util.ArrayList listOfSelectedVNodes
           
static java.awt.Point locVGraphFrm
           
 double m_zoom
           
 byte mbt_Curs
           
(package private)  java.awt.event.MouseAdapter mouseAdapt
           
(package private)  java.awt.event.MouseMotionAdapter mouseMotAdapt
           
 java.awt.Dimension prefSize
           
 java.awt.Rectangle rectangleBuffer
           
 java.awt.Rectangle rectangleTracker
           
(package private)  GraphDrawPanel.SelectCtxtMenu selctCtxtMenu
           
 java.awt.Point spt_DebDrag
           
 GraphDrawPanel.TxtFldVEdge tfldVEdge
           
 GraphDrawPanel.TxtFldVNode tfldVNode
           
(package private)  GraphDrawPanel.VEdgeCtxtMenu vedgeCtxtMenu
           
 VisualEdge vedgeInEdition
           
 VisualEdge vedgeNamePressed
           
 VisualEdge vedgeNameSelected
           
 VisualEdge vedgeSelected
           
 VisualGraph vgraph
           
 VisualGraph vgraphBuffer
           
 VisualNode vNodeCopy
           
 GraphDrawPanel.VNodeCtxtMenu vnodeCtxtMenu
           
 VisualNode vnodePressed
           
 VisualNode vnodeSelected
           
 int ZoomScale
           
 
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 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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GraphDrawPanel(Lexicon lexicon)
          Create a GraphDrawPanel for the specified GraphDrawFrame, taking into account the specified Lexicon
 
Method Summary
protected  boolean canNodeBeEdited()
           
 void clear()
          Clear the content of the current GraphDrawPanel
(package private) static int computeDistance(java.awt.Point p, java.awt.Point p0, java.awt.Point p1)
          Compute the distance between a point p and the segment (p0, p1).
(package private) static boolean computeIntersection(java.awt.Point p0, java.awt.Point p1, java.awt.Point n0, java.awt.Point n1, java.awt.Point px)
          Compute the intersection between (p0, p1) and (n0, n1) and returns the result
 void copy()
          Copy the selected elements
 Edge createEdge()
          Create an Edge.
 Graph createGraph()
          Create a Graph.
 void cut()
          Cut the selected elements
protected  void cutWithoutBuffering()
           
protected  void displayContent(VisualNode vnode)
          Display the content of the specified Visual Node.
(package private)  void drawVEdgeInEdition(java.awt.Graphics g)
          Draw the VisualEdge that is in edition
 boolean drawVNode(java.awt.Graphics g, VisualNode vnode, Lexicon lexicon)
          Draw VisualNode.
 void ExeTreatVnode(java.lang.String contenu)
           
 void finalize()
           
 void getBorderForSelection()
          Get the minimal rectangle for the tracker
 int getFontSize()
          return the font size of the current VisualGraph
(package private) static java.awt.Point getIntersect(java.awt.Point p0, java.awt.Point p1, java.awt.Rectangle rect)
          Auxiliary Methods
(package private)  void getSelectedVEdges(java.util.ArrayList lstVEdgeASel, java.util.ArrayList lstVNodeSel)
           
(package private)  void getSelectedVNodes(java.util.ArrayList lst)
           
protected  java.lang.String getTxtInEdition(int caretPosition)
           
 boolean graphWithDrawingInf(Graph graph)
           
protected  boolean insertText(java.lang.String s2Insert, int insertPosition)
           
(package private) static boolean isBetween(int v, int b1, int b2)
           
(package private) static boolean isRectangleInRectangle(java.awt.Rectangle rct1, java.awt.Rectangle rct2)
           
(package private)  void onKeyPressed(java.awt.event.KeyEvent e)
           
 void onMouseClicked(java.awt.event.MouseEvent e)
           
(package private)  void onMouseDragged(java.awt.event.MouseEvent e)
           
protected  void onMouseEntered(java.awt.event.MouseEvent e1)
           
(package private)  void onMouseExited(java.awt.event.MouseEvent e1)
           
(package private)  void onMouseMoved(java.awt.event.MouseEvent e1)
           
 void onMousePressed(java.awt.event.MouseEvent e)
           
protected  void onMouseReleased(java.awt.event.MouseEvent e)
           
 void paintComponent(java.awt.Graphics g)
          PaintComponent of the current GraphDrawPanel
 void paste()
          Paste the content of the buffer at the position specified by the attribute clickPoint
 void rearrange()
          ADDED By Nabil this method allow the automatic reorganizing of graph's nodes
(package private) static java.awt.Rectangle rectangleBoundTxt(java.lang.String s, java.awt.Point p)
           
 void selectAll()
          Select all the elements (visual nodes and visual edges) of the current GraphDrawPanel
protected  void selectElements(int caretPosition)
           
 void selectVEdge(VisualEdge vedge)
          Set the specified vedge as the selected Visual Edge.
 void selectVEdgeName(VisualEdge vedge)
          Set the specified vedge as the selected Visual Edge.
 void selectVNode(VisualNode vnode)
          Set the specified vnode as the selected Visual Node.
 void setCursorTolinkMode()
          Set the cursor for the current GraphDrawPanel to Link Mode VEdge.
 void setCursorToModeCmd()
          Set the cursor for the current GraphDrawPanel to Mode Command
 void setCursorToModeEdit()
          Set the cursor for the current GraphDrawPanel to Mode Edition
 void setCursorToModePaste()
          Set the cursor for the current GraphDrawPanel to Mode Paste.
 void setCursorToModeZoom()
          Set the cursor for the current GraphDrawPanel to Mode Zoom
 void setCursorTovedgeMode()
          Set the cursor for the current GraphDrawPanel to Mode VEdge (for the creation of a Visual Edge).
 void setCursorTovnodeMode()
          Set the cursor for the current GraphDrawPanel to Mode VNode (for the creation of a Visual Node).
protected  void setElemsInTxtFldVEdge()
           
 void SetFontSize(int fontsize)
          Set the font size of the current VisualGraph
protected  void setIndividualElements()
           
protected  void setTypeElements()
          It should be redefined by subclasses of GraphDrawPanel
 void SetZoomScale(int zoom)
          Set the scale zoom of the current VisualGraph
protected  void treatVEdge(java.lang.String txt)
           
(package private)  void undoVEdgeEdition()
          Undo Visual Edge Edition
 void unselectTracker()
          Deselect the tracker.
 void unselectVEdge()
          Deselect the selected Visual Edge.
 void unselectVEdgeName()
          Deselect the selected Visual Edge.
 void unselectVNode()
          Deselect the selected Visual Node.
 void update(VisualNode vnode, java.lang.String contenu, java.awt.Rectangle rectangle)
          Update the specified vnode according to the new content (contenu) and with the new rectangle.
 void updateCursorMode(byte btCursMode)
           
 void updateDeletingEdge()
           
protected  void updateItemsNdeCtxtMn()
          It should be redefined by subclasses of GraphDraPanel
protected  void updatePanels(Node source)
           
 void updateScroll()
          Update the scroll of the frame of the current GraphDrawPanel
protected  void updateTreePanel()
           
(package private)  boolean vedgeClicked(java.awt.Point p)
           
(package private)  boolean vedgeNameClicked(java.awt.Point p)
           
protected  boolean vnodeClicked(java.awt.Point p)
           
 void vnodesInTracker()
          Determine the visual nodes that are enclosed by the tracker and put them in the attribute listOfSelectedVNodes.
 void ZoomIn()
           
 void ZoomOut()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

curs_default

public static final java.awt.Cursor curs_default

curs_Text

public static final java.awt.Cursor curs_Text

curs_Crosshair

public static final java.awt.Cursor curs_Crosshair

curs_Move

public static final java.awt.Cursor curs_Move

curs_Hand

public static final java.awt.Cursor curs_Hand

curs_North

public static final java.awt.Cursor curs_North

locVGraphFrm

public static final java.awt.Point locVGraphFrm

cstbt_ModeCmd

public static final byte cstbt_ModeCmd
See Also:
Constant Field Values

cstbt_vnodeMode

public static final byte cstbt_vnodeMode
See Also:
Constant Field Values

cstbt_vedgeMode

public static final byte cstbt_vedgeMode
See Also:
Constant Field Values

cstbt_ModePaste

public static final byte cstbt_ModePaste
See Also:
Constant Field Values

cstbt_linkMode

public static final byte cstbt_linkMode
See Also:
Constant Field Values

cstbt_ModeEdit

public static final byte cstbt_ModeEdit
See Also:
Constant Field Values

cstbt_ModeZoom

public static final byte cstbt_ModeZoom
See Also:
Constant Field Values

vedgeInEdition

public VisualEdge vedgeInEdition

vgraphBuffer

public VisualGraph vgraphBuffer

rectangleBuffer

public java.awt.Rectangle rectangleBuffer

vnodePressed

public VisualNode vnodePressed

vedgeNamePressed

public VisualEdge vedgeNamePressed

initPosOfVEdgeName

static java.awt.Point initPosOfVEdgeName

spt_DebDrag

public java.awt.Point spt_DebDrag

dragMode

public static boolean dragMode

prefSize

public java.awt.Dimension prefSize

clickPoint

protected java.awt.Point clickPoint

fontTxtFld

public static final java.awt.Font fontTxtFld

lemon_Chiffon

public static final java.awt.Color lemon_Chiffon

currFontSize

public int currFontSize

currentLexicon

public Lexicon currentLexicon

tfldVNode

public GraphDrawPanel.TxtFldVNode tfldVNode

tfldVEdge

public GraphDrawPanel.TxtFldVEdge tfldVEdge

selctCtxtMenu

GraphDrawPanel.SelectCtxtMenu selctCtxtMenu

vnodeCtxtMenu

public GraphDrawPanel.VNodeCtxtMenu vnodeCtxtMenu

vedgeCtxtMenu

GraphDrawPanel.VEdgeCtxtMenu vedgeCtxtMenu

cmdCtxtMenu

public GraphDrawPanel.CmdCtxtMenu cmdCtxtMenu

vgraph

public VisualGraph vgraph

listOfSelectedVNodes

java.util.ArrayList listOfSelectedVNodes

mbt_Curs

public byte mbt_Curs

vnodeSelected

public VisualNode vnodeSelected

vedgeSelected

public VisualEdge vedgeSelected

vedgeNameSelected

public VisualEdge vedgeNameSelected

rectangleTracker

public java.awt.Rectangle rectangleTracker

mouseMotAdapt

java.awt.event.MouseMotionAdapter mouseMotAdapt

mouseAdapt

java.awt.event.MouseAdapter mouseAdapt

keyListener

java.awt.event.KeyListener keyListener

vNodeCopy

public VisualNode vNodeCopy

ZoomScale

public int ZoomScale

m_zoom

public double m_zoom
Constructor Detail

GraphDrawPanel

public GraphDrawPanel(Lexicon lexicon)
Create a GraphDrawPanel for the specified GraphDrawFrame, taking into account the specified Lexicon

Parameters:
lexicon - A Lexicon
Method Detail

finalize

public void finalize()

updateCursorMode

public void updateCursorMode(byte btCursMode)

setCursorToModeCmd

public void setCursorToModeCmd()
Set the cursor for the current GraphDrawPanel to Mode Command


setCursorToModeEdit

public void setCursorToModeEdit()
Set the cursor for the current GraphDrawPanel to Mode Edition


setCursorToModeZoom

public void setCursorToModeZoom()
Set the cursor for the current GraphDrawPanel to Mode Zoom


setCursorTovnodeMode

public void setCursorTovnodeMode()
Set the cursor for the current GraphDrawPanel to Mode VNode (for the creation of a Visual Node).


setCursorTovedgeMode

public void setCursorTovedgeMode()
Set the cursor for the current GraphDrawPanel to Mode VEdge (for the creation of a Visual Edge).


setCursorTolinkMode

public void setCursorTolinkMode()
Set the cursor for the current GraphDrawPanel to Link Mode VEdge.


setCursorToModePaste

public void setCursorToModePaste()
Set the cursor for the current GraphDrawPanel to Mode Paste.


createEdge

public Edge createEdge()
Create an Edge. This method does nothing here, it should be redefined in subclasses of GraphDrawPanel.

Returns:
an Edge

createGraph

public Graph createGraph()
Create a Graph. This method does nothing here, it should be redefined in subclasses of GraphDrawPanel.

Returns:
a Graph

selectVNode

public void selectVNode(VisualNode vnode)
Set the specified vnode as the selected Visual Node.

Parameters:
vnode - A Visual Node

unselectVNode

public void unselectVNode()
Deselect the selected Visual Node.


selectVEdge

public void selectVEdge(VisualEdge vedge)
Set the specified vedge as the selected Visual Edge.

Parameters:
vedge - A Visual Edge

unselectVEdge

public void unselectVEdge()
Deselect the selected Visual Edge.


selectVEdgeName

public void selectVEdgeName(VisualEdge vedge)
Set the specified vedge as the selected Visual Edge.

Parameters:
vedge - A Visual Edge

unselectVEdgeName

public void unselectVEdgeName()
Deselect the selected Visual Edge.


unselectTracker

public void unselectTracker()
Deselect the tracker.


undoVEdgeEdition

void undoVEdgeEdition()
Undo Visual Edge Edition


drawVEdgeInEdition

void drawVEdgeInEdition(java.awt.Graphics g)
Draw the VisualEdge that is in edition

Parameters:
g - Graphics

vnodeClicked

protected boolean vnodeClicked(java.awt.Point p)

vedgeClicked

boolean vedgeClicked(java.awt.Point p)

vedgeNameClicked

boolean vedgeNameClicked(java.awt.Point p)

selectAll

public void selectAll()
Select all the elements (visual nodes and visual edges) of the current GraphDrawPanel


getBorderForSelection

public void getBorderForSelection()
Get the minimal rectangle for the tracker


vnodesInTracker

public void vnodesInTracker()
Determine the visual nodes that are enclosed by the tracker and put them in the attribute listOfSelectedVNodes.


updateScroll

public void updateScroll()
Update the scroll of the frame of the current GraphDrawPanel


update

public void update(VisualNode vnode,
                   java.lang.String contenu,
                   java.awt.Rectangle rectangle)
            throws java.lang.Exception
Update the specified vnode according to the new content (contenu) and with the new rectangle. This method does nothing here but it should be redefined in subclasses of GraphDrawPanel (for instance in CGDrawPanel and OntologyDrawPanel)

Throws:
java.lang.Exception

graphWithDrawingInf

public boolean graphWithDrawingInf(Graph graph)

paintComponent

public void paintComponent(java.awt.Graphics g)
PaintComponent of the current GraphDrawPanel

Parameters:
g - Graphics

getSelectedVNodes

void getSelectedVNodes(java.util.ArrayList lst)

getSelectedVEdges

void getSelectedVEdges(java.util.ArrayList lstVEdgeASel,
                       java.util.ArrayList lstVNodeSel)

copy

public void copy()
Copy the selected elements


paste

public void paste()
Paste the content of the buffer at the position specified by the attribute clickPoint


cut

public void cut()
Cut the selected elements


cutWithoutBuffering

protected void cutWithoutBuffering()

updateDeletingEdge

public void updateDeletingEdge()

clear

public void clear()
Clear the content of the current GraphDrawPanel


onMouseClicked

public void onMouseClicked(java.awt.event.MouseEvent e)

onMousePressed

public void onMousePressed(java.awt.event.MouseEvent e)

onMouseDragged

void onMouseDragged(java.awt.event.MouseEvent e)

onMouseEntered

protected void onMouseEntered(java.awt.event.MouseEvent e1)

onMouseExited

void onMouseExited(java.awt.event.MouseEvent e1)

onMouseMoved

void onMouseMoved(java.awt.event.MouseEvent e1)

canNodeBeEdited

protected boolean canNodeBeEdited()

updatePanels

protected void updatePanels(Node source)

updateTreePanel

protected void updateTreePanel()

onMouseReleased

protected void onMouseReleased(java.awt.event.MouseEvent e)

onKeyPressed

void onKeyPressed(java.awt.event.KeyEvent e)

updateItemsNdeCtxtMn

protected void updateItemsNdeCtxtMn()
It should be redefined by subclasses of GraphDraPanel


setTypeElements

protected void setTypeElements()
It should be redefined by subclasses of GraphDrawPanel


setIndividualElements

protected void setIndividualElements()

setElemsInTxtFldVEdge

protected void setElemsInTxtFldVEdge()

insertText

protected boolean insertText(java.lang.String s2Insert,
                             int insertPosition)

getTxtInEdition

protected java.lang.String getTxtInEdition(int caretPosition)

selectElements

protected void selectElements(int caretPosition)

drawVNode

public boolean drawVNode(java.awt.Graphics g,
                         VisualNode vnode,
                         Lexicon lexicon)
Draw VisualNode. It should be redefined by subclasses of GraphDraPanel


displayContent

protected void displayContent(VisualNode vnode)
Display the content of the specified Visual Node. It should be redefined by subclasses of GraphDraPanel


ExeTreatVnode

public void ExeTreatVnode(java.lang.String contenu)
                   throws java.lang.Exception
Throws:
java.lang.Exception

treatVEdge

protected void treatVEdge(java.lang.String txt)

getIntersect

static java.awt.Point getIntersect(java.awt.Point p0,
                                   java.awt.Point p1,
                                   java.awt.Rectangle rect)
Auxiliary Methods


computeIntersection

static boolean computeIntersection(java.awt.Point p0,
                                   java.awt.Point p1,
                                   java.awt.Point n0,
                                   java.awt.Point n1,
                                   java.awt.Point px)
Compute the intersection between (p0, p1) and (n0, n1) and returns the result


isBetween

static boolean isBetween(int v,
                         int b1,
                         int b2)

computeDistance

static int computeDistance(java.awt.Point p,
                           java.awt.Point p0,
                           java.awt.Point p1)
Compute the distance between a point p and the segment (p0, p1). This method is used to determine if a mouse click (the point p) is near enough to the segment (p0, p1) of a vedge to conclude that it is a click for selecting the vedge.


isRectangleInRectangle

static boolean isRectangleInRectangle(java.awt.Rectangle rct1,
                                      java.awt.Rectangle rct2)

rectangleBoundTxt

static java.awt.Rectangle rectangleBoundTxt(java.lang.String s,
                                            java.awt.Point p)

rearrange

public void rearrange()
ADDED By Nabil this method allow the automatic reorganizing of graph's nodes


SetFontSize

public void SetFontSize(int fontsize)
Set the font size of the current VisualGraph


getFontSize

public int getFontSize()
return the font size of the current VisualGraph


SetZoomScale

public void SetZoomScale(int zoom)
Set the scale zoom of the current VisualGraph


ZoomOut

public void ZoomOut()

ZoomIn

public void ZoomIn()