Browse Source

Improve the Color Dialog to Support Intensity, to allow a slider to be increased to have a light with 10 intensity (color would be (10, 10, 10, 10)). The downside is that there is no distinction between a grey (0.5, 0.5, 0.5, 0.5) with an intensity of 2 and a white with an intensity of 1, but that's because the engine does store intensity on top of the color and not seperate

MeFisto94 6 years ago
parent
commit
503080ab3e

+ 27 - 6
jme3-core/src/com/jme3/gde/core/properties/ColorRGBADialog.form

@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 
 
 <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
 <Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
   <Properties>
   <Properties>
@@ -6,6 +6,7 @@
   </Properties>
   </Properties>
   <SyntheticProperties>
   <SyntheticProperties>
     <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
     <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+    <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
   </SyntheticProperties>
   </SyntheticProperties>
   <AuxValues>
   <AuxValues>
     <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
     <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
@@ -23,26 +24,29 @@
     <DimensionLayout dim="0">
     <DimensionLayout dim="0">
       <Group type="103" groupAlignment="0" attributes="0">
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="1" attributes="0">
           <Group type="102" alignment="1" attributes="0">
-              <Component id="jToolBar1" pref="320" max="32767" attributes="0"/>
+              <Component id="jToolBar1" pref="554" max="32767" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jButton2" min="-2" max="-2" attributes="0"/>
               <Component id="jButton2" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jButton1" min="-2" max="-2" attributes="0"/>
               <Component id="jButton1" min="-2" max="-2" attributes="0"/>
           </Group>
           </Group>
-          <Component id="jColorChooser1" alignment="0" pref="496" max="32767" attributes="0"/>
+          <Component id="jColorChooser1" alignment="0" pref="701" max="32767" attributes="0"/>
       </Group>
       </Group>
     </DimensionLayout>
     </DimensionLayout>
     <DimensionLayout dim="1">
     <DimensionLayout dim="1">
       <Group type="103" groupAlignment="0" attributes="0">
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="1" attributes="0">
           <Group type="102" alignment="1" attributes="0">
-              <Component id="jColorChooser1" pref="380" max="32767" attributes="0"/>
+              <Component id="jColorChooser1" pref="423" max="32767" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
-              <Group type="103" groupAlignment="1" attributes="0">
+              <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="103" groupAlignment="3" attributes="0">
                   <Group type="103" groupAlignment="3" attributes="0">
                       <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
                   </Group>
                   </Group>
-                  <Component id="jToolBar1" min="-2" pref="25" max="-2" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="jToolBar1" pref="28" max="32767" attributes="0"/>
+                      <EmptySpace max="-2" attributes="0"/>
+                  </Group>
               </Group>
               </Group>
           </Group>
           </Group>
       </Group>
       </Group>
@@ -88,8 +92,25 @@
         </Component>
         </Component>
         <Component class="javax.swing.JSlider" name="alphaSlider">
         <Component class="javax.swing.JSlider" name="alphaSlider">
           <Properties>
           <Properties>
+            <Property name="maximum" type="int" value="2000"/>
             <Property name="value" type="int" value="100"/>
             <Property name="value" type="int" value="100"/>
+            <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+              <Dimension value="[150, 16]"/>
+            </Property>
+          </Properties>
+          <Events>
+            <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="alphaSliderStateChanged"/>
+          </Events>
+        </Component>
+        <Component class="javax.swing.JSpinner" name="jSpinner1">
+          <Properties>
+            <Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
+              <SpinnerModel initial="1.0" minimum="0.0" numberType="java.lang.Float" stepSize="0.25" type="number"/>
+            </Property>
           </Properties>
           </Properties>
+          <Events>
+            <EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="jSpinner1StateChanged"/>
+          </Events>
         </Component>
         </Component>
       </SubComponents>
       </SubComponents>
     </Container>
     </Container>

