don't show grid on the thumbnail

This commit is contained in:
bancika
2011-02-13 11:46:53 +00:00
parent 6f5926e18e
commit 56e112ff81
4 changed files with 17 additions and 4 deletions
@@ -17,4 +17,12 @@
</gridColor> </gridColor>
</org.diylc.core.Theme> </org.diylc.core.Theme>
</entry> </entry>
<entry>
<string>showTemplatesAtStartup</string>
<boolean>false</boolean>
</entry>
<entry>
<string>exportGrid</string>
<boolean>true</boolean>
</entry>
</map> </map>
@@ -112,7 +112,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
private RulerScrollPane getScrollPane() { private RulerScrollPane getScrollPane() {
if (scrollPane == null) { if (scrollPane == null) {
scrollPane = new RulerScrollPane(getCanvasPanel(), new ProjectDrawingProvider( scrollPane = new RulerScrollPane(getCanvasPanel(), new ProjectDrawingProvider(
plugInPort, true), new Size(1d, SizeUnit.cm).convertToPixels(), new Size(1d, plugInPort, true, false), new Size(1d, SizeUnit.cm).convertToPixels(), new Size(1d,
SizeUnit.in).convertToPixels()); SizeUnit.in).convertToPixels());
boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY, boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY,
true); true);
@@ -31,7 +31,7 @@ public class FileMenuPlugin implements IPlugIn {
@Override @Override
public void connect(IPlugInPort plugInPort) { public void connect(IPlugInPort plugInPort) {
this.drawingProvider = new ProjectDrawingProvider(plugInPort, false); this.drawingProvider = new ProjectDrawingProvider(plugInPort, false, true);
this.traceMaskDrawingProvider = new TraceMaskDrawingProvider(plugInPort); this.traceMaskDrawingProvider = new TraceMaskDrawingProvider(plugInPort);
ActionFactory actionFactory = ActionFactory.getInstance(); ActionFactory actionFactory = ActionFactory.getInstance();
@@ -21,11 +21,14 @@ public class ProjectDrawingProvider implements IDrawingProvider {
private IPlugInPort plugInPort; private IPlugInPort plugInPort;
private boolean useZoom; private boolean useZoom;
private boolean showGridWhenNeeded;
public ProjectDrawingProvider(IPlugInPort plugInPort, boolean useZoom) { public ProjectDrawingProvider(IPlugInPort plugInPort, boolean useZoom,
boolean showGridWhenNeeded) {
super(); super();
this.plugInPort = plugInPort; this.plugInPort = plugInPort;
this.useZoom = useZoom; this.useZoom = useZoom;
this.showGridWhenNeeded = showGridWhenNeeded;
} }
@Override @Override
@@ -34,7 +37,9 @@ public class ProjectDrawingProvider implements IDrawingProvider {
if (useZoom) { if (useZoom) {
options.add(DrawOption.ZOOM); options.add(DrawOption.ZOOM);
} }
if (ConfigurationManager.getInstance().readBoolean(IPlugInPort.EXPORT_GRID_KEY, false)) { if (showGridWhenNeeded
&& ConfigurationManager.getInstance().readBoolean(IPlugInPort.EXPORT_GRID_KEY,
false)) {
options.add(DrawOption.GRID); options.add(DrawOption.GRID);
} }
plugInPort.draw((Graphics2D) g, options, null); plugInPort.draw((Graphics2D) g, options, null);