verinec.gui.configurator.nodeeditor
Class NodeEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by verinec.gui.configurator.nodeeditor.EditorPanel
                      extended by verinec.gui.configurator.nodeeditor.NodeEditor
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, IEditorComponent

public class NodeEditor
extends EditorPanel
implements ChangeListener, ActionListener

Creates an interface to edit the configuration of a node. Currently it displays in the right sidebar of the application. This class is loaded in the Configurator.load(VerinecStudio) function using the instance function VerinecStudio.setTopComponent(Component).

Author:
Damian Vogel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  VerinecStudio caller
          Reference to the main class that created the NodeEditor instance
static String Discard
          Gui names.
private  EditorTextField hasFocusTextField
          The textField which has currently the focus
protected  Logger logger
          Debugging.
static String Save
          Gui names.
private  HashMap selectedComponents
          Keeps track of the in the drawpanel currently selected Components
static String Update
          Gui names.
 
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
NodeEditor(VerinecStudio analyser)
          Constructs a new NodeEditor Panel.
 
Method Summary
 void drawPanelRepaint()
          Function to force the drawPanel (Panel where the Networklayout is drawn) to repaint.
static EditorPanel getComponent(Element baseElement, NodeEditor nodeEditor)
          Detects element type and instantiates the according panel.
 void setFocusTextField(EditorTextField editorTextField)
          Notify the nodeeditor which field has focus (to check for changes if the whole panel looses focus).
 void stateChanged(ChangeEvent component)
          Is called when node in VerinecStudio is selected, unselected, and so on.
 
Methods inherited from class verinec.gui.configurator.nodeeditor.EditorPanel
actionPerformed, createResetButtons, discard, discardRed, save, update
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

caller

private VerinecStudio caller
Reference to the main class that created the NodeEditor instance


Update

public static final String Update
Gui names.

See Also:
Constant Field Values

Save

public static final String Save
Gui names.

See Also:
Constant Field Values

Discard

public static final String Discard
Gui names.

See Also:
Constant Field Values

selectedComponents

private HashMap selectedComponents
Keeps track of the in the drawpanel currently selected Components


hasFocusTextField

private EditorTextField hasFocusTextField
The textField which has currently the focus


logger

protected Logger logger
Debugging.

Constructor Detail

NodeEditor

public NodeEditor(VerinecStudio analyser)
Constructs a new NodeEditor Panel.

Parameters:
analyser - The analyser which is an instance variable of the calling class (Configurator.load(VerinecStudio)), necessary to add this object as a change listener to the analyser.
Method Detail

stateChanged

public void stateChanged(ChangeEvent component)
Is called when node in VerinecStudio is selected, unselected, and so on. It will call a function to check if there are unsaved changes and update the input fields. The NwComponent of the component parameter is never null; when a component gets selected, it is passed the first time, and when it is unselected, a second time. This facilitates keeping track of the selected components with a list. Then it either creates the editor panel for a newly selected node and updates the GUI or removes the panel if the node got deselected.

Specified by:
stateChanged in interface ChangeListener
Parameters:
component - The event source is an NwComponent and used to know which node's state changed.

setFocusTextField

public void setFocusTextField(EditorTextField editorTextField)
Notify the nodeeditor which field has focus (to check for changes if the whole panel looses focus).

Parameters:
editorTextField - The field to have focus.

drawPanelRepaint

public void drawPanelRepaint()
Function to force the drawPanel (Panel where the Networklayout is drawn) to repaint. Is called in the EditorTextField, wenn the value of a Hostname Textfiel has changed so the drawPanel will show the new name.


getComponent

public static EditorPanel getComponent(Element baseElement,
                                       NodeEditor nodeEditor)
Detects element type and instantiates the according panel.

Parameters:
baseElement - The element which contains all the XML information
nodeEditor - Reference to the instance of the first EditorPanel, the NodeEditor
Returns:
Get a panel for the element.

Copyright © 2005 Verinec, DIUF