< prev index next >
src/com/sun/javatest/mrep/OptionsPane.java
Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg
*** 320,330 ****
/**
* @param lst JList of checkboxes
* @param p parent Panel
* @param cardLayout The CardLayout for options
*/
! SelectListener(JList lst, JPanel p, CardLayout cardLayout) {
list = lst;
listModel = list.getModel();
lastSelected = listModel.getElementAt(0);
panel = p;
cards = cardLayout;
--- 320,330 ----
/**
* @param lst JList of checkboxes
* @param p parent Panel
* @param cardLayout The CardLayout for options
*/
! SelectListener(JList<JCheckBox> lst, JPanel p, CardLayout cardLayout) {
list = lst;
listModel = list.getModel();
lastSelected = listModel.getElementAt(0);
panel = p;
cards = cardLayout;
*** 342,352 ****
}
}
public void valueChanged(ListSelectionEvent e) {
int index = list.getSelectedIndex();
! JCheckBox box = (JCheckBox) (listModel.getElementAt(index));
if (lastSelected != box) {
cards.show(panel, box.getName());
lastSelected = box;
}
--- 342,352 ----
}
}
public void valueChanged(ListSelectionEvent e) {
int index = list.getSelectedIndex();
! JCheckBox box = (listModel.getElementAt(index));
if (lastSelected != box) {
cards.show(panel, box.getName());
lastSelected = box;
}
*** 377,387 ****
}
}
}
private void process(final int index) {
! JCheckBox box = (JCheckBox) (listModel.getElementAt(index));
if (lastSelected == box) {
box.doClick();
list.repaint(); // important!
enablePanel(box);
--- 377,387 ----
}
}
}
private void process(final int index) {
! JCheckBox box = (listModel.getElementAt(index));
if (lastSelected == box) {
box.doClick();
list.repaint(); // important!
enablePanel(box);
*** 394,405 ****
public void keyPressed(KeyEvent e) {
}
Object lastSelected;
! JList list;
! ListModel listModel;
JPanel panel;
CardLayout cards;
double emptyCBW = new JCheckBox("").getPreferredSize().getWidth() + 2;
}
--- 394,405 ----
public void keyPressed(KeyEvent e) {
}
Object lastSelected;
! JList<JCheckBox> list;
! ListModel<JCheckBox> listModel;
JPanel panel;
CardLayout cards;
double emptyCBW = new JCheckBox("").getPreferredSize().getWidth() + 2;
}
*** 467,477 ****
private Set<Component> enabledComp;
}
private class CheckBoxListCellRenderer implements ListCellRenderer<JCheckBox> {
! public Component getListCellRendererComponent(JList list, JCheckBox comp,
int index, boolean isSelected, boolean cellHasFocus) {
// assert: value is a JCheckBox
if (isSelected) {
comp.setOpaque(true);
comp.setBackground(UIFactory.Colors.TEXT_HIGHLIGHT_COLOR.getValue());
--- 467,477 ----
private Set<Component> enabledComp;
}
private class CheckBoxListCellRenderer implements ListCellRenderer<JCheckBox> {
! public Component getListCellRendererComponent(JList<? extends JCheckBox> list, JCheckBox comp,
int index, boolean isSelected, boolean cellHasFocus) {
// assert: value is a JCheckBox
if (isSelected) {
comp.setOpaque(true);
comp.setBackground(UIFactory.Colors.TEXT_HIGHLIGHT_COLOR.getValue());
< prev index next >