]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/gui/UndoManager.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / gui / UndoManager.java
index 46a1c8d9de834f231b7a48f4607d33144665d2c5..48307c1a1f9cc54d107462a7a68f4008d9d938a4 100644 (file)
@@ -28,7 +28,7 @@ public class UndoManager
 {
        private App _app;
        private JDialog _dialog;
-       private JList _actionList;
+       private JList<String> _actionList;
 
 
        /**
@@ -44,15 +44,15 @@ public class UndoManager
                JPanel mainPanel = new JPanel();
                mainPanel.setLayout(new BorderLayout(3, 3));
                mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-               Stack undoStack = inApp.getUndoStack();
+               Stack<UndoOperation> undoStack = inApp.getUndoStack();
                mainPanel.add(new JLabel(I18nManager.getText("dialog.undo.pretext")), BorderLayout.NORTH);
 
                String[] undoActions = new String[undoStack.size()];
                for (int i=0; i<undoStack.size(); i++)
                {
-                       undoActions[i] = ((UndoOperation) undoStack.elementAt(undoStack.size()-1-i)).getDescription();
+                       undoActions[i] = undoStack.elementAt(undoStack.size()-1-i).getDescription();
                }
-               _actionList = new JList(undoActions);
+               _actionList = new JList<String>(undoActions);
                _actionList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
                _actionList.setSelectedIndex(0);
                _actionList.addListSelectionListener(new ListSelectionListener()
@@ -91,7 +91,7 @@ public class UndoManager
                mainPanel.add(buttonPanel, BorderLayout.SOUTH);
                _dialog.getContentPane().add(mainPanel);
                _dialog.pack();
-               _dialog.show();
+               _dialog.setVisible(true);
        }
 
 }