|
Evaluation
|
This can be accomodated by adding the following API to AbstractColorChooserPanel:
/**
* Provides a hint to the look and feel as to which character in
* <code>getDisplayName</code> should be the mnemonic. A value of -1
* indicates there is no mnemonic.
* <p>
* The return value here is a hint, it is ultimately up to the look
* and feel to honor the return value. For example, a look and
* feel may wish to render each <code>AbstractColorChooserPanel</code>
* in a <code>JTabbedPane</code>, and further use this return value in
* combination with <code>getDisplayName</code> to set the mnemonic
* on the <code>JTabbedPane</code>.
* <p>
* This implementation returns -1, indicating the
* <code>AbstractColorChooserPanel</code> does not support a mnemonic,
* subclasses wishing a mnemonic will need to override this.
*
* @return Character index to render mnemonic for; -1 for no mnemonic
* @since 1.4
*/
public int getDisplayedMnemonicIndex();
DefaultRGBChooserPanel, DefaultHSBChooserPanel and DefaultSwatchesPanel will all override this.
xxxxx@xxxxx 2001-02-15
As there is no way to map from a character to the KeyEvent, this has been changed to:
/**
* Provides a hint to the look and feel as to the
* <code>KeyEvent.VK</code> constant that can be used as a mnemonic to
* access the panel. A return value <= 0 indicates there is no mnemonic.
* <p>
* The return value here is a hint, it is ultimately up to the look
* and feel to honor the return value in some meaningful way.
* <p>
* This implementation returns 0, indicating the
* <code>AbstractColorChooserPanel</code> does not support a mnemonic,
* subclasses wishing a mnemonic will need to override this.
*
* @return KeyEvent.VK constant identifying the mnemonic; <= 0 for no
* mnemonic
* @see #getDisplayedMnemonicIndex
* @since 1.4
*/
public int getMnemonic();
/**
* Provides a hint to the look and feel as to the index of the character in
* <code>getDisplayName</code> that should be visually identified as the
* mnemonic. The look and feel should only use this if
* <code>getMnemonic</code> returns a value > 0.
* <p>
* The return value here is a hint, it is ultimately up to the look
* and feel to honor the return value in some meaningful way. For example,
* a look and feel may wish to render each
* <code>AbstractColorChooserPanel</code> in a <code>JTabbedPane</code>,
* and further use this return value to underline a character in
* the <code>getDisplayName</code>.
* <p>
* This implementation returns -1, indicating the
* <code>AbstractColorChooserPanel</code> does not support a mnemonic,
* subclasses wishing a mnemonic will need to override this.
*
* @return Character index to render mnemonic for; -1 to provide no
* visual identifier for this panel.
* @see #getMnemonic
* @since 1.4
*/
public int getDisplayedMnemonicIndex();
xxxxx@xxxxx 2001-06-27
|