Module org.hdfgroup.hdfview
Package hdf.view.TableView

# Class DefaultBaseTableView

Object
hdf.view.TableView.DefaultBaseTableView

All Implemented Interfaces:
  `DataView`, `TableView`

Direct Known Subclasses:
  `DefaultCompoundDSTableView`, `DefaultScalarDSTableView`

public abstract class DefaultBaseTableView extends Object implements TableView
DefaultBaseTableView serves as the base class for a DataView that displays HDF data in a tabular format. This class is used for internal bookkeeping and as a place to store higher-level data manipulation functions, whereas its subclasses are responsible for setting up the actual GUI components.

Version:
  1.0 4/13/2018
Author:
  jhenderson

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected class`
  `DefaultBaseTableView.ColumnHeader`
  An implementation of the table's Column Header which adapts to the current font.
  `protected class`
  `DefaultBaseTableView.EditingGridLayer`
  An implementation of a GridLayer with support for column grouping and with editing triggered by a double click instead of a single click.
  `protected class`
  `DefaultBaseTableView.RefContextMenu`
  `protected class`
  `DefaultBaseTableView.RowHeader`
  An implementation of the table's Row Header which adapts to the current font.
  `protected class`
  `DefaultBaseTableView.RowHeaderDataProvider`
  Custom Row Header data provider to set row indices based on Index Base for both Scalar Datasets and Compound Datasets.
  `protected static class`
  `DefaultBaseTableView.ViewType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `binaryOrder`
  `protected BitSet`
  `bitmask`
  `protected ViewProperties.BITMASK_OP`
  `bitmaskOP`
  `protected org.eclipse.swt.widgets.Label`
  `cellLabel`
  `protected org.eclipse.swt.widgets.Text`
  `cellValueField`
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkBin`
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkCustomNotation`
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkEnum`
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkFixedDataLength`
  Global variables for GUI components
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkHex`
  `protected org.eclipse.swt.widgets.MenuItem`
  `checkScientificNotation`
  `protected org.eclipse.nebula.widgets.nattable.data.IDataProvider`
  `columnHeaderDataProvider`
  `protected org.eclipse.swt.graphics.Font`
  `curFont`
  `protected DecimalFormat`
  `customFormat`
  `protected DataDisplayConverterFactory.HDFDisplayConverter`
  `dataDisplayConverter`
  `protected org.eclipse.nebula.widgets.nattable.layer.DataLayer`
  `dataLayer`
  `protected DataFormat`
  `dataObject`
  `protected DataProviderFactory.HDFDataProvider`
  `dataProvider`
  `protected org.eclipse.nebula.widgets.nattable.NatTable`
  `dataTable`
  `protected Object`
  `dataValue`
  `protected Object`
  `fillValue`
  `protected int`
  `fixedDataLength`
  `protected int`
  `indexBase`
  `protected org.eclipse.swt.widgets.Group`
  `indexBaseGroup`
  `protected boolean`
  `isDataTransposed`
  `protected boolean`
  `isDisplayTypeChar`
  `protected boolean`
  `isEnumConverted`
  `protected boolean`
  `isObjRef`
  `protected boolean`
  `isReadOnly`
  `protected boolean`
  `isRegRef`
  `protected NumberFormat`
  `normalFormat`
  `protected NumberFormat`
  `numberFormat`
  `protected org.eclipse.nebula.widgets.nattable.data.IDataProvider`
  `rowHeaderDataProvider`
  `protected DecimalFormat`
  `scientificFormat`
  `protected org.eclipse.nebula.widgets.nattable.selection.SelectionLayer`
  `selectionLayer`
  `protected org.eclipse.swt.widgets.Shell`
  `shell`
  `protected boolean`
  `showAsBin`
  `protected boolean`
  `showAsHex`
  `protected DataViewManager`
  `viewer`
  `protected DefaultBaseTableView.ViewType`
  `viewType`

  ### Fields inherited from interface hdf.view.DataView.DataView

  `DATAVIEW_IMAGE, DATAVIEW_TABLE, DATAVIEW_UNKNOWN`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultBaseTableView​(DataViewManager theView)`
  Constructs a base TableView with no additional data properties.
  `DefaultBaseTableView​(DataViewManager theView, HashMap dataPropertiesMap)`
  Constructs a base TableView with the specified data properties.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected org.eclipse.swt.widgets.Menu`
  `createMenuBar​(org.eclipse.swt.widgets.Shell theShell)`
  `protected abstract org.eclipse.nebula.widgets.nattable.NatTable`
  `createTable​(org.eclipse.swt.widgets.Composite parent, DataFormat dataObject)`
  `protected abstract org.eclipse.nebula.widgets.nattable.config.IEditableRule`
  `getDataEditingRule​(DataFormat dataObject)`
  `org.eclipse.nebula.widgets.nattable.layer.DataLayer`
  `getDataLayer()`
  `HObject`
  `getDataObject()`
  `int`
  `getSelectedColumnCount()`
  `int`
  `getSelectedRowCount()`
  `org.eclipse.nebula.widgets.nattable.selection.SelectionLayer`
  `getSelectionLayer()`
  `Object`
  `getTable()`
  `protected void`
  `importBinaryData()`
  Import data values from binary file.
  `protected void`
  `importTextData​(String fname)`
  Import data values from text file.
  `protected void`
  `loadData​(DataFormat dataObject)`
  `protected void`
  `NewshowObjRefData​(long ref)`
  Display data pointed to by object references.
  `protected void`
  `NewshowRegRefData​(String reg)`
  Display data pointed to by region references.
  `protected void`
  `saveAsBinary()`
  Save data as binary.
  `protected void`
  `saveAsText()`
  Save data as text.
  `protected abstract void`
  `showObjRefData​(long ref)`
  `protected abstract void`
  `showRegRefData​(String reg)`
  `protected void`
  `updateDataConversionSettings()`
  `void`
  `updateValueInFile()`
  Update dataset's value in file.

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

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

  ### Methods inherited from interface hdf.view.TableView.TableView

  `getSelectedData`

- ## Field Details

  - ### shell

    protected final org.eclipse.swt.widgets.Shell shell

  - ### curFont

    protected org.eclipse.swt.graphics.Font curFont

  - ### viewer

    protected final DataViewManager viewer

  - ### dataTable

    protected org.eclipse.nebula.widgets.nattable.NatTable dataTable

  - ### dataObject

    protected final DataFormat dataObject

  - ### dataValue

    protected Object dataValue

  - ### fillValue

    protected Object fillValue

  - ### viewType

    protected DefaultBaseTableView.ViewType viewType

  - ### scientificFormat

    protected final DecimalFormat scientificFormat

  - ### customFormat

    protected DecimalFormat customFormat

  - ### normalFormat

    protected final NumberFormat normalFormat

  - ### numberFormat

    protected NumberFormat numberFormat

  - ### bitmask

    protected BitSet bitmask

  - ### bitmaskOP

    protected ViewProperties.BITMASK_OP bitmaskOP

  - ### indexBase

    protected int indexBase

  - ### fixedDataLength

    protected int fixedDataLength

  - ### binaryOrder

    protected int binaryOrder

  - ### isReadOnly

    protected boolean isReadOnly

  - ### isEnumConverted

    protected boolean isEnumConverted

  - ### isDisplayTypeChar

    protected boolean isDisplayTypeChar

  - ### isDataTransposed

    protected boolean isDataTransposed

  - ### isRegRef

    protected boolean isRegRef

  - ### isObjRef

    protected boolean isObjRef

  - ### showAsHex

    protected boolean showAsHex

  - ### showAsBin

    protected boolean showAsBin

  - ### selectionLayer

    protected org.eclipse.nebula.widgets.nattable.selection.SelectionLayer selectionLayer

  - ### dataLayer

    protected org.eclipse.nebula.widgets.nattable.layer.DataLayer dataLayer

  - ### rowHeaderDataProvider

    protected org.eclipse.nebula.widgets.nattable.data.IDataProvider rowHeaderDataProvider

  - ### columnHeaderDataProvider

    protected org.eclipse.nebula.widgets.nattable.data.IDataProvider columnHeaderDataProvider

  - ### dataProvider

    protected DataProviderFactory.HDFDataProvider dataProvider

  - ### dataDisplayConverter

    protected DataDisplayConverterFactory.HDFDisplayConverter dataDisplayConverter

  - ### checkFixedDataLength

    protected org.eclipse.swt.widgets.MenuItem checkFixedDataLength
    Global variables for GUI components

  - ### checkCustomNotation

    protected org.eclipse.swt.widgets.MenuItem checkCustomNotation

  - ### checkScientificNotation

    protected org.eclipse.swt.widgets.MenuItem checkScientificNotation

  - ### checkHex

    protected org.eclipse.swt.widgets.MenuItem checkHex

  - ### checkBin

    protected org.eclipse.swt.widgets.MenuItem checkBin

  - ### checkEnum

    protected org.eclipse.swt.widgets.MenuItem checkEnum

  - ### indexBaseGroup

    protected org.eclipse.swt.widgets.Group indexBaseGroup

  - ### cellValueField

    protected org.eclipse.swt.widgets.Text cellValueField

  - ### cellLabel

    protected org.eclipse.swt.widgets.Label cellLabel

- ## Constructor Details

  - ### DefaultBaseTableView

    public DefaultBaseTableView​(DataViewManager theView)
    Constructs a base TableView with no additional data properties.
    Parameters:
      `theView` - the main HDFView.

  - ### DefaultBaseTableView

    public DefaultBaseTableView​(DataViewManager theView, HashMap dataPropertiesMap)
    Constructs a base TableView with the specified data properties.
    Parameters:
      `theView` - the main HDFView.
      `dataPropertiesMap` - the properties on how to show the data. The map is used to allow applications to pass properties on how to display the data, such as: transposing data, showing data as characters, applying a bitmask, and etc. Predefined keys are listed at ViewProperties.DATA_VIEW_KEY.

- ## Method Details

  - ### createMenuBar

    protected org.eclipse.swt.widgets.Menu createMenuBar​(org.eclipse.swt.widgets.Shell theShell)

  - ### loadData

    protected void loadData​(DataFormat dataObject) throws Exception
    Throws:
      `Exception`

  - ### createTable

    protected abstract org.eclipse.nebula.widgets.nattable.NatTable createTable​(org.eclipse.swt.widgets.Composite parent, DataFormat dataObject)

  - ### showObjRefData

    protected abstract void showObjRefData​(long ref)

  - ### showRegRefData

    protected abstract void showRegRefData​(String reg)

  - ### NewshowObjRefData

    protected void NewshowObjRefData​(long ref)
    Display data pointed to by object references. Data of each object is shown in a separate spreadsheet.
    Parameters:
      `ref` - the array of strings that contain the object reference information.

  - ### NewshowRegRefData

    protected void NewshowRegRefData​(String reg)
    Display data pointed to by region references. Data of each region is shown in a separate spreadsheet. The reg. ref. information is stored in strings of the format below:
    - For point selections: "`file_id:obj_id { [point1] [point2] ...) }`", where `[point1]` is in the form of (location_of_dim0, location_of_dim1, ...). For example, `0:800 { (0,1) (2,11) (1,0) (2,4) }`
    - For rectangle selections: "`file_id:obj_id { [corner coordinates1] [corner coordinates2] ... }`", where [corner coordinates1] is in the form of (start_corner)-(oposite_corner). For example, `0:800 { (0,0)-(0,2) (0,11)-(0,13) (2,0)-(2,2) (2,11)-(2,13) }`
    Parameters:
      `reg` - the array of strings that contain the reg. ref information.

  - ### getDataEditingRule

    protected abstract org.eclipse.nebula.widgets.nattable.config.IEditableRule getDataEditingRule​(DataFormat dataObject)

  - ### updateDataConversionSettings

    protected void updateDataConversionSettings()

  - ### updateValueInFile

    public void updateValueInFile()
    Update dataset's value in file. The changes will go to the file.
    Specified by:
      `updateValueInFile` in interface `TableView`

  - ### getDataObject

    public HObject getDataObject()
    Specified by:
      `getDataObject` in interface `DataView`
    Returns:
      the data object displayed in this data viewer

  - ### getTable

    public Object getTable()
    Specified by:
      `getTable` in interface `TableView`
    Returns:
      the table

  - ### getSelectedRowCount

    public int getSelectedRowCount()
    Specified by:
      `getSelectedRowCount` in interface `TableView`

  - ### getSelectedColumnCount

    public int getSelectedColumnCount()
    Specified by:
      `getSelectedColumnCount` in interface `TableView`

  - ### getSelectionLayer

    public org.eclipse.nebula.widgets.nattable.selection.SelectionLayer getSelectionLayer()

  - ### getDataLayer

    public org.eclipse.nebula.widgets.nattable.layer.DataLayer getDataLayer()

  - ### saveAsText

    protected void saveAsText() throws Exception
    Save data as text.
    Throws:
      `Exception` - if a failure occurred

  - ### saveAsBinary

    protected void saveAsBinary() throws Exception
    Save data as binary.
    Throws:
      `Exception` - if a failure occurred

  - ### importTextData

    protected void importTextData​(String fname)
    Import data values from text file.
    Parameters:
      `fname` - the file to import text from

  - ### importBinaryData

    protected void importBinaryData()
    Import data values from binary file.