示例#1
0
 /**
  * Auto-generated main method to display this JPanel inside a new JFrame.
  */
 public static void main(string[] args)
 {
     JFrame frame = new JFrame();
     frame.getContentPane().add(new RenderGlobalsPanel());
     frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
     frame.pack();
     frame.setVisible(true);
 }
示例#2
0
        /**
         * Auto-generated main method to display this JPanel inside a new JFrame.
         */
        public static void main(string[] args)
        {
            JFrame frame = new JFrame();

            frame.getContentPane().add(new RenderGlobalsPanel());
            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
            frame.pack();
            frame.setVisible(true);
        }
        public static void main(string[] args)
        {
            JFrame jframe = new JFrame();

            jframe.setTitle("Debug");
            jframe.setDefaultCloseOperation(3);
            jframe.pack();
            jframe.setVisible(false);
            FilenameDialog filenameDialog = new FilenameDialog(jframe, true, "Save as...");

            [email protected]("Showing dialog...");
            filenameDialog.setVisible(true);
            string text = filenameDialog.getFilename();

            [email protected](new StringBuilder().append("Filename: ").append(text).append(" (length = ").append(String.instancehelper_length(text)).append(')').toString());
            java.lang.System.exit(0);
        }
示例#4
0
        /**
         * Main program (used when run as application instead of applet).
         */
        public static void main(String[] args)
        {
            DelaunayAp applet = new DelaunayAp();              // Create applet

            applet.init();                                     // Perform applet initialization
            JFrame dWindow = new JFrame();                     // Create window

            dWindow.setSize(700, 500);                         // Set window size
            dWindow.setTitle("Voronoi/Delaunay Window");
            // Set window title
            dWindow.getContentPane().setLayout(new BorderLayout());
            // Specify layout manager
            dWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // Specify closing behavior
            dWindow.getContentPane().add(applet, "Center");
            // Place applet into window
            dWindow.setVisible(true);                          // Show the window
        }
示例#5
0
 public void imageBegin(int w, int h, int bucketSize)
 {
     lock (lockObj)
     {
         if (frame != null && image != null && w == image.getWidth() && h == image.getHeight())
         {
             // nothing to do
         }
         else
         {
             // allocate new framebuffer
             pixels = new int[w * h];
             image  = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
             // prepare frame
             if (frame == null)
             {
                 setPreferredSize(new Dimension(w, h));
                 frame = new JFrame("Sunflow v" + SunflowAPI.VERSION);
                 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//fixme: change to WinForms
                 //frame.addKeyListener(new KeyAdapter() {
                 //    @Override
                 //    public void keyPressed(KeyEvent e) {
                 //        if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                 //            System.exit(0);
                 //    }
                 //});
                 frame.setContentPane(this);
                 frame.pack();
                 frame.setLocationRelativeTo(null);
                 frame.setVisible(true);
             }
         }
         // start counter
         t.start();
     }
 }
示例#6
0
 public void imageBegin(int w, int h, int bucketSize)
 {
     lock (lockObj)
     {
         if (frame != null && image != null && w == image.getWidth() && h == image.getHeight())
         {
             // nothing to do
         }
         else
         {
             // allocate new framebuffer
             pixels = new int[w * h];
             image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
             // prepare frame
             if (frame == null)
             {
                 setPreferredSize(new Dimension(w, h));
                 frame = new JFrame("Sunflow v" + SunflowAPI.VERSION);
                 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//fixme: change to WinForms
                 //frame.addKeyListener(new KeyAdapter() {
                 //    @Override
                 //    public void keyPressed(KeyEvent e) {
                 //        if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                 //            System.exit(0);
                 //    }
                 //});
                 frame.setContentPane(this);
                 frame.pack();
                 frame.setLocationRelativeTo(null);
                 frame.setVisible(true);
             }
         }
         // start counter
         t.start();
     }
 }
示例#7
0
 public static void main(string[] args)
 {
     AudioTool.prefs    = Preferences.userRoot().node("/edu/cmu/sphinx/tools/audio/AudioTool");
     AudioTool.filename = AudioTool.prefs.get("filename", "untitled.raw");
     AudioTool.file     = new File(AudioTool.filename);
     if (args.Length == 1 && String.instancehelper_equals(args[0], "-dumpMixers"))
     {
         AudioTool.dumpMixers();
         java.lang.System.exit(0);
     }
     try
     {
         if (args.Length > 0)
         {
             AudioTool.filename = args[0];
         }
         URL url;
         if (args.Length == 2)
         {
             url = new File(args[1]).toURI().toURL();
         }
         else
         {
             url = ClassLiteral <AudioTool> .Value.getResource("spectrogram.config.xml");
         }
         ConfigurationManager configurationManager = new ConfigurationManager(url);
         AudioTool.recorder = (Microphone)configurationManager.lookup("microphone");
         AudioTool.recorder.initialize();
         AudioTool.audio = new AudioData();
         FrontEnd         frontEnd      = (FrontEnd)configurationManager.lookup("frontEnd");
         StreamDataSource dataSource    = (StreamDataSource)configurationManager.lookup("streamDataSource");
         FrontEnd         frontEnd2     = (FrontEnd)configurationManager.lookup("cepstrumFrontEnd");
         StreamDataSource dataSource2   = (StreamDataSource)configurationManager.lookup("cstreamDataSource");
         PropertySheet    propertySheet = configurationManager.getPropertySheet("windower");
         float            @float        = propertySheet.getFloat("windowShiftInMs");
         JFrame           jframe        = new JFrame("AudioTool");
         AudioTool.fileChooser = new JFileChooser();
         AudioTool.createMenuBar(jframe);
         float num = @float * AudioTool.audio.getAudioFormat().getSampleRate() / 1000f;
         AudioTool.audioPanel       = new AudioPanel(AudioTool.audio, 1f / num, 0.004f);
         AudioTool.spectrogramPanel = new SpectrogramPanel(frontEnd, dataSource, AudioTool.audio);
         AudioTool.cepstrumPanel    = new CepstrumPanel(frontEnd2, dataSource2, AudioTool.audio);
         JPanel jpanel = new JPanel();
         jpanel.setLayout(new BoxLayout(jpanel, 3));
         jpanel.add(AudioTool.audioPanel);
         AudioTool.audioPanel.setAlignmentX(0f);
         jpanel.add(AudioTool.spectrogramPanel);
         AudioTool.spectrogramPanel.setAlignmentX(0f);
         jpanel.add(AudioTool.cepstrumPanel);
         AudioTool.cepstrumPanel.setAlignmentX(0f);
         JScrollPane jscrollPane = new JScrollPane(jpanel);
         JPanel      jpanel2     = new JPanel(new BorderLayout());
         jpanel2.add(AudioTool.createButtonPanel(), "North");
         jpanel2.add(jscrollPane);
         AudioTool.player = new AudioPlayer(AudioTool.audio);
         AudioTool.player.start();
         AudioTool.getAudioFromFile(AudioTool.filename);
         jframe.setDefaultCloseOperation(3);
         jframe.setContentPane(jpanel2);
         jframe.pack();
         jframe.setSize(640, 400);
         jframe.setVisible(true);
     }
     catch (System.Exception ex)
     {
         Throwable.instancehelper_printStackTrace(ex);
     }
 }