+ 87 - 18
jme3-core/src/com/jme3/gde/core/properties/ColorRGBADialog.java

@@ -1,5 +1,5 @@
 /*
 /*
- *  Copyright (c) 2009-2010 jMonkeyEngine
+ *  Copyright (c) 2009-2019 jMonkeyEngine
  *  All rights reserved.
  *  All rights reserved.
  * 
  * 
  *  Redistribution and use in source and binary forms, with or without
  *  Redistribution and use in source and binary forms, with or without
@@ -38,35 +38,66 @@
 package com.jme3.gde.core.properties;
 package com.jme3.gde.core.properties;
 
 
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.ColorRGBA;
+import com.jme3.math.Vector4f;
 import java.awt.Color;
 import java.awt.Color;
+import javax.swing.JSlider;
+import javax.swing.JSpinner;
 
 
 /**
 /**
- *
+ * Allow to edit ColorRGBAs (in constrast to regular colors, these consist of
+ * an additional alpha and values > 1 are permitted)
+ * 
  * @author normenhansen
  * @author normenhansen
  */
  */
 public class ColorRGBADialog extends javax.swing.JDialog {
 public class ColorRGBADialog extends javax.swing.JDialog {
 
 
     private ColorRGBAPropertyEditor editor;
     private ColorRGBAPropertyEditor editor;
+    /** Sometimes UI Code sets other UI Code, that's synthetic. Don't react to them as events */
+    protected boolean syntheticCall;
 
 
-    /** Creates new form ColorRGBADialog */
+    /** Creates new form ColorRGBADialog
+     * @param parent The parental frame
+     * @param modal Whether we are a modal dialog
+     * @param editor The Property Editor
+     */
     public ColorRGBADialog(java.awt.Frame parent, boolean modal, ColorRGBAPropertyEditor editor) {
     public ColorRGBADialog(java.awt.Frame parent, boolean modal, ColorRGBAPropertyEditor editor) {
         super(parent, modal);
         super(parent, modal);
         this.editor = editor;
         this.editor = editor;
         initComponents();
         initComponents();
-        jColorChooser1.setColor(new Color(((ColorRGBA)editor.getValue()).asIntARGB()));
-        alphaSlider.setValue(Math.round(((ColorRGBA)editor.getValue()).getAlpha()*100));
+        fromColor((ColorRGBA)editor.getValue());
+    }
+
+    protected void fromColor(ColorRGBA col) {
+        Vector4f vCol = new Vector4f(col.r, col.g, col.b, col.a);
+        // normalize so that the max component is 1.0f (because even a grey is white with less intensity)
+        float intensity = Math.max(Math.max(vCol.x, vCol.y), Math.max(vCol.z, vCol.w));
+        
+        if (intensity > 1.0f) {
+            vCol.divideLocal(intensity); // bypass regular normalization
+        } else {
+             // otherwise keep it, to support grey colors.
+             intensity = 1f;
+        }
+        // Unfortunately a grey with intensity 2 will still show like a white though.
+        // (0.5, 0.5, 0.5, 0.5) * 2 = (1.0, 1.0, 1.0, 1.0), no way to tell...
+        
+        jColorChooser1.setColor(new Color(vCol.x, vCol.y, vCol.z, vCol.w));
+        alphaSlider.setValue(Math.round(intensity * 100));
     }
     }
 
 
     public ColorRGBA setColor() {
     public ColorRGBA setColor() {
-        Color cColor = jColorChooser1.getColor();
-        ColorRGBA color = new ColorRGBA();
+        ColorRGBA oldColor = new ColorRGBA((ColorRGBA) editor.getValue());
+        Color color = jColorChooser1.getColor();
+        ColorRGBA newColor = new ColorRGBA();
+        
         float[] floats = new float[4];
         float[] floats = new float[4];
-        cColor.getComponents(floats);
-        color.set(floats[0], floats[1], floats[2], ((float)alphaSlider.getValue())/100.0f);
-        ColorRGBA color2 = new ColorRGBA((ColorRGBA) editor.getValue());
-        editor.setValue(color);
-        editor.notifyListeners(color2, color);
-        return color;
+        color.getComponents(floats);
+        newColor.set(floats[0], floats[1], floats[2], floats[3]);
+        newColor.multLocal((Float)jSpinner1.getValue());
+        
+        editor.setValue(newColor);
+        editor.notifyListeners(oldColor, newColor);
+        return newColor;
     }
     }
 
 
     /** This method is called from within the constructor to
     /** This method is called from within the constructor to
@@ -84,6 +115,7 @@ public class ColorRGBADialog extends javax.swing.JDialog {
         jToolBar1 = new javax.swing.JToolBar();
         jToolBar1 = new javax.swing.JToolBar();
         alphaLabel = new javax.swing.JLabel();
         alphaLabel = new javax.swing.JLabel();
         alphaSlider = new javax.swing.JSlider();
         alphaSlider = new javax.swing.JSlider();
+        jSpinner1 = new javax.swing.JSpinner();
 
 
         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
 
 
@@ -107,31 +139,48 @@ public class ColorRGBADialog extends javax.swing.JDialog {
         alphaLabel.setText(org.openide.util.NbBundle.getMessage(ColorRGBADialog.class, "ColorRGBADialog.alphaLabel.text")); // NOI18N
         alphaLabel.setText(org.openide.util.NbBundle.getMessage(ColorRGBADialog.class, "ColorRGBADialog.alphaLabel.text")); // NOI18N
         jToolBar1.add(alphaLabel);
         jToolBar1.add(alphaLabel);
 
 
+        alphaSlider.setMaximum(2000);
         alphaSlider.setValue(100);
         alphaSlider.setValue(100);
+        alphaSlider.setPreferredSize(new java.awt.Dimension(150, 16));
+        alphaSlider.addChangeListener(new javax.swing.event.ChangeListener() {
+            public void stateChanged(javax.swing.event.ChangeEvent evt) {
+                alphaSliderStateChanged(evt);
+            }
+        });
         jToolBar1.add(alphaSlider);
         jToolBar1.add(alphaSlider);
 
 
+        jSpinner1.setModel(new javax.swing.SpinnerNumberModel(1.0f, 0.0f, null, 0.25f));
+        jSpinner1.addChangeListener(new javax.swing.event.ChangeListener() {
+            public void stateChanged(javax.swing.event.ChangeEvent evt) {
+                jSpinner1StateChanged(evt);
+            }
+        });
+        jToolBar1.add(jSpinner1);
+
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
         getContentPane().setLayout(layout);
         getContentPane().setLayout(layout);
         layout.setHorizontalGroup(
         layout.setHorizontalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
+                .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 554, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jButton2)
                 .addComponent(jButton2)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jButton1))
                 .addComponent(jButton1))
-            .addComponent(jColorChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE)
+            .addComponent(jColorChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 701, Short.MAX_VALUE)
         );
         );
         layout.setVerticalGroup(
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addComponent(jColorChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
+                .addComponent(jColorChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                         .addComponent(jButton1)
                         .addComponent(jButton1)
                         .addComponent(jButton2))
                         .addComponent(jButton2))
-                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
+                        .addContainerGap())))
         );
         );
 
 
         pack();
         pack();
@@ -145,12 +194,32 @@ public class ColorRGBADialog extends javax.swing.JDialog {
     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
         dispose();
         dispose();
     }//GEN-LAST:event_jButton2ActionPerformed
     }//GEN-LAST:event_jButton2ActionPerformed
+
+    private void jSpinner1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner1StateChanged
+        JSpinner source = (JSpinner)evt.getSource();
+        if (!syntheticCall) {
+            syntheticCall = true;
+            alphaSlider.setValue(Math.round((Float)source.getValue() * 100));
+            syntheticCall = false;
+        }
+    }//GEN-LAST:event_jSpinner1StateChanged
+
+    private void alphaSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_alphaSliderStateChanged
+        JSlider source = (JSlider)evt.getSource();
+        if (!syntheticCall && !source.getValueIsAdjusting()) {
+            syntheticCall = true;
+            jSpinner1.setValue(source.getValue() / 100.0f);
+            syntheticCall = false;
+        }
+    }//GEN-LAST:event_alphaSliderStateChanged
+
     // Variables declaration - do not modify//GEN-BEGIN:variables
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JLabel alphaLabel;
     private javax.swing.JLabel alphaLabel;
     private javax.swing.JSlider alphaSlider;
     private javax.swing.JSlider alphaSlider;
     private javax.swing.JButton jButton1;
     private javax.swing.JButton jButton1;
     private javax.swing.JButton jButton2;
     private javax.swing.JButton jButton2;
     private javax.swing.JColorChooser jColorChooser1;
     private javax.swing.JColorChooser jColorChooser1;
+    private javax.swing.JSpinner jSpinner1;
     private javax.swing.JToolBar jToolBar1;
     private javax.swing.JToolBar jToolBar1;
     // End of variables declaration//GEN-END:variables
     // End of variables declaration//GEN-END:variables
 }
 }

+ 28 - 4
jme3-core/src/com/jme3/gde/core/properties/ColorRGBAPropertyEditor.java

@@ -32,6 +32,8 @@
 package com.jme3.gde.core.properties;
 package com.jme3.gde.core.properties;
 
 
 import com.jme3.math.ColorRGBA;
 import com.jme3.math.ColorRGBA;
+import com.jme3.math.Vector4f;
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics;
 import java.awt.Rectangle;
 import java.awt.Rectangle;
@@ -50,6 +52,7 @@ public class ColorRGBAPropertyEditor implements PropertyEditor {
     private LinkedList<PropertyChangeListener> listeners = new LinkedList<PropertyChangeListener>();
     private LinkedList<PropertyChangeListener> listeners = new LinkedList<PropertyChangeListener>();
     private ColorRGBA color = new ColorRGBA();
     private ColorRGBA color = new ColorRGBA();
 
 
+    @Override
     public void setValue(Object value) {
     public void setValue(Object value) {
         if (value instanceof ColorRGBA) {
         if (value instanceof ColorRGBA) {
             if (color == null) {
             if (color == null) {
@@ -60,39 +63,56 @@ public class ColorRGBAPropertyEditor implements PropertyEditor {
         }
         }
     }
     }
 
 
+    @Override
     public Object getValue() {
     public Object getValue() {
         return color;
         return color;
     }
     }
 
 
+    @Override
     public boolean isPaintable() {
     public boolean isPaintable() {
         return true;
         return true;
     }
     }
+    
+    // See ColorRGBADialog#fromColor for comments
+    protected Color fromColor(ColorRGBA col) {
+        Vector4f vCol = new Vector4f(col.r, col.g, col.b, col.a);
+        float intensity = Math.max(Math.max(vCol.x, vCol.y), Math.max(vCol.z, vCol.w));
+        if (intensity > 1.0f) {
+            vCol.divideLocal(intensity);
+        }
+        
+        return new Color(vCol.x, vCol.y, vCol.z, vCol.w);
+    }
 
 
+    @Override
     public void paintValue(Graphics gfx, Rectangle box) {
     public void paintValue(Graphics gfx, Rectangle box) {
         final int width = box.height - 2;
         final int width = box.height - 2;
         final int height = box.height - 2;
         final int height = box.height - 2;
         java.awt.Color oldColor = gfx.getColor();
         java.awt.Color oldColor = gfx.getColor();
         gfx.setColor(java.awt.Color.BLACK);
         gfx.setColor(java.awt.Color.BLACK);
         gfx.drawRect(box.x, box.y + 1, width, height);
         gfx.drawRect(box.x, box.y + 1, width, height);
-        gfx.setColor(new java.awt.Color(color.asIntARGB(), true));
+        gfx.setColor(fromColor(color));
         gfx.fillRect(box.x + 1, box.y + 2, width - 1, height - 1);
         gfx.fillRect(box.x + 1, box.y + 2, width - 1, height - 1);
         gfx.setColor(oldColor);
         gfx.setColor(oldColor);
         gfx.drawString(getAsText(), box.x + width + 5, box.y + (box.height / 2) + 4);
         gfx.drawString(getAsText(), box.x + width + 5, box.y + (box.height / 2) + 4);
     }
     }
 
 
+    @Override
     public String getJavaInitializationString() {
     public String getJavaInitializationString() {
         return null;
         return null;
     }
     }
 
 
+    @Override
     public String getAsText() {
     public String getAsText() {
         return "[" + color.r + ", " + color.g + ", " + color.b + ", " + color.a + "]";
         return "[" + color.r + ", " + color.g + ", " + color.b + ", " + color.a + "]";
     }
     }
 
 
+    @Override
     public void setAsText(String text) throws IllegalArgumentException {
     public void setAsText(String text) throws IllegalArgumentException {
         text = text.replace('[', ' ');
         text = text.replace('[', ' ');
         text = text.replace(']', ' ');
         text = text.replace(']', ' ');
         String[] values = text.split(",");
         String[] values = text.split(",");
-        ColorRGBA old=color;
+        ColorRGBA old = color;
         if (values.length != 4) {
         if (values.length != 4) {
             throw (new IllegalArgumentException("String not correct"));
             throw (new IllegalArgumentException("String not correct"));
         }
         }
@@ -105,31 +125,35 @@ public class ColorRGBAPropertyEditor implements PropertyEditor {
         notifyListeners(old, color);
         notifyListeners(old, color);
     }
     }
 
 
+    @Override
     public String[] getTags() {
     public String[] getTags() {
         return null;
         return null;
     }
     }
 
 
+    @Override
     public Component getCustomEditor() {
     public Component getCustomEditor() {
         ColorRGBADialog dialog = new ColorRGBADialog(null, true, this);
         ColorRGBADialog dialog = new ColorRGBADialog(null, true, this);
         dialog.setLocationRelativeTo(null);
         dialog.setLocationRelativeTo(null);
         return dialog;
         return dialog;
     }
     }
 
 
+    @Override
     public boolean supportsCustomEditor() {
     public boolean supportsCustomEditor() {
         return true;
         return true;
     }
     }
 
 
+    @Override
     public void addPropertyChangeListener(PropertyChangeListener listener) {
     public void addPropertyChangeListener(PropertyChangeListener listener) {
         listeners.add(listener);
         listeners.add(listener);
     }
     }
 
 
+    @Override
     public void removePropertyChangeListener(PropertyChangeListener listener) {
     public void removePropertyChangeListener(PropertyChangeListener listener) {
         listeners.remove(listener);
         listeners.remove(listener);
     }
     }
 
 
     public void notifyListeners(ColorRGBA before, ColorRGBA after) {
     public void notifyListeners(ColorRGBA before, ColorRGBA after) {
-        for (Iterator<PropertyChangeListener> it = listeners.iterator(); it.hasNext();) {
-            PropertyChangeListener propertyChangeListener = it.next();
+        for (PropertyChangeListener propertyChangeListener : listeners) {
             //TODO: check what the "programmatic name" is supposed to be here.. for now its ColorRGBA
             //TODO: check what the "programmatic name" is supposed to be here.. for now its ColorRGBA
             propertyChangeListener.propertyChange(new PropertyChangeEvent(this, null, before, after));
             propertyChangeListener.propertyChange(new PropertyChangeEvent(this, null, before, after));
         }
         }