Module org.hdfgroup.hdfview
Package hdf.view

# Class HDFView

Object
hdf.view.HDFView

All Implemented Interfaces:
  `DataViewManager`

public class HDFView extends Object implements DataViewManager
HDFView is the main class of this HDF visual tool. It is used to layout the graphical components of the hdfview. The major GUI components of the HDFView include Menubar, Toolbar, TreeView, ContentView, and MessageArea. The HDFView is designed in such a way that it does not have direct access to the HDF library. All the HDF library access is done through HDF objects. Therefore, the HDFView package depends on the object package but not the library package. The source code of the view package (hdf.view) should be compiled with the library package (hdf.hdflib and hdf.hdf5lib).

Version:
  2.4 2015
Author:
  Jordan T. Henderson

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `viewerState`
  State of refresh.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HDFView(String root, String start_dir)`
  Constructs HDFView with a given root directory, where the HDFView is installed, and opens the given files in the viewer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDataView(DataView dataView)`
  Data content is displayed, add the dataview to the main windows
  `void`
  `closeFile(FileFormat theFile)`
  close the file currently selected in the application
  `final void`
  `executeTimer(boolean toggleTimer)`
  Start stop a timer.
  `DataView`
  `getDataView(HObject dataObject)`
  Returns DataView that contains the specified data object.
  `static final List<String>`
  `getListOfImageViews()`
  `static final List<?>`
  `getListOfMetaDataViews()`
  `static final List<?>`
  `getListOfPaletteViews()`
  `static final List<?>`
  `getListOfTableViews()`
  `static final List<String>`
  `getListOfTreeViews()`
  `boolean`
  `getTestState()`
  Get the testing state that determines if HDFView is being executed for GUI testing.
  `TreeView`
  `getTreeView()`
  `org.eclipse.swt.widgets.Combo`
  `getUrlBar()`
  `static void`
  `main(String[] args)`
  The starting point of this application.
  `org.eclipse.swt.widgets.Shell`
  `openMainWindow(List<File> flist, int width, int height, int x, int y)`
  Creates HDFView with a given size, and opens the given files in the viewer.
  `void`
  `removeDataView(DataView dataView)`
  Data content is closed, remove the dataview from the main window
  `void`
  `runMainWindow()`
  switch processing to the main application window
  `void`
  `setTestState(boolean testing)`
  Set the testing state that determines if HDFView is being executed for GUI testing.
  `void`
  `showError(String errMsg)`
  Display error message
  `void`
  `showMetaData(HObject obj)`
  Display the metadata view for an object
  `void`
  `showStatus(String msg)`
  Display feedback message.
  `void`
  `writeDataToFile(FileFormat theFile)`
  Write the change of data to the given file.

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

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

- ## Field Details

  - ### viewerState

    public boolean viewerState
    State of refresh.

- ## Constructor Details

  - ### HDFView

    public HDFView(String root, String start_dir)
    Constructs HDFView with a given root directory, where the HDFView is installed, and opens the given files in the viewer.
    Parameters:
      `root` - the directory where the HDFView is installed.
      `start_dir` - the starting directory for file searches

