public static void main(String[] args) { MainFrame mainFrame = new MainFrame(); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setSize(500, 720); mainFrame.setVisible(true); mainFrame.setResizable(false); }
void addButton_actionPerformed(ActionEvent e) { GenericEditor editor = tableModel.getEditor(); editor.editNew(); MainFrame w = (MainFrame) this.getTopLevelAncestor(); w.addToDesktop(editor); editor.show(); }
public void save(AxisID axisID) { if (isHead()) { if (mainFrame.isMenuSaveEnabled()) { mainFrame.save(axisID); } } }
@Override // 设置窗口显示模式 protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { switch (getDefaultCloseOperation()) { case HIDE_ON_CLOSE: setVisible(false); MainFrame.getMainFrame().cancelShowNear(); MainFrame.getMainFrame().cancelShowFocusNearPoint(); break; case DISPOSE_ON_CLOSE: dispose(); break; case DO_NOTHING_ON_CLOSE: default: break; case EXIT_ON_CLOSE: // This needs to match the checkExit call in // setDefaultCloseOperation System.exit(0); break; } } }
public static void main(String[] args) { MainFrame fm = new MainFrame(); fm.setVisible(true); GameBoard board = new GameBoard(); }
private void editCurrent() { GenericEditor editor = tableModel.getEditor(); editor.edit(tableModel.getRowData(objectTable.getSelectedRow())); MainFrame w = (MainFrame) this.getTopLevelAncestor(); w.addToDesktop(editor); editor.show(); }
public MessageDialog(String message, Dialog owner) { super(owner); // WindowClosw時にリソースを開放してダイアログを閉じる addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); } }); setTitle("MessageDialog"); setBounds(200, 200, 0, 0); setLayout(gbl); // (0, 0) 幅=50, 高さ=1 Label label = new Label(message); gbl.setConstraints(label, MainFrame.setGBC(0, 0, 50, 1)); add(label); // (0, 1) 幅=50, 高さ=1 Button ok_btn = new Button("OK"); gbl.setConstraints(ok_btn, MainFrame.setGBC(0, 1, 50, 1)); add(ok_btn); ok_btn.addActionListener(this); pack(); setModal(true); setVisible(true); }
public void init() { mainFrame = new MainFrame(displayOption); siteMapPanel = new SiteMapPanel(); outputPanel = new OutputPanel(); ExtensionHelp.enableHelpKey(outputPanel, "ui.tabs.output"); // do not allow editable in request panel getWorkbench() .getTabbedWork() .addTab(getRequestPanel().getName(), getRequestPanel().getIcon(), getRequestPanel()); getWorkbench() .getTabbedWork() .addTab(getResponsePanel().getName(), getResponsePanel().getIcon(), getResponsePanel()); // logPanel.setDisplayPanel(requestPanel, responsePanel); // getWorkbench().getTabbedStatus().add(logPanel, "URLs"); // ZAP: Added 'world' icon Icon icon = new ImageIcon(View.class.getResource("/resource/icon/16/094.png")); getWorkbench() .getTabbedSelect() .addTab(Constant.messages.getString("sites.panel.title"), icon, siteMapPanel); // ZAP: i18n getWorkbench().getTabbedWork().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedStatus().setAlternativeParent(mainFrame.getPaneDisplay()); getWorkbench().getTabbedSelect().setAlternativeParent(mainFrame.getPaneDisplay()); messagePanelsPositionController = new MessagePanelsPositionController(requestPanel, responsePanel, mainFrame, getWorkbench()); }
private BusLine addBusLine(PointInfo p1, PointInfo p2) { if (p1.equals(p2)) { return null; } BusLine aBusLine = findBusLine(p1, p2); if (aBusLine == null) { aBusLine = new BusLine( p1.getPId(), p2.getPId(), p1.getAxisX(), p1.getAxisY(), p2.getAxisX(), p2.getAxisY(), StringUtil.distance(p1.getAxisX(), p1.getAxisY(), p2.getAxisX(), p2.getAxisY()), busSelect.getBusId(), busSelect.getBusNoTh(), busSelect.getBusNoEn(), busSelect.getBusPrice(), mainFrame.getLineType(), "", "", "", ""); busSelect.getBusLine().add(aBusLine); busSelect.setEdited(); mainFrame.onSelectBus(busSelect); } return aBusLine; }
/** Creates a new instance of ReportElementSheetPanel */ public ReportObjectSheetPanel() { super(); this.setBackground(Color.BLUE); initSheetProperties(); // We have to register for element changes... MainFrame mf = MainFrame.getMainInstance(); mf.addReportListener(this); mf.addReportFrameActivatedListener(this); I18n.addOnLanguageChangedListener(this); }
public static void main(String[] args) throws Exception { initLogging(); mainFrame = new MainFrame(); operatingSystem = System.getProperty("os.name"); CommandLineParser parser = new BasicParser(); Options options = new Options(); options.addOption("h", "help", false, "Print this usage information"); options.addOption( "t", "test", true, "Name of the Bat-File which is executed for Compilation and Unit-Testing"); options.addOption( "r", "run", true, "Name of the Bat-File which is executed for Compilation and running the project"); options.addOption( "f", "folder", true, "Name of the Folder in which the exercises for the Experiment are stored"); CommandLine commandLine = parser.parse(options, args); // read from command line if (commandLine.getOptions().length > 0) { readCommandLine(commandLine, options); } // read from property file else { readPropertyFile(); } checkBatFile(); mainFrame.init(); mainFrame.setSize(800, 600); mainFrame.setVisible(true); mainFrame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { addLineToLogFile("[Close] Emperior"); System.exit(0); } }); mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); addLineToLogFile("[Start] Emperior"); makeContiniousCopys(); }
@Override public void init(GLAutoDrawable drawable) { try { gl = drawable.getGL().getGL2(); gl.glClearColor(0.7f, 0.7f, 0.9f, 1.0f); // gl.setSwapInterval(1); gl.glEnable(GL.GL_DEPTH_TEST); gl.glEnable(GL2.GL_LIGHTING); gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_BACK); ///////////////////////////////// // carregando e compilando objetos ///////////////////////////////// createSceneObjects(); Iterator<SceneObject> it = scene.getSceneObjectsIterator(); while (it.hasNext()) { SceneObject sceneObject = it.next(); JWavefrontModel[] models = sceneObject.getAnimationModels(); if (models == null) continue; for (JWavefrontModel model : models) { if (sceneObject.useTexture()) model.compile( drawable, JWavefrontModel.WF_MATERIAL | JWavefrontModel.WF_TEXTURE | JWavefrontModel.WF_SMOOTH); else model.compile(drawable, JWavefrontModel.WF_COLOR | JWavefrontModel.WF_SMOOTH); } } // light setSunLight(); // fog setFog(); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); float h = (float) mainFrame.getWidth() / (float) mainFrame.getHeight(); glu.gluPerspective(FPCamera.FOV, h, FPCamera.NEAR, FPCamera.FAR); } catch (IOException ex) { Logger.getLogger(Renderer.class.getName()).log(Level.SEVERE, null, ex); } }
public void actionPerformed(ActionEvent e) { JButton b = (JButton) e.getSource(); if (b.getActionCommand().equals("OK")) { if (checkPW(MainFrame.getUser())) { System.out.println("Correct"); } else { System.out.println("Wrong"); MainFrame.setPW("", true); } } else if (b.getActionCommand().equals("EXIT")) { System.exit(0); } else { MainFrame.setPW(b.getText(), false); } }
public void exit(final AxisID axisID, final int exitValue) { // Store the current location of the frame in case etomo exits. if (isHead()) { mainFrame.saveLocation(); EtomoFrame subFrame = mainFrame.getOtherFrame(); if (subFrame != null) { subFrame.saveLocation(); } } // Check to see if etomo an exit, save data, and then exit. if (EtomoDirector.INSTANCE.exitProgram(axisID)) { System.err.println("exitValue:" + exitValue); System.exit(exitValue); } }
public void actionPerformed(ActionEvent e) { JFrame mainFrame = MainFrame.getMain(); mainFrame.setContentPane(new EmployeeHomePanel(employee)); mainFrame.setBounds(mainFrame.getContentPane().getBounds()); mainFrame.setVisible(true); mainFrame.repaint(); }
private String getTextFor(OpenDefinitionsDocument doc) { DefinitionsPane pane = _frame.getDefPaneGivenODD(doc); String endl = "\n"; // was StringOps.EOL; but Swing uses '\n' for newLine int loc = pane.getCaretPosition(); int start = loc; int end = loc; String text; text = doc.getText(); /* get the starting point of 2 lines up... */ for (int i = 0; i < 4; i++) { if (start > 0) start = text.lastIndexOf(endl, start - endl.length()); } if (start == -1) start = 0; // skip the end line, if we're at one // if (doc.getLength() >= endl.length() && text.substring(start, start+endl.length()) == // endl) // start += endl.length(); if (doc.getLength() >= endl.length() && text.substring(start, start + endl.length()).equals(endl)) start += endl.length(); /* get the ending point 2 lines down */ int index; for (int i = 0; i < 4; i++) { if (end < doc.getLength()) { index = text.indexOf(endl, end + endl.length()); if (index != -1) end = index; } } if (end < start) end = start; text = text.substring(start, end); return text; }
/** * Creates a call to the given list of contacts. * * @param contacts the list of contacts to call to */ public void createCall(Vector contacts) { CallPanel callPanel = new CallPanel(this, contacts); mainFrame.addCallPanel(callPanel); new CreateCallThread(contacts, callPanel).start(); }
/** * Creates a call to the contact represented by the given string. * * @param contact the contact to call to */ public void createCall(String contact) { CallPanel callPanel = new CallPanel(this, contact); mainFrame.addCallPanel(callPanel); new CreateCallThread(contact, callPanel).start(); }
protected void signalViolation(String msg) { final Color bg = _field.getBackground(); _field.setBackground(Binding.INVALID_COLOR); MainFrame.getInstance().warn(msg); _field.setBackground(bg); _field.requestFocusInWindow(); }
/** Load the settings of this panel */ private void loadSettings() { uploadPrioTextField.setText(settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD)); downloadPrioTextField.setText( settings.getValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD)); useOneConnectionForMessagesCheckBox.setSelected( settings.getBoolValue(SettingsClass.FCP2_USE_ONE_CONNECTION_FOR_MESSAGES)); displayDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DISPLAY)); downloadDaysTextField.setText(settings.getValue(SettingsClass.MAX_MESSAGE_DOWNLOAD)); messageBaseTextField.setText(settings.getValue(SettingsClass.MESSAGE_BASE)); alwaysDownloadBackloadCheckBox.setSelected( settings.getBoolValue(SettingsClass.ALWAYS_DOWNLOAD_MESSAGES_BACKLOAD)); minimumIntervalTextField.setText( settings.getValue(SettingsClass.BOARD_AUTOUPDATE_MIN_INTERVAL)); concurrentUpdatesTextField.setText( settings.getValue(SettingsClass.BOARD_AUTOUPDATE_CONCURRENT_UPDATES)); // this setting is in MainFrame automaticBoardUpdateCheckBox.setSelected( MainFrame.getInstance().isAutomaticBoardUpdateEnabled()); refreshUpdateState(); storeSentMessagesCheckBox.setSelected( settings.getBoolValue(SettingsClass.STORAGE_STORE_SENT_MESSAGES)); silentlyRetryCheckBox.setSelected(settings.getBoolValue(SettingsClass.SILENTLY_RETRY_MESSAGES)); altEditCheckBox.setSelected(settings.getBoolValue(SettingsClass.ALTERNATE_EDITOR_ENABLED)); altEditTextField.setEnabled(altEditCheckBox.isSelected()); altEditTextField.setText(settings.getValue(SettingsClass.ALTERNATE_EDITOR_COMMAND)); }
/** Save the settings of this panel */ private void saveSettings() { settings.setValue( SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD, uploadPrioTextField.getText()); settings.setValue( SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD, downloadPrioTextField.getText()); settings.setValue( SettingsClass.FCP2_USE_ONE_CONNECTION_FOR_MESSAGES, useOneConnectionForMessagesCheckBox.isSelected()); settings.setValue(SettingsClass.MAX_MESSAGE_DISPLAY, displayDaysTextField.getText()); settings.setValue(SettingsClass.MAX_MESSAGE_DOWNLOAD, downloadDaysTextField.getText()); settings.setValue( SettingsClass.MESSAGE_BASE, messageBaseTextField.getText().trim().toLowerCase()); settings.setValue( SettingsClass.ALWAYS_DOWNLOAD_MESSAGES_BACKLOAD, alwaysDownloadBackloadCheckBox.isSelected()); settings.setValue( SettingsClass.BOARD_AUTOUPDATE_CONCURRENT_UPDATES, concurrentUpdatesTextField.getText()); settings.setValue( SettingsClass.BOARD_AUTOUPDATE_MIN_INTERVAL, minimumIntervalTextField.getText()); // settings.setValue(SettingsClass.BOARD_AUTOUPDATE_ENABLED, // automaticBoardUpdateCheckBox.isSelected()); // we change setting in MainFrame, this is auto-saved during frostSettings.save() MainFrame.getInstance() .setAutomaticBoardUpdateEnabled(automaticBoardUpdateCheckBox.isSelected()); settings.setValue( SettingsClass.STORAGE_STORE_SENT_MESSAGES, storeSentMessagesCheckBox.isSelected()); settings.setValue(SettingsClass.SILENTLY_RETRY_MESSAGES, silentlyRetryCheckBox.isSelected()); settings.setValue(SettingsClass.ALTERNATE_EDITOR_ENABLED, altEditCheckBox.isSelected()); settings.setValue(SettingsClass.ALTERNATE_EDITOR_COMMAND, altEditTextField.getText()); }
// функция звонок @SuppressWarnings("static-access") public static void Call(final String num) { CallFrame CallFrame = new CallFrame(); CallFrame.HoldIfNotActive(); Redial = num; PrintWriter writer = MainFrame.TelnetWriter(); writer.print("Action: Originate\r\n"); writer.print("Channel: SIP/" + MainExtension + "\r\n"); writer.print("Exten: " + num + "\r\n"); writer.print("Context: " + Context + "\r\n"); writer.print("Priority: 1\r\n"); writer.print("CallerId: phone<" + num + ">\r\n"); writer.print("Async: yes\r\n\r\n"); writer.flush(); CallFrame.removeFromList(CallFrame); CallFrame.dispose(); // для последовательного вывод на экран CallFrames MainFrame.xLocationForCallFrame -= 450; // остановка главного потока на 1300 миллисекунд, чтобы поток Asterisk смог обработать команды CallButton.setEnabled(false); try { Thread.sleep(600); } catch (InterruptedException e) { } new CallButtonTrue().start(); CallFrame.MakeFramesNotEnable(false); new CallFramesTrue().start(); }
public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { AdjuPopupPane popup = (AdjuPopupPane) relComponents[LABELS.adjudicationDisagreement.ordinal()]; if (isParent) { String itemValue = (String) ((JComboBox) e.getSource()).getSelectedItem(); if (itemValue.equals("Selected Annotator") || itemValue.equals("Select and Edit")) { String diff = relation.getAdjuDiff(); popup.setAnnValue(diff); popup.setClickable(true); // relComponents[LABELS.adjudicationDisagreement.ordinal()}. } else { popup.annReset(); popup.setClickable(false); } } else { popup.annReset(); popup.setClickable(false); } mainFrame.inputAction((JComponent) e.getSource(), spanButtons); enableRelationType(); } }
@Override public final Object showModal(final IClient parent, final Object... params) { // labFrame.setTitle(String.format("%s %s %s", // (String) params[1], (String) params[2], (String) params[3])); labFrame.setTitle("Лабораторные исследования"); JDialog dialog = prepareModal(parent); labFrame.fillPatient( (int) params[0], (String) params[1], (String) params[2], (String) params[3], (int) params[4]); dialog.setVisible(true); disposeModal(); return null; }
public ExerciseFailedDialog(ExecutionProgress ep) { super(MainFrame.getInstance(), "Exercise failed /o\\", true); setLayout(new MigLayout("fill", "")); add(new JLabel((Icon) UIManager.getLookAndFeelDefaults().get("OptionPane.errorIcon"))); JLabel msg; JTextArea ta = new JTextArea(); ta.setEditable(false); if (ep.compilationError == null) { msg = new JLabel("You didn't manage to reach your objective."); ta.setText(ep.details); } else { msg = new JLabel("Compilation error"); ta.setText(ep.compilationError); } ta.setCaretPosition(0); add(msg, "wrap"); add(new JScrollPane(ta), "spanx, grow, growprio 200, wrap"); JButton close = new JButton("Close"); close.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dispose(); } }); add(close, "span, alignx 50%"); pack(); setVisible(true); }
@Override public void actionPerformed(ActionEvent ae) { if (ae.getSource() == closeButton) { mf.rebuild(); dispose(); } }
public ViewStatisticsDialog(MainFrame main) { setTitle(TITLE); setSize(WIDTH, HEIGHT); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); setLocation((screen.width - WIDTH) / 2, (screen.height - HEIGHT) / 2); icon = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icon.png")); setIconImage(icon); statistics_table = new JTable(); sp_table = new JScrollPane(statistics_table); setLayout(new BorderLayout()); add(sp_table, BorderLayout.CENTER); final User loginUser = main.getLoginUser(); EventQueue.invokeLater( new Runnable() { @SuppressWarnings("unchecked") @Override public void run() { Statistics s = new Statistics(); List<Statistics> sList = (List<Statistics>) s.filter( " where userID = ? order by year desc,month asc ,day asc", new Object[] {loginUser.getId()}); statistics_table.setModel(new StatisticsTableModel(sList)); } }); }
private void ucmButtonActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_ucmButtonActionPerformed // TODO add your handling code here: // mf.removeAll(); // mf.add(new UcmPanel()); MainFrame mf = McContext.getMainFrame(); mf.removeAll(); mf.add(new UcmPanel()); mf.validate(); mf.repaint(); mf.paintAll(mf.getGraphics()); mf.paintComponents(mf.getGraphics()); } // GEN-LAST:event_ucmButtonActionPerformed
public void switchToOriginalColor() { MainFrame.printLog("swiching back to original color", Color.white); Appearance ap = new Appearance(); for (int z = 0; z < CanvasActionListener.colorCubeArrayList.size(); z++) { DNAColorCube pickedCube = CanvasActionListener.colorCubeArrayList.get(z).canvasDNAColorCube; pickedCube.setAppearance(ap); } }
public static void main(String[] args) { final MainFrame mf = new MainFrame(); mf.addWindowListener( new WindowAdapter() { public void windowClosed(WindowEvent e) { mf.setVisible(false); System.exit(0); } public void windowClosing(WindowEvent e) { mf.setVisible(false); System.exit(0); } }); mf.setVisible(true); }