continuous component creation

This commit is contained in:
bancika
2011-02-23 23:44:00 +00:00
parent 80e7ebcbe9
commit 3856af3e18
5 changed files with 28 additions and 7 deletions
@@ -8,8 +8,8 @@
<string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string> <string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string>
</entry> </entry>
<entry> <entry>
<string>stickyPoints</string> <string>autoCreatePads</string>
<boolean>true</boolean> <boolean>false</boolean>
</entry> </entry>
<entry> <entry>
<string>theme</string> <string>theme</string>
@@ -30,21 +30,25 @@
</org.diylc.core.Theme> </org.diylc.core.Theme>
</entry> </entry>
<entry> <entry>
<string>autoCreatePads</string> <string>stickyPoints</string>
<boolean>false</boolean> <boolean>true</boolean>
</entry> </entry>
<entry> <entry>
<string>antiAliasing</string> <string>antiAliasing</string>
<boolean>true</boolean> <boolean>true</boolean>
</entry> </entry>
<entry> <entry>
<string>snapToGrid</string> <string>continuousCreation</string>
<boolean>true</boolean> <boolean>true</boolean>
</entry> </entry>
<entry> <entry>
<string>hiQualityRender</string> <string>hiQualityRender</string>
<boolean>false</boolean> <boolean>false</boolean>
</entry> </entry>
<entry>
<string>snapToGrid</string>
<boolean>true</boolean>
</entry>
<entry> <entry>
<string>showTemplatesAtStartup</string> <string>showTemplatesAtStartup</string>
<boolean>false</boolean> <boolean>false</boolean>
@@ -39,6 +39,7 @@ public interface IPlugInPort {
public static final String METRIC_KEY = "metric"; public static final String METRIC_KEY = "metric";
public static final String SNAP_TO_GRID_KEY = "snapToGrid"; public static final String SNAP_TO_GRID_KEY = "snapToGrid";
public static final String AUTO_PADS_KEY = "autoCreatePads"; public static final String AUTO_PADS_KEY = "autoCreatePads";
public static final String CONTINUOUS_CREATION_KEY = "continuousCreation";
/** /**
* Returns size of the canvas that takes project dimensions into account as * Returns size of the canvas that takes project dimensions into account as
@@ -379,7 +379,12 @@ public class Presenter implements IPlugInPort {
LOG.error("Error instatiating component of type: " LOG.error("Error instatiating component of type: "
+ componentTypeSlot.getInstanceClass().getName(), e); + componentTypeSlot.getInstanceClass().getName(), e);
} }
if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.CONTINUOUS_CREATION_KEY, false)) {
setNewComponentTypeSlot(componentTypeSlot);
} else {
setNewComponentTypeSlot(null); setNewComponentTypeSlot(null);
}
break; break;
case POINT_BY_POINT: case POINT_BY_POINT:
// First click is just to set the controlPointSlot and // First click is just to set the controlPointSlot and
@@ -411,8 +416,13 @@ public class Presenter implements IPlugInPort {
} }
updateSelection(newSelection); updateSelection(newSelection);
messageDispatcher.dispatchMessage(EventType.REPAINT); messageDispatcher.dispatchMessage(EventType.REPAINT);
if (ConfigurationManager.getInstance().readBoolean(
IPlugInPort.CONTINUOUS_CREATION_KEY, false)) {
setNewComponentTypeSlot(componentTypeSlot);
} else {
setNewComponentTypeSlot(null); setNewComponentTypeSlot(null);
} }
}
break; break;
default: default:
LOG.error("Unknown creation method: " + componentTypeSlot.getCreationMethod()); LOG.error("Unknown creation method: " + componentTypeSlot.getCreationMethod());
@@ -50,6 +50,8 @@ public class ConfigPlugin implements IPlugIn {
"Snap to Grid", IPlugInPort.SNAP_TO_GRID_KEY, true), CONFIG_MENU); "Snap to Grid", IPlugInPort.SNAP_TO_GRID_KEY, true), CONFIG_MENU);
swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort, swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort,
"Auto-Create Pads", IPlugInPort.AUTO_PADS_KEY, false), CONFIG_MENU); "Auto-Create Pads", IPlugInPort.AUTO_PADS_KEY, false), CONFIG_MENU);
swingUI.injectMenuAction(ActionFactory.getInstance().createConfigAction(plugInPort,
"Continuous Creation", IPlugInPort.CONTINUOUS_CREATION_KEY, false), CONFIG_MENU);
File themeDir = new File("themes"); File themeDir = new File("themes");
if (themeDir.exists()) { if (themeDir.exists()) {
XStream xStream = new XStream(new DomDriver()); XStream xStream = new XStream(new DomDriver());
@@ -252,6 +252,10 @@
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Auto-create solder pads</description> <description>Auto-create solder pads</description>
</com.diyfever.gui.update.Change> </com.diyfever.gui.update.Change>
<com.diyfever.gui.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Continuous component creation</description>
</com.diyfever.gui.update.Change>
</changes> </changes>
<url>http://code.google.com/p/diy-layout-creator/downloads/list <url>http://code.google.com/p/diy-layout-creator/downloads/list
</url> </url>