org.opensourcephysics.tools
Class LaunchBuilder

java.lang.Object
  extended by org.opensourcephysics.tools.Launcher
      extended by org.opensourcephysics.tools.LaunchBuilder

public class LaunchBuilder
extends Launcher

This provides a GUI for building LaunchNode and LaunchSet xml files.

Version:
1.2
Author:
Douglas Brown

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opensourcephysics.tools.Launcher
Launcher.HTMLPane, Launcher.LauncherFrame, Launcher.LaunchSet
 
Field Summary
 
Fields inherited from class org.opensourcephysics.tools.Launcher
activeNode, frame, singleAppMode, singletonMode
 
Constructor Summary
LaunchBuilder()
          No-arg constructor.
LaunchBuilder(boolean splash)
          Constructs a builder with or without a splash screen.
LaunchBuilder(java.lang.String fileName)
          Constructs a builder and loads the specified file.
LaunchBuilder(java.lang.String fileName, boolean splash)
          Constructs a builder and loads the specified file with or without splash.
 
Method Summary
 void addChildToSelectedNode(LaunchNode child)
          Adds a child node to the selected node.
 boolean addTab(LaunchNode root)
          Creates a LaunchPanel with the specified root and adds it to a new tab.
static javax.swing.JFileChooser getHTMLChooser()
          Gets a file chooser for selecting html files.
static void main(java.lang.String[] args)
          Main entry point when used as application.
 void removeSelectedNode()
          Removes the selected node.
 void removeSelectedNodes()
          Removes the selected nodes.
 boolean removeSelectedTab()
          Removes the selected tab.
 java.lang.String save(LaunchNode node, java.lang.String fileName)
          Saves a node to the specified file.
 java.lang.String saveAs(LaunchNode node)
          Saves a node to an xml file selected with a chooser.
 boolean saveTabs()
          Saves tabs.
 java.lang.String saveTabSet()
          Saves the current tabset.
 
Methods inherited from class org.opensourcephysics.tools.Launcher
clearHistory, getContentPane, getDivider, getHTMLTab, getRootNode, getSelectedNode, getSelectedTab, getSize, getTab, getTabCount, isVisible, launch, launch, launch, open, open, setCanExit, setDivider, setEditorEnabled, setHyperlinksEnabled, setHyperlinksEnabled, setJarsOnly, setNavbarRightEndComponents, setNavigationVisible, setSelectedNode, setSelectedNode, setSelectedNode, setSelectedNodeByKey, setSelectedTab, setSelectedTab, setSize, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LaunchBuilder

public LaunchBuilder()
No-arg constructor.


LaunchBuilder

public LaunchBuilder(java.lang.String fileName)
Constructs a builder and loads the specified file.

Parameters:
fileName - the file name

LaunchBuilder

public LaunchBuilder(boolean splash)
Constructs a builder with or without a splash screen.

Parameters:
splash - true to show the splash screen

LaunchBuilder

public LaunchBuilder(java.lang.String fileName,
                     boolean splash)
Constructs a builder and loads the specified file with or without splash.

Parameters:
fileName - the file name
splash - true to show the splash screen
Method Detail

main

public static void main(java.lang.String[] args)
Main entry point when used as application.

Parameters:
args - args[0] may be an xml file name

save

public java.lang.String save(LaunchNode node,
                             java.lang.String fileName)
Saves a node to the specified file.

Parameters:
node - the node
fileName - the desired name of the file
Returns:
the name of the saved file, or null if not saved

saveAs

public java.lang.String saveAs(LaunchNode node)
Saves a node to an xml file selected with a chooser.

Parameters:
node - the node
Returns:
the name of the file

saveTabSet

public java.lang.String saveTabSet()
Saves the current tabset.

Returns:
the full path to the saved file, or null if not saved

saveTabs

public boolean saveTabs()
Saves tabs.

Returns:
true unless cancelled by user

addTab

public boolean addTab(LaunchNode root)
Creates a LaunchPanel with the specified root and adds it to a new tab.

Parameters:
root - the root node
Returns:
true if tab successfully added

removeSelectedTab

public boolean removeSelectedTab()
Removes the selected tab. Overrides Launcher method.

Returns:
true if the tab was removed

removeSelectedNode

public void removeSelectedNode()
Removes the selected node.


removeSelectedNodes

public void removeSelectedNodes()
Removes the selected nodes.


addChildToSelectedNode

public void addChildToSelectedNode(LaunchNode child)
Adds a child node to the selected node.

Parameters:
child - the child node to add

getHTMLChooser

public static javax.swing.JFileChooser getHTMLChooser()
Gets a file chooser for selecting html files.

Returns:
the html chooser