Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'javafx' into xuggler
  • Loading branch information
bduong committed Nov 8, 2012
2 parents d9637da + 8b8c4d5 commit 0107f59
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 3 deletions.
20 changes: 19 additions & 1 deletion GUI/pom.xml
Expand Up @@ -14,6 +14,7 @@
<name>User Interface</name>
<properties>
<mary.tts.version>5.1-SNAPSHOT</mary.tts.version>
<jfx.version>2.2</jfx.version>
</properties>

<repositories>
Expand Down Expand Up @@ -77,11 +78,29 @@
<artifactId>hsqldb</artifactId>
<version>2.0.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javafx</groupId>
<artifactId>javafx</artifactId>
<version>2.0</version>
<systemPath>${java.home}/lib/jfxrt.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>javafx</groupId>
<artifactId>javafx-ant</artifactId>
<version>2.0</version>
<systemPath>${java.home}/../lib/ant-javafx.jar</systemPath>
<scope>system</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down Expand Up @@ -134,5 +153,4 @@
</plugin>
</plugins>
</build>

</project>
18 changes: 17 additions & 1 deletion GUI/src/main/java/superkidsapplication/panels/TutorialPanel.java
Expand Up @@ -12,6 +12,7 @@
import java.util.List;
import javax.swing.Icon;
import superkidsapplication.controllers.TutorialController;
import java.awt.BorderLayout;
/**
*
* @author FRANKs
Expand All @@ -21,11 +22,26 @@ public class TutorialPanel extends javax.swing.JPanel {
/**
* Creates new form TutorialPanel
*/

private VideoPlayerPanel videoplayerpanel=null;

public TutorialPanel(String category) {
this.setName("Learning");
initComponents();
jLabel1.setText(category);
jLabel1.setText(category);
if (category.equals("SHAPES"))
{
videoplayerpanel=new VideoPlayerPanel("file:///../../../resources/videos/shapes.mp4");
}
if (category.equals("COLORS"))
{
videoplayerpanel=new VideoPlayerPanel("file:///../../../resources/videos/colors.mp4");
}
if (category.equals("ANIMALS"))
{
videoplayerpanel=new VideoPlayerPanel("file:///../../../resources/videos/animals.mp4");
}
//this.add(videoplayerpanel,BorderLayout.CENTER);
}

/**
Expand Down
@@ -0,0 +1,66 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package superkidsapplication.panels;

import java.awt.BorderLayout;
import java.awt.Color;
import javafx.application.Platform;
import javax.swing.JPanel;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.embed.swing.JFXPanel;
import javax.swing.SwingUtilities;

/**
*
* @author Heng
*/
public class VideoPlayerPanel extends JPanel{

private String filepath=null;
private Media media=null;
private MediaPlayer mediaplayer=null;
private MediaView mediaview=null;
private Group root=null;
private Scene scene = null;
private JFXPanel jfxpanel=new JFXPanel();

public VideoPlayerPanel(String str){
//TODO constructor
this.filepath=str;
//this.setBackground(Color.red);
this.setSize(640, 360);
initAndShowGUI();
}

private void initAndShowGUI(){



this.add(jfxpanel,BorderLayout.CENTER);
this.setVisible(true);

Platform.runLater(new Runnable(){
@Override
public void run(){
initFX(jfxpanel);
}
});
}

private void initFX(JFXPanel jfxpenal){
root=new Group();
scene=new Scene(root,640,360);
media=new Media(filepath);
mediaplayer=new MediaPlayer(media);
mediaview=new MediaView(mediaplayer);
mediaplayer.setAutoPlay(true);
root.getChildren().add(mediaview);
jfxpanel.setScene(scene);
}
}
Binary file added GUI/src/main/resources/videos/animals.mp4
Binary file not shown.
Binary file added GUI/src/main/resources/videos/colors.mp4
Binary file not shown.
Binary file added GUI/src/main/resources/videos/shapes.mp4
Binary file not shown.
9 changes: 9 additions & 0 deletions pom.xml
Expand Up @@ -42,6 +42,15 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
6 changes: 5 additions & 1 deletion server/pom.xml
Expand Up @@ -27,6 +27,10 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -41,7 +45,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<configuration>
<outputDirectory> ${project.build.directory}/surefire-reports </outputDirectory>
<outputDirectory>${project.build.directory}/surefire-reports</outputDirectory>
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit 0107f59

Please sign in to comment.