|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--javatools.swing.VariablePaneDispatcher
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 |
protected java.awt.Container refContainer
protected java.util.HashMap type2panel
protected java.util.HashMap type2message
protected Clippable obj
protected Clippable previousObj
protected boolean stoppedExternally
protected boolean initialized
protected java.lang.String panelName
Constructor Detail |
public VariablePaneDispatcher()
Method Detail |
public void start()
start
method.
start
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopAll()
public void setObject(Clippable pObj)
pObj
- The object to use.public void setContainer(java.awt.Container cont)
cont
- The container to use.public void setStatusLabelSync(StatusLabelSync sync)
sync
- The status label sync to use.protected void doDispatch()
protected abstract void initialize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |