Browse Source

added rudimentary "play animation"...

hutattedonmyarm 12 years ago
parent
commit
779cff97bf
2 changed files with 25 additions and 0 deletions
  1. BIN
      CubeControl/CubeControlMac.jar
  2. 25
    0
      CubeControl/Frame.java

BIN
CubeControl/CubeControlMac.jar View File


+ 25
- 0
CubeControl/Frame.java View File

@@ -76,6 +76,7 @@ public class Frame extends JFrame implements ListSelectionListener {
76 76
 	private JTextField frameLengthText = new JTextField();
77 77
 	private JButton frameDuration = new JButton();
78 78
     private JButton fullScreenButton = new JButton();
79
+	private JButton playAnimation = new JButton();
79 80
 	// Ende Attribute
80 81
 
81 82
 	public cubeWorker worker = new cubeWorker();
@@ -368,6 +369,16 @@ public class Frame extends JFrame implements ListSelectionListener {
368 369
 			}
369 370
 		});
370 371
 
372
+		playAnimation.setText("Play");
373
+		playAnimation.setBounds(344, 390, 147, 25);
374
+		playAnimation.setFont(new Font("Dialog", Font.PLAIN, 13));
375
+		cp.add(playAnimation);
376
+		playAnimation.addActionListener(new ActionListener() {
377
+			public void actionPerformed(ActionEvent evt){
378
+				playAnimation(evt);		
379
+			}
380
+		});
381
+
371 382
 		frameDuration.setBounds(590, 184, 60, 24);
372 383
 		frameDuration.setText("OK");
373 384
 		frameDuration.setFont(new Font("Dialog", Font.PLAIN, 13));
@@ -543,6 +554,20 @@ public class Frame extends JFrame implements ListSelectionListener {
543 554
 
544 555
 	// Anfang Ereignisprozeduren
545 556
 	
557
+	public void playAnimation(ActionEvent evt){
558
+			if (animList.getSelectedIndex() == -1) {
559
+			errorMessage("Please select an animation.");
560
+		} else if (frameList.getSelectedIndex() == -1) {
561
+			errorMessage("Please select a Frame.");
562
+		} else {
563
+			for(int i = 0; i < frameList.getModel().getSize(); i++){
564
+				frameList.setSelectedIndex(i);
565
+			
566
+			}	
567
+		}
568
+	
569
+	}
570
+	
546 571
 	public void enterFullscreen(ActionEvent evt) {
547 572
 		ledView.enterFullscreen();
548 573
 		FullscreenWindow fw = new FullscreenWindow(worker, cubeCanvas, ledView, this);

Loading…
Cancel
Save