diff --git a/MasterofSprites/nbproject/private/private.xml b/MasterofSprites/nbproject/private/private.xml index a8a7f07..9b553a6 100644 --- a/MasterofSprites/nbproject/private/private.xml +++ b/MasterofSprites/nbproject/private/private.xml @@ -14,6 +14,7 @@ file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/SpritePreview.java file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/MasterofSprites.java + file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/docs/manual.html file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java diff --git a/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java b/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java index c881394..a70fba8 100644 --- a/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java +++ b/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java @@ -67,7 +67,6 @@ public EditorPanel() { layoutControls(); setProject(null); - setSelection(null); } private void createControls() { diff --git a/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java b/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java index d14cd4d..3c86093 100644 --- a/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java +++ b/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java @@ -20,9 +20,6 @@ import java.awt.image.BufferedImage; import java.io.*; import java.util.Calendar; -import java.util.Date; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.imageio.*; import javax.swing.*; import javax.swing.filechooser.*; diff --git a/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java b/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java index 63a2036..3ca9925 100644 --- a/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java +++ b/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java @@ -142,6 +142,8 @@ public PreviewPanel() { add(northPanel, BorderLayout.NORTH); add(southPanel, BorderLayout.SOUTH); + currentSelection = new ArrayList<>(); + timer = new Timer(100, ae->preview.nextFrame()); frameDelaySpinner.addChangeListener(che->timer.setDelay((Integer)frameDelaySpinner.getValue())); frameCountSpinner.addChangeListener(che->{ @@ -172,6 +174,7 @@ public void setProject(SpriteProject p) { this.project = p; preview.setProject(this.project); + setSelection(null); preview.reload(); } @@ -179,7 +182,9 @@ public void setSelection(ArrayList s) { requestedSelection = s; if (!lockButton.isSelected()) { - currentSelection = requestedSelection; + currentSelection.clear(); + if (requestedSelection != null) + requestedSelection.forEach(i->currentSelection.add(i)); if (currentSelection == null) arrangementModel.setSelectionSize(0);