- ## Method Details

  - ### openMainWindow

    public org.eclipse.swt.widgets.Shell openMainWindow(List<File> flist, int width, int height, int x, int y)
    Creates HDFView with a given size, and opens the given files in the viewer.
    Parameters:
      `flist` - a list of files to open.
      `width` - the width of the app in pixels
      `height` - the height of the app in pixels
      `x` - the coord x of the app in pixels
      `y` - the coord y of the app in pixels
    Returns:
      the newly-created HDFView Shell

  - ### runMainWindow

    public void runMainWindow()
    switch processing to the main application window

  - ### getListOfTreeViews

    public static final List<String> getListOfTreeViews()
    Returns:
      a list of treeview implementations.

  - ### getListOfImageViews

    public static final List<String> getListOfImageViews()
    Returns:
      a list of imageview implementations.

  - ### getListOfTableViews

    public static final List<?> getListOfTableViews()
    Returns:
      a list of tableview implementations.

  - ### getListOfMetaDataViews

    public static final List<?> getListOfMetaDataViews()
    Returns:
      a list of metaDataview implementations.

  - ### getListOfPaletteViews

    public static final List<?> getListOfPaletteViews()
    Returns:
      a list of paletteview implementations.

  - ### getTreeView

    public TreeView getTreeView()
    Specified by:
      `getTreeView` in interface `DataViewManager`
    Returns:
      the current TreeView

  - ### getUrlBar

    public org.eclipse.swt.widgets.Combo getUrlBar()
    Returns:
      the combobox associated with a URL entry.

  - ### executeTimer

    public final void executeTimer(boolean toggleTimer)
    Start stop a timer.
    Specified by:
      `executeTimer` in interface `DataViewManager`
    Parameters:
      `toggleTimer` - -- true: start timer, false stop timer.

  - ### showStatus

    public void showStatus(String msg)
    Display feedback message.
    Specified by:
      `showStatus` in interface `DataViewManager`
    Parameters:
      `msg` - the message to display.

  - ### showError

    public void showError(String errMsg)
    Display error message
    Specified by:
      `showError` in interface `DataViewManager`
    Parameters:
      `errMsg` - the error message to display

  - ### showMetaData

    public void showMetaData(HObject obj)
    Display the metadata view for an object
    Parameters:
      `obj` - the object containing the metadata to show

  - ### closeFile

    public void closeFile(FileFormat theFile)
    close the file currently selected in the application
    Parameters:
      `theFile` - the file selected or specified

  - ### writeDataToFile

    public void writeDataToFile(FileFormat theFile)
    Write the change of data to the given file.
    Parameters:
      `theFile` - The file to be updated.

  - ### addDataView

    public void addDataView(DataView dataView)
    Description copied from interface: `DataViewManager`
    Data content is displayed, add the dataview to the main windows
    Specified by:
      `addDataView` in interface `DataViewManager`
    Parameters:
      `dataView` - the dataView whose presence in the main view is to be added.

  - ### removeDataView

    public void removeDataView(DataView dataView)
    Description copied from interface: `DataViewManager`
    Data content is closed, remove the dataview from the main window
    Specified by:
      `removeDataView` in interface `DataViewManager`
    Parameters:
      `dataView` - the dataView whose presence in the main view is to be removed.

  - ### getDataView

    public DataView getDataView(HObject dataObject)
    Description copied from interface: `DataViewManager`
    Returns DataView that contains the specified data object. It is useful to avoid redundant display of data object that is opened already.
    Specified by:
      `getDataView` in interface `DataViewManager`
    Parameters:
      `dataObject` - the object whose presence in the main view is to be tested.
    Returns:
      DataView contains the specified data object, null if the data object is not displayed.

  - ### setTestState

    public void setTestState(boolean testing)
    Set the testing state that determines if HDFView is being executed for GUI testing.
    Parameters:
      `testing` - Provides SWTBot native dialog compatibility workarounds if set to true.

  - ### getTestState

    public boolean getTestState()
    Get the testing state that determines if HDFView is being executed for GUI testing.
    Returns:
      true if HDFView is being executed for GUI testing.

  - ### main

    public static void main(String[] args)
    The starting point of this application.

         Usage: java(w)
                -Dhdf.hdf5lib.H5.hdf5lib="your HDF5 library path"
                -Dhdf.hdflib.HDFLibrary.hdflib="your HDF4 library path"
                -root "the directory where the HDFView is installed"
                -start "the directory HDFView searches for files"
                -geometry or -g "the preferred window size as WIDTHxHEIGHT+XOFF+YOFF"
                -java.version "show the version of jave used to build the HDFView and exit"
                [filename] "the file to open"

    Parameters:
      `args` - the command line arguments