|
@@ -17,7 +17,7 @@ public class Gallery extends JPanel implements Observer
|
|
|
this.setBackground(Color.white);
|
|
|
this.items = new ArrayList();
|
|
|
reList();
|
|
|
- reFill(3);
|
|
|
+ reFill();
|
|
|
model.addObserver(this);
|
|
|
}
|
|
|
|
|
@@ -27,7 +27,7 @@ public class Gallery extends JPanel implements Observer
|
|
|
public void update(Object observable)
|
|
|
{
|
|
|
reList();
|
|
|
- reFill(3);
|
|
|
+ reFill();
|
|
|
revalidate();
|
|
|
repaint();
|
|
|
}
|
|
@@ -47,7 +47,7 @@ public class Gallery extends JPanel implements Observer
|
|
|
{
|
|
|
if (model.getGrid())
|
|
|
{
|
|
|
- this.setLayout(new GridLayout(0, cols));
|
|
|
+ this.setLayout(new FlowLayout(10));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -81,11 +81,11 @@ class Item extends JPanel
|
|
|
this.pic = new JLabel(picture, JLabel.CENTER);
|
|
|
this.pic.setPreferredSize(new Dimension(100, 100));
|
|
|
this.name = new JLabel(data.getName(), JLabel.CENTER);
|
|
|
- this.setPreferredSize(new Dimension(100, 20));
|
|
|
+ this.name.setPreferredSize(new Dimension(100, 20));
|
|
|
this.rating = new JLabel(Integer.toString(data.getRating()), JLabel.CENTER);
|
|
|
- this.setPreferredSize(new Dimension(100, 20));
|
|
|
+ this.rating.setPreferredSize(new Dimension(100, 20));
|
|
|
this.dateSize = new JLabel(Long.toString(data.getLastmod()) + Long.toString(data.getSize()), JLabel.CENTER);
|
|
|
- this.setPreferredSize(new Dimension(100, 20));
|
|
|
+ this.dateSize.setPreferredSize(new Dimension(100, 20));
|
|
|
this.add(pic);
|
|
|
this.add(name);
|
|
|
this.add(rating);
|