org.vishia.gral.swt

## Class SwtCurveView.CurveView

- java.lang.Object
- - org.eclipse.swt.widgets.Widget
  - - org.eclipse.swt.widgets.Control
    - - org.eclipse.swt.widgets.Scrollable
      - - org.eclipse.swt.widgets.Composite
        - - org.eclipse.swt.widgets.Canvas
          - - org.vishia.gral.swt.SwtCurveView.CurveView

- All Implemented Interfaces:
    org.eclipse.swt.graphics.Drawable
  Enclosing class:
    SwtCurveView

      private class SwtCurveView.CurveView
      extends org.eclipse.swt.widgets.Canvas

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) org.eclipse.swt.events.FocusListener` | `focusListener`
    `(package private) org.eclipse.swt.events.PaintListener` | `paintListener`

    - ### Fields inherited from class org.eclipse.swt.widgets.Control

      `handle`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CurveView(org.eclipse.swt.widgets.Composite parent, int xPixel, int yPixel, int nrofXvalues)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `drawBackground(org.eclipse.swt.graphics.GC g, int xView, int yView, int dxView, int dyView)` This routine overrides
    `void` | `redrawData()`
    `void` | `setGridHorizontal(float percentY, int periodStrongLine)` Set distance for horizontal grid lines.
    `void` | `setGridVertical(int dataPointsBetweenGridLines, int periodStrongLine)`

    - ### Methods inherited from class org.eclipse.swt.widgets.Canvas

      `getCaret, getIME, scroll, setCaret, setFont, setIME`

    - ### Methods inherited from class org.eclipse.swt.widgets.Composite

      `changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

    - ### Methods inherited from class org.eclipse.swt.widgets.Scrollable

      `computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar`

    - ### Methods inherited from class org.eclipse.swt.widgets.Control

      `addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update`

    - ### Methods inherited from class org.eclipse.swt.widgets.Widget

      `addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString`

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

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

    - ### Methods inherited from interface org.eclipse.swt.graphics.Drawable

      `isAutoScalable`

- - ### Field Detail

    - #### paintListener

          org.eclipse.swt.events.PaintListener paintListener

    - #### focusListener

          org.eclipse.swt.events.FocusListener focusListener

  - ### Constructor Detail

    - #### CurveView

          public CurveView(org.eclipse.swt.widgets.Composite parent,
                           int xPixel,
                           int yPixel,
                           int nrofXvalues)

  - ### Method Detail

    - #### setGridVertical

          public void setGridVertical(int dataPointsBetweenGridLines,
                                      int periodStrongLine)

    - #### setGridHorizontal

          public void setGridHorizontal(float percentY,
                                        int periodStrongLine)

      Set distance for horizontal grid lines.
      Parameters:
        `percentY` - percent of y-view for grid lines. For example 50.0: divide y-axis in 50 steps.
        `periodStrongLine` - period for strong lines For example 5, any 5. line is stroke.

    - #### redrawData

          public void redrawData()

    - #### drawBackground

          public void drawBackground(org.eclipse.swt.graphics.GC g,
                                     int xView,
                                     int yView,
                                     int dxView,
                                     int dyView)

      This routine overrides
      Overrides:
        `drawBackground` in class `org.eclipse.swt.widgets.Canvas`
      See Also:
        `It is called in this class in {@link #paintListener} in the {@link PaintListener#paintControl(PaintEvent)} method. It draws the whole content.
        Because of saving calculation time there will be drawn only a small peace on right side of the area with the new data normally. The rest inclusive grid lines, curves, text is moved to left. But if the whole window should be refreshed, the whole widget is drawn newly.`