/** Generic code to set properties appropriately from any of the renderer * fetching methods */ private void configureFrom(Object value, JComponent target, boolean selected, boolean leadSelection) { if (value == null) { value = ""; } setText((value == null) ? "" : value.toString()); setSelected(selected); if (selected) { setParentFocused(checkFocused(target)); } else { setParentFocused(false); } setEnabled(target.isEnabled()); setLeadSelection(leadSelection); setFont(target.getFont()); }
/** * Tells whether this model reacts on mouse-clicks or not. * @return the property */ public boolean isEnabled() { return owner.isEnabled(); }
@Override public boolean isOkButtonEnabled() { return okButton.isEnabled(); } }
@Override public boolean isUsingDefault() { return !component.isEnabled(); }
public static int getComponentState(JComponent c) { if (c.isEnabled()) { if (c.isFocusOwner()) { return SynthConstants.ENABLED | SynthConstants.FOCUSED; } return SynthConstants.ENABLED; } return SynthConstants.DISABLED; }
@Override protected void updateEnabled() { if (target != null) { setEnabled(target.isEnabled()); } } }
public boolean canImport(JComponent c, DataFlavor[] flavors ){ if (c.isEnabled()) { if (hasConceptBeanFlavor(flavors,conceptBeanFlavor )) { return true; } } return false; } private boolean hasConceptBeanFlavor(DataFlavor[] flavors,DataFlavor conceptBeanFlavor) {
public static int getComponentState(JComponent c) { if (c.isEnabled()) { if (c.isFocusOwner()) { return SynthConstants.ENABLED | SynthConstants.FOCUSED; } return SynthConstants.ENABLED; } return SynthConstants.DISABLED; }
@Override protected void updateEnabled() { if (target != null) { setEnabled(target.isEnabled()); } } }
public static int getComponentState(JComponent c) { if (c.isEnabled()) { if (c.isFocusOwner()) { return SynthConstants.ENABLED | SynthConstants.FOCUSED; } return SynthConstants.ENABLED; } return SynthConstants.DISABLED; }
@Override public void mouseClicked(MouseEvent e) { if ((e.getClickCount() == 2) && (e.getButton() == MouseEvent.BUTTON3)) { if (getComponent().isEnabled()) { setValue(null); } } } });
public static boolean shouldIgnore(MouseEvent mouseEvent, JComponent component) { return ((component == null) || (!(component.isEnabled())) || (!(SwingUtilities.isLeftMouseButton(mouseEvent))) || (mouseEvent.isConsumed())); }
private int getComponentState(JComponent c, Region region) { if (region == Region.SLIDER_THUMB && thumbActive && c.isEnabled()) { int state = thumbPressed ? PRESSED : MOUSE_OVER; if (c.isFocusOwner()) state |= FOCUSED; return state; } return SeaGlassLookAndFeel.getComponentState(c); }
private int getComponentState(JComponent c) { JComponent comp = ((JToolTip) c).getComponent(); if (comp != null && !comp.isEnabled()) { return DISABLED; } return SeaGlassLookAndFeel.getComponentState(c); }
@Override public void mousePressed(MouseEvent e) { super.mousePressed(e); if (button.isEnabled()) { button.requestFocus(); } } });
public static boolean shouldIgnore(MouseEvent mouseEvent, JComponent component) { return ((component == null) || (!(component.isEnabled())) || (!(SwingUtilities.isLeftMouseButton(mouseEvent))) || (mouseEvent.isConsumed())); }
@Override public boolean isEnabled(Object sender) { if (component == null || !component.isEnabled() || !component.hasFocus()) return false; return isClickable(getFocusedCell()); } };
@Override public boolean isEnabled(Object sender) { if (component == null || !component.isEnabled() || !component.hasFocus()) return false; return isClickable(getFocusedCell()); } };
protected void copySettings( JComponent from, JComponent to ) { to.setForeground( from.getForeground( ) ); to.setBackground( from.getBackground( ) ); to.setEnabled( from.isEnabled( ) ); to.setFont( from.getFont( ) ); to.setOpaque( from.isOpaque( ) ); }