@ScriptFunction(jsDoc = FOREGROUND_JSDOC) @Override public Color getForeground() { return super.getForeground(); }
public void actionPerformed(ActionEvent e) { if ("color".equals(e.getActionCommand())) { JButton invoker = (JButton) e.getSource(); Color newColor = JColorChooser.showDialog(this, Messages.DI_SELECTCOLOR, invoker.getForeground()); if (newColor != null) { invoker.setForeground(newColor); } } }
public int getSelectedIndex() { int i = 0; for (final VerticalTab<?> tab : _tabs) { final JButton button = tab.getButton(); if (button.getForeground() == COLOR_SELECTED_FOREGROUND && button.getBackground() == COLOR_SELECTED_BACKGROUND) { return i; } i++; } return -1; }
public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog( colorChooser, "Annotation Color", colorChooser.getForeground()); annotatingPlugin.setAnnotationColor(color); colorChooser.setForeground(color); } });
public void actionPerformed(ActionEvent e) { Color color = JColorChooser.showDialog(colorChooser, "Annotation Color", colorChooser.getForeground()); annotatingPlugin.setAnnotationColor(color); colorChooser.setForeground(color); }}); return colorChooser;
/** * <p>Apply an icon to a button. Both icon states (enabled/disabled) will be added.</p> * <p>The icon will use the font and color from the button, but <strong>will not</strong> reflect any subsequent updates.</p> * * @param icon The icon reference * @param button The button * @param leading True if the icon comes before the text in the reading direction (LTR and RTL is handled automatically) * @param verticalAlignment One of JLabel.TOP, JLabel.CENTER, JLabel.BOTTOM The position of the text relative to the icon * @param size The icon size (font metrics) */ public static void applyIcon(AwesomeIcon icon, JButton button, boolean leading, int verticalAlignment, int size) { JButton iconButton = new JButton(); iconButton.setFont(iconButton.getFont().deriveFont((float) size)); iconButton.setForeground(button.getForeground()); Icon enabledIcon = new AwesomeSwingIcon(iconButton, icon.getChar(), true); Icon disabledIcon = new AwesomeSwingIcon(iconButton, icon.getChar(), false); button.setIcon(enabledIcon); button.setDisabledIcon(disabledIcon); align(button, leading); if (verticalAlignment == JLabel.TOP || verticalAlignment == JLabel.BOTTOM) { button.setVerticalTextPosition(verticalAlignment); // Override the horizontal alignment button.setHorizontalTextPosition(JLabel.CENTER); } }
void updatePanel() { if (plageEnCours_ == null) { ic_.setCouleur(btColor_.getForeground()); valueEditor_.setValue(CtuluLibString.EMPTY_STRING, txtMax_); valueEditor_.setValue(CtuluLibString.EMPTY_STRING, txtMin_); } else { ic_.setCouleur(plageEnCours_.getCouleur()); ic_.setTaille(plageEnCours_.getIconeTaille()); ic_.setType(plageEnCours_.getIconeType()); // final CtuluNumberFormatI fmt = plageEnCours_.getgetDefaultFormat(); String s = Double.toString(plageEnCours_.getMin()); valueEditor_.setValue(s, txtMin_); txtMin_.setToolTipText(s); s = Double.toString(plageEnCours_.getMax()); valueEditor_.setValue(s, txtMax_); txtMax_.setToolTipText(s); } if (cbChangedLeg_ != null) { cbChangedLeg_.setSelected(plageEnCours_.isLegendCustomized()); } btColor_.repaint(); }