Author: clopes
Date: 2012-06-19 08:59:23 -0700 (Tue, 19 Jun 2012)
New Revision: 29616
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/LineTypeVisualProperty.java
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/NodeShapeVisualProperty.java
Log:
Fixes #1142 ("V" Node Shape is not restored from session files).
Also fixes parsing line types and arrow shapes.
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
===================================================================
---
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
2012-06-19 14:19:24 UTC (rev 29615)
+++
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/ArrowShapeVisualProperty.java
2012-06-19 15:59:23 UTC (rev 29616)
@@ -78,6 +78,16 @@
if (value != null)
shape = DEFAULT_SHAPES.get(value.toUpperCase());
+ if (shape == null) {
+ // Try to find the shape in the range (it might have
been added by a private visual lexicon)
+ for (final ArrowShape as : ARROW_SHAPE_RANGE.values()) {
+ if
(as.getSerializableString().equalsIgnoreCase(value)) {
+ shape = as;
+ break;
+ }
+ }
+ }
+
return shape;
}
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/LineTypeVisualProperty.java
===================================================================
---
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/LineTypeVisualProperty.java
2012-06-19 14:19:24 UTC (rev 29615)
+++
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/LineTypeVisualProperty.java
2012-06-19 15:59:23 UTC (rev 29616)
@@ -71,8 +71,19 @@
lineType = lineTypes.get(value);
}
- if (lineType == null) lineType = SOLID;
+ if (lineType == null) {
+ // Try to find it in the range (it might have been
added by a private visual lexicon)
+ for (final LineType lt : LINE_TYPE_RANGE.values()) {
+ if
(lt.getSerializableString().equalsIgnoreCase(value)) {
+ lineType = lt;
+ break;
+ }
+ }
+ }
+ if (lineType == null)
+ lineType = SOLID;
+
return lineType;
}
Modified:
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/NodeShapeVisualProperty.java
===================================================================
---
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/NodeShapeVisualProperty.java
2012-06-19 14:19:24 UTC (rev 29615)
+++
core3/api/trunk/presentation-api/src/main/java/org/cytoscape/view/presentation/property/NodeShapeVisualProperty.java
2012-06-19 15:59:23 UTC (rev 29616)
@@ -88,6 +88,16 @@
if (value != null)
shape = DEFAULT_SHAPES.get(value.toUpperCase());
+ if (shape == null) {
+ // Try to find the shape in the range (it might have
been added by a private visual lexicon)
+ for (final NodeShape ns : NODE_SHAPE_RANGE.values()) {
+ if
(ns.getSerializableString().equalsIgnoreCase(value)) {
+ shape = ns;
+ break;
+ }
+ }
+ }
+
return shape;
}
--
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.