Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.swing
Class VariablePaneDispatcher  view VariablePaneDispatcher download VariablePaneDispatcher.java

java.lang.Object
  extended byjava.lang.Thread
      extended byjavatools.swing.VariablePaneDispatcher
All Implemented Interfaces:
java.lang.Runnable

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();


Nested Class Summary
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private static java.text.MessageFormat formatter
           
protected  boolean initialized
          Checks whether the thread has been initialized.
protected  javatools.util.Clippable obj
          The object you want to display its details.
private  java.util.Collection paneCollection
           
private  javatools.swing.internal.VPDPanelDisplayer panelDisplayer
           
private  javatools.swing.internal.VPDPanelHider panelHider
           
protected  java.lang.String panelName
          Contains the panel name, to be used as a "thread name" for the status sync label.
protected  javatools.util.Clippable previousObj
          The previous selected object.
private  boolean processing
           
protected  java.awt.Container refContainer
          The container to be used.
private  StatusLabelSync statusSync
           
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.
private  void doDispatchOne()
           
private  void doInitialize()
           
protected abstract  void initialize()
          It will be called when the thread starts.
private  void restartDispatch()
           
 void run()
          Thread's run method.
 void setContainer(java.awt.Container cont)
          Sets the container that will contain the panels.
 void setObject(javatools.util.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, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 javatools.util.Clippable obj
The object you want to display its details.


previousObj

protected javatools.util.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.


processing

private boolean processing

statusSync

private StatusLabelSync statusSync

paneCollection

private java.util.Collection paneCollection

panelHider

private javatools.swing.internal.VPDPanelHider panelHider

panelDisplayer

private javatools.swing.internal.VPDPanelDisplayer panelDisplayer

formatter

private static java.text.MessageFormat formatter
Constructor Detail

VariablePaneDispatcher

public VariablePaneDispatcher()
Creates a new instance of VariablePaneDispatcher

Method Detail

start

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


run

public void run()
Thread's run method.


stopAll

public void stopAll()
Stops the thread.


setObject

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


setContainer

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


setStatusLabelSync

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


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.


doInitialize

private void doInitialize()

restartDispatch

private void restartDispatch()

doDispatchOne

private void doDispatchOne()