public BanPlayerAction(final Component parent, final IServerMessenger messenger) { super("Ban Player From Game"); this.parent = JOptionPane.getFrameForComponent(parent); this.messenger = messenger; }
public GetGameSaveClientAction(final Component parent, final IServerStartupRemote serverRemote) { super("Download Gamesave (Save Game)"); this.parent = JOptionPane.getFrameForComponent(parent); this.serverRemote = serverRemote; }
public BootPlayerAction(final Component parent, final IServerMessenger messenger) { super("Remove Player"); this.parent = JOptionPane.getFrameForComponent(parent); this.messenger = messenger; }
public ChangeGameOptionsClientAction(final Component parent, final IServerStartupRemote serverRemote) { super("Edit Game Options"); this.parent = JOptionPane.getFrameForComponent(parent); this.serverRemote = serverRemote; }
private boolean confirm(final String question) { final int selectionOption = JOptionPane.showConfirmDialog(JOptionPane.getFrameForComponent(this), question, "Question", JOptionPane.OK_CANCEL_OPTION); return selectionOption == JOptionPane.OK_OPTION; }
public SetMapClientAction(final Component parent, final IClientMessenger clientMessenger, final List<String> availableGames) { super("Change Game To"); this.parent = JOptionPane.getFrameForComponent(parent); this.clientMessenger = clientMessenger; this.availableGames = availableGames; Collections.sort(this.availableGames); }
public void startEditing(){ if(editBase == null){ return; } final JFrame frame = (JFrame) JOptionPane.getFrameForComponent(AttributeTable.this); editBase.show(frame); }
public ChangeToAutosaveClientAction(final Component parent, final IClientMessenger clientMessenger, final HeadlessAutoSaveType typeOfAutosave) { super("Change To " + typeOfAutosave.toString().toLowerCase()); this.parent = JOptionPane.getFrameForComponent(parent); this.clientMessenger = clientMessenger; this.typeOfAutosave = typeOfAutosave; }
public static Frame getFrame() { final Component currentRootComponent = getMenuComponent(); return currentRootComponent instanceof Frame ? (Frame)currentRootComponent : JOptionPane.getFrameForComponent(currentRootComponent); }
ReturnValue show(final Window parent) { dialog = new JDialog(JOptionPane.getFrameForComponent(parent), "Login", true); dialog.getContentPane().add(this); SwingComponents.addEscapeKeyListener(dialog, this::close); dialog.pack(); dialog.setLocationRelativeTo(parent); dialog.setVisible(true); dialog.dispose(); dialog = null; return returnValue; } }
public void actionPerformed(ActionEvent evt) { if(evt.getSource() == ok) dispose(); else if(evt.getSource() == pluginMgr) { PluginManager.showPluginManager(JOptionPane.getFrameForComponent( ErrorListDialog.this)); } } //}}} } //}}}
public static Artifact showDialog(Component frameComp, Component locationComp, String labelText, String title, String[] suggestedGroups, String[] suggestedVersions) { Frame frame = JOptionPane.getFrameForComponent(frameComp); dialog = new ArtifactDownloadDialog(frame, locationComp, labelText, title, suggestedGroups, suggestedVersions); dialog.setVisible(true); return artifact; }
public VerifiedRandomNumbersDialog(final Component parent) { super(JOptionPane.getFrameForComponent(parent), "Verified Random Numbers", false); init(); pack(); }
private DateTimeChooser getChooser() { if ((chooser == null) && (browseButton != null)) { Frame f = JOptionPane.getFrameForComponent(browseButton); String title = LanguageSupport.getOptionalLocalizedString("CHOOSE_DATE", "Choose date"); chooser = new DateTimeChooser(f, title, type == DateType.DATE_TIME); } return chooser; }
boolean frameLayoutCompleted() { final Frame frame = JOptionPane.getFrameForComponent(this); final Insets frameInsets = frame.getInsets(); final Component rootPane = frame.getComponent(0); final boolean frameLayoutCompleted = rootPane.getWidth() == frame.getWidth() - frameInsets.left - frameInsets.right && rootPane.getHeight() == frame.getHeight() - frameInsets.top - frameInsets.bottom; return frameLayoutCompleted; }
public Dialog(Component parent, String title, JPanel panel) { super(JOptionPane.getFrameForComponent(parent), title); setModal(true); this.panel = panel; getContentPane().add(panel, BorderLayout.CENTER); getContentPane().add(createButtonPanel(), BorderLayout.SOUTH); }
public ServerOptions(final Component owner, final String defaultName, final int defaultPort, final boolean showComment) { super(owner == null ? null : JOptionPane.getFrameForComponent(owner), "Server options", true); this.showComment = showComment; initComponents(); layoutComponents(); setupActions(); nameField.setText(defaultName); portField.setValue(defaultPort); setWidgetActivation(); pack(); }
public ValidationDialog(Component parent, ValidationReport theReport) { super(JOptionPane.getFrameForComponent(parent)); setModal(true); report = theReport; setTitle(); buildGui(); aborted = report.getGlobalValidationLevel() == Level.ERROR; setBounds(parent); }
private void hostGame() { final ServerOptions options = new ServerOptions(JOptionPane.getFrameForComponent(this), messengers.getMessenger().getLocalNode().getName(), 3300, true); options.setLocationRelativeTo(JOptionPane.getFrameForComponent(this)); options.setNameEditable(false); options.setVisible(true); if (!options.getOkPressed()) { return; } GameRunner.hostGame(options.getPort(), options.getName(), options.getComments(), options.getPassword(), messengers); }
public void actionPerformed(final ActionEvent e) { if (!getPrintController().acquirePrinterJobAndPageFormat(false)) { return; } final Component mapView = Controller.getCurrentController().getMapViewManager().getMapViewComponent(); final PreviewDialog previewDialog = new PreviewDialog(getPrintController(), TextUtils .getText("print_preview_title"), mapView); previewDialog.pack(); previewDialog.setLocationRelativeTo(JOptionPane.getFrameForComponent(mapView)); previewDialog.setVisible(true); } }