org.vishia.gral.base

## Class GralPos.Coordinate

- java.lang.Object
- - org.vishia.gral.base.GralPos.Coordinate

- Enclosing class:
    GralPos

      public static class GralPos.Coordinate
      extends java.lang.Object

  Class holds values for either x or y. Both values are calculated with adequate algorithms, so that algorithm is written only one time but called 2 times for x and for y.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `attr` Attributes of this coordinate.
    `char` | `dirNext` direction of the next element.
    `int` | `endSepLine` Relation of xEnd and yEnd right and bottom to any separation line. 0 - relation to left and top border.
    `(package private) int` | `n1` Start Position in percent.
    `(package private) int` | `n2` End Position in percent.
    `(package private) char` | `origin`
    `int` | `p1` The start position for the spread.
    `int` | `p1Frac` Fractional parts of position.
    `int` | `p2` The end position for the spread.
    `int` | `p2Frac` Fractional parts of position.
    `int` | `pb` Additional border value for `GralPos.next`.
    `int` | `pbf` Additional border value for `GralPos.next`.
    `int` | `sepLine` Relation of x and y left and top to any separation line. 0 - relation to left and top border.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Coordinate()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `calc(int[] dst, int dparent, int dnat, int xPixelUnit, int[] xPixelFrac)` Calculate from size to pixel.
    `(package private) void` | `set(GralPos.Coordinate src)` Copies all values.
    `GralPos.Coordinate` | `set(int z1, int z1Frac, int z2, int z2Frac, GralPos.Coordinate parent)` Sets the new position for this coordinate.

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

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

- - ### Field Detail

    - #### p1

          public int p1

      The start position for the spread. If there are positive numbers, they count from left to right respectively top to bottom. If the value is negative, the absolute is the distance from right respectively bottom.

    - #### p2

          public int p2

      The end position for the spread. If there are positive numbers, they count from left to right respectively top to bottom. If the value is negative or 0, the absolute is the distance from right respectively bottom.

    - #### n1

          int n1

      Start Position in percent. If -1 then not used.

    - #### n2

          int n2

      End Position in percent.

    - #### p1Frac

          public int p1Frac

      Fractional parts of position. Use 0..9 only. The fractional part counts from left to right respectively top to bottom independent of the sign of p1, p2.

    - #### p2Frac

          public int p2Frac

      Fractional parts of position. Use 0..9 only. The fractional part counts from left to right respectively top to bottom independent of the sign of p1, p2.

    - #### pb

          public int pb

      Additional border value for `GralPos.next`.

    - #### pbf

          public int pbf

      Additional border value for `GralPos.next`.

    - #### attr

          public int attr

      Attributes of this coordinate.

    - #### origin

          char origin

    - #### dirNext

          public char dirNext

      direction of the next element. Use r, d, l, u.

    - #### sepLine

          public int sepLine

      Relation of x and y left and top to any separation line. 0 - relation to left and top border. TODO the sepLine is planned but not used yet. 2012-01-31

    - #### endSepLine

          public int endSepLine

      Relation of xEnd and yEnd right and bottom to any separation line. 0 - relation to left and top border. positive Index: separation line with this index is left or top. Typical it may be the same index then for left top position. negative Index: separation line with negate value as index is right or bottom.

  - ### Constructor Detail

    - #### Coordinate

          public Coordinate()

  - ### Method Detail

    - #### set

          public GralPos.Coordinate set(int z1,
                                        int z1Frac,
                                        int z2,
                                        int z2Frac,
                                        GralPos.Coordinate parent)

      Sets the new position for this coordinate.
      Parameters:
        `z1` -
        `z1Frac` -
        `z2` -
        `z2Frac` -
        `parent` - The refer position. Note that parent may be == this because the new position based on the current.

    - #### set

          void set(GralPos.Coordinate src)

      Copies all values. Hint: clone isn't able to use because the instance in parent is final.
      Parameters:
        `src` -

    - #### calc

          void calc(int[] dst,
                    int dparent,
                    int dnat,
                    int xPixelUnit,
                    int[] xPixelFrac)

      Calculate from size to pixel.