javatools.swing
Class VariablePaneDispatcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.swing.VariablePaneDispatcher
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
AuthorPaneDispatcher, ContainerPaneDispatcher, DataSetPaneDispatcher, ExecutionPaneDispatcher, GenrePaneDispatcher

public abstract class VariablePaneDispatcher
extends java.lang.Thread

It represents an "event dispatcher" to be used to manage a "variable pane" i.e. a pane that changes depending on a particular selection in another place of the application. You have to inherit only this method: initialize: to init the panels, if you need it. Set the panelName to your own name, to differentiate between different VariablePaneDispatcher's. Create your panels, put them in type2panel HashMap, depending on the type of the (Clippable) object to be displayed. Put your messages in type2message HashMap (depending on ther type) and make all you need for your panels. The panels must be of the type IndexablePanel. All the dispatching is internal. Use this sequence of commands: VariablePaneDispatcher disp = new VariablePaneDispatcher(); disp.setContainer(theContainerToContainThePanels); disp.setStatusLabelSync(myStatusLabelSync); disp.start(); -- repeat disp.setObject(myOwnClippableObject); -- until you need it. disp.stopAll();


Field Summary
protected  boolean initialized
          Checks whether the thread has been initialized.
protected  Clippable obj
          The object you want to display its details.
protected  java.lang.String panelName
          Contains the panel name, to be used as a "thread name" for the status sync label.
protected  Clippable previousObj
          The previous selected object.
protected  java.awt.Container refContainer
          The container to be used.
protected  boolean stoppedExternally
          Checks whether the thread has been stopped externally.
protected  java.util.HashMap type2message
          Maps types and message to be displayed into a status bar.
protected  java.util.HashMap type2panel
          Maps types and panels
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
VariablePaneDispatcher()
          Creates a new instance of VariablePaneDispatcher
 
Method Summary
protected  void doDispatch()
          Dispatches the requests.
protected abstract  void initialize()
          It will be called when the thread starts.
 void run()
          Thread's run method.
 void setContainer(java.awt.Container cont)
          Sets the container that will contain the panels.
 void setObject(Clippable pObj)
          Sets the object that you want its details to be displayed.
 void setStatusLabelSync(StatusLabelSync sync)
          Sets the status label sync to display status messages.
 void start()
          Ovverrides thread's start method.
 void stopAll()
          Stops the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

refContainer

protected java.awt.Container refContainer
The container to be used.


type2panel

protected java.util.HashMap type2panel
Maps types and panels


type2message

protected java.util.HashMap type2message
Maps types and message to be displayed into a status bar.


obj

protected Clippable obj
The object you want to display its details.


previousObj

protected Clippable previousObj
The previous selected object. If you need it, use it...


stoppedExternally

protected boolean stoppedExternally
Checks whether the thread has been stopped externally.


initialized

protected boolean initialized
Checks whether the thread has been initialized.


panelName

protected java.lang.String panelName
Contains the panel name, to be used as a "thread name" for the status sync label.

Constructor Detail

VariablePaneDispatcher

public VariablePaneDispatcher()
Creates a new instance of VariablePaneDispatcher

Method Detail

start

public void start()
Ovverrides thread's start method.

Overrides:
start in class java.lang.Thread

run

public void run()
Thread's run method.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopAll

public void stopAll()
Stops the thread.


setObject

public void setObject(Clippable pObj)
Sets the object that you want its details to be displayed.

Parameters:
pObj - The object to use.

setContainer

public void setContainer(java.awt.Container cont)
Sets the container that will contain the panels.

Parameters:
cont - The container to use.

setStatusLabelSync

public void setStatusLabelSync(StatusLabelSync sync)
Sets the status label sync to display status messages.

Parameters:
sync - The status label sync to use.

doDispatch

protected void doDispatch()
Dispatches the requests.


initialize

protected abstract void initialize()
It will be called when the thread starts. Inherit it and put your initialization code.