com.eliad.swing
Class AccessibleGrid

java.lang.Object
  |
  +--javax.accessibility.AccessibleContext
        |
        +--java.awt.Component.AccessibleAWTComponent
              |
              +--java.awt.Container.AccessibleAWTContainer
                    |
                    +--javax.swing.JComponent.AccessibleJComponent
                          |
                          +--com.eliad.swing.AccessibleGrid

public class AccessibleGrid
extends javax.swing.JComponent.AccessibleJComponent
implements javax.accessibility.AccessibleSelection, GridSelectionListener, GridModelListener, RulerModelListener, javax.swing.event.CellEditorListener, java.beans.PropertyChangeListener, javax.accessibility.AccessibleTable

The class used to obtain the accessible role for this object.

See Also:
Serialized Form

Inner Class Summary
protected  class AccessibleGrid.AccessibleGridCell
          The class used to obtain the AccessibleRole for a cell.
protected  class AccessibleGrid.AccessibleGridModelChange
          Describes a change in the accessible table model.
 
Inner classes inherited from class javax.swing.JComponent.AccessibleJComponent
javax.swing.JComponent.AccessibleJComponent.AccessibleContainerHandler, javax.swing.JComponent.AccessibleJComponent.AccessibleFocusHandler
 
Inner classes inherited from class java.awt.Container.AccessibleAWTContainer
java.awt.Container.AccessibleAWTContainer.AccessibleContainerHandler
 
Inner classes inherited from class java.awt.Component.AccessibleAWTComponent
java.awt.Component.AccessibleAWTComponent.AccessibleAWTComponentHandler, java.awt.Component.AccessibleAWTComponent.AccessibleAWTFocusHandler
 
Fields inherited from class javax.swing.JComponent.AccessibleJComponent
accessibleContainerHandler, accessibleFocusHandler
 
Fields inherited from class java.awt.Container.AccessibleAWTContainer
accessibleContainerHandler
 
Fields inherited from class java.awt.Component.AccessibleAWTComponent
accessibleAWTComponentHandler, accessibleAWTFocusHandler
 
Fields inherited from class javax.accessibility.AccessibleContext
ACCESSIBLE_ACTION_PROPERTY, ACCESSIBLE_ACTIVE_DESCENDANT_PROPERTY, ACCESSIBLE_CARET_PROPERTY, ACCESSIBLE_CHILD_PROPERTY, ACCESSIBLE_DESCRIPTION_PROPERTY, ACCESSIBLE_NAME_PROPERTY, ACCESSIBLE_SELECTION_PROPERTY, ACCESSIBLE_STATE_PROPERTY, ACCESSIBLE_TABLE_CAPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_COLUMN_HEADER_CHANGED, ACCESSIBLE_TABLE_MODEL_CHANGED, ACCESSIBLE_TABLE_ROW_DESCRIPTION_CHANGED, ACCESSIBLE_TABLE_ROW_HEADER_CHANGED, ACCESSIBLE_TABLE_SUMMARY_CHANGED, ACCESSIBLE_TEXT_PROPERTY, ACCESSIBLE_VALUE_PROPERTY, ACCESSIBLE_VISIBLE_DATA_PROPERTY, accessibleDescription, accessibleName, accessibleParent
 
Constructor Summary
AccessibleGrid(JSmartGrid grid)
           
 
Method Summary
 void addAccessibleSelection(int i)
          Adds the specified Accessible child of the object to the object's selection.
 void anchorChanged(GridSelectionEvent e)
          Track changes to table cell selections.
 void beforeItemsMoved(RulerModelEvent e)
           
 void clearAccessibleSelection()
          Clears the selection in the object, so that no children in the object are selected.
protected  void columnMoved(int from, int to)
          Track changes of a column repositioning.
protected  void columnsDeleted(int start, int count)
          Track changes to the grid shape (columns deletions).
protected  void columnsInserted(int start, int count)
          Track changes to the grid shape (columns insertions).
