Class LaunchPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class LaunchPanel extends JPanel
This is a panel that displays a tree with a LaunchNode root.
Version:
1.0
Author:
Douglas Brown
See Also:
  • Field Details

    • TEXT_TYPE

      protected static final String TEXT_TYPE
      See Also:
    • tree

      protected JTree tree
    • treeModel

      protected DefaultTreeModel treeModel
    • splitPane

      protected JSplitPane splitPane
    • dataPanel

      protected JPanel dataPanel
    • tabbedPane

      protected JTabbedPane tabbedPane
    • descriptionPane

      protected JEditorPane descriptionPane
    • descriptionScroller

      protected JScrollPane descriptionScroller
    • showAllNodes

      protected boolean showAllNodes
    • visibleNodeMap

      protected Map<LaunchNode,org.opensourcephysics.tools.LaunchPanel.VisibleNode> visibleNodeMap
    • launcher

      protected Launcher launcher
    • rebuildingTabs

      protected boolean rebuildingTabs
    • htmlSubstitutions

      protected Map<String,String> htmlSubstitutions
    • isSelectingNode

      public boolean isSelectingNode
  • Constructor Details

    • LaunchPanel

      public LaunchPanel(LaunchNode rootNode, Launcher launcher)
      Constructor.
      Parameters:
      rootNode - the root node
      launcher - the Launcher that is creating this panel
  • Method Details

    • setTreeSelectionPath

      public void setTreeSelectionPath(LaunchNode node)
      Sets the selected node.
      Parameters:
      node - the node to select
    • setTreeSelectionPaths

      public void setTreeSelectionPaths(ArrayList<LaunchNode> nodes)
      Sets the selected nodes.
      Parameters:
      nodes - the nodes to select
    • setSelectedNode

      public void setSelectedNode(LaunchNode node, int tabNumber)
      Sets the selected node.
      Parameters:
      node - the node to select
      tabNumber - the tab to display
    • setSelectedNode

      public void setSelectedNode(LaunchNode node, int tabNumber, URL url)
      Sets the selected node and displays a URL. Detects if the url is a reference change only, as from a hyperlink on a page and, if so, just scrolls to that position on the page. Otherwise rebuilds the full tab system.
      Parameters:
      node - the node to select
      tabNumber - the tab to display
      url - the URL to display in the tab
    • getSelectedNode

      public LaunchNode getSelectedNode()
      Gets the selected node.
      Returns:
      the selected node
    • getSelectedNodes

      public ArrayList<LaunchNode> getSelectedNodes()
      Gets the selected nodes.
      Returns:
      the selected nodes
    • getSelectedDisplayTab

      public int getSelectedDisplayTab()
      Gets the selected display tab.
      Returns:
      the selected display tab
    • getRootNode

      public LaunchNode getRootNode()
      Gets the root node.
      Returns:
      the root node
    • getHTMLSubstitutionMap

      public Map<String,String> getHTMLSubstitutionMap()
      Gets the HTML substitution map. This maps target to replacement Strings to be substituted in HTML documents.
      Returns:
      the HTML substitution map
    • 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
    • rebuildAndDisplayTabs

      protected void rebuildAndDisplayTabs(LaunchNode node)
      Rebuilds the tabs from scratch in order to displays all tabs for the specified node.
      Parameters:
      node - the LaunchNode
    • launchHtml

      protected void launchHtml(Launcher.HTMLPane html, URL theURL, boolean nodeEnabled)
    • createGUI

      protected void createGUI()
      Creates the GUI.
    • createTree

      protected void createTree(LaunchNode rootNode)
      Creates the tree.
      Parameters:
      rootNode - the root node
    • getExpandedNodes

      protected Collection<String> getExpandedNodes()
      Returns a collection of nodes that are currently expanded.
      Returns:
      the expanded nodes
    • setExpandedNodes

      protected void setExpandedNodes(Collection<?> expanded)
      Expands the specified nodes.
      Parameters:
      expanded - the nodes to expand