javax.swing

Class JTree.AccessibleJTree.AccessibleJTreeNode

protected class JTree.AccessibleJTree.AccessibleJTreeNode extends AccessibleContext implements Accessible, AccessibleComponent, AccessibleSelection, AccessibleAction

This class implements accessibility support for the JTree child. It provides an implementation of the Java Accessibility API appropriate to tree nodes.
Constructor Summary
AccessibleJTreeNode(JTree t, TreePath p, Accessible ap)
Constructs an AccessibleJTreeNode
Method Summary
voidaddAccessibleSelection(int i)
Adds the specified selected item in the object to the object's selection.
voidaddFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component.
voidaddPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener to the listener list.
voidclearAccessibleSelection()
Clears the selection in the object, so that nothing in the object is selected.
booleancontains(Point p)
Checks whether the specified point is within this object's bounds, where the point's x and y coordinates are defined to be relative to the coordinate system of the object.
booleandoAccessibleAction(int i)
Perform the specified Action on the tree node.
AccessibleActiongetAccessibleAction()
Get the AccessibleAction associated with this object.
intgetAccessibleActionCount()
Returns the number of accessible actions available in this tree node.
StringgetAccessibleActionDescription(int i)
Return a description of the specified action of the tree node.
AccessiblegetAccessibleAt(Point p)
Returns the Accessible child, if one exists, contained at the local coordinate Point.
AccessiblegetAccessibleChild(int i)
Return the specified Accessible child of the object.
intgetAccessibleChildrenCount()
Returns the number of accessible children in the object.
AccessibleComponentgetAccessibleComponent()
Get the AccessibleComponent associated with this object.
AccessibleContextgetAccessibleContext()
Get the AccessibleContext associated with this tree node.
StringgetAccessibleDescription()
Get the accessible description of this object.
intgetAccessibleIndexInParent()
Get the index of this object in its accessible parent.
StringgetAccessibleName()
Get the accessible name of this object.
AccessiblegetAccessibleParent()
Get the Accessible parent of this object.
AccessibleRolegetAccessibleRole()
Get the role of this object.
AccessibleSelectiongetAccessibleSelection()
Get the AccessibleSelection associated with this object if one exists.
AccessiblegetAccessibleSelection(int i)
Returns an Accessible representing the specified selected item in the object.
intgetAccessibleSelectionCount()
Returns the number of items currently selected.
AccessibleStateSetgetAccessibleStateSet()
Get the state set of this object.
AccessibleTextgetAccessibleText()
Get the AccessibleText associated with this object if one exists.
AccessibleValuegetAccessibleValue()
Get the AccessibleValue associated with this object if one exists.
ColorgetBackground()
Get the background color of this object.
RectanglegetBounds()
Gets the bounds of this object in the form of a Rectangle object.
CursorgetCursor()
Gets the Cursor of this object.
FontgetFont()
Gets the Font of this object.
FontMetricsgetFontMetrics(Font f)
Gets the FontMetrics of this object.
ColorgetForeground()
Get the foreground color of this object.
LocalegetLocale()
Gets the locale of the component.
PointgetLocation()
Gets the location of the object relative to the parent in the form of a point specifying the object's top-left corner in the screen's coordinate space.
protected PointgetLocationInJTree()
Returns the location in the tree.
PointgetLocationOnScreen()
Returns the location of the object on the screen.
DimensiongetSize()
Returns the size of this object in the form of a Dimension object.
booleanisAccessibleChildSelected(int i)
Returns true if the current child of this object is selected.
booleanisEnabled()
Determines if the object is enabled.
booleanisFocusTraversable()
Returns whether this object can accept focus or not.
booleanisShowing()
Determines if the object is showing.
booleanisVisible()
Determines if the object is visible.
voidremoveAccessibleSelection(int i)
Removes the specified selected item in the object from the object's selection.
voidremoveFocusListener(FocusListener l)
Removes the specified focus listener so it no longer receives focus events from this component.
voidremovePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeListener from the listener list.
voidrequestFocus()
Requests focus for this object.
voidselectAllAccessibleSelection()
Causes every selected item in the object to be selected if the object supports multiple selections.
voidsetAccessibleDescription(String s)
Set the accessible description of this object.
voidsetAccessibleName(String s)
Set the localized accessible name of this object.
voidsetBackground(Color c)
Set the background color of this object.
voidsetBounds(Rectangle r)
Sets the bounds of this object in the form of a Rectangle object.
voidsetCursor(Cursor c)
Sets the Cursor of this object.
voidsetEnabled(boolean b)
Sets the enabled state of the object.
voidsetFont(Font f)
Sets the Font of this object.
voidsetForeground(Color c)
Sets the foreground color of this object.
voidsetLocation(Point p)
Sets the location of the object relative to the parent.
voidsetSize(Dimension d)
Resizes this object so that it has width and height.
voidsetVisible(boolean b)
Sets the visible state of the object.

