ij.plugin
Class ControlPanel

java.lang.Object
  extended by ij.plugin.ControlPanel
All Implemented Interfaces:
PlugIn

public class ControlPanel
extends java.lang.Object
implements PlugIn

ControlPanel.
Created: Tue Dec 5 00:52:15 2000; Modified 05/03/2004

Version:
1.0g
Author:
Cezar M. Tigaret

Field Summary
(package private)  java.util.Vector allMenus
           
(package private)  int argLength
           
(package private)  java.util.Hashtable commands
           
(package private)  java.lang.String currentArg
           
(package private)  java.lang.String[] installableMenuLabels
           
(package private)  java.util.Hashtable menuCommands
           
(package private)  java.util.Vector menus
           
(package private)  java.lang.String[] pluginsArray
           
(package private)  java.awt.MenuItem reloadMI
           
(package private)  java.util.Hashtable treeCommands
           
 
Constructor Summary
ControlPanel()
           
 
Method Summary
(package private)  javax.swing.tree.DefaultMutableTreeNode buildTree(java.lang.String arg)
          Constructs the root TreeNode of the ControlPanel.
(package private)  void closeAll(boolean die)
           
(package private)  TreePanel getPanelForNode(javax.swing.tree.DefaultMutableTreeNode node)
           
(package private)  java.util.Hashtable getPanels()
           
(package private)  java.lang.String getPluginsPath()
           
 javax.swing.tree.DefaultMutableTreeNode getRoot()
           
(package private)  java.util.Hashtable getTreeCommands()
           
 java.lang.String getVersion()
           
(package private)  int getVisiblePanelsCount()
           
(package private)  boolean hasExpandedStateProperty(java.lang.String item)
           
(package private)  boolean hasPanelForNode(javax.swing.tree.DefaultMutableTreeNode node)
           
(package private)  boolean hasPanelShowingProperty(java.lang.String item)
           
(package private)  boolean hasVisiblePanels()
           
(package private)  java.lang.String key2pStr(java.lang.String keyword)
           
(package private)  void load()
           
(package private)  void loadProperties()
          All properties related to the ControlPanel have keywords starting with "Control_Panel".
(package private)  TreePanel newPanel(javax.swing.tree.DefaultMutableTreeNode node)
          Constructs a TreePanel rooted at the node argument.
(package private)  TreePanel newPanel(javax.swing.tree.DefaultMutableTreeNode node, java.awt.Point location)
           
(package private)  TreePanel newPanel(java.lang.String path)
          Constructs a TreePanel rooted at the path.
(package private)  java.lang.String pStr2Key(java.lang.String pathString)
           
(package private)  void recordGeometry(TreePanel panel)
           
(package private)  void registerPanel(TreePanel panel)
           
(package private)  boolean requiresDoubleClick()
           
(package private)  void restoreGeometry(TreePanel panel)
           
(package private)  void restoreVisiblePanels()
           
 void run(java.lang.String arg)
          Creates a panel with the hierarchical tree structure of (some of the) ImageJ's commands according to the structure of the String argument (see below).
 int[] s2ints(java.lang.String s)
          Breaks the specified string into an array of ints.
(package private)  void saveProperties()
           
(package private)  void setDoubleClick(boolean dc)
           
(package private)  void setExpandedStateProperty(java.lang.String item)
           
(package private)  void setPanelShowingProperty(java.lang.String item)
           
(package private)  void showHelp()
           
(package private)  void unsetExpandedStateProperty(java.lang.String item)
           
(package private)  void unsetPanelShowingProperty(java.lang.String item)
           
(package private)  void verifyQuit()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentArg

java.lang.String currentArg

menus

java.util.Vector menus

allMenus

java.util.Vector allMenus

installableMenuLabels

java.lang.String[] installableMenuLabels

commands

java.util.Hashtable commands

menuCommands

java.util.Hashtable menuCommands

pluginsArray

java.lang.String[] pluginsArray

treeCommands

java.util.Hashtable treeCommands

argLength

int argLength

reloadMI

java.awt.MenuItem reloadMI
Constructor Detail

ControlPanel

public ControlPanel()
Method Detail

run

public void run(java.lang.String arg)
Creates a panel with the hierarchical tree structure of (some of the) ImageJ's commands according to the structure of the String argument (see below).

