/** * 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 rebuild the ActionMap based upon an * EditorKit change. * * @param evt the property change event */ @Override protected void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent) evt.getSource()); } super.propertyChange(evt); }
/** * Notifies this UI delegate to repaint the specified component. This method paints the component * background, then calls the {@link #paint(SynthContext,Graphics)} method. * * <p>In general, this method does not need to be overridden by subclasses. All Look and Feel * rendering code should reside in the {@code paint} method. * * @param g the {@code Graphics} object used for painting * @param c the component being painted * @see #paint(SynthContext,Graphics) */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); SynthLookAndFeel.update(context, g); paintBackground(context, g, c); paint(context, g); }
private void updateStyle(JTextComponent comp) { SynthContext context = getContext(comp, ENABLED); SynthStyle oldStyle = style; style = SynthLookAndFeel.updateStyle(context, this); if (style != oldStyle) { SynthTextFieldUI.updateStyle(comp, context, getPropertyPrefix()); if (oldStyle != null) { uninstallKeyboardActions(); installKeyboardActions(); } } }
private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); }
/** {@inheritDoc} */ @Override public SynthContext getContext(JComponent c) { return getContext(c, SynthLookAndFeel.getComponentState(c)); }
private SynthContext getContext(JComponent c, int state) { return SynthContext.getContext( SynthContext.class, c, SynthLookAndFeel.getRegion(c), style, state); }