org.opensourcephysics.tools
Class LaunchPanel

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 org.opensourcephysics.tools.LaunchPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class LaunchPanel
extends javax.swing.JPanel

This is a panel that displays a tree with a LaunchNode root.

Version:
1.0
Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
protected  javax.swing.JPanel dataPanel
           
protected  javax.swing.JEditorPane descriptionPane
           
protected  javax.swing.JScrollPane descriptionScroller
           
protected  javax.swing.JTabbedPane htmlTabs
           
protected  Launcher launcher
           
protected  boolean rebuildingTabs
           
protected  boolean showAllNodes
           
protected  javax.swing.JSplitPane splitPane
           
protected static java.lang.String TEXT_TYPE
           
protected  javax.swing.JTree tree
           
protected  javax.swing.tree.DefaultTreeModel treeModel
           
protected  java.util.Map<LaunchNode,org.opensourcephysics.tools.LaunchPanel.VisibleNode> visibleNodeMap
           
 
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
LaunchPanel(LaunchNode rootNode, Launcher launcher)
          Constructor.
 
Method Summary
protected  void createGUI()
          Creates the GUI.
protected  void createTree(LaunchNode rootNode)
          Creates the tree.
protected  void displayHTML(LaunchNode node)
          Displays the html for the specified node.
protected  LaunchNode getClone(LaunchNode node)
          Returns the node with the same file name as the specified node.
protected  java.util.Collection<java.lang.String> getExpandedNodes()
          Returns a collection of nodes that are currently expanded.
 LaunchNode getRootNode()
          Gets the root node.
 int getSelectedHTMLPage()
          Gets the selected html page.
 LaunchNode getSelectedNode()
          Gets the selected node.
protected  void setExpandedNodes(java.util.Collection<?> expanded)
          Expands the specified nodes.
 void setSelectedNode(LaunchNode node)
          Sets the selected node.
 void setSelectedNode(LaunchNode node, int pageNumber)
          Sets the selected node.
 void setSelectedNode(LaunchNode node, int pageNumber, java.net.URL url)
          Sets the selected node and displays a URL.
 
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, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 

Field Detail

TEXT_TYPE

protected static final java.lang.String TEXT_TYPE
See Also:
Constant Field Values

tree

protected javax.swing.JTree tree

treeModel

protected javax.swing.tree.DefaultTreeModel treeModel

splitPane

protected javax.swing.JSplitPane splitPane

dataPanel

protected javax.swing.JPanel dataPanel

htmlTabs

protected javax.swing.JTabbedPane htmlTabs

descriptionPane

protected javax.swing.JEditorPane descriptionPane

descriptionScroller

protected javax.swing.JScrollPane descriptionScroller

showAllNodes

protected boolean showAllNodes

visibleNodeMap

protected java.util.Map<LaunchNode,org.opensourcephysics.tools.LaunchPanel.VisibleNode> visibleNodeMap

launcher

protected Launcher launcher

rebuildingTabs

protected boolean rebuildingTabs
Constructor Detail

LaunchPanel

public LaunchPanel(LaunchNode rootNode,
                   Launcher launcher)
Constructor.

Parameters:
rootNode - the root node
launcher - the Launcher that is creating this panel
Method Detail

setSelectedNode

public void setSelectedNode(LaunchNode node)
Sets the selected node.

Parameters:
node - the node to select

setSelectedNode

public void setSelectedNode(LaunchNode node,
                            int pageNumber)
Sets the selected node.

Parameters:
node - the node to select
pageNumber - the html page to display

setSelectedNode

public void setSelectedNode(LaunchNode node,
                            int pageNumber,
                            java.net.URL url)
Sets the selected node and displays a URL.

Parameters:
node - the node to select
pageNumber - the html page to display
url - the URL to display in the page

getSelectedNode

public LaunchNode getSelectedNode()
Gets the selected node.

Returns:
the selected node

getSelectedHTMLPage

public int getSelectedHTMLPage()
Gets the selected html page.

Returns:
the selected html tab

getRootNode

public LaunchNode getRootNode()
Gets the root node.

Returns:
the root node

getClone

protected LaunchNode getClone(LaunchNode node)
Returns the node with the same file name as the specified node. May return null.

Parameters:
node - the node to match
Returns:
the first node with the same file name

displayHTML

protected void displayHTML(LaunchNode node)
Displays the html for the specified node.

Parameters:
node - the LaunchNode

createGUI

protected void createGUI()
Creates the GUI.


createTree

protected void createTree(LaunchNode rootNode)
Creates the tree.

Parameters:
rootNode - the root node

getExpandedNodes

protected java.util.Collection<java.lang.String> getExpandedNodes()
Returns a collection of nodes that are currently expanded.

Returns:
the expanded nodes

setExpandedNodes

protected void setExpandedNodes(java.util.Collection<?> expanded)
Expands the specified nodes.

Parameters:
expanded - the nodes to expand