jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java
changeset 465 507ce3a1af17
parent 2 90ce3da70b43
child 1288 27aaa860d855
--- a/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Wed May 07 20:26:32 2008 +0400
+++ b/jdk/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java	Wed May 07 21:54:03 2008 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2001 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,9 +26,7 @@
 package javax.swing.colorchooser;
 
 import java.awt.*;
-import java.io.Serializable;
 import javax.swing.*;
-import javax.swing.event.*;
 
 /**
  * This is the abstract superclass for color choosers.  If you want to add
@@ -55,17 +53,6 @@
     private JColorChooser chooser;
 
     /**
-     *
-     */
-    private ChangeListener colorListener;
-
-    /**
-     *
-     */
-    private boolean dirty  = true;
-
-
-    /**
       * Invoked automatically when the model's state changes.
       * It is also called by <code>installChooserPanel</code> to allow
       * you to set up the initial state of your chooser.
@@ -157,8 +144,6 @@
         chooser = enclosingChooser;
         buildChooser();
         updateChooser();
-        colorListener = new ModelListener();
-        getColorSelectionModel().addChangeListener(colorListener);
     }
 
     /**
@@ -166,7 +151,6 @@
      * If override this, be sure to call <code>super</code>.
      */
   public void uninstallChooserPanel(JColorChooser enclosingChooser) {
-        getColorSelectionModel().removeChangeListener(colorListener);
         chooser = null;
     }
 
@@ -192,10 +176,6 @@
      * @param g  the <code>Graphics</code> object
      */
     public void paint(Graphics g) {
-        if (dirty) {
-            updateChooser();
-            dirty = false;
-        }
         super.paint(g);
     }
 
@@ -222,18 +202,4 @@
         }
         return defaultValue;
     }
-
-    /**
-     *
-     */
-    class ModelListener implements ChangeListener, Serializable {
-        public void stateChanged(ChangeEvent e) {
-          if (isShowing()) {  // isVisible
-                updateChooser();
-                dirty = false;
-            } else {
-                dirty = true;
-            }
-        }
-    }
 }