|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bbn.openmap.layer.policy.StandardPCPolicy
ProjectionChangePolicy that uses a Layer SwingWorker to kick off a thread to call layer.prepare() and doesn't delete the OMGraphicList between projection changes. The standard behavior for simple layers that maintain a constant list of OMGraphics.
Field Summary | |
protected boolean |
alwaysSpawnThread
A flag to tell the policy to always spawn a thread. |
protected int |
graphicCutoff
The number of OMGraphics that have to be on the layer's OMGraphicList before a thread is spawned. |
protected OMGraphicHandlerLayer |
layer
The OMGraphicHandlerLayer using this policy. |
Constructor Summary | |
StandardPCPolicy()
You must set a layer at some point before using this class. |
|
StandardPCPolicy(OMGraphicHandlerLayer layer)
Don't pass in a null layer. |
|
StandardPCPolicy(OMGraphicHandlerLayer layer,
boolean alwaysSpawnThreadForPrepare)
Don't pass in a null layer. |
Method Summary | |
boolean |
getAlwaysSpawnThread()
|
int |
getGraphicCutoff()
|
OMGraphicHandlerLayer |
getLayer()
Get the OMGraphicHandlerLayer to work with. |
void |
projectionChanged(ProjectionEvent pe)
When the projection changes, the StandardPCPolicy sets the current projection on the layer, and calls prepare() on the layer. |
void |
setAlwaysSpawnThread(boolean val)
Tell the policy whether to spawn a thread when projectionChanged() is called with a new projection. |
void |
setGraphicCutoff(int number)
Set the number of OMGraphics that have to be on the list before a thread gets spawned to call generate() on them. |
void |
setLayer(OMGraphicHandlerLayer l)
Set the OMGraphicHandlerLayer to work with. |
protected boolean |
shouldSpawnThreadForPrepare()
We're assuming that the list is somewhat constant for the layer. |
void |
workerComplete(OMGraphicList aList)
This is a subtle call, that dictates what should happen when the LayerWorker has completed working in it's thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected OMGraphicHandlerLayer layer
protected int graphicCutoff
protected boolean alwaysSpawnThread
Constructor Detail |
public StandardPCPolicy()
public StandardPCPolicy(OMGraphicHandlerLayer layer)
public StandardPCPolicy(OMGraphicHandlerLayer layer, boolean alwaysSpawnThreadForPrepare)
layer
- layer to work foralwaysSpawnThreadForPrepare
- should be true if the
layer's prepare method takes a while. Normally, the
policy looks at the number of OMGraphics on the list to
determine if a thread should be spawned. True by
default.Method Detail |
public void setLayer(OMGraphicHandlerLayer l)
ProjectionChangePolicy
setLayer
in interface ProjectionChangePolicy
public OMGraphicHandlerLayer getLayer()
ProjectionChangePolicy
getLayer
in interface ProjectionChangePolicy
public void setAlwaysSpawnThread(boolean val)
public boolean getAlwaysSpawnThread()
public void projectionChanged(ProjectionEvent pe)
projectionChanged
in interface ProjectionChangePolicy
public void workerComplete(OMGraphicList aList)
workerComplete
in interface ProjectionChangePolicy
protected boolean shouldSpawnThreadForPrepare()
public void setGraphicCutoff(int number)
public int getGraphicCutoff()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |