Jelajahi Sumber

Changed ActTimeTest.
Added menu bar support for OSX.

Gilian Joosen 11 tahun lalu
induk
melakukan
cf9ebce442
2 mengubah file dengan 15 tambahan dan 13 penghapusan
  1. 13 11
      src/frames/MainFrame.java
  2. 2 2
      test/agenda/ActTimeTest.java

+ 13 - 11
src/frames/MainFrame.java

@@ -7,16 +7,18 @@ import javax.swing.JPanel;
 public class MainFrame extends JFrame{
 	
 		public MainFrame(JPanel panel){
-		this.add(panel);
-		this.setResizable(false);
-		this.setBounds(100,100,1440,900);
-		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-		this.setUndecorated(false);
-		this.setJMenuBar(new MenuBar());
-		this.setVisible(true);
+            
+            if(System.getProperties().getProperty("os.name").equals("Mac OS X")) {
+                System.setProperty("apple.laf.useScreenMenuBar", "true");
+                System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Test");
+            }
+            
+		    this.add(panel);
+		    this.setResizable(true);
+		    this.setBounds(100,100,1440,900);
+		    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+		    this.setUndecorated(false);
+		    this.setJMenuBar(new MenuBar());
+		    this.setVisible(true);
 		}
-		
-		
-		
-		
 }

+ 2 - 2
test/agenda/ActTimeTest.java

@@ -10,7 +10,7 @@ public class ActTimeTest extends TestCase{
 
     @org.junit.Test
     public void testGetLength() throws Exception {
-        ActTime actTime = new ActTime(new Time(10, 10), new Time(10, 20));
-        assert(actTime.getLength() == 10);
+        ActTime actTime = new ActTime(2014, 5, 31, 21, 0, 2014, 5, 31, 23, 0);
+        assert(actTime.getLength() == 120);
     }
 }