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
 	private JTextField frameLengthText = new JTextField();
76
 	private JTextField frameLengthText = new JTextField();
77
 	private JButton frameDuration = new JButton();
77
 	private JButton frameDuration = new JButton();
78
     private JButton fullScreenButton = new JButton();
78
     private JButton fullScreenButton = new JButton();
79
+	private JButton playAnimation = new JButton();
79
 	// Ende Attribute
80
 	// Ende Attribute
80
 
81
 
81
 	public cubeWorker worker = new cubeWorker();
82
 	public cubeWorker worker = new cubeWorker();
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
 		frameDuration.setBounds(590, 184, 60, 24);
382
 		frameDuration.setBounds(590, 184, 60, 24);
372
 		frameDuration.setText("OK");
383
 		frameDuration.setText("OK");
373
 		frameDuration.setFont(new Font("Dialog", Font.PLAIN, 13));
384
 		frameDuration.setFont(new Font("Dialog", Font.PLAIN, 13));
543
 
554
 
544
 	// Anfang Ereignisprozeduren
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
 	public void enterFullscreen(ActionEvent evt) {
571
 	public void enterFullscreen(ActionEvent evt) {
547
 		ledView.enterFullscreen();
572
 		ledView.enterFullscreen();
548
 		FullscreenWindow fw = new FullscreenWindow(worker, cubeCanvas, ledView, this);
573
 		FullscreenWindow fw = new FullscreenWindow(worker, cubeCanvas, ledView, this);

Loading…
Cancel
Save