Author: kono Date: 2009-12-09 18:45:29 -0800 (Wed, 09 Dec 2009) New Revision: 18715
Modified: csplugins/trunk/ucsd/kono/NCBIClient2/manifest/plugin.props csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/NCBIClient.java csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/util/VisualStyleBuilder.java Log: Create view is turned off. This will be done in core from Cytoscape 2.7.0. Modified: csplugins/trunk/ucsd/kono/NCBIClient2/manifest/plugin.props =================================================================== --- csplugins/trunk/ucsd/kono/NCBIClient2/manifest/plugin.props 2009-12-10 01:27:37 UTC (rev 18714) +++ csplugins/trunk/ucsd/kono/NCBIClient2/manifest/plugin.props 2009-12-10 02:45:29 UTC (rev 18715) @@ -8,7 +8,7 @@ pluginDescription=<p>Web Service client module for <a href="http://www.ncbi.nlm.nih.gov/entrez/query/static/esoap_help.html">NCBI Entrez Utilities Web Service</a>.</p><p>For more information, please visit the following pages:</p><ul><li><a href="http://www.cytoscape.org/cgi-bin/moin.cgi/SampleWebServiceClients">Sample clients</a></li><li><a href="http://www.cytoscape.org/cgi-bin/moin.cgi/WebServiceWorkflow">Sample workflow</a></li></ul><p><strong><font color="red">To use this function from Cytoscape Desktop, <u>NCBI Entrez Gene User Interface</u> plugin is required. This plugin works with Cytoscape 2.7.0 or later.</font></strong> # Plugin version number, this must be two numbers separated by a decimlal. Ex. 0.2, 14.03 -pluginVersion=0.92 +pluginVersion=0.95 # Compatible Cytoscape version cytoscapeVersion=2.7 Modified: csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/NCBIClient.java =================================================================== --- csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/NCBIClient.java 2009-12-10 01:27:37 UTC (rev 18714) +++ csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/NCBIClient.java 2009-12-10 02:45:29 UTC (rev 18715) @@ -594,8 +594,9 @@ } if (net == null) { + // Create network without view net = Cytoscape.createNetwork(nodeList, edgeList, "NCBI-Net", - null); + null, false); Cytoscape.firePropertyChange( WSResponseType.DATA_IMPORT_FINISHED.toString(), null, net); @@ -799,8 +800,8 @@ .getOtherSourceSrc().getDbtag() .getDbtagDb(); - System.out.println("DB Tag for nodeID: " - + nodeid + " = " + nodeType); +// System.out.println("DB Tag for nodeID: " +// + nodeid + " = " + nodeType); // In case ID is not GeneID, put tag if (nodeType.equals(GENE_ID_TAG) == false) { Modified: csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/util/VisualStyleBuilder.java =================================================================== --- csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/util/VisualStyleBuilder.java 2009-12-10 01:27:37 UTC (rev 18714) +++ csplugins/trunk/ucsd/kono/NCBIClient2/src/edu/ucsd/bioeng/idekerlab/ncbiclient/util/VisualStyleBuilder.java 2009-12-10 02:45:29 UTC (rev 18715) @@ -13,8 +13,8 @@ import cytoscape.visual.VisualPropertyType; import cytoscape.visual.VisualStyle; import cytoscape.visual.calculators.AbstractCalculator; -import cytoscape.visual.calculators.EdgeCalculator; -import cytoscape.visual.calculators.NodeCalculator; +import cytoscape.visual.calculators.BasicCalculator; +import cytoscape.visual.calculators.Calculator; import cytoscape.visual.mappings.DiscreteMapping; import cytoscape.visual.mappings.ObjectMapping; import cytoscape.visual.mappings.PassThroughMapping; @@ -29,35 +29,32 @@ private static final String DEF_VS_NAME = "Entrez Gene Style"; private static final String NEW_VS_NAME = "Entrez Gene Style 2"; - - + // Tag definitions - - + private static VisualStyleBuilder builder = new VisualStyleBuilder(); - + public static VisualStyle getDefaultStyle() { return builder.getDefStyle(); } - + public static VisualStyle getNewVisualStyle() { return builder.getNewStyle(); } private VisualStyleBuilder() { defaultVS = buidlDefaultStyle(); - newVS = buildNewStyle(); + newVS = buildNewStyle(); } - + public VisualStyle getDefStyle() { return defaultVS; } - + public VisualStyle getNewStyle() { return newVS; } - - + /** * Generate default visual style. The style is database-dependent. * @@ -81,12 +78,12 @@ PassThroughMapping m = new PassThroughMapping("", AbstractCalculator.ID); - NodeCalculator calc = new NodeCalculator(DEF_VS_NAME + "-" - + "NodeLabelMapping", m, null, NODE_LABEL); + final Calculator calc = new BasicCalculator(DEF_VS_NAME + "-" + + "NodeLabelMapping", m, NODE_LABEL); PassThroughMapping me = new PassThroughMapping("", "interaction"); - EdgeCalculator calce = new EdgeCalculator(DEF_VS_NAME + "-" - + "EdgeLabelMapping", me, null, EDGE_LABEL); + final Calculator calce = new BasicCalculator(DEF_VS_NAME + "-" + + "EdgeLabelMapping", me, EDGE_LABEL); nac.setCalculator(calc); nac.getDefaultAppearance().set(VisualPropertyType.NODE_FILL_COLOR, @@ -133,14 +130,13 @@ edgeLineStyle.putMapValue("physical", LineStyle.SOLID); edgeLineStyle.putMapValue("genetic", LineStyle.LONG_DASH); - EdgeCalculator edgeColorCalc = new EdgeCalculator(DEF_VS_NAME + "-" - + "EdgeColorMapping", edgeColor, null, - VisualPropertyType.EDGE_COLOR); + Calculator edgeColorCalc = new BasicCalculator(DEF_VS_NAME + "-" + + "EdgeColorMapping", edgeColor, VisualPropertyType.EDGE_COLOR); eac.setCalculator(edgeColorCalc); - EdgeCalculator edgeLineStyleCalc = new EdgeCalculator(DEF_VS_NAME + "-" - + "EdgeLineStyleMapping", edgeLineStyle, null, + Calculator edgeLineStyleCalc = new BasicCalculator(DEF_VS_NAME + "-" + + "EdgeLineStyleMapping", edgeLineStyle, VisualPropertyType.EDGE_LINE_STYLE); eac.setCalculator(edgeLineStyleCalc); @@ -169,25 +165,25 @@ PassThroughMapping m = new PassThroughMapping("", "Alt Name"); - NodeCalculator calc = new NodeCalculator(NEW_VS_NAME + "-" - + "NodeLabelMapping", m, null, NODE_LABEL); + final Calculator calc = new BasicCalculator(NEW_VS_NAME + "-" + + "NodeLabelMapping", m, NODE_LABEL); PassThroughMapping me = new PassThroughMapping("", "interaction"); - EdgeCalculator calce = new EdgeCalculator(NEW_VS_NAME + "-" - + "EdgeLabelMapping", me, null, EDGE_LABEL); + final Calculator calce = new BasicCalculator(NEW_VS_NAME + "-" + + "EdgeLabelMapping", me, EDGE_LABEL); nac.setCalculator(calc); - // Setup default view nac.getDefaultAppearance().set(VisualPropertyType.NODE_FILL_COLOR, NODE_COLOR); nac.getDefaultAppearance().set(VisualPropertyType.NODE_BORDER_COLOR, NODE_BORDER_COLOR); - + nac.getDefaultAppearance().set(VisualPropertyType.NODE_SHAPE, NodeShape.RECT); nac.getDefaultAppearance().set(VisualPropertyType.NODE_OPACITY, 110); - nac.getDefaultAppearance().set(VisualPropertyType.NODE_BORDER_OPACITY, 240); + nac.getDefaultAppearance().set(VisualPropertyType.NODE_BORDER_OPACITY, + 240); nac.getDefaultAppearance().set(VisualPropertyType.NODE_LABEL_OPACITY, 225); nac.getDefaultAppearance().set(VisualPropertyType.NODE_LINE_WIDTH, 3); @@ -213,9 +209,8 @@ eac.getDefaultAppearance().set(VisualPropertyType.EDGE_LINE_WIDTH, 2); eac.getDefaultAppearance().set(VisualPropertyType.EDGE_LABEL, ""); - // Modify node apeearence based on type - + // Color DiscreteMapping nodeColor = new DiscreteMapping(NODE_COLOR, "Interactor Type", ObjectMapping.NODE_MAPPING); @@ -223,23 +218,24 @@ nodeColor.putMapValue(GENE_ID, NODE_COLOR); nodeColor.putMapValue(PROTEIN, new Color(0x64, 0x95, 0xed)); nodeColor.putMapValue(NUCLEOTIDE, new Color(0xff, 0x7f, 0x50)); - - NodeCalculator nodeColorCalc = new NodeCalculator(NEW_VS_NAME + "-" - + "NodeColorMapping", nodeColor, null, + + final Calculator nodeColorCalc = new BasicCalculator(NEW_VS_NAME + "-" + + "NodeColorMapping", nodeColor, VisualPropertyType.NODE_FILL_COLOR); nac.setCalculator(nodeColorCalc); - + // Border Color - DiscreteMapping nodeBorderColor = new DiscreteMapping(NODE_BORDER_COLOR, - "Interactor Type", ObjectMapping.NODE_MAPPING); + DiscreteMapping nodeBorderColor = new DiscreteMapping( + NODE_BORDER_COLOR, "Interactor Type", + ObjectMapping.NODE_MAPPING); nodeBorderColor.putMapValue(GENE_ID, NODE_BORDER_COLOR); nodeBorderColor.putMapValue(PROTEIN, new Color(0x0000cd)); nodeBorderColor.putMapValue(NUCLEOTIDE, new Color(0x800000)); - - NodeCalculator nodeBorderColorCalc = new NodeCalculator(NEW_VS_NAME + "-" - + "NodeBorderColorMapping", nodeBorderColor, null, + + final Calculator nodeBorderColorCalc = new BasicCalculator(NEW_VS_NAME + + "-" + "NodeBorderColorMapping", nodeBorderColor, VisualPropertyType.NODE_BORDER_COLOR); nac.setCalculator(nodeBorderColorCalc); @@ -251,13 +247,12 @@ nodeShape.putMapValue(GENE_ID, NodeShape.RECT); nodeShape.putMapValue(PROTEIN, NodeShape.ELLIPSE); nodeShape.putMapValue(NUCLEOTIDE, NodeShape.OCTAGON); - - NodeCalculator nodeShapeCalc = new NodeCalculator(NEW_VS_NAME + "-" - + "NodeShapeMapping", nodeShape, null, - VisualPropertyType.NODE_SHAPE); + final Calculator nodeShapeCalc = new BasicCalculator(NEW_VS_NAME + "-" + + "NodeShapeMapping", nodeShape, VisualPropertyType.NODE_SHAPE); + nac.setCalculator(nodeShapeCalc); - + // Set edge color based on datasource name DiscreteMapping edgeColor = new DiscreteMapping(EDGE_COLOR, "datasource", ObjectMapping.EDGE_MAPPING); @@ -272,27 +267,26 @@ edgeLineStyle.putMapValue("physical", LineStyle.SOLID); edgeLineStyle.putMapValue("genetic", LineStyle.LONG_DASH); - EdgeCalculator edgeColorCalc = new EdgeCalculator(NEW_VS_NAME + "-" - + "EdgeColorMapping", edgeColor, null, - VisualPropertyType.EDGE_COLOR); + final Calculator edgeColorCalc = new BasicCalculator(NEW_VS_NAME + "-" + + "EdgeColorMapping", edgeColor, VisualPropertyType.EDGE_COLOR); eac.setCalculator(edgeColorCalc); - EdgeCalculator edgeLineStyleCalc = new EdgeCalculator(NEW_VS_NAME + "-" - + "EdgeLineStyleMapping", edgeLineStyle, null, + final Calculator edgeLineStyleCalc = new BasicCalculator(NEW_VS_NAME + + "-" + "EdgeLineStyleMapping", edgeLineStyle, VisualPropertyType.EDGE_LINE_STYLE); eac.setCalculator(edgeLineStyleCalc); - + // Edge line width mapping. - DiscreteMapping edgeWidth = new DiscreteMapping(2, - "interaction type", ObjectMapping.EDGE_MAPPING); + DiscreteMapping edgeWidth = new DiscreteMapping(2, "interaction type", + ObjectMapping.EDGE_MAPPING); edgeWidth.putMapValue("physical", 3); edgeWidth.putMapValue("genetic", 2); - EdgeCalculator edgeWidthCalc = new EdgeCalculator(NEW_VS_NAME + "-" - + "EdgeWidthMapping", edgeWidth, null, + final Calculator edgeWidthCalc = new BasicCalculator(NEW_VS_NAME + "-" + + "EdgeWidthMapping", edgeWidth, VisualPropertyType.EDGE_LINE_WIDTH); eac.setCalculator(edgeWidthCalc); -- 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.
