< prev index next >

src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java

Print this page
rev 1580 : 6727661: Code improvement and warnings removing from the swing/plaf packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: alexp
Contributed-by: Florian Brunner <fbrunnerlist@gmx.ch>


 215      * @param evt the property change event
 216      */
 217     protected void propertyChange(PropertyChangeEvent evt) {
 218         if (SynthLookAndFeel.shouldUpdateStyle(evt)) {
 219             updateStyle((JTextComponent)evt.getSource());
 220         }
 221         super.propertyChange(evt);
 222     }
 223 
 224     public void focusGained(FocusEvent e) {
 225         getComponent().repaint();
 226     }
 227 
 228     public void focusLost(FocusEvent e) {
 229         getComponent().repaint();
 230     }
 231 
 232     protected void installDefaults() {
 233         // Installs the text cursor on the component
 234         super.installDefaults();
 235         updateStyle((JTextComponent)getComponent());
 236         getComponent().addFocusListener(this);
 237     }
 238 
 239     protected void uninstallDefaults() {
 240         SynthContext context = getContext(getComponent(), ENABLED);
 241 
 242         getComponent().putClientProperty("caretAspectRatio", null);
 243         getComponent().removeFocusListener(this);
 244 
 245         style.uninstallDefaults(context);
 246         context.dispose();
 247         style = null;
 248         super.uninstallDefaults();
 249     }
 250 
 251     public void installUI(JComponent c) {
 252         super.installUI(c);
 253     }
 254 }


 215      * @param evt the property change event
 216      */
 217     protected void propertyChange(PropertyChangeEvent evt) {
 218         if (SynthLookAndFeel.shouldUpdateStyle(evt)) {
 219             updateStyle((JTextComponent)evt.getSource());
 220         }
 221         super.propertyChange(evt);
 222     }
 223 
 224     public void focusGained(FocusEvent e) {
 225         getComponent().repaint();
 226     }
 227 
 228     public void focusLost(FocusEvent e) {
 229         getComponent().repaint();
 230     }
 231 
 232     protected void installDefaults() {
 233         // Installs the text cursor on the component
 234         super.installDefaults();
 235         updateStyle(getComponent());
 236         getComponent().addFocusListener(this);
 237     }
 238 
 239     protected void uninstallDefaults() {
 240         SynthContext context = getContext(getComponent(), ENABLED);
 241 
 242         getComponent().putClientProperty("caretAspectRatio", null);
 243         getComponent().removeFocusListener(this);
 244 
 245         style.uninstallDefaults(context);
 246         context.dispose();
 247         style = null;
 248         super.uninstallDefaults();
 249     }
 250 
 251     public void installUI(JComponent c) {
 252         super.installUI(c);
 253     }
 254 }
< prev index next >