public void paintIcon(Component c, Graphics g, int x, int y) { if (c.isEnabled()) { g.setColor(Color.RED); } else { g.setColor(Color.GRAY); } g.fillRect(x, y, SIZE, SIZE); }
private void eEnable() { if(se_req_body.getEditorComponent().isEnabled()) { Component[] components = bpm.getComponents(); for(Component c: components) { if(!c.isEnabled()) { c.setEnabled(true); } } } }
if (c != null && c.isEnabled() && c.isVisible()) { if (c instanceof Container) { Container cont = (Container) c;
g2D.setPaint(gradientShadow); } else { if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { g2D.setColor(deSelectColor); GradientPaint gradientShadowTmp = new GradientPaint(0, 0, new Color(255, 255, 200), 0, y + h / 2, new Color(240, 255, 210)); if (tabPane.isEnabled() && tabPane.isEnabledAt(tabIndex)) { g.setColor(tabPane.getForegroundAt(tabIndex)); BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent());
final int dot = field.getCaret().getDot(); final int mark = field.getCaret().getMark(); if ( field.isEnabled() && field.isEditable() ) { SwingUtilities.invokeLater( new Runnable() { @Override
private void enableActionControl(boolean enable, Component comp) { if (enable) { // restore last enable state comp.setEnabled(actionsControlStates.getOrDefault(comp, true)); } else { // save enable state and disable it actionsControlStates.putIfAbsent(comp, comp.isEnabled()); comp.setEnabled(false); } }
if (isEnabled()) { int p = getValue(); String percent = Integer.toString(p, 10) + "%"; g2d.setColor(isEnabled() ? borderColor : disabledBorderColor); g2d.drawLine(1, 0, w - 1, 0); g2d.drawLine(1, h, w - 1, h); g2d.fillRect(1, h - (int) (h * FACTOR), w - 1, (int) (h * FACTOR)); if (isEnabled()) { for (int i = h; i < w; i += h) { g2d.setComposite(veryTransparent);
/** * Draw the icon at the specified location. */ public void paintIcon(Component c, Graphics g, int x, int y) { Image image = bufferedImage; if (c != null && !c.isEnabled()) { image = bufferedImageDisabled; } g.drawImage(image, x, y, null); }
static void setupAlpha(Component c, Graphics2D g2) { if(!c.isEnabled()) { g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); } } }
static void setupAlpha(Component c, Graphics2D g2) { if(!c.isEnabled()) { g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f)); } } }
/** * Adds the specified control to the selection and * selects the control. * @param control */ public void add(Selectable control) { selection.add(control); control.setSelected(true); if(!controlPanel.copyItem.isEnabled()) { controlPanel.copyItem.setEnabled(true); } }
public TinyComboBoxButton(JComboBox cb, Icon i, boolean onlyIcon, CellRendererPane pane, JList list) { this(); comboBox = cb; comboIcon = i; rendererPane = pane; listBox = list; setEnabled(comboBox.isEnabled()); }
public void mouseMoved(MouseEvent e) { if(tabPane == null) return; if(!tabPane.isEnabled()) return; // Note: When running JRE v1.4 there's no way to do // tab rollovers with SCROLL_TAB_LAYOUT if(TinyUtils.is1dot4() && scrollableTabLayoutEnabled()) return; checkRollOver(getTabAtLocation(e.getX(), e.getY())); } }
if ((fo != null) && (!fo.isEnabled()) && (wizardPanel != null)) { wizardPanel.requestFocus();
@Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { paintBorder(c, g, x, y, width, height, c.isEnabled(), c.hasFocus(), this.alpha); }
public void actionPerformed(ActionEvent e) { AbstractButton b = (AbstractButton)e.getSource(); if("copy".equals(b.getActionCommand())) { cp.createParameterSet(); if(!pasteButton.isEnabled()) { pasteButton.setEnabled(true); } } else { // "paste" cp.pasteParameters(); } }
/** * If enabled, focuses the specified component. * @param comp component to be focused */ static void focus(final Component comp) { final GUI gui = gui(comp); if(gui == null) return; if(gui.gopts.get(GUIOptions.MOUSEFOCUS) && comp.isEnabled()) comp.requestFocusInWindow(); }
public void mousePressed(MouseEvent e) { if(SwingUtilities.isLeftMouseButton(e) && e.getComponent().isEnabled()) { spinner = eventToSpinner(e); actionCount = 0; modCount = 20; autoRepeatTimer.start(); focusSpinnerIfNecessary(); } }
public void paintIcon(Component c, Graphics g, int x, int y) { if (direction == NORTH || direction == SOUTH) { paintTriangle(g, x, y, getIconWidth(), getIconHeight(), direction, c.isEnabled()); } else if (direction == WEST || direction==EAST) { paintTriangle(g, x, y, getIconWidth(), getIconHeight(), direction, c.isEnabled()); } }
protected void processFocusEvent(FocusEvent fe) { super.processFocusEvent(fe); if (fe.getID() == fe.FOCUS_GAINED) { if ((inner != null) && inner.isEnabled() && inner.isFocusTraversable()) { inner.requestFocus(); } } }