Methods Summary |
---|
protected void | buildChooser()
GridBagLayout gb = new GridBagLayout();
GridBagConstraints gbc = new GridBagConstraints();
JPanel superHolder = new JPanel(gb);
swatchPanel = new MainSwatchPanel();
swatchPanel.getAccessibleContext().setAccessibleName(getDisplayName());
recentSwatchPanel = new RecentSwatchPanel();
recentSwatchPanel.getAccessibleContext().setAccessibleName(recentStr);
mainSwatchListener = new MainSwatchListener();
swatchPanel.addMouseListener(mainSwatchListener);
recentSwatchListener = new RecentSwatchListener();
recentSwatchPanel.addMouseListener(recentSwatchListener);
Border border = new CompoundBorder( new LineBorder(Color.black),
new LineBorder(Color.white) );
swatchPanel.setBorder(border);
gbc.weightx = 1.0;
gbc.gridwidth = 2;
gbc.gridheight = 2;
gbc.weighty = 1.0;
superHolder.add( swatchPanel, gbc );
recentSwatchPanel.addMouseListener(recentSwatchListener);
recentSwatchPanel.setBorder(border);
JPanel recentLabelHolder = new JPanel(new BorderLayout());
JLabel l = new JLabel(recentStr);
l.setLabelFor(recentSwatchPanel);
recentLabelHolder.add(l, BorderLayout.NORTH);
gbc.weighty = 0.0;
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.gridheight = 1;
superHolder.add( recentLabelHolder, gbc );
superHolder.add( recentSwatchPanel, gbc );
add(superHolder);
|
public java.lang.String | getDisplayName()
return UIManager.getString("ColorChooser.swatchesNameText");
|
public int | getDisplayedMnemonicIndex()Provides a hint to the look and feel as to the index of the character in
getDisplayName that should be visually identified as the
mnemonic. The look and feel should only use this if
getMnemonic returns a value > 0.
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
AbstractColorChooserPanel in a JTabbedPane ,
and further use this return value to underline a character in
the getDisplayName .
This implementation looks up the value from the default
ColorChooser.rgbDisplayedMnemonicIndex , or if it
isn't available (or not an Integer ) returns -1.
The lookup for the default is done through the UIManager :
UIManager.get("ColorChooser.swatchesDisplayedMnemonicIndex"); .
return getInt("ColorChooser.swatchesDisplayedMnemonicIndex", -1);
|
public javax.swing.Icon | getLargeDisplayIcon()
return null;
|
public int | getMnemonic()Provides a hint to the look and feel as to the
KeyEvent.VK constant that can be used as a mnemonic to
access the panel. A return value <= 0 indicates there is no mnemonic.
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.
This implementation looks up the value from the default
ColorChooser.swatchesMnemonic , or if it
isn't available (or not an Integer ) returns -1.
The lookup for the default is done through the UIManager :
UIManager.get("ColorChooser.swatchesMnemonic"); .
return getInt("ColorChooser.swatchesMnemonic", -1);
|
public javax.swing.Icon | getSmallDisplayIcon()
return null;
|
public void | installChooserPanel(javax.swing.JColorChooser enclosingChooser)The background color, foreground color, and font are already set to the
defaults from the defaults table before this method is called.
super.installChooserPanel(enclosingChooser);
|
public void | uninstallChooserPanel(javax.swing.JColorChooser enclosingChooser)
super.uninstallChooserPanel(enclosingChooser);
swatchPanel.removeMouseListener(mainSwatchListener);
recentSwatchPanel.removeMouseListener(recentSwatchListener);
swatchPanel = null;
recentSwatchPanel = null;
mainSwatchListener = null;
recentSwatchListener = null;
removeAll(); // strip out all the sub-components
|
public void | updateChooser()
|