Sfoglia il codice sorgente

things scale within the images properly now, need to fix scrolling inside the grid view. maybe need to move text to the side on list view.

tsdedhar 7 anni fa
parent
commit
d01cea1f02

BIN
assignments/a3/.gradle/4.7/fileHashes/fileHashes.bin


BIN
assignments/a3/.gradle/4.7/fileHashes/fileHashes.lock


BIN
assignments/a3/.gradle/4.7/taskHistory/taskHistory.bin


BIN
assignments/a3/.gradle/4.7/taskHistory/taskHistory.lock


BIN
assignments/a3/.gradle/buildOutputCleanup/buildOutputCleanup.lock


BIN
assignments/a3/build/classes/java/main/Gallery.class


BIN
assignments/a3/build/classes/java/main/Item$clickListener.class


BIN
assignments/a3/build/classes/java/main/Item.class


BIN
assignments/a3/build/libs/a2-1.0-SNAPSHOT.jar


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

@@ -55,6 +55,8 @@ public class Gallery extends JPanel implements Observer
     {
       this.setLayout(new GridLayout(0, 1));
     }
+
+    this.setBackground(Color.cyan);
     
     this.removeAll();
     
@@ -93,18 +95,18 @@ class Item extends JPanel
   {
     this.data = p;
     this.clicklistener = new clickListener();
-    this.setLayout(new GridLayout(0, 1));
-    this.setPreferredSize(new Dimension(200, 320));
+    this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
+    this.setPreferredSize(new Dimension(200, 300));
     this.picture = new ImageIcon(data.getPic());
     this.pic = new JLabel(picture, JLabel.CENTER);
     this.pic.addMouseListener(clicklistener);
     this.pic.setPreferredSize(new Dimension(200, 200));
     this.name = new JLabel(data.getName(), JLabel.CENTER);
-    this.name.setPreferredSize(new Dimension(200, 40));
+    this.name.setPreferredSize(new Dimension(200, 25));
     this.rating = new JLabel(Integer.toString(data.getRating()), JLabel.CENTER);
-    this.rating.setPreferredSize(new Dimension(200, 40));
+    this.rating.setPreferredSize(new Dimension(200, 50));
     this.dateSize = new JLabel(Long.toString(data.getLastmod()) + Long.toString(data.getSize()), JLabel.CENTER);
-    this.dateSize.setPreferredSize(new Dimension(200, 40));
+    this.dateSize.setPreferredSize(new Dimension(200, 25));
     this.add(pic);
     this.add(name);
     this.add(rating);