Ver Fonte

small changes to make ui less buggy-looking.capping size of pics, no more cyan

tarfeef101 há 6 anos atrás
pai
commit
9d1dff9b0e

+ 2 - 5
assignments/a3/src/main/java/Gallery.java

@@ -21,7 +21,6 @@ public class Gallery extends JPanel implements Observer, Serializable
     // Hook up this observer so that it will be notified when the model
     // changes.
     this.model = model;
-    this.setBackground(Color.cyan);
     this.setMinimumSize(new Dimension(400, 400));
     this.items = new ArrayList();
     reList();
@@ -81,7 +80,6 @@ public class Gallery extends JPanel implements Observer, Serializable
     }
     else
     {
-      this.setBackground(Color.cyan);
       this.setLayout(new GridLayout(0, 1));
     }
 
@@ -91,8 +89,6 @@ public class Gallery extends JPanel implements Observer, Serializable
     {
       if (i.getData().getRating() >= model.getFilter()) this.add(i);
     }
-
-    this.setBackground(Color.cyan);
   }
 }
 
@@ -320,7 +316,8 @@ class Item extends JPanel implements Serializable
     star4.setSelected(false);
     star5.setSelected(false);
     this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
-    this.setPreferredSize(new Dimension(200, 300));
+    this.setPreferredSize(new Dimension(200, 282));
+    this.setMaximumSize(new Dimension(200, 282));
     this.picture = new ImageIcon(data.getPic());
     this.pic = new JLabel(picture, JLabel.CENTER);
     this.pic.addMouseListener(clicklistener);

+ 0 - 1
assignments/a3/src/main/java/Model.java

@@ -64,7 +64,6 @@ public class Model extends Observable implements Serializable
     if (grid != flag)
     {
       grid = flag;
-      System.out.println("Layout Toggled!");
       setChanged();
       notifyObservers();
     }