Constructor Detail

AccessibleJTreeNode

public AccessibleJTreeNode(JTree t, TreePath p, Accessible ap)
Constructs an AccessibleJTreeNode

Parameters: t - the current tree p - the current path to be dealt with ap - the accessible object to use

Method Detail

addAccessibleSelection

public void addAccessibleSelection(int i)
Adds the specified selected item in the object to the object's selection.

Parameters: i - the i-th child of this node.

addFocusListener

public void addFocusListener(FocusListener l)
Adds the specified focus listener to receive focus events from this component.

Parameters: l - the new focus listener

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeListener to the listener list.

Parameters: l - the new property change listener

clearAccessibleSelection

public void clearAccessibleSelection()
Clears the selection in the object, so that nothing in the object is selected.

contains

public boolean contains(Point p)
Checks whether the specified point is within this object's bounds, where the point's x and y coordinates are defined to be relative to the coordinate system of the object.

Parameters: p - the point to check

Returns: true if p is in the bounds

doAccessibleAction

public boolean doAccessibleAction(int i)
Perform the specified Action on the tree node.

Parameters: i - the i-th action to perform

Returns: true if the the action was performed; else false.

getAccessibleAction

public AccessibleAction getAccessibleAction()
Get the AccessibleAction associated with this object.

Returns: the action

getAccessibleActionCount

public int getAccessibleActionCount()
Returns the number of accessible actions available in this tree node.

Returns: the number of actions

getAccessibleActionDescription

public String getAccessibleActionDescription(int i)
Return a description of the specified action of the tree node.

Parameters: i - the i-th action's description

Returns: a description of the action

getAccessibleAt

public Accessible getAccessibleAt(Point p)
Returns the Accessible child, if one exists, contained at the local coordinate Point.

Parameters: p - the point of the accessible

Returns: the accessible at point p if it exists

getAccessibleChild

public Accessible getAccessibleChild(int i)
Return the specified Accessible child of the object.

Parameters: i - the i-th child of the current path

Returns: the child if it exists

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children in the object.

Returns: the number of children the current node has

getAccessibleComponent

public AccessibleComponent getAccessibleComponent()
Get the AccessibleComponent associated with this object.

Returns: the accessible component if it is supported.

getAccessibleContext

public AccessibleContext getAccessibleContext()
Get the AccessibleContext associated with this tree node.

Returns: an instance of this class

getAccessibleDescription

public String getAccessibleDescription()
Get the accessible description of this object.

Returns: the accessible description

getAccessibleIndexInParent

public int getAccessibleIndexInParent()
Get the index of this object in its accessible parent.

Returns: the index of this in the parent.

getAccessibleName

public String getAccessibleName()
Get the accessible name of this object.

Returns: the accessible name

getAccessibleParent

public Accessible getAccessibleParent()
Get the Accessible parent of this object.

Returns: the accessible parent if it exists.

getAccessibleRole

public AccessibleRole getAccessibleRole()
Get the role of this object.

Returns: the accessible role

getAccessibleSelection

public AccessibleSelection getAccessibleSelection()
Get the AccessibleSelection associated with this object if one exists.

Returns: the accessible selection for this.

getAccessibleSelection

public Accessible getAccessibleSelection(int i)
Returns an Accessible representing the specified selected item in the object.

Returns: the accessible representing a certain selected item.

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of items currently selected.

Returns: the number of items selected.