protected  void columnsResized(int index)
          Track column resizing.
 void editingCanceled(javax.swing.event.ChangeEvent e)
          Invoked when editing is canceled.
 void editingStopped(javax.swing.event.ChangeEvent e)
          Track changes to a cell's contents.
 javax.accessibility.Accessible getAccessibleAt(int r, int c)
           
 javax.accessibility.Accessible getAccessibleAt(java.awt.Point p)
          Returns the Accessible child, if one exists, contained at the local coordinate Point.
 javax.accessibility.Accessible getAccessibleCaption()
          Returns the caption for the table.
 javax.accessibility.Accessible getAccessibleChild(int i)
          Return the nth Accessible child of the object.
 int getAccessibleChildrenCount()
          Returns the number of accessible children in the object.
 int getAccessibleColumnAtIndex(int i)
           
 int getAccessibleColumnCount()
           
 javax.accessibility.Accessible getAccessibleColumnDescription(int c)
          Return the description of the specified column in the table.
 int getAccessibleColumnExtentAt(int row, int column)
          Returns the number of columns occupied by the Accessible at a given (row, column)
 javax.accessibility.AccessibleTable getAccessibleColumnHeader()
          Return the column headers as an AccessibleTable.
 int getAccessibleIndexAt(int r, int c)
          Returns the index at a given (row, column) in the table
 javax.accessibility.AccessibleRole getAccessibleRole()
          Returns the role of this object.
 int getAccessibleRowAtIndex(int i)
           
 int getAccessibleRowCount()
           
 javax.accessibility.Accessible getAccessibleRowDescription(int r)
          Return the description of the specified row in the table.
 int getAccessibleRowExtentAt(int row, int column)
          Returns the number of rows occupied by the Accessible at a specified row and column in the table.
 javax.accessibility.AccessibleTable getAccessibleRowHeader()
          Return the row headers as an AccessibleTable.
 javax.accessibility.AccessibleSelection getAccessibleSelection()
          Returns the AccessibleSelection associated with this object if one exists.
 javax.accessibility.Accessible getAccessibleSelection(int i)
          Returns an Accessible representing the specified selected child in the object.
 int getAccessibleSelectionCount()
          Returns the number of Accessible children currently selected.
 javax.accessibility.Accessible getAccessibleSummary()
          Returns the summary description of the table.
 javax.accessibility.AccessibleTable getAccessibleTable()
          Gets the AccessibleTable associated with this object if one exists.
 int[] getSelectedAccessibleColumns()
          Returns the selected columns in a table.
 int[] getSelectedAccessibleRows()
          Returns the selected rows in a table.
 void gridDataChanged(GridModelEvent e)
          Track changes to the grid data.
 void gridModelChanged(GridModelEvent e)
          Track global changes to the grid model.
 void gridStructureChanged(GridModelEvent e)
          Track changes to the grid model structure.
 boolean isAccessibleChildSelected(int i)
          Determines if the current child of this object is selected.
 boolean isAccessibleColumnSelected(int c)
          Returns a boolean value indicating whether the specified column is selected
 boolean isAccessibleRowSelected(int r)
          Returns a boolean value indicating whether the specified row is selected
 boolean isAccessibleSelected(int r, int c)
          Returns a boolean value indicating whether the accessible at a given (row, column) is selected
 void propertyChange(java.beans.PropertyChangeEvent e)
          Tracks changes to selection model, column model, etc. so as to be able to re-place listeners and to pass on information to the Accessibility PropertyChange mechanism.
 void rangeChanged(GridSelectionEvent e)
          Track changes to table cell selections.
 void removeAccessibleSelection(int i)
          Removes the specified child of the object from the object's selection.
protected  void rowsDeleted(int start, int count)
          Track changes to the grid shape (row deletions).
protected  void rowsInserted(int start, int count)
          Track changes to the grid shape (row insertions).
