public h4Jmf(View view, String position) { super(); count++; logger.info("args constructor " + count); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // logger.info("view="+view+" position="+position); this.view = view; // position.equals(DockableWindowManager.FLOATING); // cnsl=new Console(100); h4JmfPlugin.cnsl.setPreferredSize(new Dimension(500, 200)); JScrollPane jscrllpn = new JScrollPane(h4JmfPlugin.cnsl); // jscrllpn.setPreferredSize(new Dimension(500,200)); // add(BorderLayout.SOUTH,jscrllpn); add(jscrllpn); if (h4JmfPlugin.playMP3 != null) { java.awt.Component cpc = h4JmfPlugin.playMP3.getControlPanelComponent(); // logger.info("cpc="+cpc); if (cpc != null) // after panel has been closed, new instance !! { cpc.setPreferredSize(new Dimension(500, 50)); this.add(cpc); } } this.setPreferredSize(new Dimension(500, 300)); // cnsl.append("begin"); // cnsl.append("SettingsDirectory="+jEdit.getSettingsDirectory()); h4JmfPlugin.cnsl.append("args constructor " + count); // EditBus.addToBus(this);//moved to notify /** * *********************** //check a few jmf-classes begin done in h4JmfPlugin Class tst=null; * try { tst=Class.forName("com.sun.media.codec.audio.mp3.JavaDecoder"); jmf_ok=true; * cnsl.append("jmf Java Media Framework seems to be installed."); } catch(Exception excptn) { * cnsl.append("trying presence of jmf"); cnsl.append(excptn); cnsl.append("jmf Java Media * Framework does not seem to be installed!"); cnsl.append("see README for more info"); } * //check a few jmf-classes end ** */ if (!h4JmfPlugin.jmf_ok) { h4JmfPlugin.cnsl.append("JMF Java Media Framework does not seem to be installed!"); h4JmfPlugin.cnsl.append("see README for more info"); } logger.info("constructor end"); } // constructor
public static void centerFrame(java.awt.Component c) { java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); c.setLocation( (int) ((tk.getScreenSize().getWidth() - c.getWidth()) / 2), (int) ((tk.getScreenSize().getHeight() - c.getHeight()) / 2)); }