private void showFileEditor() { if (m_fileEditorDialog == null) { if (PropertyDialog.getParentDialog(this) != null) { m_fileEditorDialog = new PropertyDialog( PropertyDialog.getParentDialog(this), m_fileEditor, -1, -1); } else { m_fileEditorDialog = new PropertyDialog( PropertyDialog.getParentFrame(this), m_fileEditor, -1, -1); } } if (PropertyDialog.getParentDialog(this) != null) { m_fileEditorDialog.setLocationRelativeTo(PropertyDialog.getParentDialog(this)); } else { m_fileEditorDialog.setLocationRelativeTo(PropertyDialog.getParentFrame(this)); } m_fileEditorDialog.setVisible(true); }
addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { e.getWindow().dispose(); getContentPane().setLayout(new BorderLayout()); getContentPane().add(m_EditorComponent, BorderLayout.CENTER); pack(); int screenWidth = getGraphicsConfiguration().getBounds().width; int screenHeight = getGraphicsConfiguration().getBounds().height; if (getHeight() > (double) screenHeight * 0.95) setSize(getWidth(), (int) ((double) screenHeight * 0.95)); setLocationRelativeTo(getOwner()); if (x + getWidth() > screenWidth) x = screenWidth - getWidth(); if (y + getHeight() > screenHeight) y = screenHeight - getHeight(); setLocation(x, y);
@Override public void removeNotify() { super.removeNotify(); if (m_fileEditorDialog != null) { m_fileEditorDialog.dispose(); m_fileEditorDialog = null; } }
/** * Gets called when the title of the frame/dialog needs updating. * * @param event the event that got sent */ public void titleUpdated(TitleUpdatedEvent event) { if (PropertyDialog.getParentDialog(ScriptingPanel.this) != null) PropertyDialog.getParentDialog(ScriptingPanel.this).setTitle(getTitle()); else if (PropertyDialog.getParentFrame(ScriptingPanel.this) != null) PropertyDialog.getParentFrame(ScriptingPanel.this).setTitle(getTitle()); }
PropertyDialog pd = new PropertyDialog((Frame) null, ce, 100, 100); pd.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { pd.setVisible(true);
PropertyDialog pd = new PropertyDialog((Frame) null, ce, 100, 100); pd.setSize(200, 200); pd.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { pd.setVisible(true);
/** * Creates the editor frame - only kept for backward-compatibility. * * @param pe the PropertyEditor * @param x initial x coord for the frame * @param y initial y coord for the frame * @deprecated instead of this constructor, one should use the constructors * with an explicit owner (either derived from * <code>java.awt.Dialog</code> or from * <code>java.awt.Frame</code>) or, if none available, * using <code>(Frame) null</code> as owner. */ public PropertyDialog(PropertyEditor pe, int x, int y) { this((Frame) null, pe, x, y); setVisible(true); }
return; if (PropertyDialog.getParentDialog(FileScriptingPanel.this) != null) { dialog = PropertyDialog.getParentDialog(FileScriptingPanel.this); dialog.setVisible(false); else if (PropertyDialog.getParentFrame(FileScriptingPanel.this) != null) { jintframe = PropertyDialog.getParentInternalFrame(FileScriptingPanel.this); if (jintframe != null) { jintframe.doDefaultCloseAction(); frame = PropertyDialog.getParentFrame(FileScriptingPanel.this); if (frame instanceof JFrame) { jframe = (JFrame) frame;
@Override public void windowClosing(WindowEvent e) { PropertyEditor pe = ((PropertyDialog) e.getSource()).getEditor(); Object c = pe.getValue(); String options = ""; if (c instanceof OptionHandler) { options = Utils.joinOptions(((OptionHandler) c).getOptions()); } System.out.println(c.getClass().getName() + " " + options); System.exit(0); } });
new JDialog(PropertyDialog.getParentFrame(ClassifierPanel.this), "Classifier evaluation options"); jd.getContentPane().setLayout(new BorderLayout());
/** * Closes the dialog. */ protected void closeDialog() { if (m_FileChooser instanceof Container) { Dialog dlg = PropertyDialog.getParentDialog((Container) m_FileChooser); if (dlg != null) dlg.setVisible(false); } } }
PropertyDialog pd = new PropertyDialog((Frame) null, ce, 100, 100); pd.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { pd.setVisible(true);
PropertyDialog pd = new PropertyDialog((Frame) null, ce, 100, 100); pd.setSize(200, 200); pd.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { pd.setVisible(true);
/** * Gets called when the title of the frame/dialog needs updating. * * @param event the event that got sent */ public void titleUpdated(TitleUpdatedEvent event) { if (PropertyDialog.getParentDialog(ScriptingPanel.this) != null) PropertyDialog.getParentDialog(ScriptingPanel.this).setTitle(getTitle()); else if (PropertyDialog.getParentFrame(ScriptingPanel.this) != null) PropertyDialog.getParentFrame(ScriptingPanel.this).setTitle(getTitle()); }
/** * Creates the editor frame - only kept for backward-compatibility. * * @param pe the PropertyEditor * @param x initial x coord for the frame * @param y initial y coord for the frame * @deprecated instead of this constructor, one should use the constructors * with an explicit owner (either derived from * <code>java.awt.Dialog</code> or from * <code>java.awt.Frame</code>) or, if none available, * using <code>(Frame) null</code> as owner. */ public PropertyDialog(PropertyEditor pe, int x, int y) { this((Frame) null, pe, x, y); setVisible(true); }
return; if (PropertyDialog.getParentDialog(FileScriptingPanel.this) != null) { dialog = PropertyDialog.getParentDialog(FileScriptingPanel.this); dialog.setVisible(false); else if (PropertyDialog.getParentFrame(FileScriptingPanel.this) != null) { jintframe = PropertyDialog.getParentInternalFrame(FileScriptingPanel.this); if (jintframe != null) { jintframe.doDefaultCloseAction(); frame = PropertyDialog.getParentFrame(FileScriptingPanel.this); if (frame instanceof JFrame) { jframe = (JFrame) frame;
@Override public void windowClosing(WindowEvent e) { PropertyEditor pe = ((PropertyDialog)e.getSource()).getEditor(); Object c = pe.getValue(); String options = ""; if (c instanceof OptionHandler) options = Utils.joinOptions(((OptionHandler)c).getOptions()); System.out.println(c.getClass().getName() + " " + options); System.exit(0); } });
new JDialog(PropertyDialog.getParentFrame(ClassifierPanel.this), "Classifier evaluation options"); jd.getContentPane().setLayout(new BorderLayout());
/** * Closes the dialog. */ protected void closeDialog() { if (m_CustomEditor instanceof Container) { Dialog dlg = PropertyDialog.getParentDialog((Container) m_CustomEditor); if (dlg != null) dlg.setVisible(false); } }
private void showFileEditor() { if (m_fileEditorDialog == null) { if (PropertyDialog.getParentDialog(this) != null) { m_fileEditorDialog = new PropertyDialog( PropertyDialog.getParentDialog(this), m_fileEditor, -1, -1); } else { m_fileEditorDialog = new PropertyDialog( PropertyDialog.getParentFrame(this), m_fileEditor, -1, -1); } } if (PropertyDialog.getParentDialog(this) != null) { m_fileEditorDialog.setLocationRelativeTo(PropertyDialog.getParentDialog(this)); } else { m_fileEditorDialog.setLocationRelativeTo(PropertyDialog.getParentFrame(this)); } m_fileEditorDialog.setVisible(true); }