com.jaxfront.swing.ui.editor
Class EditorPanel

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 com.jaxfront.swing.ui.editor.AbstractEditorPanel
                      extended by com.jaxfront.swing.ui.editor.EditorPanel
All Implemented Interfaces:
EditablePanel, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TreeModelListener, javax.swing.event.TreeSelectionListener

public class EditorPanel
extends AbstractEditorPanel
implements java.awt.event.WindowListener, javax.swing.event.TreeModelListener, javax.swing.event.TreeSelectionListener, java.awt.image.ImageObserver

A instance of this class can be used to visualize a jaxfront tree with its types. Note that this class needs the root type to visualize the whole tree. For example:

 JFrame aFrame = new JFrame();
 AbstractEditorPanel panel = new EditorPanel(aType, aFrame);
 aFrame.getContentPane().add(panel);
 

Version:
1.60
See Also:
com.jaxfront.core.ui.editor.AbstractEditorPanel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
EditorPanel(Type type, java.awt.Window frame)
          EditorPanel constructor.
 
Method Summary
static java.awt.Image getEmbbededImage()
           
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
           
 void paint(java.awt.Graphics g)
           
 void release()
          Memorymanagement - use this method to release the documents and to do a clean up.
 void removeTreeNodes(java.util.List nodesToRemove)
           
 void removeWorkspace()
           
 void treeNodesChanged(javax.swing.event.TreeModelEvent e)
           Invoked after a node (or a set of siblings) has changed in some way.
 void treeNodesInserted(javax.swing.event.TreeModelEvent e)
           Invoked after nodes have been inserted into the tree.
 void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
           Invoked after nodes have been removed from the tree.
 void treeStructureChanged(javax.swing.event.TreeModelEvent e)
           Invoked after the tree has drastically changed structure from a given node down.
 void updateTreeUI()
           
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          Called whenever the value of the selection changes.
 Visualizer visualize(Type type, boolean forceRepaint)
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class com.jaxfront.swing.ui.editor.AbstractEditorPanel
addButton, addButton, addHelpListener, clearWorkbench, fireHelpEvent, getCenterComponent, getDOM, getHelpPanel, getLastDividerLocation, getNavigationTree, getRootType, getScrollPane, getSelectedNode, getSelectedTreeNode, getTargetDOM, getTreeModel, getWindow, getWorkspace, highlightNode, isTopLevelEditor, isTreeSelect, isXUIEditor, removeHelpListener, removeSaveButton, selectNode, selectNode, selectNode, selectRootNode, setCenterComponent, setHelpPanelPosition, setHighLightMode, setIsTreeSelect, setRootVisible, setSelectedNode, setTargetDOM, setTargetMessageTable, setTargetMessageTable
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditorPanel

public EditorPanel(Type type,
                   java.awt.Window frame)
EditorPanel constructor.

Parameters:
type - the root type from the tree should be visualised
frame - the containter (a frame), that hold this instance
Method Detail

removeWorkspace

public void removeWorkspace()

release

public void release()
Description copied from class: AbstractEditorPanel
Memorymanagement - use this method to release the documents and to do a clean up.

Overrides:
release in class AbstractEditorPanel
See Also:
com.jaxfront.core.ui.editor.AbstractEditorPanel#release()

treeNodesChanged

public void treeNodesChanged(javax.swing.event.TreeModelEvent e)

Invoked after a node (or a set of siblings) has changed in some way. The node(s) have not changed locations in the tree or altered their children arrays, but other attributes have changed and may affect presentation. Example: the name of a file has changed, but it is in the same location in the file system.

To indicate the root has changed, childIndices and children will be null.

e.path() returns the path the parent of the changed node(s).

e.childIndices() returns the index(es) of the changed node(s).

Specified by:
treeNodesChanged in interface javax.swing.event.TreeModelListener
Specified by:
treeNodesChanged in class AbstractEditorPanel

treeNodesInserted

public void treeNodesInserted(javax.swing.event.TreeModelEvent e)

Invoked after nodes have been inserted into the tree.

e.path() returns the parent of the new nodes

e.childIndices() returns the indices of the new nodes in ascending order.

Specified by:
treeNodesInserted in interface javax.swing.event.TreeModelListener
Specified by:
treeNodesInserted in class AbstractEditorPanel

treeNodesRemoved

public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)

Invoked after nodes have been removed from the tree. Note that if a subtree is removed from the tree, this method may only be invoked once for the root of the removed subtree, not once for each individual set of siblings removed.

e.path() returns the former parent of the deleted nodes.

e.childIndices() returns the indices the nodes had before they were deleted in ascending order.

Specified by:
treeNodesRemoved in interface javax.swing.event.TreeModelListener
Specified by:
treeNodesRemoved in class AbstractEditorPanel

treeStructureChanged

public void treeStructureChanged(javax.swing.event.TreeModelEvent e)

Invoked after the tree has drastically changed structure from a given node down. If the path returned by e.getPath() is of length one and the first element does not identify the current root node the first element should become the new root of the tree.

e.path() holds the path to the node.

e.childIndices() returns null.

Specified by:
treeStructureChanged in interface javax.swing.event.TreeModelListener
Specified by:
treeStructureChanged in class AbstractEditorPanel

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
Called whenever the value of the selection changes.

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener
Specified by:
valueChanged in class AbstractEditorPanel
Parameters:
e - the event that characterizes the change.

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

paint

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

getEmbbededImage

public static java.awt.Image getEmbbededImage()

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Specified by:
imageUpdate in interface java.awt.image.ImageObserver
Overrides:
imageUpdate in class java.awt.Component

visualize

public Visualizer visualize(Type type,
                            boolean forceRepaint)
Specified by:
visualize in interface EditablePanel
Specified by:
visualize in class AbstractEditorPanel

removeTreeNodes

public void removeTreeNodes(java.util.List nodesToRemove)
Specified by:
removeTreeNodes in interface EditablePanel

updateTreeUI

public void updateTreeUI()