public abstract class GralGraphicOrder
extends java.lang.Object
EventConsumer#processEvent(EventObject)
for the graphic (the first task)
as also contains the data for the graphic event by implementation of Payload
.
TimeOrder
which is necessary for the management of the execution time
using the GralMng
as org.vishia.event.EventTimerThread
.
The time order facility can be used to send the event not immediately but with delay,
so that a renew of the order can be done if the time is not yet elapsed.
EventConsumer
the operation EventConsumer#processEvent(EventObject)
need to be overridden in the inherit class.. Whereby the argument event is type of the overridden type itself.
Hence it is not necessary to evaluate, it is this itself.
The 'processEvent(...)' does the necessary work.
EventWithDst
.
is also referenced as composite here, hence any possible order has its specific event.
It is used and activated if the source of the event becomes active.
Payload#serialize()
and ~deserialize() are dummy implementations.
Modifier and Type | Field and Description |
---|---|
(package private) <any> |
ev |
(package private) GralMng |
gralMng |
(package private) java.lang.String |
sInfo |
(package private) TimeOrder |
timeOrder |
static java.lang.String |
version
Version and history.
|
Modifier | Constructor and Description |
---|---|
protected |
GralGraphicOrder(java.lang.String name,
GralMng gralMng)
Super constructor for all graphic time orders.
|
Modifier and Type | Method and Description |
---|---|
GralGraphicOrder |
clean() |
boolean |
deserialize(byte[] data) |
EventThread_ifc |
evThread() |
byte[] |
serialize() |
void |
setStackInfo()
Set the info from where the call comes (on calling this operation):
|
java.lang.String |
srcInfo()
Used for debugging and messaging: gets an information from where the order was created.
|
public static final java.lang.String version
EventConsumerAwait
needs a Payload derived from org.vishia.event.PayloadBack
and this is as first type argument the GralGraphicOrder itself,
the formally refactoring was not possible (two extends will be necessary, from GralGraphicOrder extends PayloadBack extends EventConsumerAwait).
But it is substantial a false concept, because this class is not a consumer of a callback event,
it is a consumer of a forwarded command event. The EventConsumerAwait#awaitExecution(long, boolean)
was never used also.
EventConsumerAwait
for #awaitExecution(long)
as essential operation. All is adapted and runs.
setStackInfo()
and sInfo
possible as information from the event producer
to the event dst to inform from where and why comes the event proper usable to search and improve in software.
org.vishia.event.EventTimerThread
the operation EnqueueInGraphicThread is no more necessary. The event can immediately executed in the graphic thread.
GralDispatchCallbackWorker
#addToGraphicThread(GralGraphicThread, int)
:
For time saving: If an instance is added already and its new execution time
is up to 5 ms later, nothing is done. It saves time for more as one call of this routine
in a fast loop.
#bAdded
==true
but it wasn't added, Therefore on #addToGraphicThread(GralGraphicThread, int)
it is removed
from list and added newly. It is more save.
#removeFromQueue(GralGraphicThread)
. It is a better naming because it is removed from the queue
in the graphic thread. This class is only used in that queue.
#name
to identify, proper for debugging
#addToGraphicThread(GralGraphicThread, int)
and
#removeFromQueue(GralGraphicThread)
as thread-safe functions which
marks the instance as added (for delayed execution, for re-using).
final GralMng gralMng
java.lang.String sInfo
final <any> ev
final TimeOrder timeOrder
protected GralGraphicOrder(java.lang.String name, GralMng gralMng)
private final GralGraphicTimeOrder repaintRequ = new GralGraphicTimeOrder("GralWidget.repaintRequ"){ QOverride public void executeOrder() { repaintGthread(); } QOverride public String toString(){ return name + ":" + GralWidget.this.name; } };
name
- The name is only used for showing in debugging.public void setStackInfo()
public java.lang.String srcInfo()
public EventThread_ifc evThread()
public GralGraphicOrder clean()
public byte[] serialize()
public boolean deserialize(byte[] data)