Object
hdf.view.TreeView.DefaultTreeView
- All Implemented Interfaces:
- TreeView
public class DefaultTreeView extends Object implements TreeView
TreeView defines APIs for opening files and displaying the file structure in a tree structure.
TreeView uses folders and leaf items to represent groups and data objects in the file. You can expand or collapse folders to navigate data objects in the file.
From the TreeView, you can open data content or metadata of the selected object. You can select object(s) to delete or add new objects to the file.
- Version:
- 2.4 12//2015
- Author:
- Jordan T. Henderson
- 
Constructor SummaryConstructors Constructor Description DefaultTreeView(org.eclipse.swt.widgets.Composite parent, DataViewManager theView)
- 
Method SummaryModifier and Type Method Description org.eclipse.swt.widgets.TreeItemaddObject(HObject obj, Group parentGroup)Adds an already created HObject to the tree under the TreeItem containing the specified parent group.voidcloseFile(FileFormat file)Close a fileorg.eclipse.swt.widgets.TreeItemfindTreeItem(HObject obj)Returns the tree item that contains the given data object.List<FileFormat>getCurrentFiles()HObjectgetCurrentObject()FileFormatgetSelectedFile()Gets the selected file.org.eclipse.swt.widgets.TreegetTree()FileFormatopenFile(String filename, int accessID)Opens a file and retrieves the file structure of the file.FileFormatreopenFile(FileFormat fileFormat, int newFileAccessMode)voidsaveFile(FileFormat file)Save a filevoidsetDefaultDisplayMode(boolean displaymode)change the display option.DataViewshowDataContent(HObject dataObject)Display the content of a data object.MetaDataViewshowMetaData(HObject dataObject)Displays the meta data of a data object.voidupdateFont(org.eclipse.swt.graphics.Font font)voidupdateItemIcon(HObject obj)Updates the icon for the TreeItem representing the given HObject.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
DefaultTreeView
 
- 
- 
Method Details- 
addObjectAdds an already created HObject to the tree under the TreeItem containing the specified parent group.
- 
openFileOpens a file and retrieves the file structure of the file. It also can be used to create a new file by setting the accessID to FileFormat.CREATE.Subclasses must implement this function to take appropriate steps to open a file. - Specified by:
- openFilein interface- TreeView
- Parameters:
- filename- the name of the file to open.
- accessID- identifier for the file access. Valid value of accessID is:- FileFormat.READ --- allow read-only access to file.
- FileFormat.WRITE --- allow read and write access to file.
- FileFormat.CREATE --- create a new file.
 
- Returns:
- the FileFormat of this file if successful; otherwise returns null.
- Throws:
- Exception- if a failure occurred
 
- 
reopenFile- Specified by:
- reopenFilein interface- TreeView
- Throws:
- Exception
 
- 
closeFileClose a file
- 
saveFileSave a file
- 
findTreeItemReturns the tree item that contains the given data object.- Specified by:
- findTreeItemin interface- TreeView
- Parameters:
- obj- the object to find
- Returns:
- the tree item that contains the given data object.
 
- 
setDefaultDisplayModechange the display option.- Specified by:
- setDefaultDisplayModein interface- TreeView
- Parameters:
- displaymode- the default displaymode
 
- 
getSelectedFileGets the selected file. When multiple files are open, we need to know which file is currently selected.- Specified by:
- getSelectedFilein interface- TreeView
- Returns:
- the FileFormat of the currently selected file.
 
- 
getCurrentObject- Specified by:
- getCurrentObjectin interface- TreeView
- Returns:
- the currently selected object in the tree.
 
- 
getTree
- 
getCurrentFiles- Specified by:
- getCurrentFilesin interface- TreeView
- Returns:
- the list of currently open files.
 
- 
showDataContentDisplay the content of a data object.- Specified by:
- showDataContentin interface- TreeView
- Parameters:
- dataObject- the data object
- Returns:
- the DataView that displays the data content
- Throws:
- Exception- if a failure occurred
 
- 
showMetaDataDisplays the meta data of a data object.- Specified by:
- showMetaDatain interface- TreeView
- Parameters:
- dataObject- the data object
- Returns:
- the MetaDataView that displays the MetaData of the data object
- Throws:
- Exception- if a failure occurred
 
- 
updateFont
- 
updateItemIconUpdates the icon for the TreeItem representing the given HObject. Used to change the icon after a status update, such as adding an attribute to an object.- Parameters:
- obj- the object to update the icon for
 
 
-