Specified by:
run in interface PlugIn
Parameters:
arg - String (optional): a semi-colon - separated list of one or more tokens:
"imagej menus"
creates a tree with all of ImageJ's menu structure, that means it replicates in tree form the ImageJ's menu bar; this includes any jar plugin and user plugins
"user plugins"
creates a tree with loose user plugins (not "jar plugins")
"imagej commands"
creates a tree with all ImageJ's commands
"about"
will not create a tree panel; instead, it will show a brief help message
If there is more than one token, a subtree will be created for each token, and added to a common root tree. If the "about" token is also present, a help essage will be displayed
If the argument is missing, a panel with all of ImageJ's menus will be created as if "imagej menus" was passed as argument.
Please note that when no arguments are passed, ImageJ's menus will be shown as a unique tree named "Control Panel"; if "imagej menus"
is part of a multi-token argument, them ImageJ menus will be created as a sub tree called "ImageJ Menus" (what else ? :-)...) and the main tree will be called "Control Panel"

load

void load()

buildTree

javax.swing.tree.DefaultMutableTreeNode buildTree(java.lang.String arg)
Constructs the root TreeNode of the ControlPanel. If a non-empty argument is passed, then for each token in the argument this method delegates the construction of the TreeNode to the doRoot(String) method. Else, this method delegates to the doRootFromMenus() method.

Parameters:
arg - See run(String) comments for what arguments are allowed.
Returns:
a DefaultMutableTreeNode populated according to the argument.
See Also:
doRoot(String)

newPanel

TreePanel newPanel(javax.swing.tree.DefaultMutableTreeNode node)
Constructs a TreePanel rooted at the node argument.


newPanel

TreePanel newPanel(javax.swing.tree.DefaultMutableTreeNode node,
                   java.awt.Point location)

newPanel

TreePanel newPanel(java.lang.String path)
Constructs a TreePanel rooted at the path.

Parameters:
s - A string with the structure "[item1,item2,...,itemn]", as returned by a call to the toString() method in the javax.swing.tree.TreePath class.

requiresDoubleClick

boolean requiresDoubleClick()

setDoubleClick

void setDoubleClick(boolean dc)

hasPanelForNode

boolean hasPanelForNode(javax.swing.tree.DefaultMutableTreeNode node)

getPanelForNode

TreePanel getPanelForNode(javax.swing.tree.DefaultMutableTreeNode node)

getPluginsPath

java.lang.String getPluginsPath()

getVersion

public java.lang.String getVersion()

getRoot

public javax.swing.tree.DefaultMutableTreeNode getRoot()

getPanels

java.util.Hashtable getPanels()

getTreeCommands

java.util.Hashtable getTreeCommands()

hasVisiblePanels

boolean hasVisiblePanels()

getVisiblePanelsCount

int getVisiblePanelsCount()

registerPanel

void registerPanel(TreePanel panel)

loadProperties

void loadProperties()
All properties related to the ControlPanel have keywords starting with "Control_Panel". This is to facilitate the integration of these properties with ImageJ's properties database. The keywords are dot-separated lists of tokens; in each token, spaces are relaced by underscores. Each token represents a node, and hence the keyword represents a tree path. The values can be either:
  1. a space-separated list of integers, indicating panel frame geometry in the following fixed order: x coordinate, y coordinate , width, height
  2. or the word "expand" which indicates that the path represented by the keyword is an expanded branch


saveProperties

void saveProperties()

setExpandedStateProperty

void setExpandedStateProperty(java.lang.String item)

hasExpandedStateProperty

boolean hasExpandedStateProperty(java.lang.String item)

unsetExpandedStateProperty

void unsetExpandedStateProperty(java.lang.String item)

setPanelShowingProperty

void setPanelShowingProperty(java.lang.String item)

unsetPanelShowingProperty

void unsetPanelShowingProperty(java.lang.String item)

hasPanelShowingProperty

boolean hasPanelShowingProperty(java.lang.String item)

restoreVisiblePanels

void restoreVisiblePanels()

recordGeometry

void recordGeometry(TreePanel panel)

restoreGeometry

void restoreGeometry(TreePanel panel)

closeAll

void closeAll(boolean die)

verifyQuit

void verifyQuit()

showHelp

void showHelp()

pStr2Key

java.lang.String pStr2Key(java.lang.String pathString)

key2pStr

java.lang.String key2pStr(java.lang.String keyword)

s2ints

public int[] s2ints(java.lang.String s)
Breaks the specified string into an array of ints. Returns null if there is an error.