Package uk.ac.starlink.vo

# Class FeatureTreeModel

java.lang.Object
uk.ac.starlink.vo.FeatureTreeModel

All Implemented Interfaces:
  `TreeModel`

public class FeatureTreeModel extends Object implements TreeModel
Model for tree which displays ADQL language features. This includes standard and user-defined functions, as well as other mandatory and declared language features.

Since:
  19 Feb 2024
Author:
  Mark Taylor
See Also:
  - TAPRegExt 1.0 sec 2.3

## Constructor Summary

Constructors
Constructor
Description
`FeatureTreeModel(JScrollPane treeScroller)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addTreeModelListener(TreeModelListener l)`
`static TreeCellRenderer`
`createRenderer()`
Returns a renderer that can be used for the JTree displaying this model.
`Object`
`getChild(Object parent, int index)`
`int`
`getChildCount(Object parent)`
`int`
`getIndexOfChild(Object parent, Object child)`
`Object`
`getRoot()`
`boolean`
`isLeaf(Object node)`
`void`
`removeTreeModelListener(TreeModelListener l)`
`void`
`setAdqlVersion(AdqlVersion adqlVersion)`
Sets the ADQL version for which this tree should display information.
`void`
`setCapability(TapCapability tcap)`
Set the content of this tree according to a supplied TapCapability.
`void`
`valueForPathChanged(TreePath path, Object newValue)`

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

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

## Constructor Details

### FeatureTreeModel

public FeatureTreeModel(JScrollPane treeScroller)
Constructor. The scroll pane containing the tree which this model will be displayed has to be supplied, since some rendering gymnastics are required when the scroll pane viewport is resized.

Parameters:
  `treeScroller` - scroll pane containing tree

## Method Details

### setCapability

public void setCapability(TapCapability tcap)
Set the content of this tree according to a supplied TapCapability.

Parameters:
  `tcap` - capability

### setAdqlVersion

public void setAdqlVersion(AdqlVersion adqlVersion)
Sets the ADQL version for which this tree should display information.

Parameters:
  `adqlVersion` - version

### getRoot

public Object getRoot()

Specified by:
  `getRoot` in interface `TreeModel`

### getChildCount

public int getChildCount(Object parent)

Specified by:
  `getChildCount` in interface `TreeModel`

### getChild

public Object getChild(Object parent, int index)

Specified by:
  `getChild` in interface `TreeModel`

### isLeaf

public boolean isLeaf(Object node)

Specified by:
  `isLeaf` in interface `TreeModel`

### getIndexOfChild

public int getIndexOfChild(Object parent, Object child)

Specified by:
  `getIndexOfChild` in interface `TreeModel`

### addTreeModelListener

public void addTreeModelListener(TreeModelListener l)

Specified by:
  `addTreeModelListener` in interface `TreeModel`

### removeTreeModelListener

public void removeTreeModelListener(TreeModelListener l)

Specified by:
  `removeTreeModelListener` in interface `TreeModel`

### valueForPathChanged

public void valueForPathChanged(TreePath path, Object newValue)

Specified by:
  `valueForPathChanged` in interface `TreeModel`

### createRenderer

public static TreeCellRenderer createRenderer()
Returns a renderer that can be used for the JTree displaying this model.

Returns:
  renderer