Author: thomasobrien95
Date: Thu Apr 2 08:44:46 2009
New Revision: 2968
Modified:
trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java
Log:
The exportToPDFAction was previously destroying the actual play pen
being used in Architect instead of the copy of the play pen created
for making a PDF.
Modified:
trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java
==============================================================================
---
trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java
(original)
+++
trunk/src/ca/sqlpower/architect/swingui/action/ExportPlaypenToPDFAction.java
Thu Apr 2 08:44:46 2009
@@ -118,18 +118,18 @@
@Override
public void doStuff(MonitorableImpl monitor, Map<String, Object>
properties) {
logger.debug("Creating PDF of playpen: " + playpen);
- PlayPen playPen = new PlayPen(session, playpen);
+ PlayPen pp = new PlayPen(session, playpen);
// don't need this playpen to be interactive or respond to
SQLObject changes
- playpen.destroy();
+ pp.destroy();
/* We translate the graphics to (OUTSIDE_PADDING, OUTSIDE_PADDING)
* so nothing is drawn right on the edge of the document. So
* we multiply by 2 so we can accomodate the translate and ensure
* nothing gets drawn outside of the document size.
*/
- final int width = playPen.getBounds().width + 2*OUTSIDE_PADDING;
- final int height = playPen.getBounds().height + 2*OUTSIDE_PADDING;
+ final int width = pp.getBounds().width + 2*OUTSIDE_PADDING;
+ final int height = pp.getBounds().height + 2*OUTSIDE_PADDING;
final Rectangle ppSize = new Rectangle(width, height);
OutputStream out = null;
@@ -148,7 +148,7 @@
Graphics2D g = cb.createGraphicsShapes(width, height);
// ensure a margin
g.translate(OUTSIDE_PADDING, OUTSIDE_PADDING);
- PlayPenContentPane contentPane = playPen.getContentPane();
+ PlayPenContentPane contentPane = pp.getContentPane();
int j=0;
for (int i = contentPane.getComponentCount() - 1; i >= 0; i--)
{
PlayPenComponent ppc = contentPane.getComponent(i);
@@ -161,7 +161,7 @@
monitor.setProgress(j);
j++;
}
- playPen.paintComponent(g);
+ pp.paintComponent(g);
g.dispose();
} catch (Exception ex) {
ASUtils.showExceptionDialog(session,