diff --git a/src/main/java/com/marginallyclever/ro3/RO3Frame.java b/src/main/java/com/marginallyclever/ro3/RO3Frame.java index bb73361d7..3f36f9d27 100644 --- a/src/main/java/com/marginallyclever/ro3/RO3Frame.java +++ b/src/main/java/com/marginallyclever/ro3/RO3Frame.java @@ -152,14 +152,13 @@ private JMenu buildFileMenu() { RecentFilesMenu loadRecentMenu = new RecentFilesMenu(Preferences.userNodeForPackage(LoadScene.class)); menuFile.add(new JMenuItem(new LoadScene(loadRecentMenu))); menuFile.add(loadRecentMenu); - menuFile.add(new JMenuItem(new SaveScene())); - - menuFile.add(new JSeparator()); menuFile.add(new JMenuItem(new ImportScene())); + + menuFile.add(new JMenuItem(new SaveScene())); menuFile.add(new JMenuItem(new ExportScene())); - // TODO load recent scene + menuFile.add(new JSeparator()); - JMenuItem quit = new JMenuItem(new AbstractAction("Quit") { + menuFile.add(new JMenuItem(new AbstractAction("Quit") { @Override public void actionPerformed(java.awt.event.ActionEvent e) { if(confirmClose()) { @@ -167,8 +166,7 @@ public void actionPerformed(java.awt.event.ActionEvent e) { RO3Frame.this.dispatchEvent(new WindowEvent(RO3Frame.this, WindowEvent.WINDOW_CLOSING)); } } - }); - menuFile.add(quit); + })); return menuFile; } diff --git a/src/main/java/com/marginallyclever/ro3/actions/AddNode.java b/src/main/java/com/marginallyclever/ro3/actions/AddNode.java index 27b6a8eca..0521b097a 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/AddNode.java +++ b/src/main/java/com/marginallyclever/ro3/actions/AddNode.java @@ -10,12 +10,16 @@ import java.awt.event.ActionEvent; import java.util.function.Supplier; +/** + * Add a new instance of a Node to every selected branches of the tree + */ public class AddNode extends AbstractAction { private static final FactoryPanel nfd = new FactoryPanel<>(Registry.nodeFactory); private final NodeTreeView treeView; public AddNode(NodeTreeView treeView) { super("Add Node"); + putValue(SHORT_DESCRIPTION,"Add a new instance of a Node to every selected branches of the tree."); this.treeView = treeView; } diff --git a/src/main/java/com/marginallyclever/ro3/actions/ExportScene.java b/src/main/java/com/marginallyclever/ro3/actions/ExportScene.java index 7b631f836..af2786ea1 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/ExportScene.java +++ b/src/main/java/com/marginallyclever/ro3/actions/ExportScene.java @@ -10,8 +10,8 @@ import java.io.File; /** - * Export the scene to a file for sharing on another computer. This is not the same as saving the scene. - * Exporting the scene will save the scene and all the assets it uses to a single file. + *

Export the scene and all the assets used to a single file for sharing on another computer. + * This is not the same as saving the scene.

*/ public class ExportScene extends AbstractAction { private static final Logger logger = LoggerFactory.getLogger(SaveScene.class); @@ -19,6 +19,7 @@ public class ExportScene extends AbstractAction { public ExportScene() { super("Export Scene"); + putValue(SHORT_DESCRIPTION,"Export the scene and all the assets used to a single file."); } /** diff --git a/src/main/java/com/marginallyclever/ro3/actions/ImportScene.java b/src/main/java/com/marginallyclever/ro3/actions/ImportScene.java index ffbfef212..4ef118a37 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/ImportScene.java +++ b/src/main/java/com/marginallyclever/ro3/actions/ImportScene.java @@ -26,6 +26,7 @@ public class ImportScene extends AbstractAction { public ImportScene() { this("Import Scene"); + putValue(SHORT_DESCRIPTION,"Load a Scene into the existing Scene."); } public ImportScene(String name) { diff --git a/src/main/java/com/marginallyclever/ro3/actions/LoadScene.java b/src/main/java/com/marginallyclever/ro3/actions/LoadScene.java index a9085cd8b..6f5fc821f 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/LoadScene.java +++ b/src/main/java/com/marginallyclever/ro3/actions/LoadScene.java @@ -17,6 +17,9 @@ import java.nio.file.Paths; import java.security.InvalidParameterException; +/** + * Load a scene from a file. Completely replaces the current Scene. + */ public class LoadScene extends AbstractAction { private static final Logger logger = LoggerFactory.getLogger(LoadScene.class); private static final JFileChooser chooser = new JFileChooser(); @@ -25,6 +28,7 @@ public class LoadScene extends AbstractAction { public LoadScene(RecentFilesMenu menu) { this(menu,null); + putValue(SHORT_DESCRIPTION,"Load a scene from a file. Completely replaces the current Scene."); } public LoadScene(RecentFilesMenu menu, String filePath) { diff --git a/src/main/java/com/marginallyclever/ro3/actions/NewScene.java b/src/main/java/com/marginallyclever/ro3/actions/NewScene.java index 4d2677e98..627c1ef66 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/NewScene.java +++ b/src/main/java/com/marginallyclever/ro3/actions/NewScene.java @@ -10,11 +10,15 @@ import java.util.ArrayList; import java.util.List; +/** + * Reset the scene to a new empty scene. + */ public class NewScene extends AbstractAction { private static final Logger logger = LoggerFactory.getLogger(NewScene.class); public NewScene() { super("New Scene"); + putValue(SHORT_DESCRIPTION,"Reset the scene to a new empty scene."); } /** diff --git a/src/main/java/com/marginallyclever/ro3/actions/RemoveNode.java b/src/main/java/com/marginallyclever/ro3/actions/RemoveNode.java index 4ffdaa531..55030a126 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/RemoveNode.java +++ b/src/main/java/com/marginallyclever/ro3/actions/RemoveNode.java @@ -13,6 +13,7 @@ public class RemoveNode extends AbstractAction { private final NodeTreeView nodeTreeView; public RemoveNode(NodeTreeView nodeTreeView) { super("Remove Node"); + putValue(SHORT_DESCRIPTION,"Remove the selected node(s)."); this.nodeTreeView = nodeTreeView; } diff --git a/src/main/java/com/marginallyclever/ro3/actions/SaveScene.java b/src/main/java/com/marginallyclever/ro3/actions/SaveScene.java index d96ad7182..9a27ee986 100644 --- a/src/main/java/com/marginallyclever/ro3/actions/SaveScene.java +++ b/src/main/java/com/marginallyclever/ro3/actions/SaveScene.java @@ -1,6 +1,5 @@ package com.marginallyclever.ro3.actions; -import com.fasterxml.jackson.databind.ObjectMapper; import com.marginallyclever.ro3.Registry; import com.marginallyclever.robotoverlord.RobotOverlord; import org.slf4j.Logger; @@ -14,12 +13,16 @@ import java.io.FileWriter; import java.io.IOException; +/** + * Save the entire scene to a file. + */ public class SaveScene extends AbstractAction { private static final Logger logger = LoggerFactory.getLogger(SaveScene.class); private static final JFileChooser chooser = new JFileChooser(); public SaveScene() { super("Save Scene"); + putValue(SHORT_DESCRIPTION,"Save the entire scene to a file."); } /**