protected  void rowsResized(int index)
          Track row resizing.
 void rulerDataChanged(RulerModelEvent e)
           
 void rulerModelChanged(RulerModelEvent e)
           
 void rulerStructureChanged(RulerModelEvent e)
          This is not meant for us!
 void selectAllAccessibleSelection()
          Causes every child of the object to be selected, but only if the JSmartGrid supports multiple selections, and if individual cell selection is enabled.
 void setAccessibleCaption(javax.accessibility.Accessible a)
          Sets the caption for the table.
 void setAccessibleColumnDescription(int c, javax.accessibility.Accessible a)
          Sets the description text of the specified column of the table.
 void setAccessibleColumnHeader(javax.accessibility.AccessibleTable a)
          Return the column headers as an AccessibleTable.
 void setAccessibleRowDescription(int r, javax.accessibility.Accessible a)
          Sets the description text of the specified row of the table.
 void setAccessibleRowHeader(javax.accessibility.AccessibleTable a)
          Return the row headers as an AccessibleTable.
 void setAccessibleSummary(javax.accessibility.Accessible a)
          Sets the summary description of the table.
 
Methods inherited from class javax.swing.JComponent.AccessibleJComponent
addPropertyChangeListener, getAccessibleDescription, getAccessibleName, getAccessibleStateSet, getBorderTitle, removePropertyChangeListener
 
Methods inherited from class java.awt.Component.AccessibleAWTComponent
addFocusListener, contains, getAccessibleComponent, getAccessibleIndexInParent, getAccessibleParent, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getLocale, getLocation, getLocationOnScreen, getSize, isEnabled, isFocusTraversable, isShowing, isVisible, removeFocusListener, requestFocus, setBackground, setBounds, setCursor, setEnabled, setFont, setForeground, setLocation, setSize, setVisible
 
Methods inherited from class javax.accessibility.AccessibleContext
firePropertyChange, getAccessibleAction, getAccessibleIcon, getAccessibleRelationSet, getAccessibleText, getAccessibleValue, setAccessibleDescription, setAccessibleName, setAccessibleParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessibleGrid

public AccessibleGrid(JSmartGrid grid)
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Tracks changes to selection model, column model, etc. so as to be able to re-place listeners and to pass on information to the Accessibility PropertyChange mechanism.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

gridDataChanged

public void gridDataChanged(GridModelEvent e)
Track changes to the grid data.
Specified by:
gridDataChanged in interface GridModelListener

gridModelChanged

public void gridModelChanged(GridModelEvent e)
Track global changes to the grid model.
Specified by:
gridModelChanged in interface GridModelListener

gridStructureChanged

public void gridStructureChanged(GridModelEvent e)
Track changes to the grid model structure.
Specified by:
gridStructureChanged in interface GridModelListener

rowsInserted

protected void rowsInserted(int start,
                            int count)
Track changes to the grid shape (row insertions).

rowsDeleted

protected void rowsDeleted(int start,
                           int count)
Track changes to the grid shape (row deletions).

columnsInserted

protected void columnsInserted(int start,
                               int count)
Track changes to the grid shape (columns insertions).

columnsDeleted

protected void columnsDeleted(int start,
                              int count)
Track changes to the grid shape (columns deletions).

columnMoved

protected void columnMoved(int from,
                           int to)
Track changes of a column repositioning.
See Also:
RulerModelListener

rowsResized

protected void rowsResized(int index)
Track row resizing.
See Also:
RulerModelListener

columnsResized

protected void columnsResized(int index)
Track column resizing.
See Also:
RulerModelListener

rulerModelChanged

public void rulerModelChanged(RulerModelEvent e)
Specified by:
rulerModelChanged in interface RulerModelListener

rulerStructureChanged

public void rulerStructureChanged(RulerModelEvent e)
This is not meant for us!
Specified by:
rulerStructureChanged in interface RulerModelListener

rulerDataChanged

public void rulerDataChanged(RulerModelEvent e)
Specified by:
rulerDataChanged in interface RulerModelListener

beforeItemsMoved

public void beforeItemsMoved(RulerModelEvent e)
                      throws java.beans.PropertyVetoException
Specified by:
beforeItemsMoved in interface RulerModelListener

editingStopped

