当前位置: 首页>>代码示例>>Java>>正文


Java ModalityType类代码示例

本文整理汇总了Java中java.awt.Dialog.ModalityType的典型用法代码示例。如果您正苦于以下问题:Java ModalityType类的具体用法?Java ModalityType怎么用?Java ModalityType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ModalityType类属于java.awt.Dialog包,在下文中一共展示了ModalityType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SQLQueryBuilder

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public SQLQueryBuilder(Window owner, DatabaseHandler databaseHandler) {
    super(owner, "build_sql_query", ModalityType.APPLICATION_MODAL, new Object[0]);
    this.tableList = new JList(new DefaultListModel());
    this.attributeList = new JList(new DefaultListModel());
    this.whereTextArea = new JTextArea(4, 15);
    this.sqlQueryTextArea = new SQLEditor();
    this.surroundingDialog = null;
    this.connectionStatus = new JLabel();
    this.gridPanel = new JPanel(createGridLayout(1, 3));
    this.attributeNameMap = new LinkedHashMap();
    this.databaseHandler = databaseHandler;
    this.cache = TableMetaDataCache.getInstance();
    if(!"false".equals(ParameterService.getParameterValue("rapidminer.gui.fetch_data_base_table_names"))) {
        try {
            this.retrieveTableNames();
        } catch (SQLException var4) {
            SwingTools.showSimpleErrorMessage("db_connection_failed_simple", var4, new Object[0]);
            this.databaseHandler = null;
        }
    }

}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:23,代码来源:SQLQueryBuilder.java