getAccessibleStateSet

public AccessibleStateSet getAccessibleStateSet()
Get the state set of this object.

Returns: the state set for this object

getAccessibleText

public AccessibleText getAccessibleText()
Get the AccessibleText associated with this object if one exists.

Returns: the accessible text

getAccessibleValue

public AccessibleValue getAccessibleValue()
Get the AccessibleValue associated with this object if one exists.

Returns: the accessible value if it exists

getBackground

public Color getBackground()
Get the background color of this object.

Returns: the color of the background.

getBounds

public Rectangle getBounds()
Gets the bounds of this object in the form of a Rectangle object.

Returns: the bounds of the current node.

getCursor

public Cursor getCursor()
Gets the Cursor of this object.

Returns: the cursor for the current node

getFont

public Font getFont()
Gets the Font of this object.

Returns: the font for the current node

getFontMetrics

public FontMetrics getFontMetrics(Font f)
Gets the FontMetrics of this object.

Parameters: f - the current font.

Returns: the font metrics for the given font.

getForeground

public Color getForeground()
Get the foreground color of this object.

Returns: the foreground for this object.

getLocale

public Locale getLocale()
Gets the locale of the component.

Returns: the locale of the component.

getLocation

public Point getLocation()
Gets the location of the object relative to the parent in the form of a point specifying the object's top-left corner in the screen's coordinate space.

Returns: the location of the current node.

getLocationInJTree

protected Point getLocationInJTree()
Returns the location in the tree.

Returns: the location in the JTree.

getLocationOnScreen

public Point getLocationOnScreen()
Returns the location of the object on the screen.

Returns: the location of the object on the screen.

getSize

public Dimension getSize()
Returns the size of this object in the form of a Dimension object.

Returns: the size of the object

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int i)
Returns true if the current child of this object is selected.

Parameters: i - the child of the current node

Returns: true if the child is selected.

isEnabled

public boolean isEnabled()
Determines if the object is enabled.

Returns: true if the tree is enabled

isFocusTraversable

public boolean isFocusTraversable()
Returns whether this object can accept focus or not.

Returns: true, it is always focus traversable

isShowing

public boolean isShowing()
Determines if the object is showing.

Returns: true if the object is visible and the parent is visible.

isVisible

public boolean isVisible()
Determines if the object is visible.

Returns: true if the object is visible.

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Removes the specified selected item in the object from the object's selection.

Parameters: i - the specified item to remove

removeFocusListener

public void removeFocusListener(FocusListener l)
Removes the specified focus listener so it no longer receives focus events from this component.

Parameters: l - the focus listener to remove

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeListener from the listener list.

Parameters: l - the property change listener to remove.

requestFocus

public void requestFocus()
Requests focus for this object.

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Causes every selected item in the object to be selected if the object supports multiple selections.

setAccessibleDescription

public void setAccessibleDescription(String s)
Set the accessible description of this object.

Parameters: s - the string to set the accessible description to.

setAccessibleName

public void setAccessibleName(String s)
Set the localized accessible name of this object.

Parameters: s - the string to set the accessible name to.

setBackground

public void setBackground(Color c)
Set the background color of this object.

Parameters: c - the color to set the background to.

setBounds

public void setBounds(Rectangle r)
Sets the bounds of this object in the form of a Rectangle object.

Parameters: r - the bounds to set the object o

setCursor

public void setCursor(Cursor c)
Sets the Cursor of this object.

Parameters: c - the new cursor

setEnabled

public void setEnabled(boolean b)
Sets the enabled state of the object.

Parameters: b - boolean to enable or disable object

setFont

public void setFont(Font f)
Sets the Font of this object.

Parameters: f - the new font.

setForeground

public void setForeground(Color c)
Sets the foreground color of this object.

Parameters: c - the new foreground color.

setLocation

public void setLocation(Point p)
Sets the location of the object relative to the parent.

Parameters: p - the new location for the object.

setSize

public void setSize(Dimension d)
Resizes this object so that it has width and height.

Parameters: d - the new size for the object.

setVisible

public void setVisible(boolean b)
Sets the visible state of the object.

Parameters: b - sets the objects visibility.