Explorar o código

further beautifing

Noah Vogt %!s(int64=3) %!d(string=hai) anos
pai
achega
15f1348a6c
Modificáronse 1 ficheiros con 22 adicións e 18 borrados
  1. 22 18
      src/ui/MainWindow.java

+ 22 - 18
src/ui/MainWindow.java

@@ -80,9 +80,6 @@ public class MainWindow {
 	}
 
     private void redrawCardPanel() {
-        // if (isNotNeededToDrawMultiplePages())
-        //     return;
-
         int startIndex = (24 * (activePageNumber - 1));
         int endIndex = (Math.min((24 * (activePageNumber - 1) + 23),
                                   (kartenDeck.getDeckSize() - 1)));
@@ -106,10 +103,6 @@ public class MainWindow {
         cardPanel.repaint();
     }
 
-    // private boolean isNotNeededToDrawMultiplePages() {
-    //     return kartenDeck.getDeckSize() <= 24;
-    // }
-
     private void applyNordTextTheme(JComponent jComponent) {
         jComponent.setBackground(Color.decode("#373D49"));
         jComponent.setForeground(Color.decode("#D8DEE9"));
@@ -121,16 +114,8 @@ public class MainWindow {
 		topPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 50, 10));
         topPanel.setBackground(Color.decode("#2E3440"));
 
-        JLabel mischmaschineLabel = new JLabel("Mischmaschine");
-        applyNordTextTheme(mischmaschineLabel);
-        ImageIcon mischmaschineIcon = new ImageIcon("img/shuffle-64.png");
-        mischmaschineLabel.setIconTextGap(10);
-        mischmaschineLabel.setIcon(mischmaschineIcon);
-
-        JButton mischButton = new JButton("Mischen");
-        applyNordTextTheme(mischButton);
-        mischButton.setFocusable(false);
-        mischButton.setToolTipText("Mische alle Karten in der Maschine");
+        JLabel mischMaschineLabel = createMischMaschineLabel();
+        JButton mischButton = createMischButton();
 
         mischButton.addActionListener(new ActionListener(){
 			@Override
@@ -142,10 +127,29 @@ public class MainWindow {
 			}
         });
 
-        topPanel.add(mischmaschineLabel);
+        topPanel.add(mischMaschineLabel);
         topPanel.add(mischButton);
 	}
 
+	private JLabel createMischMaschineLabel() {
+		JLabel mischmaschineLabel = new JLabel("Mischmaschine");
+        applyNordTextTheme(mischmaschineLabel);
+        ImageIcon mischmaschineIcon = new ImageIcon("img/shuffle-64.png");
+        mischmaschineLabel.setIconTextGap(10);
+        mischmaschineLabel.setIcon(mischmaschineIcon);
+
+		return mischmaschineLabel;
+	}
+
+	private JButton createMischButton() {
+		JButton mischButton = new JButton("Mischen");
+        applyNordTextTheme(mischButton);
+        mischButton.setFocusable(false);
+        mischButton.setToolTipText("Mische alle Karten in der Maschine");
+
+		return mischButton;
+	}
+
     private void goToPreviousPage() {
         if (activePageNumber == 1)
             return;