Author: ruschein
Date: 2010-07-15 16:23:07 -0700 (Thu, 15 Jul 2010)
New Revision: 20942
Modified:
cytoscape/trunk/src/cytoscape/util/export/PSExporter.java
cytoscape/trunk/src/cytoscape/view/InternalFrameComponent.java
Log:
Fixed Mantis bug #2260.
Modified: cytoscape/trunk/src/cytoscape/util/export/PSExporter.java
===================================================================
--- cytoscape/trunk/src/cytoscape/util/export/PSExporter.java 2010-07-15
20:56:36 UTC (rev 20941)
+++ cytoscape/trunk/src/cytoscape/util/export/PSExporter.java 2010-07-15
23:23:07 UTC (rev 20942)
@@ -1,5 +1,35 @@
+/*
+ File: PSExporter.java
+
+ Copyright (c) 2010, The Cytoscape Consortium (www.cytoscape.org)
+
+ 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 cytoscape.util.export;
+
import java.io.FileOutputStream;
import java.io.IOException;
import cytoscape.Cytoscape;
@@ -9,35 +39,31 @@
import org.freehep.graphicsio.ps.PSGraphics2D;
import java.util.Properties;
-public class PSExporter implements Exporter
-{
+
+public class PSExporter implements Exporter {
private boolean exportTextAsFont = true;
- public PSExporter()
- {
+ public PSExporter() {
}
-
- public void export(CyNetworkView view, FileOutputStream stream) throws
IOException
- {
+ public void export(CyNetworkView view, FileOutputStream stream) throws
IOException {
DingNetworkView theView = (DingNetworkView) view;
theView.setPrintingTextAsShape(!exportTextAsFont);
InternalFrameComponent ifc =
Cytoscape.getDesktop().getNetworkViewManager().getInternalFrameComponent(view);
Properties p = new Properties();
- p.setProperty(PSGraphics2D.PAGE_SIZE,"Letter");
+ p.setProperty(PSGraphics2D.PAGE_SIZE,"Letter");
p.setProperty("org.freehep.graphicsio.AbstractVectorGraphicsIO.TEXT_AS_SHAPES",
Boolean.toString(!exportTextAsFont));
- PSGraphics2D g = new PSGraphics2D(stream,ifc);
- g.setMultiPage(false); // true for PS file
- g.setProperties(p);
+ PSGraphics2D g = new PSGraphics2D(stream,ifc);
+ g.setMultiPage(false); // true for PS file
+ g.setProperties(p);
- g.startExport();
- ifc.print(g);
- g.endExport();
-
+ g.startExport();
+ ifc.printWithoutForeground(g);
+ g.endExport();
}
public void setExportTextAsFont(boolean pExportTextAsFont) {
Modified: cytoscape/trunk/src/cytoscape/view/InternalFrameComponent.java
===================================================================
--- cytoscape/trunk/src/cytoscape/view/InternalFrameComponent.java
2010-07-15 20:56:36 UTC (rev 20941)
+++ cytoscape/trunk/src/cytoscape/view/InternalFrameComponent.java
2010-07-15 23:23:07 UTC (rev 20942)
@@ -1,15 +1,8 @@
/*
File: InternalFrameComponent.java
- Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, 2010, 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
@@ -190,6 +183,19 @@
}
/**
+ * This method is used by image export libraries. This method is
required for export formats that
+ * do not support transparency because otherwise the foreground layer
will obscure a network.
+ */
+ public void printWithoutForeground(Graphics g) {
+ backgroundCanvas.print(g);
+
+ // This is a work-around, otherwise we lose backgroundCanvas
color
+ networkCanvas.setBackground(backgroundCanvas.getBackground());
+
+ networkCanvas.print(g);
+ }
+
+ /**
* Places the canvas on the layeredPane in the following manner:
* top - bottom: foreground, network, background
*/
--
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.