Package uk.ac.starlink.vo
Class TapMetaTreeModel
- java.lang.Object
-
- uk.ac.starlink.vo.TapMetaTreeModel
-
- All Implemented Interfaces:
javax.swing.tree.TreeModel
public class TapMetaTreeModel extends java.lang.Object implements javax.swing.tree.TreeModel
TreeModel for representing a TAP table set.- Since:
- 11 Feb 2015
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description TapMetaTreeModel()
Constructs an empty tree model.TapMetaTreeModel(SchemaMeta[] schemas)
Constructs a tree model to display a given table set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTreeModelListener(javax.swing.event.TreeModelListener lnr)
java.lang.Object
getChild(java.lang.Object parent, int index)
int
getChildCount(java.lang.Object parent)
int
getIndexOfChild(java.lang.Object parent, java.lang.Object child)
java.lang.Object
getRoot()
static SchemaMeta
getSchema(javax.swing.tree.TreePath path)
Acquires the schema metadata object, if any, associated with a given tree path.SchemaMeta[]
getSchemas()
Returns the schemas array that forms the root of this tree model.static TableMeta
getTable(javax.swing.tree.TreePath path)
Acquires the table metadata object, if any, associated with a given tree path.boolean
isLeaf(java.lang.Object node)
void
removeTreeModelListener(javax.swing.event.TreeModelListener lnr)
void
setSchemas(SchemaMeta[] schemas)
Sets the content of this tree.void
valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
-
-
-
Constructor Detail
-
TapMetaTreeModel
public TapMetaTreeModel()
Constructs an empty tree model.
-
TapMetaTreeModel
public TapMetaTreeModel(SchemaMeta[] schemas)
Constructs a tree model to display a given table set.- Parameters:
schemas
- schema array defining the table metadata to be represented
-
-
Method Detail
-
setSchemas
public void setSchemas(SchemaMeta[] schemas)
Sets the content of this tree.- Parameters:
schemas
- schema array defining the table metadata to be represented
-
getSchemas
public SchemaMeta[] getSchemas()
Returns the schemas array that forms the root of this tree model.- Returns:
- schema array
-
getRoot
public java.lang.Object getRoot()
- Specified by:
getRoot
in interfacejavax.swing.tree.TreeModel
-
isLeaf
public boolean isLeaf(java.lang.Object node)
- Specified by:
isLeaf
in interfacejavax.swing.tree.TreeModel
-
getChildCount
public int getChildCount(java.lang.Object parent)
- Specified by:
getChildCount
in interfacejavax.swing.tree.TreeModel
-
getChild
public java.lang.Object getChild(java.lang.Object parent, int index)
- Specified by:
getChild
in interfacejavax.swing.tree.TreeModel
-
getIndexOfChild
public int getIndexOfChild(java.lang.Object parent, java.lang.Object child)
- Specified by:
getIndexOfChild
in interfacejavax.swing.tree.TreeModel
-
valueForPathChanged
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
- Specified by:
valueForPathChanged
in interfacejavax.swing.tree.TreeModel
-
addTreeModelListener
public void addTreeModelListener(javax.swing.event.TreeModelListener lnr)
- Specified by:
addTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
removeTreeModelListener
public void removeTreeModelListener(javax.swing.event.TreeModelListener lnr)
- Specified by:
removeTreeModelListener
in interfacejavax.swing.tree.TreeModel
-
getTable
public static TableMeta getTable(javax.swing.tree.TreePath path)
Acquires the table metadata object, if any, associated with a given tree path.- Parameters:
path
- tree path associated with an instance of this class- Returns:
- associated TableMeta object, or null
-
getSchema
public static SchemaMeta getSchema(javax.swing.tree.TreePath path)
Acquires the schema metadata object, if any, associated with a given tree path.- Parameters:
path
- tree path associated with an instance of this class- Returns:
- associated SchemaMeta object, or null
-
-