org.newsml.toolkit.explorer
Class ExplorerPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JSplitPane
                          |
                          +--org.newsml.toolkit.explorer.ExplorerPanel
All Implemented Interfaces:
Accessible, EventListener, ImageObserver, MenuContainer, Serializable, TreeSelectionListener

public class ExplorerPanel
extends JSplitPane
implements TreeSelectionListener

Split panel for viewing a NewsML package.

This class extends the Java Swing JSplitPane class to provide a view of a NewsML package: the left side of the panel contains a tree view, and the right side contains a tabular summary of the tree node currently selected.

The ExplorerFrame class embeds an instance of this class, and links the menu commands to public methods. Application developers can embed this ExplorerPanel objects directly in other applications or applets (Java2 required) if they wish.

Version:
2.0
Author:
Reuters PLC
See Also:
ExplorerFrame, Serialized Form

Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, LEFT, ONE_TOUCH_EXPANDABLE_PROPERTY, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, TOP, VERTICAL_SPLIT
 
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
ExplorerPanel(NewsML newsml)
          Public constructor.
 
Method Summary
 NewsML getNewsML()
          Get the NewsML object being displayed.
 void hideAll()
          Collapse all of the nodes in the tree.
 void highlight(BaseNodePredicate predicate)
          Highlight nodes that match a predicate.
 void setNewsML(NewsML newsml)
          Set the NewsML object to display.
 void showAll()
          Expand all of the nodes in the tree.
 void valueChanged(TreeSelectionEvent e)
          Respond to user selections in the tree.
 
Methods inherited from class javax.swing.JSplitPane
getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, remove, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, 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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExplorerPanel

public ExplorerPanel(NewsML newsml)
Public constructor.
Parameters:
newsml - The NewsML package to explorer.
Method Detail

getNewsML

public NewsML getNewsML()
Get the NewsML object being displayed.
Returns:
The NewsML package currently being explored.

setNewsML

public void setNewsML(NewsML newsml)
Set the NewsML object to display.
Parameters:
newsml - A new NewsML package to explore.

highlight

public void highlight(BaseNodePredicate predicate)
Highlight nodes that match a predicate.
Parameters:
predicate - A predicate that will be tested against every main node in the tree.

showAll

public void showAll()
Expand all of the nodes in the tree.
See Also:
hideAll()

hideAll

public void hideAll()
Collapse all of the nodes in the tree.
See Also:
showAll()

valueChanged

public void valueChanged(TreeSelectionEvent e)
Respond to user selections in the tree. This method should be invoked only by the Java library.
Specified by:
valueChanged in interface TreeSelectionListener
Parameters:
e - The event with the change information.