Browse Source

Undo some recent tidies to retain java 6 compatibility.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@7252 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 13 years ago
parent
commit
52e384b8c5
  1. 4
      prism/src/settings/ChoiceEditor.java
  2. 10
      prism/src/userinterface/CheckBoxList.java
  3. 2
      prism/src/userinterface/graph/SeriesSettingsList.java
  4. 12
      prism/src/userinterface/simulator/GUIPathPlotDialog.java
  5. 12
      prism/src/userinterface/simulator/GUISimulator.java
  6. 10
      prism/src/userinterface/simulator/GUISimulatorPathTable.java
  7. 12
      prism/src/userinterface/simulator/GUISimulatorUpdatesTable.java
  8. 20
      prism/src/userinterface/simulator/GUIViewDialog.java
  9. 10
      prism/src/userinterface/util/ChoiceProperty.java
  10. 18
      prism/src/userinterface/util/FontChooser.java
  11. 4
      prism/src/userinterface/util/PropertyTable.java
  12. 8
      prism/src/userinterface/util/PropertyTableModel.java

4
prism/src/settings/ChoiceEditor.java

@ -37,14 +37,14 @@ public class ChoiceEditor implements SettingEditor, ActionListener, FocusListene
{
private Font font = new Font("monospaced", Font.PLAIN, 12);
private String[] choices;
private JComboBox<String> combo;
private JComboBox combo;
private JTable lastTable;
private boolean modified = false;
/** Creates a new instance of ChoiceEditor */
public ChoiceEditor(String[] choices)
{
combo = new JComboBox<String>(choices);
combo = new JComboBox(choices);
combo.addActionListener(this);
combo.addFocusListener(this);
this.choices = choices;

10
prism/src/userinterface/CheckBoxList.java

@ -42,7 +42,7 @@ import javax.swing.border.EmptyBorder;
* Extension of JList containing JCheckBoxes.
*/
@SuppressWarnings("serial")
public class CheckBoxList extends JList<JCheckBox>
public class CheckBoxList extends JList
{
protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
@ -55,7 +55,7 @@ public class CheckBoxList extends JList<JCheckBox>
{
int index = locationToIndex(e.getPoint());
if (index != -1) {
JCheckBox checkbox = getModel().getElementAt(index);
JCheckBox checkbox = (JCheckBox) getModel().getElementAt(index);
checkbox.setSelected(!checkbox.isSelected());
repaint();
}
@ -64,11 +64,11 @@ public class CheckBoxList extends JList<JCheckBox>
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
}
protected class CellRenderer implements ListCellRenderer<JCheckBox>
protected class CellRenderer implements ListCellRenderer
{
public Component getListCellRendererComponent(JList<? extends JCheckBox> list, JCheckBox value, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
JCheckBox checkbox = value;
JCheckBox checkbox = (JCheckBox) value;
checkbox.setBackground(isSelected ? getSelectionBackground() : getBackground());
checkbox.setForeground(isSelected ? getSelectionForeground() : getForeground());
checkbox.setEnabled(isEnabled());

2
prism/src/userinterface/graph/SeriesSettingsList.java

@ -35,7 +35,7 @@ import javax.swing.*;
* The settings are propagated to the JFreeChart library.
*/
@SuppressWarnings("serial")
public class SeriesSettingsList extends AbstractListModel<Object> implements Observer
public class SeriesSettingsList extends AbstractListModel implements Observer
{
private Graph graph;

12
prism/src/userinterface/simulator/GUIPathPlotDialog.java

@ -108,8 +108,8 @@ public class GUIPathPlotDialog extends JDialog
private JTextField textFieldTime;
private JTextField textFieldInterval;
private JLabel lblInterval;
private JComboBox<ShowChoice> comboBoxShow;
private JComboBox<SimulateChoice> comboBoxSimulate;
private JComboBox comboBoxShow;
private JComboBox comboBoxSimulate;
private JButton okButton;
private JButton cancelButton;
private JTabbedPane tabbedPane;
@ -256,8 +256,8 @@ public class GUIPathPlotDialog extends JDialog
topPanel.add(lblSimulate, gbc_lblSimulate);
}
{
comboBoxSimulate = new JComboBox<SimulateChoice>();
comboBoxSimulate.setModel(new DefaultComboBoxModel<SimulateChoice>(SimulateChoice.values()));
comboBoxSimulate = new JComboBox();
comboBoxSimulate.setModel(new DefaultComboBoxModel(SimulateChoice.values()));
GridBagConstraints gbc_comboBoxSimulate = new GridBagConstraints();
gbc_comboBoxSimulate.anchor = GridBagConstraints.WEST;
gbc_comboBoxSimulate.insets = new Insets(0, 0, 5, 5);
@ -285,7 +285,7 @@ public class GUIPathPlotDialog extends JDialog
topPanel.add(lblShow, gbc_lblShow);
}
{
comboBoxShow = new JComboBox<ShowChoice>();
comboBoxShow = new JComboBox();
comboBoxShow.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
@ -293,7 +293,7 @@ public class GUIPathPlotDialog extends JDialog
comboBoxShowActionPerformed(e);
}
});
comboBoxShow.setModel(new DefaultComboBoxModel<ShowChoice>(ShowChoice.values()));
comboBoxShow.setModel(new DefaultComboBoxModel(ShowChoice.values()));
GridBagConstraints gbc_comboBoxShow = new GridBagConstraints();
gbc_comboBoxShow.anchor = GridBagConstraints.WEST;
gbc_comboBoxShow.insets = new Insets(0, 0, 5, 5);

12
prism/src/userinterface/simulator/GUISimulator.java

@ -1013,13 +1013,13 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
innerAutomaticExplorationPanel = new javax.swing.JPanel();
randomExplorationButton = new javax.swing.JButton();
noStepsExplorePanel = new javax.swing.JPanel();
typeExploreCombo = new javax.swing.JComboBox<String>();
typeExploreCombo = new javax.swing.JComboBox();
inputExploreField = new javax.swing.JTextField();
backtrackPanel = new javax.swing.JPanel();
innerBacktrackPanel = new javax.swing.JPanel();
backtrackButton = new javax.swing.JButton();
noStepsBacktrackPanel = new javax.swing.JPanel();
typeBacktrackCombo = new javax.swing.JComboBox<String>();
typeBacktrackCombo = new javax.swing.JComboBox();
inputBacktrackField = new javax.swing.JTextField();
manualUpdatesPanel = new javax.swing.JPanel();
innerManualUpdatesPanel = new javax.swing.JPanel();
@ -1262,7 +1262,7 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
noStepsExplorePanel.setLayout(new java.awt.GridBagLayout());
noStepsExplorePanel.setMinimumSize(new java.awt.Dimension(107, 0));
typeExploreCombo.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "Num. steps", "Upto state", "Max. time" }));
typeExploreCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Num. steps", "Upto state", "Max. time" }));
typeExploreCombo.setToolTipText("");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
@ -1320,7 +1320,7 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
noStepsBacktrackPanel.setLayout(new java.awt.GridBagLayout());
noStepsBacktrackPanel.setMinimumSize(new java.awt.Dimension(107, 0));
typeBacktrackCombo.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "Num. steps", "To state" }));
typeBacktrackCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Num. steps", "To state" }));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 2.0;
@ -2062,8 +2062,8 @@ public class GUISimulator extends GUIPlugin implements MouseListener, ListSelect
private javax.swing.JPanel topValues;
private javax.swing.JLabel totalTime;
private javax.swing.JLabel totalTimeLabel;
private javax.swing.JComboBox<String> typeBacktrackCombo;
private javax.swing.JComboBox<String> typeExploreCombo;
private javax.swing.JComboBox typeBacktrackCombo;
private javax.swing.JComboBox typeExploreCombo;
// End of variables declaration//GEN-END:variables

