Author: oriol
Date: 2012-03-22 09:07:37 -0700 (Thu, 22 Mar 2012)
New Revision: 28614

Modified:
   
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
Log:
Fix bug #781. Tunable for double textboxes has been modified to behave as the 
one for an integer textBox, which displays numbers in the same way as they 
would display in a string. This behaviour is consistent with the one in 2.8.

Modified: 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
===================================================================
--- 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
 2012-03-22 14:32:38 UTC (rev 28613)
+++ 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
 2012-03-22 16:07:37 UTC (rev 28614)
@@ -59,9 +59,7 @@
                }
 
                //set Gui
-               
-               textField = new JFormattedTextField(new DecimalFormat());
-               textField.setValue(d);
+               textField = new JFormattedTextField(d.toString());
                panel = new JPanel(new BorderLayout());
                JLabel label = new JLabel(getDescription());
                label.setFont(new Font(null, Font.PLAIN,12));
@@ -96,7 +94,7 @@
                textField.setBackground(Color.white);
                Double d;
                try{
-                       d = ((Number) textField.getValue()).doubleValue();
+                       d = Double.parseDouble(textField.getText());
                        try {
                                setValue(d);
                        } catch (final Exception e) {
@@ -131,8 +129,7 @@
                if ( textField == null )
                        return "";
 
-               Double d = ((Number) textField.getValue()).doubleValue();
-               final String text = d.toString();
+               final String text = textField.getText();
                if ( text == null )
                        return "";
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to