public void editingStopped(javax.swing.event.ChangeEvent e)
Track changes to a cell's contents. Invoked when editing is finished. The changes are saved, the editor object is discarded, and the cell is rendered once again.
Specified by:
editingStopped in interface javax.swing.event.CellEditorListener
See Also:
CellEditorListener

editingCanceled

public void editingCanceled(javax.swing.event.ChangeEvent e)
Invoked when editing is canceled. The editor object is discarded and the cell is rendered once again.
Specified by:
editingCanceled in interface javax.swing.event.CellEditorListener
See Also:
CellEditorListener

rangeChanged

public void rangeChanged(GridSelectionEvent e)
Track changes to table cell selections.
Specified by:
rangeChanged in interface GridSelectionListener

anchorChanged

public void anchorChanged(GridSelectionEvent e)
Track changes to table cell selections.
Specified by:
anchorChanged in interface GridSelectionListener

getAccessibleSelection

public javax.accessibility.AccessibleSelection getAccessibleSelection()
Returns the AccessibleSelection associated with this object if one exists. Otherwise returns null.
Returns:
the AccessibleSelection, or null
Overrides:
getAccessibleSelection in class javax.accessibility.AccessibleContext

getAccessibleRole

public javax.accessibility.AccessibleRole getAccessibleRole()
Returns the role of this object.
Returns:
an instance of AccessibleRole describing the role of the object
Overrides:
getAccessibleRole in class javax.swing.JComponent.AccessibleJComponent
See Also:
AccessibleRole

getAccessibleAt

public javax.accessibility.Accessible getAccessibleAt(java.awt.Point p)
Returns the Accessible child, if one exists, contained at the local coordinate Point.
Parameters:
p - the point defining the top-left corner of the Accessible, given in the coordinate space of the object's parent.
Returns:
the Accessible, if it exists, at the specified location; else null
Overrides:
getAccessibleAt in class java.awt.Container.AccessibleAWTContainer

getAccessibleChildrenCount

public int getAccessibleChildrenCount()
Returns the number of accessible children in the object. If all of the children of this object implement Accessible, than this method should return the number of children of this object.
Returns:
the number of accessible children in the object.
Overrides:
getAccessibleChildrenCount in class javax.swing.JComponent.AccessibleJComponent

getAccessibleChild

public javax.accessibility.Accessible getAccessibleChild(int i)
Return the nth Accessible child of the object.
Parameters:
i - zero-based index of child
Returns:
the nth Accessible child of the object
Overrides:
getAccessibleChild in class javax.swing.JComponent.AccessibleJComponent

getAccessibleSelectionCount

public int getAccessibleSelectionCount()
Returns the number of Accessible children currently selected. If no children are selected, the return value will be 0.
Specified by:
getAccessibleSelectionCount in interface javax.accessibility.AccessibleSelection
Returns:
the number of items currently selected.

getAccessibleSelection

public javax.accessibility.Accessible getAccessibleSelection(int i)
Returns an Accessible representing the specified selected child in the object. If there isn't a selection, or there are fewer children selected than the integer passed in, the return value will be null.

Note that the index represents the i-th selected child, which is different from the i-th child.

Specified by:
getAccessibleSelection in interface javax.accessibility.AccessibleSelection
Parameters:
i - the zero-based index of selected children
Returns:
the i-th selected child
See Also:
getAccessibleSelectionCount()

isAccessibleChildSelected

public boolean isAccessibleChildSelected(int i)
Determines if the current child of this object is selected.
Specified by:
isAccessibleChildSelected in interface javax.accessibility.AccessibleSelection
Parameters:
i - the zero-based index of the child in this Accessible object.
Returns:
true if the current child of this object is selected
See Also:
AccessibleContext.getAccessibleChild(int)

addAccessibleSelection

public void addAccessibleSelection(int i)
Adds the specified Accessible child of the object to the object's selection. If the object supports multiple selections, the specified child is added to any existing selection, otherwise it replaces any existing selection in the object. If the specified child is already selected, this method has no effect. This method only works on JTables which have individual cell selection enabled.
Specified by:
addAccessibleSelection in interface javax.accessibility.AccessibleSelection
Parameters:
i - the zero-based index of the child
See Also:
AccessibleContext.getAccessibleChild(int)

