Author: kono
Date: 2009-05-28 13:45:52 -0700 (Thu, 28 May 2009)
New Revision: 16832
Added:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ThreeDVisualLexicon.java
Removed:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanTwoDVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorTwoDVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleTwoDVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringTwoDVisualProperty.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/
Modified:
core3/presentation-api/trunk/osgi.bnd
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/TwoDVisualLexicon.java
Log:
Two D properties are moved to general property package. Now it includes 3D
properties,too.
Modified: core3/presentation-api/trunk/osgi.bnd
===================================================================
--- core3/presentation-api/trunk/osgi.bnd 2009-05-28 20:44:37 UTC (rev
16831)
+++ core3/presentation-api/trunk/osgi.bnd 2009-05-28 20:45:52 UTC (rev
16832)
@@ -3,4 +3,4 @@
#-----------------------------------------------------------------
Import-Package: *
-Export-Package: org.cytoscape.view.presentation,
org.cytoscape.view.presentation.twod
+Export-Package: org.cytoscape.view.presentation,
org.cytoscape.view.presentation.property
Modified:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
2009-05-28 20:44:37 UTC (rev 16831)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/PresentationFactory.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -8,10 +8,12 @@
* display. It should also be sure to register said content as a transfer
* (Drag 'n Drop) listener, if so desired.
*/
- void addPresentation(Object frame, CyNetworkView view);
+ public void addPresentation(Object frame, CyNetworkView view);
/**
*
*/
- NavigationPresentation addNavigationPresentation(Object targetComponent,
Object navBounds);
+ public NavigationPresentation addNavigationPresentation(Object
targetComponent, Object navBounds);
+
+ public NetworkRenderer getPresentation(CyNetworkView view);
}
Copied:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property
(from rev 16773,
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod)
Deleted:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanTwoDVisualProperty.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/BooleanTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanTwoDVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -1,53 +0,0 @@
-
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.presentation.twod;
-
-import org.cytoscape.view.model.AbstractVisualProperty;
-
-public class BooleanTwoDVisualProperty extends AbstractVisualProperty<Boolean>
{
-
- public BooleanTwoDVisualProperty(final String ot, final Boolean def,
final String id, final String name) {
- super(ot,def,id,name);
- }
-
- public String getSerializableString(final Boolean value) {
- return value.toString();
- }
-
- public Boolean parseSerializableString(final String text) {
- return Boolean.valueOf(text);
- }
-}
Copied:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanVisualProperty.java
(from rev 16773,
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/BooleanTwoDVisualProperty.java)
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/BooleanTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/BooleanVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -0,0 +1,53 @@
+
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.view.presentation.property;
+
+import org.cytoscape.view.model.AbstractVisualProperty;
+
+public class BooleanVisualProperty extends AbstractVisualProperty<Boolean> {
+
+ public BooleanVisualProperty(final String ot, final Boolean def, final
String id, final String name) {
+ super(ot,def,id,name);
+ }
+
+ public String getSerializableString(final Boolean value) {
+ return value.toString();
+ }
+
+ public Boolean parseSerializableString(final String text) {
+ return Boolean.valueOf(text);
+ }
+}
Deleted:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorTwoDVisualProperty.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/ColorTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorTwoDVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -1,87 +0,0 @@
-
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.presentation.twod;
-
-import java.awt.Color;
-import java.util.StringTokenizer;
-import org.cytoscape.view.model.AbstractVisualProperty;
-
-public class ColorTwoDVisualProperty extends AbstractVisualProperty<Color> {
-
- public ColorTwoDVisualProperty(final String ot, final Color def, final
String id, final String name) {
- super(ot,def,id,name);
- }
-
- public String getSerializableString(final Color color) {
- Integer red = new Integer(color.getRed());
- Integer green = new Integer(color.getGreen());
- Integer blue = new Integer(color.getBlue());
-
- return new String(red.toString() + "," + green.toString() + ","
+ blue.toString());
- }
-
- public Color parseSerializableString(final String text) {
- // Start by seeing if this is a hex representation
- if (text.startsWith("#")) {
- try {
- Color c = Color.decode(text);
- return c;
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("invalid hex
RGB format");
- }
- }
-
- // ok, this must be 3 comma separated integers instead
- StringTokenizer strtok = new StringTokenizer(text, ",");
-
- if (strtok.countTokens() != 3)
- throw new IllegalArgumentException("not all RGB
integers specified");
-
- String red = strtok.nextToken().trim();
- String green = strtok.nextToken().trim();
- String blue = strtok.nextToken().trim();
-
- try {
- int r = Integer.parseInt(red);
- int g = Integer.parseInt(green);
- int b = Integer.parseInt(blue);
-
- return new Color(r, g, b);
- } catch (NumberFormatException e) {
- throw new IllegalArgumentException("invalid RGB
format");
- }
- }
-}
Copied:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorVisualProperty.java
(from rev 16773,
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/ColorTwoDVisualProperty.java)
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/ColorTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ColorVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -0,0 +1,87 @@
+
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.view.presentation.property;
+
+import java.awt.Color;
+import java.util.StringTokenizer;
+import org.cytoscape.view.model.AbstractVisualProperty;
+
+public class ColorVisualProperty extends AbstractVisualProperty<Color> {
+
+ public ColorVisualProperty(final String ot, final Color def, final
String id, final String name) {
+ super(ot,def,id,name);
+ }
+
+ public String getSerializableString(final Color color) {
+ Integer red = new Integer(color.getRed());
+ Integer green = new Integer(color.getGreen());
+ Integer blue = new Integer(color.getBlue());
+
+ return new String(red.toString() + "," + green.toString() + ","
+ blue.toString());
+ }
+
+ public Color parseSerializableString(final String text) {
+ // Start by seeing if this is a hex representation
+ if (text.startsWith("#")) {
+ try {
+ Color c = Color.decode(text);
+ return c;
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("invalid hex
RGB format");
+ }
+ }
+
+ // ok, this must be 3 comma separated integers instead
+ StringTokenizer strtok = new StringTokenizer(text, ",");
+
+ if (strtok.countTokens() != 3)
+ throw new IllegalArgumentException("not all RGB
integers specified");
+
+ String red = strtok.nextToken().trim();
+ String green = strtok.nextToken().trim();
+ String blue = strtok.nextToken().trim();
+
+ try {
+ int r = Integer.parseInt(red);
+ int g = Integer.parseInt(green);
+ int b = Integer.parseInt(blue);
+
+ return new Color(r, g, b);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("invalid RGB
format");
+ }
+ }
+}
Deleted:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleTwoDVisualProperty.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/DoubleTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleTwoDVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -1,53 +0,0 @@
-
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.presentation.twod;
-
-import org.cytoscape.view.model.AbstractVisualProperty;
-
-public class DoubleTwoDVisualProperty extends AbstractVisualProperty<Double> {
-
- public DoubleTwoDVisualProperty(final String ot, final Double def,
final String id, final String name) {
- super(ot,def,id,name);
- }
-
- public String getSerializableString(final Double value) {
- return value.toString();
- }
-
- public Double parseSerializableString(final String text) {
- return Double.valueOf(text);
- }
-}
Copied:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
(from rev 16773,
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/DoubleTwoDVisualProperty.java)
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/DoubleTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/DoubleVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -0,0 +1,53 @@
+
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.view.presentation.property;
+
+import org.cytoscape.view.model.AbstractVisualProperty;
+
+public class DoubleVisualProperty extends AbstractVisualProperty<Double> {
+
+ public DoubleVisualProperty(final String ot, final Double def, final
String id, final String name) {
+ super(ot,def,id,name);
+ }
+
+ public String getSerializableString(final Double value) {
+ return value.toString();
+ }
+
+ public Double parseSerializableString(final String text) {
+ return Double.valueOf(text);
+ }
+}
Deleted:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringTwoDVisualProperty.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/StringTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringTwoDVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -1,53 +0,0 @@
-
-/*
- Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
-
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
-
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.presentation.twod;
-
-import org.cytoscape.view.model.AbstractVisualProperty;
-
-public class StringTwoDVisualProperty extends AbstractVisualProperty<String> {
-
- public StringTwoDVisualProperty(final String ot, final String def,
final String id, final String name) {
- super(ot,def,id,name);
- }
-
- public String getSerializableString(final String value) {
- return value;
- }
-
- public String parseSerializableString(final String text) {
- return text;
- }
-}
Copied:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringVisualProperty.java
(from rev 16773,
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/StringTwoDVisualProperty.java)
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/StringTwoDVisualProperty.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/StringVisualProperty.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -0,0 +1,53 @@
+
+/*
+ Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
+
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+package org.cytoscape.view.presentation.property;
+
+import org.cytoscape.view.model.AbstractVisualProperty;
+
+public class StringVisualProperty extends AbstractVisualProperty<String> {
+
+ public StringVisualProperty(final String ot, final String def, final
String id, final String name) {
+ super(ot,def,id,name);
+ }
+
+ public String getSerializableString(final String value) {
+ return value;
+ }
+
+ public String parseSerializableString(final String text) {
+ return text;
+ }
+}
Added:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ThreeDVisualLexicon.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/ThreeDVisualLexicon.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/ThreeDVisualLexicon.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -0,0 +1,19 @@
+package org.cytoscape.view.presentation.property;
+
+import static org.cytoscape.model.GraphObject.NETWORK;
+import static org.cytoscape.model.GraphObject.NODE;
+
+import org.cytoscape.view.model.VisualProperty;
+
+public class ThreeDVisualLexicon extends TwoDVisualLexicon {
+
+ public static final VisualProperty<Double> NODE_Z_LOCATION = new
DoubleVisualProperty(
+ NODE, 0.0, "NODE_Z_LOCATION", "Node Z Location");
+
+ public static final VisualProperty<Double> NETWORK_CENTER_Z_LOCATION =
new DoubleVisualProperty(
+ NETWORK, 0.0, "NETWORK_CENTER_Z_LOCATION",
+ "Network Center Z Location");
+
+ public static final VisualProperty<Double> NETWORK_DEPTH = new
DoubleVisualProperty(
+ NETWORK, 0.0, "NETWORK_DEPTH", "Network Depth");
+}
Modified:
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/TwoDVisualLexicon.java
===================================================================
---
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/twod/TwoDVisualLexicon.java
2009-05-05 22:27:23 UTC (rev 16773)
+++
core3/presentation-api/trunk/src/main/java/org/cytoscape/view/presentation/property/TwoDVisualLexicon.java
2009-05-28 20:45:52 UTC (rev 16832)
@@ -1,4 +1,3 @@
-
/*
Copyright (c) 2008, The Cytoscape Consortium (www.cytoscape.org)
@@ -32,8 +31,8 @@
You should have received a copy of the GNU Lesser General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
-package org.cytoscape.view.presentation.twod;
+ */
+package org.cytoscape.view.presentation.property;
import static org.cytoscape.model.GraphObject.EDGE;
import static org.cytoscape.model.GraphObject.NETWORK;
@@ -41,61 +40,71 @@
import java.awt.Color;
import java.awt.Paint;
+import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.Map;
import java.util.Set;
import org.cytoscape.view.model.VisualLexicon;
import org.cytoscape.view.model.VisualProperty;
/**
- * Should be implemented as a service.
- * 'Renderer' is simply anything that provides VisualProperties.
- * With a 'VisualProperties as annotations' this won't be needed.
+ * Should be implemented as a service. 'Renderer' is simply anything that
+ * provides VisualProperties. With a 'VisualProperties as annotations' this
+ * won't be needed.
*/
public abstract class TwoDVisualLexicon implements VisualLexicon {
+ protected static final String[] OBJ_TYPE = { NODE, EDGE, NETWORK };
+
+ protected Map<String, Set<VisualProperty<?>>> propMap;
+
protected final Set<VisualProperty<?>> visualPropertySet;
- public static final VisualProperty<? extends Paint> NODE_COLOR
- = new ColorTwoDVisualProperty(NODE,Color.RED,"NODE_COLOR","Node
Color");
- public static final VisualProperty<String> NODE_LABEL
- = new StringTwoDVisualProperty(NODE,"","NODE_LABEL","Node
Label");
- public static final VisualProperty<? extends Paint> NODE_LABEL_COLOR
- = new
ColorTwoDVisualProperty(NODE,Color.BLACK,"NODE_LABEL_COLOR","Node Label Color");
- public static final VisualProperty<Double> NODE_X_LOCATION
- = new DoubleTwoDVisualProperty(NODE,0.0,"NODE_X_LOCATION","Node
X Location");
- public static final VisualProperty<Double> NODE_Y_LOCATION
- = new DoubleTwoDVisualProperty(NODE,0.0,"NODE_Y_LOCATION","Node
Y Location");
- public static final VisualProperty<Boolean> NODE_VISIBLE
- = new BooleanTwoDVisualProperty(NODE,true,"NODE_VISIBLE","Node
Visible");
- public static final VisualProperty<Boolean> NODE_SELECTED
- = new
BooleanTwoDVisualProperty(NODE,false,"NODE_SELECTED","Node Selected");
- public static final VisualProperty<? extends Paint> EDGE_COLOR
- = new
ColorTwoDVisualProperty(EDGE,Color.BLUE,"EDGE_COLOR","Edge Color");
- public static final VisualProperty<String> EDGE_LABEL
- = new StringTwoDVisualProperty(EDGE,"","EDGE_LABEL","Edge
Label");
- public static final VisualProperty<? extends Paint> EDGE_LABEL_COLOR
- = new
ColorTwoDVisualProperty(EDGE,Color.BLACK,"EDGE_LABEL_COLOR","Edge Label Color");
- public static final VisualProperty<Boolean> EDGE_VISIBLE
- = new BooleanTwoDVisualProperty(EDGE,true,"EDGE_VISIBLE","Edge
Visible");
- public static final VisualProperty<Boolean> EDGE_SELECTED
- = new
BooleanTwoDVisualProperty(EDGE,false,"EDGE_SELECTED","Edge Selected");
- public static final VisualProperty<Double> NETWORK_SCALE_FACTOR
- = new
DoubleTwoDVisualProperty(NETWORK,1.0,"NETWORK_SCALE_FACTOR","Network Scale
Factor");
- public static final VisualProperty<Double> NETWORK_CENTER_X_LOCATION
- = new
DoubleTwoDVisualProperty(NETWORK,0.0,"NETWORK_CENTER_X_LOCATION","Network
Center X Location");
- public static final VisualProperty<Double> NETWORK_CENTER_Y_LOCATION
- = new
DoubleTwoDVisualProperty(NETWORK,0.0,"NETWORK_CENTER_Y_LOCATION","Network
Center Y Location");
- public static final VisualProperty<Double> NETWORK_WIDTH
- = new
DoubleTwoDVisualProperty(NETWORK,100.0,"NETWORK_WIDTH","Network Width");
- public static final VisualProperty<Double> NETWORK_HEIGHT
- = new
DoubleTwoDVisualProperty(NETWORK,100.0,"NETWORK_HEIGHT","Network Height");
+ public static final VisualProperty<? extends Paint> NODE_COLOR = new
ColorVisualProperty(
+ NODE, Color.RED, "NODE_COLOR", "Node Color");
+ public static final VisualProperty<String> NODE_LABEL = new
StringVisualProperty(
+ NODE, "", "NODE_LABEL", "Node Label");
+ public static final VisualProperty<? extends Paint> NODE_LABEL_COLOR =
new ColorVisualProperty(
+ NODE, Color.BLACK, "NODE_LABEL_COLOR", "Node Label
Color");
+ public static final VisualProperty<Double> NODE_X_LOCATION = new
DoubleVisualProperty(
+ NODE, 0.0, "NODE_X_LOCATION", "Node X Location");
+ public static final VisualProperty<Double> NODE_Y_LOCATION = new
DoubleVisualProperty(
+ NODE, 0.0, "NODE_Y_LOCATION", "Node Y Location");
+ public static final VisualProperty<Boolean> NODE_VISIBLE = new
BooleanVisualProperty(
+ NODE, true, "NODE_VISIBLE", "Node Visible");
+ public static final VisualProperty<Boolean> NODE_SELECTED = new
BooleanVisualProperty(
+ NODE, false, "NODE_SELECTED", "Node Selected");
+ public static final VisualProperty<? extends Paint> EDGE_COLOR = new
ColorVisualProperty(
+ EDGE, Color.BLUE, "EDGE_COLOR", "Edge Color");
+ public static final VisualProperty<String> EDGE_LABEL = new
StringVisualProperty(
+ EDGE, "", "EDGE_LABEL", "Edge Label");
+ public static final VisualProperty<? extends Paint> EDGE_LABEL_COLOR =
new ColorVisualProperty(
+ EDGE, Color.BLACK, "EDGE_LABEL_COLOR", "Edge Label
Color");
+ public static final VisualProperty<Boolean> EDGE_VISIBLE = new
BooleanVisualProperty(
+ EDGE, true, "EDGE_VISIBLE", "Edge Visible");
+ public static final VisualProperty<Boolean> EDGE_SELECTED = new
BooleanVisualProperty(
+ EDGE, false, "EDGE_SELECTED", "Edge Selected");
+ public static final VisualProperty<Double> NETWORK_SCALE_FACTOR = new
DoubleVisualProperty(
+ NETWORK, 1.0, "NETWORK_SCALE_FACTOR", "Network Scale
Factor");
+ public static final VisualProperty<Double> NETWORK_CENTER_X_LOCATION =
new DoubleVisualProperty(
+ NETWORK, 0.0, "NETWORK_CENTER_X_LOCATION",
+ "Network Center X Location");
+ public static final VisualProperty<Double> NETWORK_CENTER_Y_LOCATION =
new DoubleVisualProperty(
+ NETWORK, 0.0, "NETWORK_CENTER_Y_LOCATION",
+ "Network Center Y Location");
+ public static final VisualProperty<Double> NETWORK_WIDTH = new
DoubleVisualProperty(
+ NETWORK, 100.0, "NETWORK_WIDTH", "Network Width");
+ public static final VisualProperty<Double> NETWORK_HEIGHT = new
DoubleVisualProperty(
+ NETWORK, 100.0, "NETWORK_HEIGHT", "Network Height");
- public static final VisualProperty<? extends Paint>
NETWORK_BACKGROUND_COLOR
- = new
ColorTwoDVisualProperty(NETWORK,Color.WHITE,"NETWORK_BACKGROUND_COLOR","Network
Background Color");
- public static final VisualProperty<String> NETWORK_TITLE
- = new
StringTwoDVisualProperty(NETWORK,"","NETWORK_TITLE","Network Title");
+ public static final VisualProperty<? extends Paint>
NETWORK_BACKGROUND_COLOR = new ColorVisualProperty(
+ NETWORK, Color.WHITE, "NETWORK_BACKGROUND_COLOR",
+ "Network Background Color");
+ public static final VisualProperty<String> NETWORK_TITLE = new
StringVisualProperty(
+ NETWORK, "", "NETWORK_TITLE", "Network Title");
public TwoDVisualLexicon() {
@@ -123,7 +132,21 @@
}
public Set<VisualProperty<?>> getAllVisualProperties() {
- return Collections.unmodifiableSet( visualPropertySet );
+ return Collections.unmodifiableSet(visualPropertySet);
}
+ public Collection<VisualProperty<?>> getVisualProperties(String
objectType) {
+ if (propMap == null) {
+ propMap = new HashMap<String, Set<VisualProperty<?>>>();
+
+ for (String type : OBJ_TYPE)
+ propMap.put(type, new
HashSet<VisualProperty<?>>());
+
+ for (VisualProperty<?> vp : visualPropertySet)
+ propMap.get(vp.getObjectType()).add(vp);
+ }
+
+ return propMap.get(objectType);
+ }
+
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---