10
prism/src/userinterface/simulator/GUISimulatorPathTable.java

@ -47,7 +47,7 @@ public class GUISimulatorPathTable extends GUIGroupedTable
// Table model
private GUISimulatorPathTableModel ptm;
// Component on left hand side to show path loops
private JList<Object> loopIndicator;
private JList loopIndicator;
private LoopIndicatorListModel loopIndicatorModel;
/** Creates a new instance of GUISimulatorPathTable */
@ -63,7 +63,7 @@ public class GUISimulatorPathTable extends GUIGroupedTable
setDefaultRenderer(Object.class, new PathChangeTableRenderer(true));
// Loop indicator
loopIndicatorModel = new LoopIndicatorListModel();
loopIndicator = new JList<Object>(loopIndicatorModel);
loopIndicator = new JList(loopIndicatorModel);
loopIndicator.setBackground(new JPanel().getBackground());
loopIndicator.setFixedCellWidth(25);
loopIndicator.setFixedCellHeight(getRowHeight());
@ -109,7 +109,7 @@ public class GUISimulatorPathTable extends GUIGroupedTable
// Cell renderer for list representing loop indicator (left of path table)
class LoopIndicatorRenderer extends JPanel implements ListCellRenderer<Object>
class LoopIndicatorRenderer extends JPanel implements ListCellRenderer
{
private static final long serialVersionUID = 1L;
@ -126,7 +126,7 @@ public class GUISimulatorPathTable extends GUIGroupedTable
setFont(header.getFont());*/
}
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
//setText((value == null) ? "" : value.toString());
//setBorder(new LineBorder(Color.black, 1));
@ -216,7 +216,7 @@ public class GUISimulatorPathTable extends GUIGroupedTable
// Model for list representing loop indicator
class LoopIndicatorListModel extends AbstractListModel<Object>
class LoopIndicatorListModel extends AbstractListModel
{
private static final long serialVersionUID = 1L;

12
prism/src/userinterface/simulator/GUISimulatorUpdatesTable.java

@ -50,7 +50,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
private GUISimulator.UpdateTableModel utm;
private UpdateHeaderListModel headerModel;
private JList<?> header;
private JList header;
private UpdateHeaderRenderer updateHeaderRenderer;
private UpdateTableRenderer updateTableRenderer;
@ -69,7 +69,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
headerModel = new UpdateHeaderListModel();
JList<?> rowHeader = new JList<Object>(headerModel);
JList rowHeader = new JList(headerModel);
rowHeader.setBackground(new JPanel().getBackground());
@ -147,7 +147,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
repaint();
}
public JList<?> getUpdateRowHeader()
public JList getUpdateRowHeader()
{
return header;
}
@ -201,7 +201,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
}
}
class UpdateHeaderRenderer extends JButton implements ListCellRenderer<Object>
class UpdateHeaderRenderer extends JButton implements ListCellRenderer
{
ImageIcon selectedIcon;
@ -221,7 +221,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
selectedDisabledIcon = GUIPrism.getIconFromImage("smallItemSelectedDisabled.png");
}
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
{
setBorder(null);
if (getSelectedRow() == index) {
@ -237,7 +237,7 @@ public class GUISimulatorUpdatesTable extends JTable implements ListSelectionLis
}
class UpdateHeaderListModel extends AbstractListModel<Object>
class UpdateHeaderListModel extends AbstractListModel
{
public Object getElementAt(int index)

20
prism/src/userinterface/simulator/GUIViewDialog.java

@ -66,9 +66,9 @@ public class GUIViewDialog extends JDialog implements KeyListener
private javax.swing.JPanel centerVariablePanel;
private javax.swing.JRadioButton changeRenderingButton;
private javax.swing.JLabel hiddenLabel;
private javax.swing.JList<RewardListItem> hiddenRewardList;
private javax.swing.JList hiddenRewardList;
private javax.swing.JScrollPane hiddenRewardScrollList;
private javax.swing.JList<Variable> hiddenVariableList;
private javax.swing.JList hiddenVariableList;
private javax.swing.JScrollPane hiddenVariableScrollList;
private javax.swing.JPanel innerPathStylePanel;
private javax.swing.JPanel innerTimePanel;
@ -103,9 +103,9 @@ public class GUIViewDialog extends JDialog implements KeyListener
private javax.swing.JTabbedPane variableTabPane;
private javax.swing.JPanel variableTabPanel;
private javax.swing.JLabel visibleLabel;
private javax.swing.JList<RewardListItem> visibleRewardList;
private javax.swing.JList visibleRewardList;
private javax.swing.JScrollPane visibleRewardScrollList;
private javax.swing.JList<Variable> visibleVariableList;
private javax.swing.JList visibleVariableList;
private javax.swing.JScrollPane visibleVariableScrollList;
// End of variables declaration//GEN-END:variables
@ -210,7 +210,7 @@ public class GUIViewDialog extends JDialog implements KeyListener
leftVariableColumn = new javax.swing.JPanel();
leftVariablePanel = new javax.swing.JPanel();
visibleVariableScrollList = new javax.swing.JScrollPane();
visibleVariableList = new javax.swing.JList<Variable>();
visibleVariableList = new javax.swing.JList();
selectAllVisibleVariablesButton = new javax.swing.JButton();
centerVariableColumn = new javax.swing.JPanel();
centerVariablePanel = new javax.swing.JPanel();
@ -219,14 +219,14 @@ public class GUIViewDialog extends JDialog implements KeyListener
rightVariableColumn = new javax.swing.JPanel();
rightVariablePanel = new javax.swing.JPanel();
hiddenVariableScrollList = new javax.swing.JScrollPane();
hiddenVariableList = new javax.swing.JList<Variable>();
hiddenVariableList = new javax.swing.JList();
selectAllHiddenVariablesButton = new javax.swing.JButton();
rewardTabPanel = new javax.swing.JPanel();
rewardPanel = new javax.swing.JPanel();
leftRewardColumn = new javax.swing.JPanel();
leftRewardPanel = new javax.swing.JPanel();
visibleRewardScrollList = new javax.swing.JScrollPane();
visibleRewardList = new javax.swing.JList<RewardListItem>();
visibleRewardList = new javax.swing.JList();
selectAllVisibleRewardsButton = new javax.swing.JButton();
centerRewardColumn = new javax.swing.JPanel();
centerRewardPanel = new javax.swing.JPanel();
@ -235,7 +235,7 @@ public class GUIViewDialog extends JDialog implements KeyListener
rightRewardColumn = new javax.swing.JPanel();
rightRewardPanel = new javax.swing.JPanel();
hiddenRewardScrollList = new javax.swing.JScrollPane();
hiddenRewardList = new javax.swing.JList<RewardListItem>();
hiddenRewardList = new javax.swing.JList();
selectAllHiddenRewardsButton = new javax.swing.JButton();
otherTabPanel = new javax.swing.JPanel();
boxPanel = new javax.swing.JPanel();
@ -719,7 +719,7 @@ public class GUIViewDialog extends JDialog implements KeyListener
}
class VariableListModel extends DefaultListModel<Variable>
class VariableListModel extends DefaultListModel
{
private static final long serialVersionUID = 1L;
@ -822,7 +822,7 @@ public class GUIViewDialog extends JDialog implements KeyListener
}
}
class RewardListModel extends DefaultListModel<RewardListItem>
class RewardListModel extends DefaultListModel
{
private static final long serialVersionUID = 1L;

10
prism/src/userinterface/util/ChoiceProperty.java

@ -41,8 +41,8 @@ public class ChoiceProperty extends SingleProperty
private boolean fixedSize;
//Editor
private DefaultComboBoxModel<String> listModel;
private JComboBox<String> editor;
private DefaultComboBoxModel listModel;
private JComboBox editor;
/** Creates a new instance of DoubleProperty */
public ChoiceProperty(PropertyOwner owner, String name, String[] props, int startIndex)
@ -60,8 +60,8 @@ public class ChoiceProperty extends SingleProperty
this.currIndex = startIndex;
this.fixedSize = true;
listModel = new DefaultComboBoxModel<String>(props);
editor = new JComboBox<String>(listModel);
listModel = new DefaultComboBoxModel(props);
editor = new JComboBox(listModel);
editor.setEditable(false);
Font f = editor.getFont();
editor.setFont(new Font(f.getName(), Font.PLAIN, f.getSize()));
@ -131,7 +131,7 @@ public class ChoiceProperty extends SingleProperty
if (properties == null)
properties = new ArrayList<String>();
if (listModel == null)
listModel = new DefaultComboBoxModel<String>();
listModel = new DefaultComboBoxModel();
if (property instanceof String) {
String comp = (String) property;
boolean found = false;

18
prism/src/userinterface/util/FontChooser.java

@ -119,9 +119,9 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
String[] styles = { "Plain", "Bold", "Italic", "Bold Italic" };
String[] sizes = { "8", "9", "10", "11", "12", "14", "16", "18", "20" };
DefaultComboBoxModel<String> fontModel = new DefaultComboBoxModel<String>(allFonts);
DefaultComboBoxModel<String> styleModel = new DefaultComboBoxModel<String>(styles);
DefaultComboBoxModel<String> sizeModel = new DefaultComboBoxModel<String>(sizes);
DefaultComboBoxModel fontModel = new DefaultComboBoxModel(allFonts);
DefaultComboBoxModel styleModel = new DefaultComboBoxModel(styles);
DefaultComboBoxModel sizeModel = new DefaultComboBoxModel(sizes);
fontList.setModel(fontModel);
styleList.setModel(styleModel);
@ -168,7 +168,7 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
jPanel42 = new javax.swing.JPanel();
jPanel43 = new javax.swing.JPanel();
jScrollPane4 = new javax.swing.JScrollPane();
fontList = new javax.swing.JList<String>();
fontList = new javax.swing.JList();
jPanel44 = new javax.swing.JPanel();
jPanel45 = new javax.swing.JPanel();
jPanel46 = new javax.swing.JPanel();
@ -180,7 +180,7 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
jPanel50 = new javax.swing.JPanel();
jPanel51 = new javax.swing.JPanel();
jScrollPane5 = new javax.swing.JScrollPane();
styleList = new javax.swing.JList<String>();
styleList = new javax.swing.JList();
jPanel52 = new javax.swing.JPanel();
jPanel53 = new javax.swing.JPanel();
jPanel54 = new javax.swing.JPanel();
@ -191,7 +191,7 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
jPanel57 = new javax.swing.JPanel();
jPanel58 = new javax.swing.JPanel();
jScrollPane6 = new javax.swing.JScrollPane();
sizeList = new javax.swing.JList<String>();
sizeList = new javax.swing.JList();
jPanel59 = new javax.swing.JPanel();
jPanel60 = new javax.swing.JPanel();
previewLabel = new javax.swing.JLabel();
@ -701,7 +701,7 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
protected javax.swing.JColorChooser colorChooser;
private javax.swing.JButton defaultButton;
private javax.swing.JTextField fontBox;
private javax.swing.JList<String> fontList;
private javax.swing.JList fontList;
private javax.swing.JPanel fontPanel;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
@ -741,9 +741,9 @@ public class FontChooser extends javax.swing.JDialog implements ListSelectionLis
private javax.swing.JButton okayButton;
private javax.swing.JLabel previewLabel;
private javax.swing.JTextField sizeBox;
private javax.swing.JList<String> sizeList;
private javax.swing.JList sizeList;
private javax.swing.JTextField styleBox;
private javax.swing.JList<String> styleList;
private javax.swing.JList styleList;
private javax.swing.JTabbedPane theTabs;
// End of variables declaration//GEN-END:variables

4
prism/src/userinterface/util/PropertyTable.java

@ -197,7 +197,7 @@ public class PropertyTable extends JPanel implements ListSelectionListener, Tabl
commentText = new javax.swing.JTextArea();
commentLabel = new javax.swing.JLabel();
topPanel = new javax.swing.JPanel();
theCombo = new javax.swing.JComboBox<Object>();
theCombo = new javax.swing.JComboBox();
setLayout(new java.awt.BorderLayout());
@ -331,7 +331,7 @@ public class PropertyTable extends JPanel implements ListSelectionListener, Tabl
// Variables declaration - do not modify//GEN-BEGIN:variables
javax.swing.JLabel commentLabel;
javax.swing.JTextArea commentText;
javax.swing.JComboBox<Object> theCombo;
javax.swing.JComboBox theCombo;
javax.swing.JTable theTable;
javax.swing.JPanel topPanel;

8
prism/src/userinterface/util/PropertyTableModel.java

@ -43,7 +43,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer
private ArrayList<Integer> groupSizes;
private int currentGroup;
private DefaultComboBoxModel<Object> comboModel;
private DefaultComboBoxModel comboModel;
private JTable theTable;
@ -55,7 +55,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer
groupStarts = new ArrayList<Integer>();
groupSizes = new ArrayList<Integer>();
owners = new ArrayList<PropertyOwner>();
comboModel = new DefaultComboBoxModel<Object>();
comboModel = new DefaultComboBoxModel();
}
public void setJTable(JTable tab)
@ -123,7 +123,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer
}
if (currentGroup > owners.size() - 1)
currentGroup = 0;
comboModel = new DefaultComboBoxModel<Object>(groupNames.toArray());
comboModel = new DefaultComboBoxModel(groupNames.toArray());
fireTableDataChanged();
}
@ -277,7 +277,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer
* Getter for property comboModel.
* @return Value of property comboModel.
*/
public DefaultComboBoxModel<Object> getComboModel()
public DefaultComboBoxModel getComboModel()
{
return comboModel;
}

Loading…
Cancel
Save