xml_explorer
Class VisualNode

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JList
                  extended by xml_explorer.VisualNode
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable

public class VisualNode
extends javax.swing.JList
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

Zone d'affichage d'un noeud de l'arbre de scene.

Author:
Matthieu Courgeon
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JList
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.awt.Cursor ARROW
           
static java.awt.Color BLUE
           
protected  java.util.Vector<VisualNode> children
           
static java.awt.Color DARK_GREEN
           
static java.awt.Color DEEP_BLUE
           
protected  boolean expended
           
protected  JVisualGraphScene fatherPane
           
static java.awt.Cursor HAND
           
static java.awt.Color LIGHT_BLUE
           
static int NODE_COUNT
           
protected  int Node_ID
           
protected  java.lang.String Node_Path
           
static java.awt.Color NORMAL_COLOR
           
protected  java.lang.Object originalNode
           
protected  VisualNode parentNode
           
protected  boolean selected
           
static boolean showAttributes
           
protected  java.lang.String text
           
 
Fields inherited from class javax.swing.JList
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
 
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.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
VisualNode(JVisualGraphScene vgs, org.jdom.Attribute root, VisualNode parent, java.lang.String path)
           
VisualNode(JVisualGraphScene vgs, org.jdom.Element root, VisualNode parent, java.lang.String path)
           
 
Method Summary
 int adjustLocation(int dx, int dy)
           
 org.jdom.Attribute getAttributeNode()
           
 java.lang.String getAttributeValue(java.lang.String attrName)
           
 org.jdom.Element getElementNode()
           
 int getExpendedSubNodeCount()
           
 int getID()
           
 java.lang.String getNodeName()
           
 java.lang.String getNodePath()
           
 java.lang.String getNodeValue()
           
 VisualNode getParentNode()
           
 int getSubNodeCount()
           
 java.lang.String getText()
           
 void hideAllSubNodes()
           
 boolean isAttribute()
           
 boolean isElement()
           
 VisualNode lowestExpendedSubNode()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
static boolean notAnIndivisibleName(java.lang.String name)
           
 void paintComponent(java.awt.Graphics g)
           
 void paintTree(java.awt.Graphics2D g)
           
 void removeFromPanel()
           
 void selectNext()
           
 void selectNextChild(VisualNode node)
           
 void selectPrevious()
           
 void selectPreviousChild(VisualNode node)
           
 void setExpended(boolean val)
           
 void setText(java.lang.String t)
           
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NORMAL_COLOR

public static final java.awt.Color NORMAL_COLOR

DARK_GREEN

public static final java.awt.Color DARK_GREEN

DEEP_BLUE

public static final java.awt.Color DEEP_BLUE

NODE_COUNT

public static int NODE_COUNT

showAttributes

public static boolean showAttributes

BLUE

public static final java.awt.Color BLUE

LIGHT_BLUE

public static final java.awt.Color LIGHT_BLUE

ARROW

public static final java.awt.Cursor ARROW

HAND

public static final java.awt.Cursor HAND

expended

protected boolean expended

selected

protected boolean selected

children

protected java.util.Vector<VisualNode> children

fatherPane

protected JVisualGraphScene fatherPane

originalNode

protected java.lang.Object originalNode

parentNode

protected VisualNode parentNode

Node_ID

protected int Node_ID

Node_Path

protected java.lang.String Node_Path

text

protected java.lang.String text
Constructor Detail

VisualNode

public VisualNode(JVisualGraphScene vgs,
                  org.jdom.Element root,
                  VisualNode parent,
                  java.lang.String path)
           throws java.lang.Exception
Throws:
java.lang.Exception

VisualNode

public VisualNode(JVisualGraphScene vgs,
                  org.jdom.Attribute root,
                  VisualNode parent,
                  java.lang.String path)
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

notAnIndivisibleName

public static boolean notAnIndivisibleName(java.lang.String name)

getSubNodeCount

public int getSubNodeCount()

getExpendedSubNodeCount

public int getExpendedSubNodeCount()

hideAllSubNodes

public void hideAllSubNodes()

adjustLocation

public int adjustLocation(int dx,
                          int dy)

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

paintTree

public void paintTree(java.awt.Graphics2D g)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

setExpended

public void setExpended(boolean val)

selectPrevious

public void selectPrevious()

selectPreviousChild

public void selectPreviousChild(VisualNode node)

lowestExpendedSubNode

public VisualNode lowestExpendedSubNode()

selectNext

public void selectNext()

selectNextChild

public void selectNextChild(VisualNode node)

getAttributeNode

public org.jdom.Attribute getAttributeNode()

getElementNode

public org.jdom.Element getElementNode()

isAttribute

public boolean isAttribute()

isElement

public boolean isElement()

removeFromPanel

public void removeFromPanel()

getID

public int getID()

setText

public void setText(java.lang.String t)

getText

public java.lang.String getText()

getNodeName

public java.lang.String getNodeName()

getNodeValue

public java.lang.String getNodeValue()

getParentNode

public VisualNode getParentNode()

getNodePath

public java.lang.String getNodePath()

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attrName)