mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
When in "Highlight Connected Area" mode, the status bar shows useful
information making it harder to forget what the mode does
This commit is contained in:
@@ -85,8 +85,8 @@ public class ConfigPlugin implements IPlugIn {
|
|||||||
ActionFactory.getInstance().createConfigAction(plugInPort, "Hi-Quality Rendering",
|
ActionFactory.getInstance().createConfigAction(plugInPort, "Hi-Quality Rendering",
|
||||||
IPlugInPort.HI_QUALITY_RENDER_KEY, false), CONFIG_MENU);
|
IPlugInPort.HI_QUALITY_RENDER_KEY, false), CONFIG_MENU);
|
||||||
swingUI.injectMenuAction(
|
swingUI.injectMenuAction(
|
||||||
ActionFactory.getInstance().createConfigAction(plugInPort, "Highlight Connected Areas",
|
ActionFactory.getInstance().createConfigAction(plugInPort, "Highlight Connected Areas", IPlugInPort.HIGHLIGHT_CONTINUITY_AREA,
|
||||||
IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false, IPlugInPort.HIGHLIGHT_CONTINUITY_AREA), CONFIG_MENU);
|
false), CONFIG_MENU);
|
||||||
swingUI.injectMenuAction(
|
swingUI.injectMenuAction(
|
||||||
ActionFactory.getInstance().createConfigAction(plugInPort, "Mouse Wheel Zoom", IPlugInPort.WHEEL_ZOOM_KEY,
|
ActionFactory.getInstance().createConfigAction(plugInPort, "Mouse Wheel Zoom", IPlugInPort.WHEEL_ZOOM_KEY,
|
||||||
false), CONFIG_MENU);
|
false), CONFIG_MENU);
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
private static final Logger LOG = Logger.getLogger(StatusBar.class);
|
private static final Logger LOG = Logger.getLogger(StatusBar.class);
|
||||||
|
|
||||||
public static String UPDATE_URL = "http://www.diy-fever.com/update.xml";
|
public static String UPDATE_URL = "http://www.diy-fever.com/update.xml";
|
||||||
|
private static String HIGHLIGHT_CONNECTED_TIP = "Click on a component to highlight area directly or indirectly connected to the area below the cursor. To continue editing, this mode needs to be switched OFF";
|
||||||
private static final Format sizeFormat = new DecimalFormat("0.##");
|
private static final Format sizeFormat = new DecimalFormat("0.##");
|
||||||
|
|
||||||
private JComboBox zoomBox;
|
private JComboBox zoomBox;
|
||||||
@@ -170,6 +171,14 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
refreshPosition((Boolean)value);
|
refreshPosition((Boolean)value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ConfigurationManager.getInstance().addConfigListener(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, new IConfigListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void valueChanged(String key, Object value) {
|
||||||
|
refreshStatusText();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private JComboBox getZoomBox() {
|
private JComboBox getZoomBox() {
|
||||||
@@ -463,6 +472,7 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
break;
|
break;
|
||||||
case STATUS_MESSAGE_CHANGED:
|
case STATUS_MESSAGE_CHANGED:
|
||||||
statusMessage = (String) params[0];
|
statusMessage = (String) params[0];
|
||||||
|
refreshStatusText();
|
||||||
break;
|
break;
|
||||||
case MOUSE_MOVED:
|
case MOUSE_MOVED:
|
||||||
mousePositionIn = (Point2D) params[1];
|
mousePositionIn = (Point2D) params[1];
|
||||||
@@ -535,6 +545,11 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// override any other status with this when in highlight mode, as we cannot do anything else
|
||||||
|
Boolean highlightConnectedAreasMode = ConfigurationManager.getInstance().readBoolean(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false);
|
||||||
|
if (highlightConnectedAreasMode)
|
||||||
|
statusText = HIGHLIGHT_CONNECTED_TIP;
|
||||||
|
|
||||||
final String finalStatus = statusText;
|
final String finalStatus = statusText;
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
|
|||||||
@@ -2582,6 +2582,10 @@
|
|||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Ability to tag components and building blocks as favorites</description>
|
<description>Ability to tag components and building blocks as favorites</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>When in "Highlight Connected Area" mode, the status bar shows useful information making it harder to forget what the mode does</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>"Highlight Connected Areas" doesn't follow multiple chained wires and jumpers</description>
|
<description>"Highlight Connected Areas" doesn't follow multiple chained wires and jumpers</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user