100 |
/** |
/** |
101 |
* Accessibility support is currently missing. |
* Accessibility support is currently missing. |
102 |
*/ |
*/ |
|
|
|
103 |
protected AccessibleContext accessibleContext; |
protected AccessibleContext accessibleContext; |
104 |
|
|
105 |
public abstract class AccessibleJComponent |
public abstract class AccessibleJComponent |
163 |
*/ |
*/ |
164 |
Dimension maximumSize; |
Dimension maximumSize; |
165 |
|
|
|
|
|
166 |
/** |
/** |
167 |
* A value between 0.0 and 1.0 indicating the preferred horizontal |
* A value between 0.0 and 1.0 indicating the preferred horizontal |
168 |
* alignment of the component, relative to its siblings. The values |
* alignment of the component, relative to its siblings. The values |
346 |
*/ |
*/ |
347 |
private static final Object paintLock = new Object(); |
private static final Object paintLock = new Object(); |
348 |
|
|
|
|
|
349 |
/** |
/** |
350 |
* The default locale of the component. |
* The default locale of the component. |
351 |
* |
* |
388 |
*/ |
*/ |
389 |
public static final int WHEN_IN_FOCUSED_WINDOW = 2; |
public static final int WHEN_IN_FOCUSED_WINDOW = 2; |
390 |
|
|
|
|
|
391 |
/** |
/** |
392 |
* Creates a new <code>JComponent</code> instance. |
* Creates a new <code>JComponent</code> instance. |
393 |
*/ |
*/ |
609 |
* @param property The property to return the listeners of |
* @param property The property to return the listeners of |
610 |
* |
* |
611 |
* @return The set of <code>PropertyChangeListener</code> objects in |
* @return The set of <code>PropertyChangeListener</code> objects in |
612 |
* {@link #changeSupport} registered to listen on the specified propert |
* {@link #changeSupport} registered to listen on the specified property |
613 |
*/ |
*/ |
614 |
public PropertyChangeListener[] getPropertyChangeListeners(String property) |
public PropertyChangeListener[] getPropertyChangeListeners(String property) |
615 |
{ |
{ |
616 |
return changeSupport == null ? new PropertyChangeListener[0] |
return changeSupport == null ? new PropertyChangeListener[0] |
617 |
: changeSupport.getPropertyChangeListeners(property); |
: changeSupport.getPropertyChangeListeners(property); |
618 |
} |
} |
619 |
|
|
620 |
/** |
/** |
752 |
throws PropertyVetoException |
throws PropertyVetoException |
753 |
{ |
{ |
754 |
VetoableChangeListener[] listeners = getVetoableChangeListeners(); |
VetoableChangeListener[] listeners = getVetoableChangeListeners(); |
755 |
|
|
756 |
PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); |
PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldValue, newValue); |
757 |
|
|
758 |
for (int i = 0; i < listeners.length; i++) |
for (int i = 0; i < listeners.length; i++) |
759 |
listeners[i].vetoableChange(evt); |
listeners[i].vetoableChange(evt); |
760 |
} |
} |
769 |
return null; |
return null; |
770 |
} |
} |
771 |
|
|
|
|
|
772 |
/** |
/** |
773 |
* Get the value of the {@link #alignmentX} property. |
* Get the value of the {@link #alignmentX} property. |
774 |
* |
* |
877 |
return g2; |
return g2; |
878 |
} |
} |
879 |
|
|
|
|
|
880 |
/** |
/** |
881 |
* Get the value of the {@link #debugGraphicsOptions} property. |
* Get the value of the {@link #debugGraphicsOptions} property. |
882 |
* |
* |
1143 |
*/ |
*/ |
1144 |
public JToolTip createToolTip() |
public JToolTip createToolTip() |
1145 |
{ |
{ |
1146 |
JToolTip toolTip = new JToolTip(); |
JToolTip toolTip = new JToolTip(); |
1147 |
toolTip.setComponent(this); |
toolTip.setComponent(this); |
1148 |
toolTip.setTipText(toolTipText); |
toolTip.setTipText(toolTipText); |
1149 |
|
|
1150 |
return toolTip; |
return toolTip; |
1151 |
} |
} |
1152 |
|
|
1157 |
* @param event The event the tooltip is being presented in response to |
* @param event The event the tooltip is being presented in response to |
1158 |
* |
* |
1159 |
* @return The point at which to display a tooltip, or <code>null</code> |
* @return The point at which to display a tooltip, or <code>null</code> |
1160 |
* if swing is to choose a default location. |
* if swing is to choose a default location. |
1161 |
*/ |
*/ |
1162 |
public Point getToolTipLocation(MouseEvent event) |
public Point getToolTipLocation(MouseEvent event) |
1163 |
{ |
{ |
1179 |
toolTipText = null; |
toolTipText = null; |
1180 |
return; |
return; |
1181 |
} |
} |
1182 |
|
|
1183 |
// XXX: The tip text doesn't get updated unless you set it to null |
// XXX: The tip text doesn't get updated unless you set it to null |
1184 |
// and then to something not-null. This is consistent with the behaviour |
// and then to something not-null. This is consistent with the behaviour |
1185 |
// of Sun's ToolTipManager. |
// of Sun's ToolTipManager. |
1186 |
|
|
1187 |
String oldText = toolTipText; |
String oldText = toolTipText; |
1188 |
toolTipText = text; |
toolTipText = text; |
1189 |
|
|
1190 |
if (oldText == null) |
if (oldText == null) |
1191 |
ToolTipManager.sharedInstance().registerComponent(this); |
ToolTipManager.sharedInstance().registerComponent(this); |
1192 |
} |
} |
1317 |
* <code>CTRL+TAB</code> and <code>CTRL+SHIFT+TAB</code>. |
* <code>CTRL+TAB</code> and <code>CTRL+SHIFT+TAB</code>. |
1318 |
* |
* |
1319 |
* @return <code>true</code> if you want this component to manage its own |
* @return <code>true</code> if you want this component to manage its own |
1320 |
* focus, otherwise (by default) <code>false</code> |
* focus, otherwise (by default) <code>false</code> |
1321 |
* |
* |
1322 |
* @deprecated 1.4 Use {@link Component.setFocusTraversalKeys(int,Set)} and |
* @deprecated 1.4 Use {@link Component.setFocusTraversalKeys(int,Set)} and |
1323 |
* {@link Container.setFocusCycleRoot(boolean)} instead |
* {@link Container.setFocusCycleRoot(boolean)} instead |
1324 |
*/ |
*/ |
1325 |
public boolean isManagingFocus() |
public boolean isManagingFocus() |
1326 |
{ |
{ |
1407 |
* one of these methods rather than <code>paint</code>.</p> |
* one of these methods rather than <code>paint</code>.</p> |
1408 |
* |
* |
1409 |
* <p>For more details on the painting sequence, see <a |
* <p>For more details on the painting sequence, see <a |
1410 |
* href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html">this |
* href="http://java.sun.com/products/jfc/tsc/articles/painting/index.html"> |
1411 |
* article</a>.</p> |
* this article</a>.</p> |
1412 |
* |
* |
1413 |
* @param g The graphics context to paint with |
* @param g The graphics context to paint with |
1414 |
* |
* |
1598 |
* sun-private solution so I will only immitate it as much as it matters |
* sun-private solution so I will only immitate it as much as it matters |
1599 |
* to external observers. |
* to external observers. |
1600 |
*/ |
*/ |
|
|
|
1601 |
private static class ActionListenerProxy |
private static class ActionListenerProxy |
1602 |
extends AbstractAction |
extends AbstractAction |
1603 |
{ |
{ |
1630 |
* |
* |
1631 |
* @param anAction The action to be registered |
* @param anAction The action to be registered |
1632 |
* @param aCommand The command to deliver in the delivered {@link |
* @param aCommand The command to deliver in the delivered {@link |
1633 |
* java.awt.ActionEvent} |
* java.awt.ActionEvent} |
1634 |
* @param aKeyStroke The keystroke to register on |
* @param aKeyStroke The keystroke to register on |
1635 |
* @param aCondition One of the values {@link #UNDEFINED_CONDITION}, |
* @param aCondition One of the values {@link #UNDEFINED_CONDITION}, |
1636 |
* {@link #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or |
* {@link #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or |
1637 |
* {@link #WHEN_IN_FOCUSED_WINDOW}, indicating the condition which must |
* {@link #WHEN_IN_FOCUSED_WINDOW}, indicating the condition which must |
1638 |
* be met for the action to be fired |
* be met for the action to be fired |
1639 |
* |
* |
1640 |
* @see #unregisterKeyboardAction |
* @see #unregisterKeyboardAction |
1641 |
* @see #getConditionForKeystroke |
* @see #getConditionForKeystroke |
1649 |
getInputMap(cond).put(stroke, new ActionListenerProxy(act, cmd)); |
getInputMap(cond).put(stroke, new ActionListenerProxy(act, cmd)); |
1650 |
} |
} |
1651 |
|
|
|
|
|
|
|
|
1652 |
public final void setInputMap(int condition, InputMap map) |
public final void setInputMap(int condition, InputMap map) |
1653 |
{ |
{ |
1654 |
enableEvents(AWTEvent.KEY_EVENT_MASK); |
enableEvents(AWTEvent.KEY_EVENT_MASK); |
1722 |
* @param aKeyStroke The keystroke to return the condition of |
* @param aKeyStroke The keystroke to return the condition of |
1723 |
* |
* |
1724 |
* @return One of the values {@link #UNDEFINED_CONDITION}, {@link |
* @return One of the values {@link #UNDEFINED_CONDITION}, {@link |
1725 |
* #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or {@link |
* #WHEN_ANCESTOR_OF_FOCUSED_COMPONENT}, {@link #WHEN_FOCUSED}, or {@link |
1726 |
* #WHEN_IN_FOCUSED_WINDOW} |
* #WHEN_IN_FOCUSED_WINDOW} |
1727 |
* |
* |
1728 |
* @deprecated As of 1.3 KeyStrokes can be registered with multiple |
* @deprecated As of 1.3 KeyStrokes can be registered with multiple |
1729 |
* simultaneous conditions. |
* simultaneous conditions. |
1730 |
* |
* |
1731 |
* @see #registerKeyboardAction |
* @see #registerKeyboardAction |
1732 |
* @see #unregisterKeyboardAction |
* @see #unregisterKeyboardAction |
1782 |
* the swing {@link InputMap} / {@link ActionMap} system. |
* the swing {@link InputMap} / {@link ActionMap} system. |
1783 |
* |
* |
1784 |
* See <a |
* See <a |
1785 |
* href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html">this |
* href="http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html"> |
1786 |
* report</a> for more details, it's somewhat complex. |
* this report</a> for more details, it's somewhat complex. |
1787 |
*/ |
*/ |
1788 |
protected void processKeyEvent(KeyEvent e) |
protected void processKeyEvent(KeyEvent e) |
1789 |
{ |
{ |
1836 |
*/ |
*/ |
1837 |
public void unregisterKeyboardAction(KeyStroke aKeyStroke) |
public void unregisterKeyboardAction(KeyStroke aKeyStroke) |
1838 |
{ |
{ |
1839 |
|
// FIXME: Must be implemented. |
1840 |
} |
} |
1841 |
|
|
1842 |
|
|
1859 |
actionMap.clear(); |
actionMap.clear(); |
1860 |
} |
} |
1861 |
|
|
|
|
|
1862 |
/** |
/** |
1863 |
* Mark the described region of this component as dirty in the current |
* Mark the described region of this component as dirty in the current |
1864 |
* {@link RepaintManager}. This will queue an asynchronous repaint using |
* {@link RepaintManager}. This will queue an asynchronous repaint using |
1899 |
* |
* |
1900 |
* @return The result of {@link #requestFocus} |
* @return The result of {@link #requestFocus} |
1901 |
* |
* |
1902 |
* @deprecated Use {@link #requestFocus()} on the default component provided from |
* @deprecated Use {@link #requestFocus()} on the default component provided |
1903 |
* the {@link FocusTraversalPolicy} instead. |
* from the {@link FocusTraversalPolicy} instead. |
1904 |
*/ |
*/ |
1905 |
public boolean requestDefaultFocus() |
public boolean requestDefaultFocus() |
1906 |
{ |
{ |