Author: jm
Date: 2012-03-14 08:54:43 -0700 (Wed, 14 Mar 2012)
New Revision: 28530
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
Log:
Fixes #775: Fixed issues with DoubleHandler parsing
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-14 00:41:24 UTC (rev 28529)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/DoubleHandler.java
2012-03-14 15:54:43 UTC (rev 28530)
@@ -94,13 +94,11 @@
*/
public void handle() {
textField.setBackground(Color.white);
-
Double d;
try{
- d = Double.parseDouble(textField.getText());
+ d = ((Number) textField.getValue()).doubleValue();
try {
setValue(d);
-
} catch (final Exception e) {
textField.setBackground(Color.red);
JOptionPane.showMessageDialog(null, "The value
entered cannot be set!", "Error", JOptionPane.ERROR_MESSAGE);
@@ -108,7 +106,6 @@
textField.setBackground(Color.white);
return;
}
- textField.setValue(d);
} catch(NumberFormatException nfe) {
textField.setBackground(Color.red);
try {
@@ -134,7 +131,7 @@
if ( textField == null )
return "";
- Double d = Double.parseDouble( textField.getText());
+ Double d = ((Number) textField.getValue()).doubleValue();
final String text = d.toString();
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.