removeAccessibleSelection

public void removeAccessibleSelection(int i)
Removes the specified child of the object from the object's selection. If the specified item isn't currently selected, this method has no effect. This method only works on JTables which have individual cell selection enabled.
Specified by:
removeAccessibleSelection in interface javax.accessibility.AccessibleSelection
Parameters:
i - the zero-based index of the child
See Also:
AccessibleContext.getAccessibleChild(int)

clearAccessibleSelection

public void clearAccessibleSelection()
Clears the selection in the object, so that no children in the object are selected.
Specified by:
clearAccessibleSelection in interface javax.accessibility.AccessibleSelection

selectAllAccessibleSelection

public void selectAllAccessibleSelection()
Causes every child of the object to be selected, but only if the JSmartGrid supports multiple selections, and if individual cell selection is enabled.
Specified by:
selectAllAccessibleSelection in interface javax.accessibility.AccessibleSelection

getAccessibleTable

public javax.accessibility.AccessibleTable getAccessibleTable()
Gets the AccessibleTable associated with this object if one exists. Otherwise returns null.
Overrides:
getAccessibleTable in class javax.accessibility.AccessibleContext

getAccessibleCaption

public javax.accessibility.Accessible getAccessibleCaption()
Returns the caption for the table.
Specified by:
getAccessibleCaption in interface javax.accessibility.AccessibleTable
Returns:
the caption for the table

setAccessibleCaption

public void setAccessibleCaption(javax.accessibility.Accessible a)
Sets the caption for the table.
Specified by:
setAccessibleCaption in interface javax.accessibility.AccessibleTable
Parameters:
a - the caption for the table

getAccessibleSummary

public javax.accessibility.Accessible getAccessibleSummary()
Returns the summary description of the table.
Specified by:
getAccessibleSummary in interface javax.accessibility.AccessibleTable
Returns:
the summary description of the table

setAccessibleSummary

public void setAccessibleSummary(javax.accessibility.Accessible a)
Sets the summary description of the table.
Specified by:
setAccessibleSummary in interface javax.accessibility.AccessibleTable
Parameters:
a - the summary description of the table

getAccessibleRowCount

public int getAccessibleRowCount()
Specified by:
getAccessibleRowCount in interface javax.accessibility.AccessibleTable

getAccessibleColumnCount

public int getAccessibleColumnCount()
Specified by:
getAccessibleColumnCount in interface javax.accessibility.AccessibleTable

getAccessibleAt

public javax.accessibility.Accessible getAccessibleAt(int r,
                                                      int c)
Specified by:
getAccessibleAt in interface javax.accessibility.AccessibleTable

getAccessibleRowExtentAt

public int getAccessibleRowExtentAt(int row,
                                    int column)
Returns the number of rows occupied by the Accessible at a specified row and column in the table.
Specified by:
getAccessibleRowExtentAt in interface javax.accessibility.AccessibleTable
Returns:
the number of rows occupied by the Accessible at a specified row and column in the table.

getAccessibleColumnExtentAt

public int getAccessibleColumnExtentAt(int row,
                                       int column)
Returns the number of columns occupied by the Accessible at a given (row, column)
Specified by:
getAccessibleColumnExtentAt in interface javax.accessibility.AccessibleTable
Returns:
the number of columns occupied by the Accessible at a specified row and column in the table.

getAccessibleRowHeader

public javax.accessibility.AccessibleTable getAccessibleRowHeader()
Return the row headers as an AccessibleTable.
Specified by:
getAccessibleRowHeader in interface javax.accessibility.AccessibleTable
Returns:
an AccessibleTable representing the row headers

setAccessibleRowHeader

public void setAccessibleRowHeader(javax.accessibility.AccessibleTable a)
Return the row headers as an AccessibleTable.
Specified by:
setAccessibleRowHeader in interface javax.accessibility.AccessibleTable
Returns:
an AccessibleTable representing the row headers

