org.jplot2d.env
Class Environment
- java.lang.Object
-
- org.jplot2d.env.Environment
-
- Direct Known Subclasses:
- DummyEnvironment, PlotEnvironment
public abstract class Environment extends java.lang.ObjectAn environment that a plot can realization. Once a plot is put an environment, changes on the plot can cause re-layout or redraw, according to the changed property.Renderers can be added to an environment to get the rendered result synchronously or asynchronously.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddElementChangeListener(ElementChangeListener listener)Add an ElementChangeListenerBatchTokenbeginBatch(java.lang.String msg)Begin a batch block.voidendBatch(BatchToken token)End the batch.voidendBatch(BatchToken token, NoticeType type)End the batch.CommandLoggergetCommandLogger()Return the command logger who receive commands executed in this environment.ElementChangeListener[]getElementChangeListeners()Returns all ElementChangeListeners.ElementgetProxy(ElementEx impl)Returns the proxy wrapper of the given element.voidremoveElementChangeListener(ElementChangeListener listener)Remove an ElementChangeListenervoidsetCommandLogger(CommandLogger cmdLogger)Sets a command logger to receive commands executed in this environment.
-
-
-
Method Detail
-
getProxy
public final Element getProxy(ElementEx impl)
Returns the proxy wrapper of the given element.- Parameters:
impl-- Returns:
-
getElementChangeListeners
public ElementChangeListener[] getElementChangeListeners()
Returns all ElementChangeListeners.- Returns:
- ElementChangeListener in an array
-
addElementChangeListener
public void addElementChangeListener(ElementChangeListener listener)
Add an ElementChangeListener- Parameters:
listener-
-
removeElementChangeListener
public void removeElementChangeListener(ElementChangeListener listener)
Remove an ElementChangeListener- Parameters:
listener-
-
getCommandLogger
public CommandLogger getCommandLogger()
Return the command logger who receive commands executed in this environment. If there is no command logger, returnsnull.- Returns:
- the command logger
-
setCommandLogger
public void setCommandLogger(CommandLogger cmdLogger)
Sets a command logger to receive commands executed in this environment.- Parameters:
cmdLogger- a CommandLogger
-
beginBatch
public final BatchToken beginBatch(java.lang.String msg)
Begin a batch block. In this mode, all update on plot will not be processed, until endBatch is called. If this environment is thread-safe, this method also lock the ReentrantLock, will block other thread call this method.- Parameters:
msg- the short description about the batch- Returns:
- a batch token
-
endBatch
public final void endBatch(BatchToken token)
End the batch. All pending update will be committed at once.- Parameters:
token- the token gotten from beginBatch
-
endBatch
public final void endBatch(BatchToken token, NoticeType type)
End the batch. All pending update will be committed at once.- Parameters:
token- the token gotten from beginBatchtype- the type for notice processor
-
-
DMelt 3.0 © DataMelt by jWork.ORG