/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public JFrame getMainWindow() { return (JFrame)WindowManager.getDefault().getMainWindow(); }
public void actionPerformed(ActionEvent e) { JFileChooser directoryChooser = HeapDumpAction.getSnapshotDirectoryChooser(); directoryChooser.setCurrentDirectory(new File(getCustomDirectory())); if (directoryChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == 0) { File file = directoryChooser.getSelectedFile(); if (file != null) { customLocationField.setText(directoryChooser.getSelectedFile().getAbsolutePath()); } } } });
public void actionPerformed(ActionEvent e) { JFileChooser snapshotChooser = CompareSnapshotsAction.getSnapshotFileChooser(); snapshotChooser.setCurrentDirectory(new File((getSnapshot2Filename().length() == 0) ? getSnapshot1Filename() : getSnapshot2Filename())); if (snapshotChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()) == 0) { File file = snapshotChooser.getSelectedFile(); if (file != null) { snapshot2Field.setText(file.getAbsolutePath()); } } } });
@Override public void run() { assert EventQueue.isDispatchThread(); try { JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow(); Component component = frame.getGlassPane(); component.setVisible(show); component.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null); } catch (NullPointerException npe) { LOGGER.log(Level.WARNING, null, npe); } }
@Override public void actionPerformed(ActionEvent e) { JFileChooser fileChooser = new JFileChooser(screenshotMaker.getDefaultDirectory()); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int result = fileChooser.showOpenDialog(WindowManager.getDefault().getMainWindow()); if (result == JFileChooser.APPROVE_OPTION) { screenshotMaker.setDefaultDirectory(fileChooser.getSelectedFile()); } } });
public static void hidePopup() { if (popupWindow != null) { // popupWindow.getContentPane().removeAll(); Toolkit.getDefaultToolkit().removeAWTEventListener(hideListener); popupWindow.setVisible( false ); popupWindow.dispose(); } WindowManager.getDefault().getMainWindow().removeWindowStateListener(hideListener); WindowManager.getDefault().getMainWindow().removeComponentListener(hideListener); popupWindow = null; }
@Override public void run() { WelcomeTopComponent component = WelcomeTopComponent.getInstance(); JDialog dialog = new JDialog(WindowManager.getDefault().getMainWindow(), component.getName(), false); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.getContentPane().add(component); dialog.setBounds(212, 237, 679, 378); dialog.setVisible(true); } });
@Override public void run() { JFrame mainWindow = (JFrame) WindowManager.getDefault().getMainWindow(); mainWindow .getGlassPane() .setCursor(Cursor.getPredefinedCursor( on ? Cursor.WAIT_CURSOR : Cursor.DEFAULT_CURSOR)); mainWindow.getGlassPane().setVisible(on); } };
private static boolean isModalDialogPresent() { return hasModalDialog(WindowManager.getDefault().getMainWindow()) // XXX Trick to get the shared frame instance. || hasModalDialog(new JDialog().getOwner()); }
@Override public void actionPerformed(ActionEvent e) { Color newColor = ColorPicker.showDialog(WindowManager.getDefault().getMainWindow(), color, JColorButton.this.includeOpacity); if (newColor != null) { setColor(newColor); } } });
@Override public void run() { log.finest("resume"); loginView.setVisible(false); worldsView.setVisible(false); final JFrame mainWin = (JFrame) WindowManager.getDefault().getMainWindow(); mainWin.setGlassPane(orgGlassPane); } }
public static Image getCssPreviewImage(Map<String, String> properties, URL base, int width, int height, int defaultFontSize) { WindowManager wm = WindowManager.getDefault(); Graphics2D g2d = (Graphics2D)wm.getMainWindow().getGraphics(); return paintCssPreview(g2d, base, properties, width, height, defaultFontSize); }
@Override public void beforeSave(WindowSystemEvent event) { Frame mainWindow = WindowManager.getDefault().getMainWindow(); if (mainWindow != null) { lastDimension = mainWindow.getSize(); lastLocation = mainWindow.getLocation(); lastState = mainWindow.getExtendedState(); } }
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { Color newColor = ColorPicker.showDialog(WindowManager.getDefault().getMainWindow(), color, JColorButton.this.includeOpacity); if (newColor != null) { setColor(newColor); } } } });
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ private void internalSetTitle2() { WindowManager.getDefault().getMainWindow().setTitle(fixed(titlePrefix) + (((titlePrefix != null) && (title != null)) ? " - " : "") + fixed(title)); }
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { Color newColor = ColorPicker.showDialog(WindowManager.getDefault().getMainWindow(), color, JColorBlackWhiteSwitcher.this.includeOpacity); if (newColor != null) { setColor(newColor); } } } });
private void showReportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showReportButtonActionPerformed if (pieChart == null) { pieChart = manipulator.buildPieChart(valuesFrequencies); } final String html = manipulator.getReportHTML(table, column, valuesFrequencies, pieChart, pieChartDialog != null ? pieChartDialog.getChartSize() : null); if (reportDialog != null) { reportDialog.dispose(); } reportDialog = new SimpleHTMLReport(WindowManager.getDefault().getMainWindow(), html); }//GEN-LAST:event_showReportButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables
private static void frontMainWindow() { Frame f = WindowManager.getDefault().getMainWindow(); // makes sure the frame is visible f.setVisible(true); // uniconifies the frame if it is inconified if ((f.getExtendedState() & Frame.ICONIFIED) != 0) { f.setExtendedState(~Frame.ICONIFIED & f.getExtendedState()); } // moves it to front and requests focus f.toFront (); } private static class EQStuck extends Throwable {
@Override public void actionPerformed(ActionEvent e) { TextModelImpl model = VizController.getInstance().getVizModel().getTextModel(); Font font = JFontChooser.showDialog(WindowManager.getDefault().getMainWindow(), model.getEdgeFont()); if (font != null && font != model.getEdgeFont()) { model.setEdgeFont(font); } } });
private void showReportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showReportButtonActionPerformed prepareBoxPlot(); prepareScatterPlot(); if (histogram == null) { prepareHistogram(); } final String html = ChartsUtils.getStatisticsReportHTML(dataName, statistics, boxPlot, scatterPlot, histogram, boxPlotDialog != null ? boxPlotDialog.getChartSize() : null, scatterPlotDialog != null ? scatterPlotDialog.getChartSize() : null, histogramDialog != null ? histogramDialog.getChartSize() : null); if (reportDialog != null) { reportDialog.dispose(); } reportDialog = new SimpleHTMLReport(WindowManager.getDefault().getMainWindow(), html); }//GEN-LAST:event_showReportButtonActionPerformed