There are 11 code examples for java.awt.Dialog.ModalityType.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: megamek Package: megamek.client.ui.swing
Source Code: RandomSkillDialog.java (Click to view .java file)
Method Code:
/**
* Creates new form RandomSkillDialog2
*/
public RandomSkillDialog(ClientDialog ui,ClientGUI clientgui){
super(ui,Messages.getString("RandomSkillDialog.title"),ModalityType.APPLICATION_MODAL);
this.clientgui=clientgui;
init();
}
Project Name: weka Package: weka.gui
Source Code: PropertySelectorDialog.java (Click to view .java file)
Method Code:
/**
* Create the property selection dialog.
* @param parentFrame the parent frame of the dialog
* @param rootObject the object containing properties to select from
*/
public PropertySelectorDialog(Frame parentFrame,Object rootObject){
super(parentFrame,"Select a property",ModalityType.DOCUMENT_MODAL);
m_CancelBut.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
m_Result=CANCEL_OPTION;
setVisible(false);
}
}
);
m_SelectBut.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
TreePath tPath=m_Tree.getSelectionPath();
if (tPath == null) {
m_Result=CANCEL_OPTION;
}
else {
m_ResultPath=tPath.getPath();
if ((m_ResultPath == null) || (m_ResultPath.length < 2)) {
m_Result=CANCEL_OPTION;
}
else {
m_Result=APPROVE_OPTION;
}
}
setVisible(false);
}
}
);
m_RootObject=rootObject;
m_Root=new DefaultMutableTreeNode(new PropertyNode(m_RootObject));
createNodes(m_Root);
Container c=getContentPane();
c.setLayout(new BorderLayout());
Box b1=new Box(BoxLayout.X_AXIS);
b1.add(m_SelectBut);
b1.add(Box.createHorizontalStrut(10));
b1.add(m_CancelBut);
c.add(b1,BorderLayout.SOUTH);
m_Tree=new JTree(m_Root);
m_Tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
c.add(new JScrollPane(m_Tree),BorderLayout.CENTER);
pack();
}
Project Name: weka Package: weka.gui
Source Code: PropertyDialog.java (Click to view .java file)
Method Code:
/**
* Creates the editor dialog at the given position. The dialog is automatically
* modal in case the owner is non-null.
* @param owner the frame that opens this dialog
* @param pe the PropertyEditor
* @param x initial x coord for the dialog
* @param y initial y coord for the dialog
*/
public PropertyDialog(Frame owner,PropertyEditor pe,int x,int y){
super(owner,pe.getClass().getName(),ModalityType.DOCUMENT_MODAL);
initialize(pe,x,y);
}
Project Name: weka Package: weka.gui
Source Code: ViewerDialog.java (Click to view .java file)
Method Code:
/**
* initializes the dialog with the given parent
* @param parent the parent for this dialog
*/
public ViewerDialog(Frame parent){
super(parent,ModalityType.DOCUMENT_MODAL);
createDialog();
}
Project Name: weka Package: weka.gui
Source Code: ListSelectorDialog.java (Click to view .java file)
Method Code:
/**
* Create the list selection dialog.
* @param parentFrame the parent frame of the dialog
* @param userList the JList component the user will select from
*/
public ListSelectorDialog(Frame parentFrame,JList userList){
super(parentFrame,"Select items",ModalityType.DOCUMENT_MODAL);
m_List=userList;
m_CancelBut.setMnemonic('C');
m_CancelBut.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
m_Result=CANCEL_OPTION;
setVisible(false);
}
}
);
m_SelectBut.setMnemonic('S');
m_SelectBut.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
m_Result=APPROVE_OPTION;
setVisible(false);
}
}
);
m_PatternBut.setMnemonic('P');
m_PatternBut.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
selectPattern();
}
}
);
Container c=getContentPane();
c.setLayout(new BorderLayout());
Box b1=new Box(BoxLayout.X_AXIS);
b1.add(m_SelectBut);
b1.add(Box.createHorizontalStrut(10));
b1.add(m_PatternBut);
b1.add(Box.createHorizontalStrut(10));
b1.add(m_CancelBut);
c.add(b1,BorderLayout.SOUTH);
c.add(new JScrollPane(m_List),BorderLayout.CENTER);
getRootPane().setDefaultButton(m_SelectBut);
pack();
Dimension screen=Toolkit.getDefaultToolkit().getScreenSize();
int width=getWidth() > screen.getWidth() ? (int)screen.getWidth() : getWidth();
int height=getHeight() > screen.getHeight() ? (int)screen.getHeight() : getHeight();
setSize(width,height);
}
Project Name: weka Package: weka.gui.beans
Source Code: LoaderCustomizer.java (Click to view .java file)
Method Code:
public void actionPerformed(ActionEvent e){
try {
final JDialog jf=new JDialog((JDialog)LoaderCustomizer.this.getTopLevelAncestor(),"Choose file",ModalityType.DOCUMENT_MODAL);
jf.setLayout(new BorderLayout());
jf.getContentPane().add(m_fileChooser,BorderLayout.CENTER);
m_fileChooserFrame=jf;
jf.pack();
jf.setVisible(true);
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
Project Name: weka Package: weka.gui.beans
Source Code: KnowledgeFlowApp.java (Click to view .java file)
Method Code:
/**
* Popup the customizer for this bean
* @param custClass the class of the customizer
* @param bc the bean to be customized
*/
private void popupCustomizer(Class custClass,JComponent bc){
try {
final Object customizer=custClass.newInstance();
if (customizer instanceof EnvironmentHandler) {
((EnvironmentHandler)customizer).setEnvironment(m_flowEnvironment);
}
if (customizer instanceof BeanCustomizer) {
((BeanCustomizer)customizer).setModifiedListener(this);
}
((Customizer)customizer).setObject(bc);
final JDialog d=new JDialog((java.awt.Frame)KnowledgeFlowApp.this.getTopLevelAncestor(),ModalityType.DOCUMENT_MODAL);
d.setLayout(new BorderLayout());
d.getContentPane().add((JComponent)customizer,BorderLayout.CENTER);
if (customizer instanceof CustomizerCloseRequester) {
((CustomizerCloseRequester)customizer).setParentWindow(d);
}
d.addWindowListener(new java.awt.event.WindowAdapter(){
public void windowClosing( java.awt.event.WindowEvent e){
if (customizer instanceof CustomizerClosingListener) {
((CustomizerClosingListener)customizer).customizerClosing();
}
d.dispose();
}
}
);
d.pack();
d.setLocationRelativeTo(KnowledgeFlowApp.this);
d.setVisible(true);
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
Project Name: weka Package: weka.gui.beans
Source Code: SerializedModelSaverCustomizer.java (Click to view .java file)
Method Code:
public void actionPerformed(ActionEvent e){
try {
final JDialog jf=new JDialog((JDialog)SerializedModelSaverCustomizer.this.getTopLevelAncestor(),"Choose directory",ModalityType.DOCUMENT_MODAL);
jf.getContentPane().setLayout(new BorderLayout());
jf.getContentPane().add(m_fileChooser,BorderLayout.CENTER);
m_fileChooserFrame=jf;
jf.pack();
jf.setVisible(true);
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
Project Name: weka Package: weka.gui.beans
Source Code: SaverCustomizer.java (Click to view .java file)
Method Code:
public void actionPerformed(ActionEvent e){
try {
final JDialog jf=new JDialog((JDialog)SaverCustomizer.this.getTopLevelAncestor(),"Choose directory",ModalityType.DOCUMENT_MODAL);
jf.setLayout(new BorderLayout());
jf.getContentPane().add(m_fileChooser,BorderLayout.CENTER);
m_fileChooserFrame=jf;
jf.pack();
jf.setVisible(true);
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
Project Name: weka Package: weka.gui.experiment
Source Code: OutputFormatDialog.java (Click to view .java file)
Method Code:
/**
* initializes the dialog with the given parent frame.
* @param parent the parent of this dialog
*/
public OutputFormatDialog(Frame parent){
super(parent,"Output Format...",ModalityType.DOCUMENT_MODAL);
m_IgnoreChanges=true;
initialize();
initGUI();
m_IgnoreChanges=false;
}
Project Name: weka Package: weka.gui.sql
Source Code: SqlViewerDialog.java (Click to view .java file)
Method Code:
/**
* initializes the dialog.
* @param parent the parent frame
*/
public SqlViewerDialog(JFrame parent){
super(parent,"SQL-Viewer",ModalityType.DOCUMENT_MODAL);
m_Parent=parent;
m_URL="";
m_User="";
m_Password="";
m_Query="";
createDialog();
}