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
@@ -112,7 +112,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
private RulerScrollPane getScrollPane() {
if (scrollPane == null) {
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());
boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY,
true);
@@ -31,7 +31,7 @@ public class FileMenuPlugin implements IPlugIn {
@Override
public void connect(IPlugInPort plugInPort) {
this.drawingProvider = new ProjectDrawingProvider(plugInPort, false);
this.drawingProvider = new ProjectDrawingProvider(plugInPort, false, true);
this.traceMaskDrawingProvider = new TraceMaskDrawingProvider(plugInPort);
ActionFactory actionFactory = ActionFactory.getInstance();
@@ -21,11 +21,14 @@ public class ProjectDrawingProvider implements IDrawingProvider {
private IPlugInPort plugInPort;
private boolean useZoom;
private boolean showGridWhenNeeded;
public ProjectDrawingProvider(IPlugInPort plugInPort, boolean useZoom) {
public ProjectDrawingProvider(IPlugInPort plugInPort, boolean useZoom,
boolean showGridWhenNeeded) {
super();
this.plugInPort = plugInPort;
this.useZoom = useZoom;
this.showGridWhenNeeded = showGridWhenNeeded;
}
@Override
@@ -34,7 +37,9 @@ public class ProjectDrawingProvider implements IDrawingProvider {
if (useZoom) {
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);
}
plugInPort.draw((Graphics2D) g, options, null);