org.vishia.gral.ifc

## Class GralCanvasStorage

- java.lang.Object
- - org.vishia.gral.ifc.GralCanvasStorage

- All Implemented Interfaces:
    GralCanvas_ifc

      public class GralCanvasStorage
      extends java.lang.Object
      implements GralCanvas_ifc

  The canvas storage is a storage, which stores orders to paint. This orders are painted if the paint-routine from the windows-system is invoked. An application can call forex the `#drawLine(Color, int, int, int, int)`-routine to draw a line. This line will be drawn immediately, if the graphical window or widget gets the redraw-request. Firstly the line will be stored only.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GralCanvasStorage.PaintOrder` Data class to store an order.
    `static class` | `GralCanvasStorage.PaintOrderImage`
    `static class` | `GralCanvasStorage.PolyLine`
    `static class` | `GralCanvasStorage.PolyLineFloatArray`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `paintImage`
    `static int` | `paintLine`
    `java.util.concurrent.ConcurrentLinkedQueue<GralCanvasStorage.PaintOrder>` | `paintOrders` List of all orders to paint in `#drawBackground(GC, int, int, int, int)`.
    `static int` | `paintPolyline`
    `static java.lang.String` | `version` Version, history and license.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GralCanvasStorage()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `drawImage(GralImageBase image, int x, int y, int dx, int dy, GralRectangle imagePixelSize)`
    `void` | `drawLine(GralColor color, GralPlotArea.UserUnits userUnits, float[][] points, int iy)` Accepts a order to draw a line.
    `void` | `drawLine(GralColor color, int x1, int y1, int x2, int y2)` Accepts a order to draw a line.
    `void` | `drawLine(GralPos pos, GralColor color, java.util.List<GralPoint> points)` Accepts a order to draw a line.
    `void` | `drawText(java.lang.String text)`
    `void` | `setTextStyle(GralColor color, GralFont font, int origin)`

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

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

- - ### Field Detail

    - #### version

          public static final java.lang.String version

      Version, history and license.
      - 2012-09-27 Hartmut new: `GralCanvasStorage.PolyLineFloatArray`
      - 2012-04-22 new `drawLine(GralPos, GralColor, List)`, improved `GralCanvasStorage.PaintOrder`-derivates.
      - 2011-06-00 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 doesn'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 intent to use this source without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### paintLine

          public static final int paintLine

      See Also:
        Constant Field Values

    - #### paintImage

          public static final int paintImage

      See Also:
        Constant Field Values

    - #### paintPolyline

          public static final int paintPolyline

      See Also:
        Constant Field Values

    - #### paintOrders

          public final java.util.concurrent.ConcurrentLinkedQueue<GralCanvasStorage.PaintOrder> paintOrders

      List of all orders to paint in `#drawBackground(GC, int, int, int, int)`.

  - ### Constructor Detail

    - #### GralCanvasStorage

          public GralCanvasStorage()

  - ### Method Detail

    - #### drawLine

          public void drawLine(GralColor color,
                               int x1,
                               int y1,
                               int x2,
                               int y2)

      Accepts a order to draw a line. The coordinates are stored only. This method can be called in any thread. It is thread-safe.
      Specified by:
        `drawLine` in interface `GralCanvas_ifc`
      Parameters:
        `color` -
        `x1` - TODO yet it is pixel coordinates, use GralGrid coordinates.
        `y1` -
        `x2` -
        `y2` -

    - #### drawLine

          public void drawLine(GralPos pos,
                               GralColor color,
                               java.util.List<GralPoint> points)

      Accepts a order to draw a line. The coordinates are stored only. This method can be called in any thread. It is thread-safe.
      Parameters:
        `color` -

    - #### drawLine

          public void drawLine(GralColor color,
                               GralPlotArea.UserUnits userUnits,
                               float[][] points,
                               int iy)

      Accepts a order to draw a line. The coordinates are stored only. This method can be called in any thread. It is thread-safe.
      Parameters:
        `color` -

    - #### drawImage

          public void drawImage(GralImageBase image,
                                int x,
                                int y,
                                int dx,
                                int dy,
                                GralRectangle imagePixelSize)

      Specified by:
        `drawImage` in interface `GralCanvas_ifc`

    - #### drawText

          public void drawText(java.lang.String text)

      Specified by:
        `drawText` in interface `GralCanvas_ifc`

    - #### setTextStyle

          public void setTextStyle(GralColor color,
                                   GralFont font,
                                   int origin)

      Specified by:
        `setTextStyle` in interface `GralCanvas_ifc`