/** {@inheritDoc} */ @Override protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); updateStyle(getComponent()); getComponent().addFocusListener(handler); }
/** * This method gets called when a bound property is changed on the associated JTextComponent. This * is a hook which UI implementations may change to reflect how the UI displays bound properties * of JTextComponent subclasses. This is implemented to do nothing (i.e. the response to * properties in JTextComponent itself are handled prior to calling this method). * * @param evt the property change event */ protected void propertyChange(PropertyChangeEvent evt) { if (SeaGlassLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent) evt.getSource()); } super.propertyChange(evt); }
protected void uninstallDefaults() { super.uninstallDefaults(); if (!GraphicsEnvironment.isHeadless()) { getComponent().setDragEnabled(oldDragState); } }
protected void installDefaults() { if (!GraphicsEnvironment.isHeadless()) { oldDragState = getComponent().getDragEnabled(); getComponent().setDragEnabled(true); } super.installDefaults(); }
/** @see javax.swing.plaf.basic.BasicTextUI#installDefaults() */ protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); JTextComponent c = getComponent(); updateStyle(c); c.addFocusListener(this); }
protected void uninstallListeners() { final JTextComponent c = getComponent(); AquaTextFieldSearch.uninstallSearchFieldListener(c); AquaUtilControlSize.removeSizePropertyListener(c); c.removeFocusListener(handler); c.removePropertyChangeListener(handler); handler = null; super.uninstallListeners(); }
/** {@inheritDoc} */ @Override protected void uninstallDefaults() { SynthContext context = getContext(getComponent(), ENABLED); getComponent().putClientProperty("caretAspectRatio", null); getComponent().removeFocusListener(handler); style.uninstallDefaults(context); style = null; super.uninstallDefaults(); }
protected void installListeners() { super.installListeners(); handler = new AquaFocusHandler(); final JTextComponent c = getComponent(); c.addFocusListener(handler); c.addPropertyChangeListener(handler); LookAndFeel.installProperty(c, "opaque", UIManager.getBoolean(getPropertyPrefix() + "opaque")); AquaUtilControlSize.addSizePropertyListener(c); AquaTextFieldSearch.installSearchFieldListener(c); }
@Override protected void paintSafely(Graphics g) { super.paintSafely(g); JTextComponent comp = getComponent(); if (hint != null && comp.getText().length() == 0 && (!(hideOnFocus && comp.hasFocus()))) { if (color != null) { g.setColor(color); } else { g.setColor(comp.getForeground().brighter().brighter().brighter()); } int padding = (comp.getHeight() - comp.getFont().getSize()) / 2; g.drawString(hint, 3, comp.getHeight() - padding - 1); } }
protected void paintBackground(Graphics g) { super.paintBackground(g); // Color c = BlueLookAndFeel.getControlShadow().darker(); // g.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), 64)); // g.drawLine(0, 1, myComponent.getWidth() - 1, 1); // // g.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), 32)); // g.drawLine(0, 2, myComponent.getWidth() - 1, 2); // Rectangle editorRect = getVisibleEditorRect(); // Graphics2D g2D = (Graphics2D) g; // // paint one gradient in the upper half of the text field // GradientPaint gradient = new GradientPaint(0.0f, 0.0f, col1, 0.0f, // (float) myComponent.getHeight() * 2 / 3, col2); // g2D.setPaint(gradient); // g2D.fill(editorRect); }
/** @see javax.swing.plaf.basic.BasicTextUI#uninstallDefaults() */ protected void uninstallDefaults() { JTextComponent c = getComponent(); SeaGlassContext context = getContext(c, ENABLED); // Remove the search border, if present. Border border = c.getBorder(); if (border instanceof TextFieldBorder) { c.setBorder(null); } c.putClientProperty("caretAspectRatio", null); c.removeFocusListener(this); style.uninstallDefaults(context); context.dispose(); style = null; super.uninstallDefaults(); }
@Override protected void installListeners() { super.installListeners(); getComponent().addFocusListener(this); }
// Install a default keypress action which handles Cmd and Option keys properly protected void installKeyboardActions() { super.installKeyboardActions(); AquaKeyBindings.instance().setDefaultAction(getKeymapName()); }
@Override protected void uninstallListeners() { super.uninstallListeners(); getComponent().removeFocusListener(this); }
/** * Paints the interface. This is routed to the paintSafely method under the guarantee that the * model won't change from the view of this thread while it's rendering (if the associated model * is derived from AbstractDocument). This enables the model to potentially be updated * asynchronously. * * @param context DOCUMENT ME! * @param g DOCUMENT ME! */ protected void paint(SeaGlassContext context, Graphics g) { JTextComponent c = getComponent(); super.paint(g, c); }
protected void paintSafely(final Graphics g) { paintBackgroundSafely(g); super.paintSafely(g); }
/** @see javax.swing.plaf.basic.BasicTextUI#uninstallListeners() */ @Override protected void uninstallListeners() { super.uninstallListeners(); uninstallMouseListeners(); }
/** * Paints the specified component. * * <p>This is routed to the {@link #paintSafely} method under the guarantee that the model does * not change from the view of this thread while it is rendering (if the associated model is * derived from {@code AbstractDocument}). This enables the model to potentially be updated * asynchronously. * * @param context context for the component being painted * @param g the {@code Graphics} object used for painting * @see #update(Graphics,JComponent) */ protected void paint(SynthContext context, Graphics g) { super.paint(g, getComponent()); }
/** @see javax.swing.plaf.basic.BasicTextUI#installUI(javax.swing.JComponent) */ public void installUI(JComponent c) { super.installUI(c); updateStyle((JTextComponent) c); }
/** * This method gets called when a bound property is changed on the associated JTextComponent. This * is a hook which UI implementations may change to reflect how the UI displays bound properties * of JTextComponent subclasses. * * @param evt the property change event */ public void propertyChange(PropertyChangeEvent evt) { super.propertyChange(evt); }