01: package net.sourceforge.squirrel_sql.plugins.graph.graphtofiles;
02:
03: import net.sourceforge.squirrel_sql.plugins.graph.xmlbeans.FormatXmlBean;
04: import net.sourceforge.squirrel_sql.plugins.graph.PixelCalculater;
05:
06: import java.awt.print.PageFormat;
07: import java.awt.*;
08:
09: public class SaveToFilePageFormat extends PageFormat {
10: private PixelCalculater _pc;
11: private Dimension _graphPixelSize;
12:
13: public SaveToFilePageFormat(FormatXmlBean format) {
14: _pc = new PixelCalculater(format);
15:
16: }
17:
18: public SaveToFilePageFormat(Dimension graphPixelSize) {
19: _graphPixelSize = graphPixelSize;
20: }
21:
22: public double getImageableHeight() {
23: if (null == _pc) {
24: return _graphPixelSize.height;
25: } else {
26: return _pc.getPixelHeight();
27: }
28: }
29:
30: public double getImageableWidth() {
31: if (null == _pc) {
32: return _graphPixelSize.width;
33: } else {
34: return _pc.getPixelWidth();
35: }
36: }
37:
38: public double getImageableX() {
39: return 0;
40: }
41:
42: public double getImageableY() {
43: return 0;
44: }
45: }
|