org.vishia.gral.base

## Class GralGraphicTimeOrder

- java.lang.Object
- - java.util.EventObject
  - - org.vishia.event.EventWithDst
    - - org.vishia.event.EventTimeout
      - - org.vishia.event.TimeOrder
        - - org.vishia.gral.base.GralGraphicTimeOrder

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ExampleSimpleButton.InitGuiCodeSimpleButton

      public abstract class GralGraphicTimeOrder
      extends TimeOrder

  This is the base class for user classes, which contains code, that should be executed in the graphic thread. The method `TimeOrder.executeOrder()` should be overridden with the functionality which should be executed in the graphic thread before the system's dispatching routine starts.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `GralGraphicTimeOrder.EnqueueInGraphicThread` To create the instance for the EventConsumer to enqueue time orders in the graphic thread queue.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static long` | `serialVersionUID`
    `static java.lang.String` | `version` Version and history.

    - ### Fields inherited from class org.vishia.event.TimeOrder

      `dbgctDone, name`

    - ### Fields inherited from class org.vishia.event.EventTimeout

      `dbgctWindup, timeExecution, timeExecutionLatest`

    - ### Fields inherited from class org.vishia.event.EventWithDst

      `ctConsumed, dateCreation, orderId, stateOfEvent`

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GralGraphicTimeOrder(java.lang.String name)` Super constructor for all graphic time orders.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` Activates the graphic order to execute immediately as next call in the graphic thread.

    - ### Methods inherited from class org.vishia.event.TimeOrder

      `awaitExecution, doExecute, executeOrder, getCtDone, getStateInfo, toString`

    - ### Methods inherited from class org.vishia.event.EventTimeout

      `activate, activateAt, activateAt, deactivate, doTimeElapsed, timeExecution, timeExecutionLatest, timeToExecution, used`

    - ### Methods inherited from class org.vishia.event.EventWithDst

      `consumed, dateCreation, evDst, getDst, getDstThread, hasDst, isOccupied, occupy, occupy, occupy, occupyRecall, occupyRecall, occupyRecall, occupyRecall, relinquish, removeFromQueue, sendEvent, setDst, setOrderId, XXXdonotRelinquish`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### version

          public static final java.lang.String version

      Version and history.
      - 2015-01-10 Hartmut renamed from `GralDispatchCallbackWorker`
      - 2012-02-14 Hartmut corr: `#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.
      - 2012-02-14 Hartmut corr: It was happen that an instance was designated with `#bAdded`==true but it wasn't added, Therefore on `#addToGraphicThread(GralGraphicThread, int)` it is removed from list and added newly. It is more save.
      - 2012-01-26 Hartmut chg: rename removeFromGraphicThread(GralGraphicThread) to `#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.
      - 2012-01-15 Hartmut new: `TimeOrder.name` to identify, proper for debugging
      - 2012-01-08 Hartmut new: `#addToGraphicThread(GralGraphicThread, int)` and `#removeFromQueue(GralGraphicThread)` as thread-safe functions which marks the instance as added (for delayed execution, for re-using).
      - 2011-02-21 Hartmut created.
      Copyright/Copyleft: For this source the LGPL Lesser General Public License, published by the Free Software Foundation is valid. It means:
      1. You can use this source without any restriction for any desired purpose.
      2. You can redistribute copies of this source to everybody.
      3. Every user of this source, also the user of redistribute copies with or without payment, must accept this license for further using.
      4. But the LPGL is not appropriate for a whole software product, if this source is only a part of them. It means, the user must publish this part of source, but don't need to publish the whole source of the own product.
      5. You can study and modify (improve) this source for own using or for redistribution, but you have to license the modified sources likewise under this LGPL Lesser General Public License. You mustn't delete this Copyright/Copyleft inscription in this source file.
      If you are indent to use this sources without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### serialVersionUID

          private static final long serialVersionUID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GralGraphicTimeOrder

          protected GralGraphicTimeOrder(java.lang.String name)

      Super constructor for all graphic time orders. Usual a anonymous class is used for the instance:

            private final GralGraphicTimeOrder repaintRequ = new GralGraphicTimeOrder("GralWidget.repaintRequ"){
              QOverride public void executeOrder() {
                repaintGthread();
              }
              QOverride public String toString(){ return name + ":" + GralWidget.this.name; }
            };

      Parameters:
        `name` - The name is only used for showing in debugging.

  - ### Method Detail

    - #### activate

          public void activate()

      Activates the graphic order to execute immediately as next call in the graphic thread.