added icon for snap

renamed snap to objects
This commit is contained in:
bancika
2020-03-23 23:25:18 +01:00
parent a6b7debfd7
commit 88ec95d4fa
5 changed files with 9 additions and 9 deletions
@@ -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_NONE = "None";
public static final String SNAP_TO_GRID = "Grid"; 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 String SNAP_TO_DEFAULT = SNAP_TO_GRID;
public static final int DND_TOGGLE_STICKY = 0x1; public static final int DND_TOGGLE_STICKY = 0x1;
@@ -745,7 +745,7 @@ public class Presenter implements IPlugInPort {
snapTo = IPlugInPort.SNAP_TO_NONE; snapTo = IPlugInPort.SNAP_TO_NONE;
} }
boolean snapToGrid = snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_GRID); 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) { if (altDown) {
Project oldProject = null; 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); String snapTo = ConfigurationManager.getInstance().readString(IPlugInPort.SNAP_TO_KEY, IPlugInPort.SNAP_TO_DEFAULT);
if (this.dragAction == IPlugInPort.DND_TOGGLE_SNAP) if (this.dragAction == IPlugInPort.DND_TOGGLE_SNAP)
return false; return false;
return snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_OBJECTS); return snapTo.equalsIgnoreCase(IPlugInPort.SNAP_TO_COMPONENTS);
} }
@Override @Override
@@ -2716,7 +2716,7 @@
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <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>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
@@ -64,7 +64,7 @@ public enum IconLoader {
"documents_gear.png"), SplashResistor("splash_resistor.png"), SplashCeramic("splash_ceramic.png"), SplashElectrolytic( "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"), "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"), 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; protected String name;
@@ -97,18 +97,18 @@ public class ConfigPlugin implements IPlugIn {
swingUI.injectMenuAction( swingUI.injectMenuAction(
ActionFactory.getInstance().createConfigAction(plugInPort, "Show Rulers", IPlugInPort.SHOW_RULERS_KEY, true), ActionFactory.getInstance().createConfigAction(plugInPort, "Show Rulers", IPlugInPort.SHOW_RULERS_KEY, true),
CONFIG_MENU); CONFIG_MENU);
swingUI.injectSubmenu(SNAP_MENU, null, CONFIG_MENU); swingUI.injectSubmenu(SNAP_MENU, IconLoader.GraphEdgeDirected.getIcon(), CONFIG_MENU);
swingUI.injectMenuAction( swingUI.injectMenuAction(
ActionFactory.getInstance().createConfigAction(plugInPort, "Show Grid", IPlugInPort.SHOW_GRID_KEY, true), ActionFactory.getInstance().createConfigAction(plugInPort, "Show Grid", IPlugInPort.SHOW_GRID_KEY, true),
CONFIG_MENU); CONFIG_MENU);
swingUI.injectMenuAction( 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); SNAP_MENU);
swingUI.injectMenuAction( 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); SNAP_MENU);
swingUI.injectMenuAction( 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); SNAP_MENU);
swingUI.injectMenuAction( swingUI.injectMenuAction(
ActionFactory.getInstance() ActionFactory.getInstance()