Class GridView

Object
Node
Parent
Region
Control
GridView
All Implemented Interfaces:
Styleable, Event­Target, Skinnable

@DefaultProperty("image") public class GridView extends Control
A view of numerical values in a Rendered­Image. The rendered image is typically a two dimensional slice of a Grid­Coverage. The number of rows is the image height and the number of columns is the image width. The view shows one band at a time, but the band to show can be changed (thus providing a navigation in a third dimension).

This class is designed for large images, with tiles loaded in a background thread only when first needed. This is not a general purpose grid viewer; for matrices of relatively small size (e.g. less than 100 columns), consider using the standard JavaFX Table­View instead.

Since:
1.1
See Also:

Defined in the sis-javafx module

  • Property Summary

    Properties inherited from class Control

    context­Menu, skin, tooltip

    Properties inherited from class Region

    background, border, cache­Shape, center­Shape, height, insets, max­Height, max­Width, min­Height, min­Width, opaque­Insets, padding, pref­Height, pref­Width, scale­Shape, shape, snap­To­Pixel, width

    Properties inherited from class Parent

    needs­Layout

    Properties inherited from class Node

    accessible­Help, accessible­Role­Description, accessible­Role, accessible­Text, blend­Mode, bounds­In­Local, bounds­In­Parent, cache­Hint, cache, clip, cursor, depth­Test, disabled, disable, effective­Node­Orientation, effect, event­Dispatcher, focused, focus­Traversable, hover, id, input­Method­Requests, layout­Bounds, layout­X, layout­Y, local­To­Parent­Transform, local­To­Scene­Transform, managed, mouse­Transparent, node­Orientation, on­Context­Menu­Requested, on­Drag­Detected, on­Drag­Done, on­Drag­Dropped, on­Drag­Entered, on­Drag­Exited, on­Drag­Over, on­Input­Method­Text­Changed, on­Key­Pressed, on­Key­Released, on­Key­Typed, on­Mouse­Clicked, on­Mouse­Drag­Entered, on­Mouse­Drag­Exited, on­Mouse­Dragged, on­Mouse­Drag­Over, on­Mouse­Drag­Released, on­Mouse­Entered, on­Mouse­Exited, on­Mouse­Moved, on­Mouse­Pressed, on­Mouse­Released, on­Rotate, on­Rotation­Finished, on­Rotation­Started, on­Scroll­Finished, on­Scroll, on­Scroll­Started, on­Swipe­Down, on­Swipe­Left, on­Swipe­Right, on­Swipe­Up, on­Touch­Moved, on­Touch­Pressed, on­Touch­Released, on­Touch­Stationary, on­Zoom­Finished, on­Zoom, on­Zoom­Started, opacity, parent, pick­On­Bounds, pressed, rotate, rotation­Axis, scale­X, scale­Y, scale­Z, scene, style, translate­X, translate­Y, translate­Z, view­Order, visible
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Integer­Property
    The image band to show in the table.
    final Double­Property
    Height of all rows in the grid.
    final Double­Property
    Horizontal space between cells, as a number equals or greater than zero.
    final Double­Property
    Width of data cell to be shown in other columns than the header column.
    final Object­Property<Paint>
    The background color of row and column headers.
    final Double­Property
    Width of header cells to be shown in the first column.
    final Object­Property<Rendered­Image>
    The data shown in this table.

    Fields inherited from class Region

    USE_COMPUTED_SIZE, USE_PREF_SIZE

    Fields inherited from class Node

    BASELINE_OFFSET_SAME_AS_HEIGHT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an initially empty grid view.
  • Method Summary

    Modifier and Type
    Method
    Description
    final Optional<String­Property>
    The property for the pattern of values in cells.
    protected final Skin<Grid­View>
    Creates a new instance of the skin responsible for rendering this grid view.
    final int
    Returns the index of the band shown in this grid view.
    Returns the source of sample values for this table.
    final void
    set­Band(int index)
    Sets the number of the band to show in this grid view.
    final void
    Sets the image to show in this table.
    void
    Loads image in a background thread from the given source.

    Methods inherited from class Control

    compute­Max­Height, compute­Max­Width, compute­Min­Height, compute­Min­Width, compute­Pref­Height, compute­Pref­Width, context­Menu­Property, execute­Accessible­Action, get­Baseline­Offset, get­Class­Css­Meta­Data, get­Context­Menu, get­Control­Css­Meta­Data, get­Css­Meta­Data, get­Initial­Focus­Traversable, get­Skin, get­Tooltip, is­Resizable, layout­Children, query­Accessible­Attribute, set­Context­Menu, set­Skin, set­Tooltip, skin­Property, tooltip­Property

    Methods inherited from class Region

    background­Property, border­Property, cache­Shape­Property, center­Shape­Property, get­Background, get­Border, get­Height, get­Insets, get­Max­Height, get­Max­Width, get­Min­Height, get­Min­Width, get­Opaque­Insets, get­Padding, get­Pref­Height, get­Pref­Width, get­Shape, get­User­Agent­Stylesheet, get­Width, height­Property, insets­Property, is­Cache­Shape, is­Center­Shape, is­Scale­Shape, is­Snap­To­Pixel, layout­In­Area, layout­In­Area, layout­In­Area, layout­In­Area, max­Height, max­Height­Property, max­Width, max­Width­Property, min­Height, min­Height­Property, min­Width, min­Width­Property, opaque­Insets­Property, padding­Property, position­In­Area, position­In­Area, pref­Height, pref­Height­Property, pref­Width, pref­Width­Property, resize, scale­Shape­Property, set­Background, set­Border, set­Cache­Shape, set­Center­Shape, set­Height, set­Max­Height, set­Max­Size, set­Max­Width, set­Min­Height, set­Min­Size, set­Min­Width, set­Opaque­Insets, set­Padding, set­Pref­Height, set­Pref­Size, set­Pref­Width, set­Scale­Shape, set­Shape, set­Snap­To­Pixel, set­Width, shape­Property, snapped­Bottom­Inset, snapped­Left­Inset, snapped­Right­Inset, snapped­Top­Inset, snap­Position, snap­Position­X, snap­Position­Y, snap­Size, snap­Size­X, snap­Size­Y, snap­Space, snap­Space­X, snap­Space­Y, snap­To­Pixel­Property, width­Property

    Methods inherited from class Parent

    get­Children, get­Children­Unmodifiable, get­Managed­Children, get­Stylesheets, is­Needs­Layout, layout, lookup, needs­Layout­Property, request­Layout, request­Parent­Layout, set­Needs­Layout, update­Bounds

    Methods inherited from class Node

    accessible­Help­Property, accessible­Role­Description­Property, accessible­Role­Property, accessible­Text­Property, add­Event­Filter, add­Event­Handler, apply­Css, autosize, blend­Mode­Property, bounds­In­Local­Property, bounds­In­Parent­Property, build­Event­Dispatch­Chain, cache­Hint­Property, cache­Property, clip­Property, compute­Area­In­Screen, contains, contains, cursor­Property, depth­Test­Property, disabled­Property, disable­Property, effective­Node­Orientation­Property, effect­Property, event­Dispatcher­Property, fire­Event, focused­Property, focus­Traversable­Property, get­Accessible­Help, get­Accessible­Role, get­Accessible­Role­Description, get­Accessible­Text, get­Blend­Mode, get­Bounds­In­Local, get­Bounds­In­Parent, get­Cache­Hint, get­Clip, get­Content­Bias, get­Cursor, get­Depth­Test, get­Effect, get­Effective­Node­Orientation, get­Event­Dispatcher, get­Id, get­Initial­Cursor, get­Input­Method­Requests, get­Layout­Bounds, get­Layout­X, get­Layout­Y, get­Local­To­Parent­Transform, get­Local­To­Scene­Transform, get­Node­Orientation, get­On­Context­Menu­Requested, get­On­Drag­Detected, get­On­Drag­Done, get­On­Drag­Dropped, get­On­Drag­Entered, get­On­Drag­Exited, get­On­Drag­Over, get­On­Input­Method­Text­Changed, get­On­Key­Pressed, get­On­Key­Released, get­On­Key­Typed, get­On­Mouse­Clicked, get­On­Mouse­Drag­Entered, get­On­Mouse­Drag­Exited, get­On­Mouse­Dragged, get­On­Mouse­Drag­Over, get­On­Mouse­Drag­Released, get­On­Mouse­Entered, get­On­Mouse­Exited, get­On­Mouse­Moved, get­On­Mouse­Pressed, get­On­Mouse­Released, get­On­Rotate, get­On­Rotation­Finished, get­On­Rotation­Started, get­On­Scroll, get­On­Scroll­Finished, get­On­Scroll­Started, get­On­Swipe­Down, get­On­Swipe­Left, get­On­Swipe­Right, get­On­Swipe­Up, get­On­Touch­Moved, get­On­Touch­Pressed, get­On­Touch­Released, get­On­Touch­Stationary, get­On­Zoom, get­On­Zoom­Finished, get­On­Zoom­Started, get­Opacity, get­Parent, get­Properties, get­Pseudo­Class­States, get­Rotate, get­Rotation­Axis, get­Scale­X, get­Scale­Y, get­Scale­Z, get­Scene, get­Style, get­Styleable­Parent, get­Style­Class, get­Transforms, get­Translate­X, get­Translate­Y, get­Translate­Z, get­Type­Selector, get­User­Data, get­View­Order, has­Properties, hover­Property, id­Property, input­Method­Requests­Property, intersects, intersects, is­Cache, is­Disable, is­Disabled, is­Focused, is­Focus­Traversable, is­Hover, is­Managed, is­Mouse­Transparent, is­Pick­On­Bounds, is­Pressed, is­Visible, layout­Bounds­Property, layout­XProperty, layout­YProperty, local­To­Parent, local­To­Parent, local­To­Parent, local­To­Parent, local­To­Parent, local­To­Parent­Transform­Property, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene, local­To­Scene­Transform­Property, local­To­Screen, local­To­Screen, local­To­Screen, local­To­Screen, local­To­Screen, lookup­All, managed­Property, mouse­Transparent­Property, node­Orientation­Property, notify­Accessible­Attribute­Changed, on­Context­Menu­Requested­Property, on­Drag­Detected­Property, on­Drag­Done­Property, on­Drag­Dropped­Property, on­Drag­Entered­Property, on­Drag­Exited­Property, on­Drag­Over­Property, on­Input­Method­Text­Changed­Property, on­Key­Pressed­Property, on­Key­Released­Property, on­Key­Typed­Property, on­Mouse­Clicked­Property, on­Mouse­Drag­Entered­Property, on­Mouse­Drag­Exited­Property, on­Mouse­Dragged­Property, on­Mouse­Drag­Over­Property, on­Mouse­Drag­Released­Property, on­Mouse­Entered­Property, on­Mouse­Exited­Property, on­Mouse­Moved­Property, on­Mouse­Pressed­Property, on­Mouse­Released­Property, on­Rotate­Property, on­Rotation­Finished­Property, on­Rotation­Started­Property, on­Scroll­Finished­Property, on­Scroll­Property, on­Scroll­Started­Property, on­Swipe­Down­Property, on­Swipe­Left­Property, on­Swipe­Right­Property, on­Swipe­Up­Property, on­Touch­Moved­Property, on­Touch­Pressed­Property, on­Touch­Released­Property, on­Touch­Stationary­Property, on­Zoom­Finished­Property, on­Zoom­Property, on­Zoom­Started­Property, opacity­Property, parent­Property, parent­To­Local, parent­To­Local, parent­To­Local, parent­To­Local, parent­To­Local, pick­On­Bounds­Property, pressed­Property, pseudo­Class­State­Changed, relocate, remove­Event­Filter, remove­Event­Handler, request­Focus, resize­Relocate, rotate­Property, rotation­Axis­Property, scale­XProperty, scale­YProperty, scale­ZProperty, scene­Property, scene­To­Local, scene­To­Local, scene­To­Local, scene­To­Local, scene­To­Local, scene­To­Local, scene­To­Local, scene­To­Local, screen­To­Local, screen­To­Local, screen­To­Local, set­Accessible­Help, set­Accessible­Role, set­Accessible­Role­Description, set­Accessible­Text, set­Blend­Mode, set­Cache, set­Cache­Hint, set­Clip, set­Cursor, set­Depth­Test, set­Disable, set­Disabled, set­Effect, set­Event­Dispatcher, set­Event­Handler, set­Focused, set­Focus­Traversable, set­Hover, set­Id, set­Input­Method­Requests, set­Layout­X, set­Layout­Y, set­Managed, set­Mouse­Transparent, set­Node­Orientation, set­On­Context­Menu­Requested, set­On­Drag­Detected, set­On­Drag­Done, set­On­Drag­Dropped, set­On­Drag­Entered, set­On­Drag­Exited, set­On­Drag­Over, set­On­Input­Method­Text­Changed, set­On­Key­Pressed, set­On­Key­Released, set­On­Key­Typed, set­On­Mouse­Clicked, set­On­Mouse­Drag­Entered, set­On­Mouse­Drag­Exited, set­On­Mouse­Dragged, set­On­Mouse­Drag­Over, set­On­Mouse­Drag­Released, set­On­Mouse­Entered, set­On­Mouse­Exited, set­On­Mouse­Moved, set­On­Mouse­Pressed, set­On­Mouse­Released, set­On­Rotate, set­On­Rotation­Finished, set­On­Rotation­Started, set­On­Scroll, set­On­Scroll­Finished, set­On­Scroll­Started, set­On­Swipe­Down, set­On­Swipe­Left, set­On­Swipe­Right, set­On­Swipe­Up, set­On­Touch­Moved, set­On­Touch­Pressed, set­On­Touch­Released, set­On­Touch­Stationary, set­On­Zoom, set­On­Zoom­Finished, set­On­Zoom­Started, set­Opacity, set­Pick­On­Bounds, set­Pressed, set­Rotate, set­Rotation­Axis, set­Scale­X, set­Scale­Y, set­Scale­Z, set­Style, set­Translate­X, set­Translate­Y, set­Translate­Z, set­User­Data, set­View­Order, set­Visible, snapshot, snapshot, start­Drag­And­Drop, start­Full­Drag, style­Property, to­Back, to­Front, to­String, translate­XProperty, translate­YProperty, translate­ZProperty, uses­Mirroring, view­Order­Property, visible­Property

    Methods inherited from class Object

    clone, equals, finalize, get­Class, hash­Code, notify, notify­All, wait, wait, wait

    Methods inherited from interface Styleable

    get­Styleable­Node
  • Field Details

    • imageProperty

      public final ObjectProperty<RenderedImage> imageProperty
      The data shown in this table. Note that setting this property to a non-null value may not modify the grid content immediately. Instead, a background process will request the tiles.
      See Also:
    • bandProperty

      public final IntegerProperty bandProperty
      The image band to show in the table. It should be a number between 0 inclusive and Sample­Model​.get­Num­Bands() exclusive.
      See Also:
    • headerWidth

      public final DoubleProperty headerWidth
      Width of header cells to be shown in the first column. The first (header) column contains the row indices, or sometime the coordinate values. This size includes the cell spacing. It shall be a number strictly greater than zero.
      API note: We do not provide getter/setter for this property; use Writable­Double­Value​.set(double) directly instead. We omit the "Property" suffix for making this operation more natural.
    • cellWidth

      public final DoubleProperty cellWidth
      Width of data cell to be shown in other columns than the header column. This size includes the cell spacing. It shall be a number strictly greater than zero.
      API note: We do not provide getter/setter for this property; use Writable­Double­Value​.set(double) directly instead. We omit the "Property" suffix for making this operation more natural.
    • cellHeight

      public final DoubleProperty cellHeight
      Height of all rows in the grid. It shall be a number strictly greater than zero.
      API note: We do not provide getter/setter for this property; use Writable­Double­Value​.set(double) directly instead. We omit the "Property" suffix for making this operation more natural.
    • cellSpacing

      public final DoubleProperty cellSpacing
      Horizontal space between cells, as a number equals or greater than zero. There is no property for vertical cell spacing because increasing the cell height should be sufficient.
      API note: We do not provide getter/setter for this property; use Writable­Double­Value​.set(double) directly instead. We omit the "Property" suffix for making this operation more natural.
    • headerBackground

      public final ObjectProperty<Paint> headerBackground
      The background color of row and column headers.
      API note: We do not provide getter/setter for this property; use Writable­Object­Value​.set(Object) directly instead. We omit the "Property" suffix for making this operation more natural.
  • Constructor Details

    • GridView

      public GridView()
      Creates an initially empty grid view. The content can be set after construction by a call to set­Image(Rendered­Image).
  • Method Details

    • getImage

      public final RenderedImage getImage()
      Returns the source of sample values for this table. This method, like all other methods in this class, shall be invoked from the JavaFX thread.
      Returns:
      the image shown in this table, or null if none.
      See Also:
    • setImage

      public final void setImage(RenderedImage image)
      Sets the image to show in this table. This method shall be invoked from JavaFX thread and returns quickly; it does not attempt to fetch any tile. Calls to Rendered­Image​.get­Tile(int, int) will be done in a background thread when first needed.
      Parameters:
      image - the image to show in this table, or null if none.
      See Also:
    • setImage

      public void setImage(ImageRequest source)
      Loads image in a background thread from the given source. This method shall be invoked from JavaFX thread and returns immediately. The grid content may appear unmodified after this method returns; the modifications will appear after an undetermined amount of time.
      Parameters:
      source - the coverage or resource to load, or null if none.
      See Also:
    • getBand

      public final int getBand()
      Returns the index of the band shown in this grid view.
      Returns:
      index of the currently visible band number.
      See Also:
    • setBand

      public final void setBand(int index)
      Sets the number of the band to show in this grid view. This value should be from 0 (inclusive) to the number of bands in the image (exclusive).
      Parameters:
      index - the band to make visible.
      Throws:
      Illegal­Argument­Exception - if the given band index is out of bounds.
    • cellFormatPattern

      public final Optional<StringProperty> cellFormatPattern()
      The property for the pattern of values in cells. Note that this pattern depends on current locale. It is provided for user interactions (i.e. in a GUI control) instead of programmatic action.
      Returns:
      the localized format pattern property, or an empty value if the Number­Format used for writing cell values is not an instance of Decimal­Format.
      See Also:
    • createDefaultSkin

      protected final Skin<GridView> createDefaultSkin()
      Creates a new instance of the skin responsible for rendering this grid view. From the perspective of this Control, the Skin is a black box. It listens and responds to changes in state of this grid view. This method is called if no skin is provided via CSS or Control​.set­Skin(Skin).
      Overrides:
      create­Default­Skin in class Control
      Returns:
      the renderer of this grid view.