DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Gui.fx

01.15.2010
| 2042 views |
  • submit to reddit
        Hier moechte ich euch einen Ausschnitt aus der GUI geben damit ihr sehen koennt wie die MyMedia.fx / SwingMediaView bei meinem Funktionierenden Teil eingebunden wird...
Ist nur ein kleiner ausschnitt und zwecks der uebersichtlichkeit sind die UNRELEVANTEN "dinge" einfach minimiert...

var JMFPlayer:MyJMFPlayer; //Meine Player klasse
var MyMediaView:MyMedia; // aehnlich der JMFView aus unserem pdf.

var stage: Stage = Stage {
        /** This event closes all other Stages.
        *
        */
        onClose: function(){
            MyJMFPlayer.closePlayer();
            menu.close();
            nav.close();
        }

    [...]

        scene:SceneRef = Scene {
                
                [...]
                content: [
                    Group{
                    content:[


                        /** Player Background
                        *
                        */
                        RectangleRef=Rectangle {
                                  [...]
    
                    },
                    /** Black Background when no Video is displayed.
                    *
                    */
                    Rectangle {
                              [...]
                    },
                    /** Exit Button Icon
                    *
                    */
                    ImageView {
                              [...]
                    },
                    /** Close Button
                    *
                    */
                    Button {
                              [...]
                            }
                    },
                    /** Filechooser Icon
                    *
                    */
                    ImageView {
                             [...]
                            }
                    },
                    /** Media View. Displays video
                    *   
                    */
                    
                   MyMediaView = MyMedia{
                    }
                    /** File Chooser
                    *
                    */
                    fileBtn = javafx.ext.swing.SwingButton{
                        opacity: 0
                        width:15
                        height:15
                        translateX:10
                        translateY:5

                        text: ""
                        action: function() {
                          var fc = new JFileChooser();
                          var result = fc.showOpenDialog(fileBtn.getJButton());
                          if (result == JFileChooser.APPROVE_OPTION) {
                             var fFile = fc.getSelectedFile();
                             display = fFile.getName();
                             var file = fFile.toURL().toExternalForm();
                             MyJMFPlayer.closePlayer(); //funktion die wenn player not null is stop und dellocated....
                             JMFPlayer = new MyJMFPlayer("{fFile.toURL()}"); //Konstruktor...
                             MyMediaView.view.playerpanel = MyJMFPlayer.getVisualComponent();
                             MyMediaView.view.height = MyJMFPlayer.height;
                             MyMediaView.view.width = MyJMFPlayer.width;

                           }
                    }