Method from javax.swing.text.html.AccessibleHTML$HTMLAccessibleContext Detail: |
public void addFocusListener(FocusListener l) {
getTextComponent().addFocusListener(l);
}
Adds the specified focus listener to receive focus events from this
component. |
public boolean contains(Point p) {
Rectangle r = getBounds();
if (r != null) {
return r.contains(p.x, p.y);
} else {
return false;
}
}
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. |
public Accessible getAccessibleAt(Point p) {
ElementInfo innerMostElement = getElementInfoAt(rootElementInfo, p);
if (innerMostElement instanceof Accessible) {
return (Accessible)innerMostElement;
} else {
return null;
}
}
Returns the Accessible child, if one exists, contained at the local
coordinate Point. |
public Accessible getAccessibleChild(int i) {
ElementInfo childInfo = elementInfo.getChild(i);
if (childInfo != null && childInfo instanceof Accessible) {
return (Accessible)childInfo;
} else {
return null;
}
}
Returns the specified Accessible child of the object. The Accessible
children of an Accessible object are zero-based, so the first child
of an Accessible child is at index 0, the second child is at index 1,
and so on. |
public int getAccessibleChildrenCount() {
return elementInfo.getChildCount();
}
Returns the number of accessible children of the object. |
public AccessibleComponent getAccessibleComponent() {
return this;
}
|
public AccessibleContext getAccessibleContext() {
return this;
}
|
public int getAccessibleIndexInParent() {
return elementInfo.getIndexInParent();
}
Gets the 0-based index of this object in its accessible parent. |
public AccessibleStateSet getAccessibleStateSet() {
AccessibleStateSet states = new AccessibleStateSet();
Component comp = getTextComponent();
if (comp.isEnabled()) {
states.add(AccessibleState.ENABLED);
}
if (comp instanceof JTextComponent &&
((JTextComponent)comp).isEditable()) {
states.add(AccessibleState.EDITABLE);
states.add(AccessibleState.FOCUSABLE);
}
if (comp.isVisible()) {
states.add(AccessibleState.VISIBLE);
}
if (comp.isShowing()) {
states.add(AccessibleState.SHOWING);
}
return states;
}
Gets the state set of this object. |
public Color getBackground() {
return getTextComponent().getBackground();
}
Gets the background color of this object. |
public Rectangle getBounds() {
return elementInfo.getBounds();
}
Gets the bounds of this object in the form of a Rectangle object.
The bounds specify this object's width, height, and location
relative to its parent. |
public Cursor getCursor() {
return getTextComponent().getCursor();
}
Gets the Cursor of this object. |
public Font getFont() {
return getTextComponent().getFont();
}
Gets the Font of this object. |
public FontMetrics getFontMetrics(Font f) {
return getTextComponent().getFontMetrics(f);
}
Gets the FontMetrics of this object. |
public Color getForeground() {
return getTextComponent().getForeground();
}
Gets the foreground color of this object. |
public Locale getLocale() throws IllegalComponentStateException {
return editor.getLocale();
}
Gets the locale of the component. If the component does not have a
locale, then the locale of its parent is returned. |
public Point getLocation() {
Rectangle r = getBounds();
if (r != null) {
return new Point(r.x, r.y);
} else {
return null;
}
}
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. |
public Point getLocationOnScreen() {
Point editorLocation = getTextComponent().getLocationOnScreen();
Rectangle r = getBounds();
if (r != null) {
return new Point(editorLocation.x + r.x,
editorLocation.y + r.y);
} else {
return null;
}
}
Returns the location of the object on the screen. |
public Dimension getSize() {
Rectangle r = getBounds();
if (r != null) {
return new Dimension(r.width, r.height);
} else {
return null;
}
}
Returns the size of this object in the form of a Dimension object.
The height field of the Dimension object contains this object's
height, and the width field of the Dimension object contains this
object's width. |
public boolean isEnabled() {
return getTextComponent().isEnabled();
}
Determines if the object is enabled. Objects that are enabled
will also have the AccessibleState.ENABLED state set in their
AccessibleStateSets. |
public boolean isFocusTraversable() {
Component comp = getTextComponent();
if (comp instanceof JTextComponent) {
if (((JTextComponent)comp).isEditable()) {
return true;
}
}
return false;
}
Returns whether this object can accept focus or not. Objects that
can accept focus will also have the AccessibleState.FOCUSABLE state
set in their AccessibleStateSets. |
public boolean isShowing() {
return getTextComponent().isShowing();
}
Determines if the object is showing. This is determined by checking
the visibility of the object and its ancestors.
Note: this
will return true even if the object is obscured by another (for
example, it is underneath a menu that was pulled down). |
public boolean isVisible() {
return getTextComponent().isVisible();
}
Determines if the object is visible. Note: this means that the
object intends to be visible; however, it may not be
showing on the screen because one of the objects that this object
is contained by is currently not visible. To determine if an object
is showing on the screen, use isShowing().
Objects that are visible will also have the
AccessibleState.VISIBLE state set in their AccessibleStateSets. |
public void removeFocusListener(FocusListener l) {
getTextComponent().removeFocusListener(l);
}
Removes the specified focus listener so it no longer receives focus
events from this component. |
public void requestFocus() {
// TIGER - 4856191
if (! isFocusTraversable()) {
return;
}
Component comp = getTextComponent();
if (comp instanceof JTextComponent) {
comp.requestFocusInWindow();
try {
if (elementInfo.validateIfNecessary()) {
// set the caret position to the start of this component
Element elem = elementInfo.getElement();
((JTextComponent)comp).setCaretPosition(elem.getStartOffset());
// fire a AccessibleState.FOCUSED property change event
AccessibleContext ac = editor.getAccessibleContext();
PropertyChangeEvent pce = new PropertyChangeEvent(this,
AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
null, AccessibleState.FOCUSED);
ac.firePropertyChange(
AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
null, pce);
}
} catch (IllegalArgumentException e) {
// don't fire property change event
}
}
}
Requests focus for this object. If this object cannot accept focus,
nothing will happen. Otherwise, the object will attempt to take
focus. |
public void setBackground(Color c) {
getTextComponent().setBackground(c);
}
Sets the background color of this object. |
public void setBounds(Rectangle r) {
}
Sets the bounds of this object in the form of a Rectangle object.
The bounds specify this object's width, height, and location
relative to its parent. |
public void setCursor(Cursor cursor) {
getTextComponent().setCursor(cursor);
}
Sets the Cursor of this object. |
public void setEnabled(boolean b) {
getTextComponent().setEnabled(b);
}
Sets the enabled state of the object. |
public void setFont(Font f) {
getTextComponent().setFont(f);
}
Sets the Font of this object. |
public void setForeground(Color c) {
getTextComponent().setForeground(c);
}
Sets the foreground color of this object. |
public void setLocation(Point p) {
}
Sets the location of the object relative to the parent. |
public void setSize(Dimension d) {
Component comp = getTextComponent();
comp.setSize(d);
}
Resizes this object so that it has width and height. |
public void setVisible(boolean b) {
getTextComponent().setVisible(b);
}
Sets the visible state of the object. |