|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--javatools.swing.panel.SubPanelDispatcher
It represents an "event dispatcher" for sub-panels, i.e. panels into other panels.
It is multi-panel, you can create only one for your application, if you want
them to be processed in queue.
It can manage fixed sub-panels (i.e. when you create a panel and its subpanels
once and you have it until end of execution) or dynamic sub-panels (i.e. when
you create a panel as you need it).
Use this sequence of commands:
Integer fillerID1;
Long fillerID2;
SubPanelDispatcher disp = new SubPanelDispatcher();
disp.setStatusLabelSync(myStatusLabelSync);
-- repeat
fillerID1 = disp.registerFiller(myFiller, myMessage);
-- until you have "fixed subpanels"
-- repeat
fillerID2 = disp.reserveKey();
disp.registerFiller(fillerID2, myFiller, myMessage);
-- until you have "dynamic subpanels"
disp.fill(fillerID1, selectedObjectArray1);
disp.fill(fillerID2, selectedObjectArray2);
disp.releaseKey(fillerID2);
-- At the end of application:
disp.stopAll();
Field Summary | |
protected StatusLabelSync |
statusSync
Is is the status label sync to be used to display messages. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
SubPanelDispatcher()
Creates a new instance of SubPanelDispatcher |
Method Summary | |
protected void |
doDispatchOne(java.lang.Object fillerID,
java.lang.Object[] IDs)
Dispatches one subpanel request in the queue. |
void |
fill(java.lang.Object fillerID,
java.lang.Object[] IDs)
Fills a subpanel. |
void |
registerFiller(java.lang.Long fillerID,
SubPanelFiller filler,
java.lang.String message)
Registers a filler for a dynamic subpanel. |
java.lang.Integer |
registerFiller(SubPanelFiller filler,
java.lang.String message)
Registers a fixed subpanel's filler. |
void |
releaseKey(java.lang.Long key)
Releases a key to be used for dynamic subpanels |
java.lang.Long |
reserveKey()
Reserves a key for a dynamic subpanel. |
java.lang.Long |
reserveKey(SubPanelFiller filler,
java.lang.String message)
Reserves a key and sets the filler and the message to display. |
void |
run()
Thread's run method. |
void |
setStatusLabelSync(StatusLabelSync sync)
Sets the status label sync to display messages. |
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, start, 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 StatusLabelSync statusSync
Constructor Detail |
public SubPanelDispatcher()
Method Detail |
public void setStatusLabelSync(StatusLabelSync sync)
sync
- The sync to use.public java.lang.Long reserveKey()
public java.lang.Long reserveKey(SubPanelFiller filler, java.lang.String message)
filler
- The filler to use.message
- The message to display.
public void registerFiller(java.lang.Long fillerID, SubPanelFiller filler, java.lang.String message)
fillerID
- The key to use.filler
- The filler to be registered.message
- The message to display.public void releaseKey(java.lang.Long key)
key
- The key to use.public java.lang.Integer registerFiller(SubPanelFiller filler, java.lang.String message)
filler
- The filler to use.message
- The message to display.
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopAll()
public void fill(java.lang.Object fillerID, java.lang.Object[] IDs)
fillerID
- The ID of the filler to use (either dynamic or fixed).IDs
- The IDs of selected objects somewhere else in the application.protected void doDispatchOne(java.lang.Object fillerID, java.lang.Object[] IDs)
fillerID
- The filler ID to use.IDs
- The IDs of selected objects somewhere else in the application.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |