diff --git a/prism/src/settings/ChoiceEditor.java b/prism/src/settings/ChoiceEditor.java index 18023128..26e238f1 100644 --- a/prism/src/settings/ChoiceEditor.java +++ b/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 combo; + private JComboBox combo; private JTable lastTable; private boolean modified = false; /** Creates a new instance of ChoiceEditor */ public ChoiceEditor(String[] choices) { - combo = new JComboBox(choices); + combo = new JComboBox(choices); combo.addActionListener(this); combo.addFocusListener(this); this.choices = choices; diff --git a/prism/src/userinterface/CheckBoxList.java b/prism/src/userinterface/CheckBoxList.java index d94c1e8e..73d4e882 100644 --- a/prism/src/userinterface/CheckBoxList.java +++ b/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 +public class CheckBoxList extends JList { protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1); @@ -55,7 +55,7 @@ public class CheckBoxList extends JList { 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 setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } - protected class CellRenderer implements ListCellRenderer + protected class CellRenderer implements ListCellRenderer { - public Component getListCellRendererComponent(JList 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()); diff --git a/prism/src/userinterface/graph/SeriesSettingsList.java b/prism/src/userinterface/graph/SeriesSettingsList.java index 838e7a25..a185757e 100644 --- a/prism/src/userinterface/graph/SeriesSettingsList.java +++ b/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 implements Observer +public class SeriesSettingsList extends AbstractListModel implements Observer { private Graph graph; diff --git a/prism/src/userinterface/simulator/GUIPathPlotDialog.java b/prism/src/userinterface/simulator/GUIPathPlotDialog.java index 5912965e..29d08318 100644 --- a/prism/src/userinterface/simulator/GUIPathPlotDialog.java +++ b/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 comboBoxShow; - private JComboBox 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(); - comboBoxSimulate.setModel(new DefaultComboBoxModel(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(); + 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.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); diff --git a/prism/src/userinterface/simulator/GUISimulator.java b/prism/src/userinterface/simulator/GUISimulator.java index 39b9361d..947dbc88 100644 --- a/prism/src/userinterface/simulator/GUISimulator.java +++ b/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(); + 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(); + 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(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(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 typeBacktrackCombo; - private javax.swing.JComboBox typeExploreCombo; + private javax.swing.JComboBox typeBacktrackCombo; + private javax.swing.JComboBox typeExploreCombo; // End of variables declaration//GEN-END:variables diff --git a/prism/src/userinterface/simulator/GUISimulatorPathTable.java b/prism/src/userinterface/simulator/GUISimulatorPathTable.java index b725a048..c98da6dc 100644 --- a/prism/src/userinterface/simulator/GUISimulatorPathTable.java +++ b/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 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(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 + 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 + class LoopIndicatorListModel extends AbstractListModel { private static final long serialVersionUID = 1L; diff --git a/prism/src/userinterface/simulator/GUISimulatorUpdatesTable.java b/prism/src/userinterface/simulator/GUISimulatorUpdatesTable.java index a918d67a..7d20cd7a 100644 --- a/prism/src/userinterface/simulator/GUISimulatorUpdatesTable.java +++ b/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(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 + 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 + class UpdateHeaderListModel extends AbstractListModel { public Object getElementAt(int index) diff --git a/prism/src/userinterface/simulator/GUIViewDialog.java b/prism/src/userinterface/simulator/GUIViewDialog.java index 8ac75af9..416a39fd 100644 --- a/prism/src/userinterface/simulator/GUIViewDialog.java +++ b/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 hiddenRewardList; + private javax.swing.JList hiddenRewardList; private javax.swing.JScrollPane hiddenRewardScrollList; - private javax.swing.JList 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 visibleRewardList; + private javax.swing.JList visibleRewardList; private javax.swing.JScrollPane visibleRewardScrollList; - private javax.swing.JList 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(); + 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(); + 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(); + 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(); + 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 + 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 + class RewardListModel extends DefaultListModel { private static final long serialVersionUID = 1L; diff --git a/prism/src/userinterface/util/ChoiceProperty.java b/prism/src/userinterface/util/ChoiceProperty.java index 73908cb1..62f5fa1e 100644 --- a/prism/src/userinterface/util/ChoiceProperty.java +++ b/prism/src/userinterface/util/ChoiceProperty.java @@ -41,8 +41,8 @@ public class ChoiceProperty extends SingleProperty private boolean fixedSize; //Editor - private DefaultComboBoxModel listModel; - private JComboBox 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(props); - editor = new JComboBox(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(); if (listModel == null) - listModel = new DefaultComboBoxModel(); + listModel = new DefaultComboBoxModel(); if (property instanceof String) { String comp = (String) property; boolean found = false; diff --git a/prism/src/userinterface/util/FontChooser.java b/prism/src/userinterface/util/FontChooser.java index c0a2d8e5..dbb68805 100644 --- a/prism/src/userinterface/util/FontChooser.java +++ b/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 fontModel = new DefaultComboBoxModel(allFonts); - DefaultComboBoxModel styleModel = new DefaultComboBoxModel(styles); - DefaultComboBoxModel sizeModel = new DefaultComboBoxModel(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(); + 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(); + 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(); + 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 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 sizeList; + private javax.swing.JList sizeList; private javax.swing.JTextField styleBox; - private javax.swing.JList styleList; + private javax.swing.JList styleList; private javax.swing.JTabbedPane theTabs; // End of variables declaration//GEN-END:variables diff --git a/prism/src/userinterface/util/PropertyTable.java b/prism/src/userinterface/util/PropertyTable.java index a1036876..56025809 100644 --- a/prism/src/userinterface/util/PropertyTable.java +++ b/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(); + 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 theCombo; + javax.swing.JComboBox theCombo; javax.swing.JTable theTable; javax.swing.JPanel topPanel; diff --git a/prism/src/userinterface/util/PropertyTableModel.java b/prism/src/userinterface/util/PropertyTableModel.java index 6472743b..71d399c9 100644 --- a/prism/src/userinterface/util/PropertyTableModel.java +++ b/prism/src/userinterface/util/PropertyTableModel.java @@ -43,7 +43,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer private ArrayList groupSizes; private int currentGroup; - private DefaultComboBoxModel comboModel; + private DefaultComboBoxModel comboModel; private JTable theTable; @@ -55,7 +55,7 @@ public class PropertyTableModel extends AbstractTableModel implements Observer groupStarts = new ArrayList(); groupSizes = new ArrayList(); owners = new ArrayList(); - comboModel = new DefaultComboBoxModel(); + 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(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 getComboModel() + public DefaultComboBoxModel getComboModel() { return comboModel; }