/**
* Constructor
+ * @param inApp App object
+ * @param inFrame parent frame
*/
public UndoManager(App inApp, JFrame inFrame)
{
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.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
// Buttons
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
- JButton okButton = new JButton("OK");
+ JButton okButton = new JButton(I18nManager.getText("button.ok"));
okButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
}
});
buttonPanel.add(okButton);
- JButton cancelButton = new JButton("Cancel");
+ JButton cancelButton = new JButton(I18nManager.getText("button.cancel"));
cancelButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
mainPanel.add(buttonPanel, BorderLayout.SOUTH);
_dialog.getContentPane().add(mainPanel);
_dialog.pack();
- _dialog.show();
+ _dialog.setVisible(true);
}
}