it.eng.spagobi.plugins.ireport.gui
Class TreeFrame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended byit.eng.spagobi.plugins.ireport.gui.TreeFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeSelectionListener, javax.swing.WindowConstants

public class TreeFrame
extends javax.swing.JDialog
implements java.awt.event.ActionListener, javax.swing.event.TreeSelectionListener, javax.swing.event.TreeExpansionListener, java.awt.event.KeyListener

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TreeFrame()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method is called when a button is pressed
 javax.swing.tree.DefaultMutableTreeNode addObject(javax.swing.tree.DefaultMutableTreeNode parent, java.lang.Object child, boolean shouldBeVisible)
          This method creates a new node from the child object given as input and adds it to the the node, definded as parent, of the JTree
 javax.swing.JTree getJTree()
           
static TreeFrame getMainInstance()
          This method returns the mainInstance which is referenced to the last created instance of the TreeFrame.
 javax.swing.tree.DefaultMutableTreeNode getRootNode()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 javax.swing.tree.DefaultMutableTreeNode matchFileToNode(java.io.File file)
          This method finds if the input file matches one of the nodes into the JTree
 javax.swing.tree.DefaultMutableTreeNode matchFileToSelectedNode(java.io.File file)
          This method checks if the input file matches the current selected node into the JTree
 void populateTreeFromXML(org.dom4j.Document document)
          This method populates the JTree getting information from the XML document given as input.
 void showFrame()
           
 void showNode(java.lang.String path)
           
 void treeCollapsed(javax.swing.event.TreeExpansionEvent evt)
          This method is called when a node of the JTree is collapsed.
 void treeExpanded(javax.swing.event.TreeExpansionEvent evt)
          This method is called when a node of the JTree is expanded.
 void updateWidgetsText()
          This method refreshes the text on labels and buttons: it's called when the language has been changed
 void valueChanged(javax.swing.event.TreeSelectionEvent evt)
          This method manages the TreeSelectionEvent given by the selection or deselection of differnts node on the JTree It allows to sets the correct status for checkInButton, checkOutButton, collapseAllButton, expandeAllButton
 
Methods inherited from class javax.swing.JDialog
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeFrame

public TreeFrame()
Method Detail

getMainInstance

public static TreeFrame getMainInstance()
This method returns the mainInstance which is referenced to the last created instance of the TreeFrame. If mainInstance is null it will create a new instance of this class


getJTree

public javax.swing.JTree getJTree()

getRootNode

public javax.swing.tree.DefaultMutableTreeNode getRootNode()

populateTreeFromXML

public void populateTreeFromXML(org.dom4j.Document document)
This method populates the JTree getting information from the XML document given as input.


addObject

public javax.swing.tree.DefaultMutableTreeNode addObject(javax.swing.tree.DefaultMutableTreeNode parent,
                                                         java.lang.Object child,
                                                         boolean shouldBeVisible)
This method creates a new node from the child object given as input and adds it to the the node, definded as parent, of the JTree

Parameters:
parent - Node of the JTree to which the new node id added
child - Object added to the JTree as a new node
shouldBeVisible - set if the node will be shown (expanded)
Returns:
the new DefaulTreeMutableNode representing the new node just added to the JTree

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This method is called when a button is pressed

Specified by:
actionPerformed in interface java.awt.event.ActionListener

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent evt)
This method manages the TreeSelectionEvent given by the selection or deselection of differnts node on the JTree It allows to sets the correct status for checkInButton, checkOutButton, collapseAllButton, expandeAllButton

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent evt)
This method is called when a node of the JTree is expanded. It's used to sets the correct status for collapseAllButton, expandeAllButton

Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent evt)
This method is called when a node of the JTree is collapsed. It's used to sets the correct status for collapseAllButton, expandeAllButton

Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener

showNode

public void showNode(java.lang.String path)

matchFileToNode

public javax.swing.tree.DefaultMutableTreeNode matchFileToNode(java.io.File file)
This method finds if the input file matches one of the nodes into the JTree

Returns:
The matching node if it exists or null otherwise

matchFileToSelectedNode

public javax.swing.tree.DefaultMutableTreeNode matchFileToSelectedNode(java.io.File file)
This method checks if the input file matches the current selected node into the JTree

Returns:
The currently selected node if it matches the file or null otherwise

updateWidgetsText

public void updateWidgetsText()
This method refreshes the text on labels and buttons: it's called when the language has been changed


showFrame

public void showFrame()

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener