mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
added icon for snap
renamed snap to objects
This commit is contained in:
@@ -80,7 +80,7 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
|
||||
|
||||
public static final String SNAP_TO_NONE = "None";
|
||||
public static final String SNAP_TO_GRID = "Grid";
|
||||
public static final String SNAP_TO_OBJECTS = "Objects";
|
||||
public static final String SNAP_TO_COMPONENTS = "Components";
|
||||
public static final String SNAP_TO_DEFAULT = SNAP_TO_GRID;
|
||||
|
||||
public static final int DND_TOGGLE_STICKY = 0x1;
|
||||
|
||||
@@ -745,7 +745,7 @@ public class Presenter implements IPlugInPort {
|
||||
snapTo = IPlugInPort.SNAP_TO_NONE;
|
||||
}
|
||||
boolean snapToGrid = snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_GRID);
|
||||
boolean snapToObjects = snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_OBJECTS);
|
||||
boolean snapToObjects = snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_COMPONENTS);
|
||||
|
||||
if (altDown) {
|
||||
Project oldProject = null;
|
||||
@@ -1183,7 +1183,7 @@ public class Presenter implements IPlugInPort {
|
||||
String snapTo = ConfigurationManager.getInstance().readString(IPlugInPort.SNAP_TO_KEY, IPlugInPort.SNAP_TO_DEFAULT);
|
||||
if (this.dragAction == IPlugInPort.DND_TOGGLE_SNAP)
|
||||
return false;
|
||||
return snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_OBJECTS);
|
||||
return snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_COMPONENTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2716,7 +2716,7 @@
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added "Snap To Objects" feature that snaps control points to control points of the nearest components</description>
|
||||
<description>Added "Snap To Components" feature that snaps control points to control points of the nearest components</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
|
||||
@@ -64,7 +64,7 @@ public enum IconLoader {
|
||||
"documents_gear.png"), SplashResistor("splash_resistor.png"), SplashCeramic("splash_ceramic.png"), SplashElectrolytic(
|
||||
"splash_electrolytic.png"), SplashFilm("splash_film.png"), Splash("splash.png"), Help("help2.png"), ScrollInformation("scroll_information.png"),
|
||||
Node("node.png"), Web("web.png"), Guitar("guitar.png"), Scientist("scientist.png"), StarGrey("star_grey.png"), StarBlue("star_blue.png"),
|
||||
JarBeanInto("jar_bean_into.png");
|
||||
JarBeanInto("jar_bean_into.png"), GraphEdgeDirected("graph_edge_directed.png");
|
||||
|
||||
protected String name;
|
||||
|
||||
|
||||
@@ -97,18 +97,18 @@ public class ConfigPlugin implements IPlugIn {
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance().createConfigAction(plugInPort, "Show Rulers", IPlugInPort.SHOW_RULERS_KEY, true),
|
||||
CONFIG_MENU);
|
||||
swingUI.injectSubmenu(SNAP_MENU, null, CONFIG_MENU);
|
||||
swingUI.injectSubmenu(SNAP_MENU, IconLoader.GraphEdgeDirected.getIcon(), CONFIG_MENU);
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance().createConfigAction(plugInPort, "Show Grid", IPlugInPort.SHOW_GRID_KEY, true),
|
||||
CONFIG_MENU);
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance().createToggleAction("None", IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
ActionFactory.getInstance().createToggleAction(IPlugInPort.SNAP_TO_NONE, IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
SNAP_MENU);
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance().createToggleAction("Grid", IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
ActionFactory.getInstance().createToggleAction(IPlugInPort.SNAP_TO_GRID, IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
SNAP_MENU);
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance().createToggleAction("Objects", IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
ActionFactory.getInstance().createToggleAction(IPlugInPort.SNAP_TO_COMPONENTS, IPlugInPort.SNAP_TO_KEY, SNAP_MENU, IPlugInPort.SNAP_TO_DEFAULT),
|
||||
SNAP_MENU);
|
||||
swingUI.injectMenuAction(
|
||||
ActionFactory.getInstance()
|
||||
|
||||
Reference in New Issue
Block a user