ij.plugin
Class TreePanel

java.lang.Object
  extended by ij.plugin.TreePanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.util.EventListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeWillExpandListener

 class TreePanel
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.WindowListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeWillExpandListener

TreePanel.
This class lays out the ImageJ user plugins in a vertical, hierarchical tree.. Plugins are launched by double-clicking on their names, in the vertical tree. Advantages: uses less screen estate, and provides a realistic graphical presentation of the plugins installed in the file system.
Requires: ImageJ 1.20b or newer, and Java 2 Platform v 1.3 or newer.
NB! This plugin will NOT work with Java platform 1 even if you have the Swing components (Java Foundation Classes) installed. Created: Thu Nov 23 02:12:12 2000

Version:
1.0f
Author:
Cezar M. Tigaret
See Also:
ControlPanel

Field Summary
(package private)  java.awt.Point defaultLocation
           
(package private)  boolean isDragging
           
(package private)  boolean isMainPanel
           
(package private)  ControlPanel pcp
           
(package private)  java.lang.String title
           
 
Constructor Summary
TreePanel(javax.swing.tree.DefaultMutableTreeNode root, ControlPanel pcp, boolean isMainPanel)
           
TreePanel(javax.swing.tree.DefaultMutableTreeNode root, ControlPanel pcp, boolean isMainPanel, java.awt.Point location)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addActionListener(java.awt.event.ActionListener al)
           
(package private)  void addListeners()
           
(package private)  void addMenu()
           
 void buildTreePanel()
           
(package private)  void close()
           
(package private)  boolean getAutoSaveProps()
           
 java.awt.Point getDefaultLocation()
           
 javax.swing.JFrame getFrame()
           
 javax.swing.tree.DefaultMutableTreeNode getRootNode()
           
 javax.swing.tree.TreePath getRootPath()
           
 java.lang.String getTitle()
           
 javax.swing.JTree getTree()
           
 boolean isTheMainPanel()
           
(package private)  boolean isVisible()
           
 void processEvent(java.awt.event.ActionEvent e)
           
(package private)  void recordGeometry()
           
(package private)  void refreshTree()
           
 void removeActionListener(java.awt.event.ActionListener al)
           
(package private)  void restoreExpandedNodes()
           
(package private)  void setAutoSaveProps(boolean autoSave)
           
(package private)  void setBounds(int x, int y, int w, int h)
           
(package private)  void setLocation(java.awt.Point p)
           
(package private)  void setVisible()
           
(package private)  void tearOff()
           
(package private)  void tearOff(javax.swing.tree.DefaultMutableTreeNode node)
           
(package private)  void tearOff(javax.swing.tree.DefaultMutableTreeNode node, java.awt.Point pnt)
           
(package private)  void toAction()
          Fires an ActionEvent upon double-click on the plugin item (leaf node) in the JTree
 void treeCollapsed(javax.swing.event.TreeExpansionEvent ev)
           
 void treeExpanded(javax.swing.event.TreeExpansionEvent ev)
           
 void treeWillCollapse(javax.swing.event.TreeExpansionEvent ev)
           
 void treeWillExpand(javax.swing.event.TreeExpansionEvent ev)
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          Upon window closing, the panel removes itself from the vector of visible panels (member of pcp).
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pcp

ControlPanel pcp

isMainPanel

boolean isMainPanel

title

java.lang.String title

isDragging

boolean isDragging

defaultLocation

java.awt.Point defaultLocation
Constructor Detail

TreePanel

public TreePanel(javax.swing.tree.DefaultMutableTreeNode root,
                 ControlPanel pcp,
                 boolean isMainPanel)

TreePanel

public TreePanel(javax.swing.tree.DefaultMutableTreeNode root,
                 ControlPanel pcp,
                 boolean isMainPanel,
                 java.awt.Point location)
Method Detail

buildTreePanel

public void buildTreePanel()

addMenu

void addMenu()

addListeners

void addListeners()

getTitle

public java.lang.String getTitle()

getRootPath

public javax.swing.tree.TreePath getRootPath()

isTheMainPanel

public boolean isTheMainPanel()

getFrame

public javax.swing.JFrame getFrame()

getTree

public javax.swing.JTree getTree()

getRootNode

public javax.swing.tree.DefaultMutableTreeNode getRootNode()

getDefaultLocation

public java.awt.Point getDefaultLocation()

isVisible

boolean isVisible()

setBounds

void setBounds(int x,
               int y,
               int w,
               int h)

setAutoSaveProps

void setAutoSaveProps(boolean autoSave)

getAutoSaveProps

boolean getAutoSaveProps()

restoreExpandedNodes

void restoreExpandedNodes()

processEvent

public void processEvent(java.awt.event.ActionEvent e)

addActionListener

public void addActionListener(java.awt.event.ActionListener al)

removeActionListener

public void removeActionListener(java.awt.event.ActionListener al)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Upon window closing, the panel removes itself from the vector of visible panels (member of pcp). Then, if this is the only visible panel left, the properties are saved; else, if this is the main panel, all other visible panels are also closed and properties are saved

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

treeCollapsed

public void treeCollapsed(javax.swing.event.TreeExpansionEvent ev)
Specified by:
treeCollapsed in interface javax.swing.event.TreeExpansionListener

treeExpanded

public void treeExpanded(javax.swing.event.TreeExpansionEvent ev)
Specified by:
treeExpanded in interface javax.swing.event.TreeExpansionListener

treeWillExpand

public void treeWillExpand(javax.swing.event.TreeExpansionEvent ev)
Specified by:
treeWillExpand in interface javax.swing.event.TreeWillExpandListener

treeWillCollapse

public void treeWillCollapse(javax.swing.event.TreeExpansionEvent ev)
Specified by:
treeWillCollapse in interface javax.swing.event.TreeWillExpandListener

recordGeometry

void recordGeometry()

refreshTree

void refreshTree()

tearOff

void tearOff()

tearOff

void tearOff(javax.swing.tree.DefaultMutableTreeNode node)

tearOff

void tearOff(javax.swing.tree.DefaultMutableTreeNode node,
             java.awt.Point pnt)

toAction

void toAction()
Fires an ActionEvent upon double-click on the plugin item (leaf node) in the JTree


setVisible

void setVisible()

setLocation

void setLocation(java.awt.Point p)

close

void close()