getAccessibleColumnHeader

public javax.accessibility.AccessibleTable getAccessibleColumnHeader()
Return the column headers as an AccessibleTable.
Specified by:
getAccessibleColumnHeader in interface javax.accessibility.AccessibleTable
Returns:
an AccessibleTable representing the column headers

setAccessibleColumnHeader

public void setAccessibleColumnHeader(javax.accessibility.AccessibleTable a)
Return the column headers as an AccessibleTable.
Specified by:
setAccessibleColumnHeader in interface javax.accessibility.AccessibleTable
Returns:
an AccessibleTable representing the column headers

getAccessibleRowDescription

public javax.accessibility.Accessible getAccessibleRowDescription(int r)
Return the description of the specified row in the table.
Specified by:
getAccessibleRowDescription in interface javax.accessibility.AccessibleTable
Parameters:
r - zero-based row of the table
Returns:
the description of the row

setAccessibleRowDescription

public void setAccessibleRowDescription(int r,
                                        javax.accessibility.Accessible a)
Sets the description text of the specified row of the table.
Specified by:
setAccessibleRowDescription in interface javax.accessibility.AccessibleTable
Parameters:
r - zero-based row of the table
a - the description of the row

getAccessibleColumnDescription

public javax.accessibility.Accessible getAccessibleColumnDescription(int c)
Return the description of the specified column in the table.
Specified by:
getAccessibleColumnDescription in interface javax.accessibility.AccessibleTable
Parameters:
c - zero-based column of the table
Returns:
the description of the column

setAccessibleColumnDescription

public void setAccessibleColumnDescription(int c,
                                           javax.accessibility.Accessible a)
Sets the description text of the specified column of the table.
Specified by:
setAccessibleColumnDescription in interface javax.accessibility.AccessibleTable
Parameters:
c - zero-based column of the table
a - the description of the column

isAccessibleSelected

public boolean isAccessibleSelected(int r,
                                    int c)
Returns a boolean value indicating whether the accessible at a given (row, column) is selected
Specified by:
isAccessibleSelected in interface javax.accessibility.AccessibleTable
Parameters:
r - zero-based row of the table
c - zero-based column of the table
Returns:
the boolean value true if the accessible at (row, column) is selected. Otherwise, the boolean value false

isAccessibleRowSelected

public boolean isAccessibleRowSelected(int r)
Returns a boolean value indicating whether the specified row is selected
Specified by:
isAccessibleRowSelected in interface javax.accessibility.AccessibleTable
Parameters:
r - zero-based row of the table
Returns:
the boolean value true if the specified row is selected. Otherwise, false.

isAccessibleColumnSelected

public boolean isAccessibleColumnSelected(int c)
Returns a boolean value indicating whether the specified column is selected
Specified by:
isAccessibleColumnSelected in interface javax.accessibility.AccessibleTable
Parameters:
r - zero-based column of the table
Returns:
the boolean value true if the specified column is selected. Otherwise, false.

getSelectedAccessibleRows

public int[] getSelectedAccessibleRows()
Returns the selected rows in a table.
Specified by:
getSelectedAccessibleRows in interface javax.accessibility.AccessibleTable
Returns:
an array of selected rows where each element is a zero-based row of the table

getSelectedAccessibleColumns

public int[] getSelectedAccessibleColumns()
Returns the selected columns in a table.
Specified by:
getSelectedAccessibleColumns in interface javax.accessibility.AccessibleTable
Returns:
an array of selected columns where each element is a zero-based column of the table

getAccessibleRowAtIndex

public int getAccessibleRowAtIndex(int i)

getAccessibleColumnAtIndex

public int getAccessibleColumnAtIndex(int i)

getAccessibleIndexAt

public int getAccessibleIndexAt(int r,
                                int c)
Returns the index at a given (row, column) in the table
Parameters:
r - zero-based row of the table
c - zero-based column of the table
Returns:
the index into the table