示例2: showMacroEditorDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public static void showMacroEditorDialog(final ProcessContext context) {
	ButtonDialog dialog = new ButtonDialog(ApplicationFrame.getApplicationFrame(), "define_macros",
			ModalityType.APPLICATION_MODAL, new Object[] {}) {

		private static final long serialVersionUID = 2874661432345426452L;

		{
			MacroEditor editor = new MacroEditor(false);
			editor.setBorder(createBorder());
			JButton addMacroButton = new JButton(editor.ADD_MACRO_ACTION);
			JButton removeMacroButton = new JButton(editor.REMOVE_MACRO_ACTION);
			layoutDefault(editor, NORMAL, addMacroButton, removeMacroButton, makeOkButton());
		}

		@Override
		protected void ok() {
			super.ok();
		}
	};
	dialog.setVisible(true);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:22,代码来源:MacroEditor.java

示例3: LicenseUpgradeDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public LicenseUpgradeDialog(ResourceAction action, boolean isDowngradeInformation, String key, boolean modal, boolean forceLicenseInstall, boolean useResourceAction, int size, Object... arguments) {
    super(ApplicationFrame.getApplicationFrame(), key, modal?ModalityType.APPLICATION_MODAL:ModalityType.MODELESS, arguments);
    this.setResizable(false);
    this.action = action;
    this.useResourceAction = useResourceAction;
    if(arguments.length < 2) {
        throw new IllegalArgumentException("You need to specify at least the name and the edition of the product that needs to be upgraded.");
    } else {
        this.setModal(modal);
        this.productName = String.valueOf(arguments[0]);
        this.productEdition = isDowngradeInformation?String.valueOf(arguments[2]):String.valueOf(arguments[1]);
        this.layoutDefault(this.makeButtonPanel(), size, new AbstractButton[0]);
        if(forceLicenseInstall) {
            this.setDefaultCloseOperation(0);
        }

    }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:19,代码来源:LicenseUpgradeDialog.java

示例4: showWhoIsDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
/**
 * Show a dialog with whois data for the given point
 * @param parent
 * @param whois
 * @param point
 */
public static void showWhoIsDialog(final JComponent parent, final ServiceFactory services, final GeoPoint point) {
	final WhoIsPanel panel = new WhoIsPanel(services);
	final JDialog dialog = new JDialog(SwingUtilities.getWindowAncestor(parent), "Who is " + point.getIp(), ModalityType.APPLICATION_MODAL) {

		private static final long serialVersionUID = 1258611715478157956L;

		@Override
		public void dispose() {
			panel.dispose();
			super.dispose();
		}

	};
	dialog.getContentPane().add(panel, BorderLayout.CENTER);
	final JPanel bottom = new JPanel();
	final JButton close = new JButton(Resources.getLabel("close.button"));
	close.addActionListener(e -> dialog.dispose());
	bottom.add(close);
	dialog.getContentPane().add(bottom, BorderLayout.SOUTH);
	services.getWhois().whoIs(point.getIp());
	SwingUtilities4.setUp(dialog);
	dialog.setVisible(true);

}
 
开发者ID:leolewis,项目名称:openvisualtraceroute,代码行数:31,代码来源:WhoIsPanel.java

示例5: ContentPaneBuilderUsingDialogConfiguration

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public ContentPaneBuilderUsingDialogConfiguration(
    final IPreferences preferences,
    final IMessage message,
    final IContentPaneBuilder contentPaneBuilder,
    final DialogType dialogType) {
  super(
      preferences,
      true,
      message,
      net.anwiba.commons.swing.icon.GuiIcons.EMPTY_ICON,
      DataState.UNKNOWN,
      ModalityType.APPLICATION_MODAL,
      dialogType,
      true,
      new ObjectModel<Void>());
  this.contentPaneBuilder = contentPaneBuilder;
}
 
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:18,代码来源:ContentPaneBuilderUsingDialogConfiguration.java

示例6: getHelpDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
static public JDialog getHelpDialog(
        Window owner, 
        String title,
        Class<?> resourceClass, String resourceName) 
{
    JDialog helpDialog = new JDialog(owner,  title, ModalityType.MODELESS);

    helpDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

    String helpText = getHelpText(resourceClass, resourceName);

    JLabel label = new JLabel(helpText);
    label.setBackground(PALE_YELLOW);
    label.setOpaque(true);
    
    JScrollPane contentPane = new JScrollPane(label);

    contentPane.setBorder(
            BorderFactory.createCompoundBorder(new LineBorder(Color.BLUE),
                    new EmptyBorder(4, 4, 4, 4)));
    helpDialog.setContentPane(contentPane);

    helpDialog.pack();
    
    return helpDialog;
}
 
开发者ID:kddart,项目名称:kdxplore,代码行数:27,代码来源:HelpUtils.java

示例7: openHeroEditor

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
private void openHeroEditor(HearthStoneDb db) {
    if (uiAgent == null) {
        return;
    }
    HeroEditorPanel panel = new HeroEditorPanel(db, uiAgent);

    Window parent = SwingUtilities.getWindowAncestor(this);
    JDialog mainFrame = new JDialog(parent, "Hero Editor", ModalityType.DOCUMENT_MODAL);
    mainFrame.getContentPane().setLayout(new GridLayout(1, 1));
    mainFrame.getContentPane().add(panel);

    mainFrame.pack();
    mainFrame.setLocationRelativeTo(null);
    mainFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    mainFrame.setVisible(true);
}
 
开发者ID:AlphaHearth,项目名称:AlphaHearth,代码行数:17,代码来源:PlayerPanel.java

示例8: initUI

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
/**
 * Setting up the user interface
 */
private void initUI() {

	pb = new JProgressBar(JProgressBar.HORIZONTAL, value, maxValue == -1 ? 0 : maxValue);
	pb.setStringPainted(Boolean.TRUE);
	pb.setIndeterminate(indeterminate);

	dialog = new JDialog();
	dialog.setTitle(title);
	dialog.setModalityType(ModalityType.MODELESS);
	dialog.setIconImage(null);
	dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

	dialog.add(pb);
	dialog.setSize(this.width, this.height);
	dialog.setLocationRelativeTo(null);

	dialog.setVisible(Boolean.TRUE);

	animationThread().start();
}
 
开发者ID:Thyaris,项目名称:UtilsPlus,代码行数:24,代码来源:PLoadingScreen.java

示例9: showPostById

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public void showPostById(int id, java.awt.Component dialogParent){
    JOptionPane optionPane = new JOptionPane(Localization.format("retrieval_format", String.valueOf(id)), JOptionPane.INFORMATION_MESSAGE);
    JButton button = new JButton(Localization.getString("cancel"));
    optionPane.setOptions(new Object[]{button});
    JDialog dialog = optionPane.createDialog(dialogParent, Localization.getString("retrieving"));
    button.addActionListener(event -> dialog.dispose());
    dialog.setModalityType(ModalityType.MODELESS);
    dialog.setVisible(true);
    executor.execute(() -> {
        List<Post> searchPosts = mapi.listPosts(1, 1, "id:" + id);
        SwingUtilities.invokeLater(() -> {
            if (dialog.isDisplayable()){
                dialog.dispose();
                if (!searchPosts.isEmpty()){
                    showPostFrame.showPost(searchPosts.get(0));
                }else{
                    JOptionPane.showMessageDialog(null, Localization.getString("id_doesnot_exists"),
                        Localization.getString("error"), JOptionPane.ERROR_MESSAGE);
                }
            }
        });
    });
}
 
开发者ID:azige,项目名称:moebooru-viewer,代码行数:24,代码来源:MoebooruViewer.java

示例10: actionPerformed

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
@Override
public void actionPerformed(final ActionEvent e) {
    final String rawFilepath = PathsAndFiles.JAVA_POLICY.getFullPath();
    String filepath;
    try {
        filepath = new URL(rawFilepath).getPath();
    } catch (final MalformedURLException mfue) {
        filepath = null;
    }

    if (policyEditorWindow == null || policyEditorWindow.getPolicyEditor().isClosed()) {
        policyEditorWindow = PolicyEditor.getPolicyEditorDialog(filepath);
        policyEditorWindow.getPolicyEditor().openPolicyFileSynchronously();
    } else {
        policyEditorWindow.asWindow().toFront();
        policyEditorWindow.asWindow().repaint();
    }
    policyEditorWindow.setModalityType(ModalityType.DOCUMENT_MODAL);
    policyEditorWindow.getPolicyEditor().addNewEntry(new PolicyIdentifier(null, Collections.<PolicyParser.PrincipalEntry>emptySet(), file.getCodeBase().toString()));
    policyEditorWindow.asWindow().setVisible(true);
    menu.setVisible(false);
}
 
开发者ID:GITNE,项目名称:icedtea-web,代码行数:23,代码来源:TemporaryPermissionsButton.java

示例11: layoutDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
protected void layoutDialog() {
    Dialog.getInstance().initLaf();
    ModalityType modality = this.getModalityType();
    if (this.isCallerIsEDT()) {
        modality = ModalityType.APPLICATION_MODAL;
    }
    this.dialog = new InternDialog<T>(this, modality);

    if (this.preferredSize != null) {
        this.dialog.setPreferredSize(this.preferredSize);
    }

    this.timerLbl = new JLabel(TimeFormatter.formatMilliSeconds(this.getCountdown(), 0));
    this.timerLbl.setEnabled(this.isCountdownPausable());

}
 
开发者ID:friedlwo,项目名称:AppWoksUtils,代码行数:17,代码来源:AbstractDialog.java

示例12: separateToggleButtonActionPerformed

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
private void separateToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_separateToggleButtonActionPerformed
    if (separateToggleButton.isSelected()) {
        lensDialog = new JDialog(SwingUtilities.getWindowAncestor(this), ModalityType.MODELESS);
        lensDialog.setTitle("Lens");
        contentSplitPane.remove(lensPanel);
        lensDialog.getContentPane().setLayout(new BorderLayout());
        lensDialog.getContentPane().add(lensPanel, BorderLayout.CENTER);
        lensDialog.setSize(400, 400);
        lensDialog.setLocationRelativeTo(null);
        lensDialog.setVisible(true);
    } else {
        lensDialog.getContentPane().remove(lensPanel);
        lensDialog.dispose();
        contentSplitPane.setBottomComponent(lensPanel);
    }
}
 
开发者ID:shuichi,项目名称:MediaMatrix,代码行数:17,代码来源:MediaInspectorPanel.java

示例13: build

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
private void build() {
	this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
	this.addWindowListener(new WindowAdapter() {
		public void windowClosing(WindowEvent e){
			dialog.dispose();
		}
	});
	
	session = HibernateUtil.instance().openSession();
	
	
	this.setModalityType(ModalityType.TOOLKIT_MODAL);
	this.pack();
	this.setLocationRelativeTo(null);
	this.setVisible(true);
}
 
开发者ID:Neferteus,项目名称:librairie,代码行数:17,代码来源:DialogGenre.java

示例14: addModelessWindow

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
static public JDialog addModelessWindow(Window mainWindow, Component jpanel, String title) {
	JDialog dialog;
	if (mainWindow != null) {
		dialog = new JDialog(mainWindow, title);
	} else {
		dialog = new JDialog();
		dialog.setTitle(title);
	}
	dialog.getContentPane().setLayout(new BorderLayout());
	dialog.getContentPane().add(jpanel, BorderLayout.CENTER);
	dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	dialog.pack();
	dialog.setLocationRelativeTo(mainWindow);
	dialog.setModalityType(ModalityType.MODELESS);
	dialog.setSize(jpanel.getPreferredSize());
	dialog.setVisible(true);
	return dialog;
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:19,代码来源:SwingUtils.java

示例15: showDialog

import java.awt.Dialog.ModalityType; //导入依赖的package包/类
public static File showDialog(boolean sb2, boolean apuc, boolean save) {
	loading.setLocationRelativeTo(IdeFrame.instance);
	loading.setVisible(true);
	loading.paint(loading.getGraphics()); // so much hax
	// too lazy to get this off the EDT
	JDialog d = new JDialog();
	d.setModalityType(ModalityType.APPLICATION_MODAL);
	SavePanel p = new SavePanel(sb2, save, apuc, d);
	d.setContentPane(new JPanel(new BorderLayout()));
	d.getContentPane().add(p, BorderLayout.CENTER);
	d.pack();
	d.setLocationRelativeTo(p);
	loading.setVisible(false);
	d.setVisible(true);
	return p.selected;
}
 
开发者ID:MegaApuTurkUltra,项目名称:Scratch-ApuC,代码行数:17,代码来源:SavePanel.java


注:本文中的java.awt.Dialog.ModalityType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。