|
@@ -13,23 +13,19 @@ import javax.swing.JFileChooser;
|
|
|
public class Controls extends JPanel implements Observer, Serializable
|
|
|
{
|
|
|
private Model model;
|
|
|
- private JRadioButton grid;
|
|
|
- private JRadioButton list;
|
|
|
+ private JButton grid;
|
|
|
+ private JButton list;
|
|
|
private class customListener implements ActionListener
|
|
|
{
|
|
|
public void actionPerformed(ActionEvent e)
|
|
|
{
|
|
|
if (e.getSource() == grid)
|
|
|
{
|
|
|
- grid.setSelected(true);
|
|
|
- list.setSelected(false);
|
|
|
model.switchLayout(true);
|
|
|
grid.setIcon(lightGridIcon);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- list.setSelected(true);
|
|
|
- grid.setSelected(false);
|
|
|
model.switchLayout(false);
|
|
|
list.setIcon(lightListIcon);
|
|
|
}
|
|
@@ -198,7 +194,6 @@ public class Controls extends JPanel implements Observer, Serializable
|
|
|
}
|
|
|
private customListener customlistener;
|
|
|
private superListener superlistener;
|
|
|
- private ButtonGroup layouts;
|
|
|
private ButtonGroup stars;
|
|
|
private Image emptyStarImg;
|
|
|
private Image fullStarImg;
|
|
@@ -282,18 +277,12 @@ public class Controls extends JPanel implements Observer, Serializable
|
|
|
this.listIcon = new ImageIcon(listImg);
|
|
|
this.folderIcon = new ImageIcon(folderImg);
|
|
|
|
|
|
- this.grid = new JRadioButton(gridIcon, true);
|
|
|
+ this.grid = new JButton(gridIcon);
|
|
|
grid.addActionListener(customlistener);
|
|
|
|
|
|
- this.list = new JRadioButton(lightListIcon, false);
|
|
|
+ this.list = new JButton(lightListIcon);
|
|
|
list.addActionListener(customlistener);
|
|
|
|
|
|
- this.layouts = new ButtonGroup();
|
|
|
- layouts.add(grid);
|
|
|
- layouts.add(list);
|
|
|
- grid.setSelected(true);
|
|
|
- list.setSelected(false);
|
|
|
-
|
|
|
this.fileChooser = new JFileChooser();
|
|
|
this.fileButton = new JButton(folderIcon);
|
|
|
fileButton.addActionListener(new ActionListener()
|