better status bar text when dragging a component from the tree

This commit is contained in:
Branislav Stojkovic
2019-02-02 12:44:59 +01:00
parent 34ea20eedd
commit 46f20a75ec
2 changed files with 12 additions and 6 deletions
@@ -95,7 +95,8 @@ public class StatusBar extends JPanel implements IPlugIn {
// State variables
private ComponentType componentSlot;
private Point controlPointSlot;
private Point controlPointSlot;
private Boolean forceInstatiate;
private List<String> componentNamesUnderCursor;
private List<String> selectedComponentNames;
private List<String> stuckComponentNames;
@@ -419,7 +420,8 @@ public class StatusBar extends JPanel implements IPlugIn {
break;
case SLOT_CHANGED:
componentSlot = (ComponentType) params[0];
controlPointSlot = (Point) params[1];
controlPointSlot = (Point) params[1];
forceInstatiate = params.length > 2 ? (Boolean)params[2] : null;
refreshStatusText();
break;
case AVAILABLE_CTRL_POINTS_CHANGED:
@@ -458,7 +460,11 @@ public class StatusBar extends JPanel implements IPlugIn {
}
statusText = "<html>Selection: " + builder.toString() + "</html>";
}
} else {
} else {
if (forceInstatiate)
statusText = "<html>Drag the mouse over the canvas to place a new <font color='blue'>" + componentSlot.getName()
+ "</font></html>";
else
switch (componentSlot.getCreationMethod()) {
case POINT_BY_POINT:
String count;