Author: jm
Date: 2011-06-22 08:19:28 -0700 (Wed, 22 Jun 2011)
New Revision: 25875
Modified:
core3/biopax-impl/trunk/pom.xml
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/DisplayBioPaxXmlTask.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/ExportAsBioPAXTask.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/NetworkListenerImpl.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/util/ParentFinder.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/BioPaxContainerImpl.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/LegendPanel.java
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/util/BioPaxUtil.java
core3/cpath2-impl/trunk/pom.xml
core3/cpath2-impl/trunk/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
Log:
Fix for ticket #286: Upgraded biopax-impl to use paxtools-3.0.0
Fixed node selection behaviour which occurred because of recent changes in
event API
Modified: core3/biopax-impl/trunk/pom.xml
===================================================================
--- core3/biopax-impl/trunk/pom.xml 2011-06-22 02:16:51 UTC (rev 25874)
+++ core3/biopax-impl/trunk/pom.xml 2011-06-22 15:19:28 UTC (rev 25875)
@@ -61,13 +61,8 @@
<dependency>
<groupId>cytoscape-temp</groupId>
<artifactId>paxtools-core</artifactId>
- <version>1.0</version>
+ <version>3.0.0</version>
</dependency>
- <dependency>
- <groupId>cytoscape-temp</groupId>
- <artifactId>paxtools-simple-io</artifactId>
- <version>1.0</version>
- </dependency>
<dependency>
<groupId>cytoscape-temp</groupId>
<artifactId>commons-codec</artifactId>
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/DisplayBioPaxXmlTask.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/DisplayBioPaxXmlTask.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/DisplayBioPaxXmlTask.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -5,7 +5,7 @@
import javax.swing.JOptionPane;
-import org.biopax.paxtools.io.simpleIO.SimpleExporter;
+import org.biopax.paxtools.io.SimpleIOHandler;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.Model;
import org.cytoscape.biopax.internal.BioPaxFactory;
@@ -52,7 +52,7 @@
if (bpe != null) {
log.info("printing " + bpe + " OWL");
try {
- SimpleExporter simpleExporter = new
SimpleExporter(m.getLevel());
+ SimpleIOHandler simpleExporter = new
SimpleIOHandler(m.getLevel());
//TODO Fix: it prints '<:null' instead '<bp:'
when using writeObject method!
simpleExporter.writeObject(writer, bpe);
} catch (Exception e) {
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/ExportAsBioPAXTask.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/ExportAsBioPAXTask.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/ExportAsBioPAXTask.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -3,7 +3,7 @@
import java.io.IOException;
import java.io.OutputStream;
-import org.biopax.paxtools.io.simpleIO.SimpleExporter;
+import org.biopax.paxtools.io.SimpleIOHandler;
import org.biopax.paxtools.model.Model;
import org.cytoscape.biopax.util.BioPaxUtil;
import org.cytoscape.io.write.CyWriter;
@@ -34,7 +34,7 @@
if(bpModel == null || bpModelStr == null )
throw new IllegalArgumentException("Invalid/empty BioPAX
model.");
- SimpleExporter simpleExporter = new
SimpleExporter(bpModel.getLevel());
+ SimpleIOHandler simpleExporter = new
SimpleIOHandler(bpModel.getLevel());
simpleExporter.convertToOWL(bpModel, stream);
stream.close();
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/NetworkListenerImpl.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/NetworkListenerImpl.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/action/NetworkListenerImpl.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -41,7 +41,6 @@
import org.cytoscape.biopax.internal.view.BioPaxDetailsPanel;
import org.cytoscape.biopax.util.BioPaxUtil;
import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyTable;
import org.cytoscape.model.events.RowsSetEvent;
import org.cytoscape.model.events.RowsSetListener;
import org.cytoscape.session.events.SetCurrentNetworkViewEvent;
@@ -68,6 +67,7 @@
private final MapBioPaxToCytoscape mapBioPaxToCytoscape;
private final CyNetworkViewManager viewManager;
+ private final Map<CyNetworkView, RowsSetListener> listeners;
/**
* Constructor.
@@ -79,7 +79,7 @@
this.bpContainer = bpContainer;
this.mapBioPaxToCytoscape =
mapBioPaxToCytoscapeFactory.getInstance(null, null);
this.viewManager = viewManager;
-
+ this.listeners = new HashMap<CyNetworkView, RowsSetListener>();
}
/**
@@ -98,9 +98,8 @@
* @param cyNetwork CyNetwork Object.
*/
private void registerNodeSelectionEvents(CyNetworkView view) {
- CyNetwork cyNetwork = view.getModel();
- CyTable table = cyNetwork.getDefaultNodeTable();
- DisplayBioPaxDetails rowUpdateListener = new
DisplayBioPaxDetails(view, bpPanel, bpContainer, mapBioPaxToCytoscape);
+ DisplayBioPaxDetails listener = new DisplayBioPaxDetails(view,
bpPanel, bpContainer, mapBioPaxToCytoscape);
+ listeners.put(view, listener);
bpPanel.resetText();
}
@@ -218,9 +217,8 @@
CyNetwork network = view.getModel();
// destroy the corresponding model
BioPaxUtil.removeNetworkModel(network.getSUID());
+ listeners.remove(view);
- CyTable table = network.getDefaultNodeTable();
-
if (!networkViewsRemain()) {
onZeroNetworkViewsRemain();
}
@@ -254,8 +252,9 @@
@Override
public void handleEvent(RowsSetEvent e) {
- // TODO Auto-generated method stub
-
+ for (RowsSetListener listener : listeners.values()) {
+ listener.handleEvent(e);
+ }
}
}
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/util/ParentFinder.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/util/ParentFinder.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/util/ParentFinder.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -30,7 +30,8 @@
PropertyEditor editor) {
// skip if already found or it's not a object property
if(!found && value instanceof BioPAXElement) {
- if(getCurrentParentsList().contains(query)) { // it is
added there right before the visit method call
+ // TODO: Verify this change
+ if(getVisited().contains(query)) { // it is added there
right before the visit method call
found = true;
} else {
// continue into the value's values:
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/BioPaxContainerImpl.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/BioPaxContainerImpl.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/BioPaxContainerImpl.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -43,6 +43,7 @@
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+import org.cytoscape.application.swing.CySwingApplication;
import org.cytoscape.application.swing.CytoPanelName;
import org.cytoscape.biopax.BioPaxContainer;
import org.cytoscape.biopax.internal.MapBioPaxToCytoscapeImpl;
@@ -84,12 +85,12 @@
* @param factory
* @param applicationManager
*/
- private BioPaxContainerImpl(LaunchExternalBrowser browser,
CyApplicationManager applicationManager, CyNetworkViewManager viewManager,
BioPaxDetailsPanel bpDetailsPanel) {
+ private BioPaxContainerImpl(LaunchExternalBrowser browser,
CyApplicationManager applicationManager, CyNetworkViewManager viewManager,
BioPaxDetailsPanel bpDetailsPanel, CySwingApplication application) {
this.applicationManager = applicationManager;
cards = new JPanel(new CardLayout());
- LegendPanel bioPaxLegendPanel = new
LegendPanel(LegendPanel.BIOPAX_LEGEND);
- LegendPanel binaryLegendPanel = new
LegendPanel(LegendPanel.BINARY_LEGEND);
+ LegendPanel bioPaxLegendPanel = new
LegendPanel(LegendPanel.BIOPAX_LEGEND, applicationManager, application);
+ LegendPanel binaryLegendPanel = new
LegendPanel(LegendPanel.BINARY_LEGEND, applicationManager, application);
cards.add (bpDetailsPanel, DETAILS_CARD);
cards.add (bioPaxLegendPanel, LEGEND_BIOPAX_CARD);
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/LegendPanel.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/LegendPanel.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/internal/view/LegendPanel.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -8,8 +8,12 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import org.cytoscape.application.swing.CySwingApplication;
import org.cytoscape.biopax.internal.util.WebFileConnect;
+import org.cytoscape.session.CyApplicationManager;
/**
* Displays the Default Visual Style Legend for the BioPAX Mapper.
@@ -34,7 +38,7 @@
* Constructor.
*
*/
- public LegendPanel(int mode) {
+ public LegendPanel(int mode, final CyApplicationManager
applicationManager, final CySwingApplication swingApplication) {
this.setLayout(new BorderLayout());
JTextPane textPane = new JTextPane();
@@ -61,19 +65,16 @@
temp.append("</BODY></HTML>");
textPane.setText(temp.toString());
- /*
textPane.addHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent hyperlinkEvent) {
if (hyperlinkEvent.getEventType() ==
HyperlinkEvent.EventType.ACTIVATED) {
String name = hyperlinkEvent.getDescription();
if (name.equalsIgnoreCase("filter")) {
- EdgeFilterUi ui = new
EdgeFilterUi(Cytoscape.getCurrentNetwork());
- //TODO No action or logic was here; is something
missing?..
+ new
EdgeFilterUi(applicationManager.getCurrentNetwork(), swingApplication);
}
}
}
});
- */
BioPaxDetailsPanel.modifyStyleSheetForSingleDocument(textPane);
Modified:
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/util/BioPaxUtil.java
===================================================================
---
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/util/BioPaxUtil.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/biopax-impl/trunk/src/main/java/org/cytoscape/biopax/util/BioPaxUtil.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -37,8 +37,8 @@
import java.util.Set;
import org.biopax.paxtools.controller.EditorMap;
-import org.biopax.paxtools.io.simpleIO.SimpleEditorMap;
-import org.biopax.paxtools.io.simpleIO.SimpleReader;
+import org.biopax.paxtools.controller.SimpleEditorMap;
+import org.biopax.paxtools.io.SimpleIOHandler;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.BioPAXLevel;
import org.biopax.paxtools.model.Model;
@@ -198,7 +198,7 @@
*/
public static Model read(final InputStream in) throws
FileNotFoundException {
try {
- return new SimpleReader().convertFromOWL(in);
+ return new SimpleIOHandler().convertFromOWL(in);
} catch (Exception e) {
log.warn("Import failed: " + e);
}
Modified: core3/cpath2-impl/trunk/pom.xml
===================================================================
--- core3/cpath2-impl/trunk/pom.xml 2011-06-22 02:16:51 UTC (rev 25874)
+++ core3/cpath2-impl/trunk/pom.xml 2011-06-22 15:19:28 UTC (rev 25875)
@@ -66,7 +66,7 @@
<dependency>
<groupId>org.cytoscape</groupId>
<artifactId>biopax-impl</artifactId>
- <version>3.0.0-alpha1</version>
+ <version>3.0.0-alpha2-SNAPSHOT</version>
</dependency>
<dependency>
Modified:
core3/cpath2-impl/trunk/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
===================================================================
---
core3/cpath2-impl/trunk/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
2011-06-22 02:16:51 UTC (rev 25874)
+++
core3/cpath2-impl/trunk/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
2011-06-22 15:19:28 UTC (rev 25875)
@@ -14,7 +14,7 @@
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
-import org.biopax.paxtools.io.simpleIO.SimpleReader;
+import org.biopax.paxtools.io.SimpleIOHandler;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.Model;
import org.biopax.paxtools.model.level2.physicalEntity;
@@ -491,7 +491,7 @@
// StringReader reader = new StringReader(xml);
// BioPaxUtil bpUtil = new BioPaxUtil(reader,
new
// NullTaskMonitor());
- Model model = new
SimpleReader().convertFromOWL(new ByteArrayInputStream(xml.getBytes()));
+ Model model = new
SimpleIOHandler().convertFromOWL(new ByteArrayInputStream(xml.getBytes()));
// ArrayList peList =
bpUtil.getPhysicalEntityList();
// Namespace ns =
//
Namespace.getNamespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
--
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.