Author: kono
Date: 2012-08-06 14:43:34 -0700 (Mon, 06 Aug 2012)
New Revision: 30105
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/PaintVisualProperty.java
Log:
Error handler fails generously. If non-Color objects are passed to it, just
use white color as a default value.
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/PaintVisualProperty.java
===================================================================
---
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/PaintVisualProperty.java
2012-08-06 20:52:01 UTC (rev 30104)
+++
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/PaintVisualProperty.java
2012-08-06 21:43:34 UTC (rev 30105)
@@ -82,10 +82,14 @@
@Override
public String toSerializableString(final Paint paint) {
- if (paint instanceof Color == false)
- throw new UnsupportedOperationException("Currently,
this implementation supports only Color object.");
- final Color color = (Color) paint;
+ final Color color;
+ if (paint instanceof Color == false) {
+ logger.warn("None-Color object found. Currently, this
implementation supports only Color object.");
+ color = Color.white;
+ } else {
+ color = (Color) paint;
+ }
String hex = Integer.toHexString(color.getRGB());
hex = hex.substring(2, hex.length()); // remove alpha bits
--
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.