mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Renamed "template" to "variant"
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -853,7 +853,7 @@ public class ActionFactory {
|
||||
public SaveAsTemplateAction(IPlugInPort plugInPort) {
|
||||
super();
|
||||
this.plugInPort = plugInPort;
|
||||
putValue(AbstractAction.NAME, "Save as Template");
|
||||
putValue(AbstractAction.NAME, "Save as Variant");
|
||||
putValue(AbstractAction.SMALL_ICON, IconLoader.BriefcaseAdd.getIcon());
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ public class ActionFactory {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
LOG.info("Save as template triggered");
|
||||
String templateName =
|
||||
JOptionPane.showInputDialog(null, "Template name:", "Save as Template", JOptionPane.PLAIN_MESSAGE);
|
||||
JOptionPane.showInputDialog(null, "Variant name:", "Save as Variant", JOptionPane.PLAIN_MESSAGE);
|
||||
if (templateName != null && !templateName.trim().isEmpty()) {
|
||||
plugInPort.saveSelectedComponentAsTemplate(templateName);
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
|
||||
public JMenu getApplyTemplateMenu() {
|
||||
if (applyTemplateMenu == null) {
|
||||
applyTemplateMenu = new JMenu("Apply Template");
|
||||
applyTemplateMenu = new JMenu("Apply Variant");
|
||||
applyTemplateMenu.setIcon(IconLoader.BriefcaseInto.getIcon());
|
||||
}
|
||||
return applyTemplateMenu;
|
||||
@@ -347,7 +347,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
try {
|
||||
templates = plugInPort.getTemplatesForSelection();
|
||||
} catch (Exception e) {
|
||||
LOG.info("Could not get templates for selection");
|
||||
LOG.info("Could not load variants for selection");
|
||||
getApplyTemplateMenu().setEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ComponentButtonFactory {
|
||||
});
|
||||
|
||||
JLabel label = new JLabel(template.isDefaultFlag() ? IconLoader.PinGreen.getIcon() : IconLoader.PinGrey.getIcon());
|
||||
label.setToolTipText(template.isDefaultFlag() ? "Remove default template" : "Set default template");
|
||||
label.setToolTipText(template.isDefaultFlag() ? "Remove default variant" : "Set default variant");
|
||||
label.addMouseListener(new MouseAdapter() {
|
||||
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class ComponentButtonFactory {
|
||||
item.add(label);
|
||||
|
||||
label = new JLabel(IconLoader.Garbage.getIcon());
|
||||
label.setToolTipText("Delete template");
|
||||
label.setToolTipText("Delete variant");
|
||||
label.addMouseListener(new MouseAdapter() {
|
||||
|
||||
@Override
|
||||
@@ -143,7 +143,7 @@ public class ComponentButtonFactory {
|
||||
m.setVisible(false);
|
||||
}
|
||||
int result =
|
||||
JOptionPane.showConfirmDialog(SwingUtilities.getRoot(item), "Are you sure you want to delete template \""
|
||||
JOptionPane.showConfirmDialog(SwingUtilities.getRoot(item), "Are you sure you want to delete variant \""
|
||||
+ template.getName() + "\"", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
|
||||
if (result != JOptionPane.YES_OPTION) {
|
||||
return;
|
||||
|
||||
@@ -138,8 +138,12 @@ class ComponentTabbedPane extends JTabbedPane {
|
||||
Collections.sort(componentTypes, ComparatorFactory.getInstance().getComponentTypeComparator());
|
||||
toolbar.setLayout(new BoxLayout(toolbar, BoxLayout.X_AXIS));
|
||||
for (ComponentType componentType : componentTypes) {
|
||||
Component button = ComponentButtonFactory.create(plugInPort, componentType, createTemplatePopup(componentType));
|
||||
toolbar.add(button);
|
||||
try {
|
||||
Component button = ComponentButtonFactory.create(plugInPort, componentType, createTemplatePopup(componentType));
|
||||
toolbar.add(button);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not create recent component button for " + componentType.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
return toolbar;
|
||||
@@ -181,7 +185,7 @@ class ComponentTabbedPane extends JTabbedPane {
|
||||
(Class<? extends IDIYComponent<?>>) Class.forName(componentClassName));
|
||||
Component button = ComponentButtonFactory.create(plugInPort, componentType, createTemplatePopup(componentType));
|
||||
toolbar.add(button);
|
||||
} catch (ClassNotFoundException e) {
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not create recent component button for " + componentClassName, e);
|
||||
}
|
||||
}
|
||||
@@ -197,7 +201,7 @@ class ComponentTabbedPane extends JTabbedPane {
|
||||
templatePopup.removeAll();
|
||||
List<Template> templates = plugInPort.getTemplatesFor(componentType.getCategory(), componentType.getName());
|
||||
if (templates == null || templates.isEmpty()) {
|
||||
JMenuItem item = new JMenuItem("<no templates>");
|
||||
JMenuItem item = new JMenuItem("<no variants>");
|
||||
item.setEnabled(false);
|
||||
templatePopup.add(item);
|
||||
} else {
|
||||
|
||||
@@ -317,7 +317,7 @@ public class TreePanel extends JPanel {
|
||||
|
||||
List<Template> templates = plugInPort.getTemplatesFor(componentType.getCategory(), componentType.getName());
|
||||
if (templates == null || templates.isEmpty()) {
|
||||
JMenuItem item = new JMenuItem("<no templates>");
|
||||
JMenuItem item = new JMenuItem("<no variants>");
|
||||
item.setEnabled(false);
|
||||
popup.add(item);
|
||||
} else {
|
||||
|
||||
@@ -1569,10 +1569,14 @@
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Ability to rotate tube sockets for arbitrary angle and to change color</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Renamed "template" to "variant" as it is describes the meaning more closely</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Applying a template shouldn't affect component placement</description>
|
||||
<description>Applying a variant/template shouldn't affect component placement</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
|
||||
Reference in New Issue
Block a user