List of usage examples for java.awt Cursor DEFAULT_CURSOR
int DEFAULT_CURSOR
To view the source code for java.awt Cursor DEFAULT_CURSOR.
Click Source Link
From source file:com.github.cric.app.ui.SettingPanel.java
private Component helpLabel() { JLabel help = new JLabel(HELP_TEXT); help.addMouseListener(new MouseAdapter() { @Override/*from w w w. j a v a 2 s . c o m*/ public void mouseEntered(MouseEvent e) { help.setCursor(new Cursor(Cursor.HAND_CURSOR)); } @Override public void mouseExited(MouseEvent e) { help.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } @Override public void mouseClicked(MouseEvent e) { if (Desktop.isDesktopSupported()) { try { Desktop.getDesktop().browse(HELP_PAGE); } catch (Exception ex) { LOG.warn("unable to open link", ex); } } } }); return help; }
From source file:net.panthema.BispanningGame.MyEditingGraphMousePlugin.java
public void mouseExited(MouseEvent e) { JComponent c = (JComponent) e.getSource(); c.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
From source file:us.paulevans.basicxslt.OutputFrame.java
/** * Event handler method./* ww w. j av a2 s . c om*/ * * @param aEvt */ public void actionPerformed(ActionEvent aEvt) { int returnVal; File fileToSave; setCursor(new Cursor(Cursor.WAIT_CURSOR)); if (aEvt.getSource() == closeBtn || aEvt.getSource() == close) { dispose(userPrefs, PROPERTY_NAME_PREFIX); } else if (aEvt.getSource() == transformTimings) { new TimingsFrame(this, xslRows); } else if (aEvt.getSource() == saveOutputBtn) { try { returnVal = Utils.getInstance().getFileChooser().showSaveDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { fileToSave = Utils.getInstance().getFileChooser().getSelectedFile(); BasicXSLTFrame.setLastFileChosen(fileToSave.getAbsolutePath()); if (textArea != null) { IOUtils.writeFile(fileToSave, transformResult); } else { IOUtils.writeFile(fileToSave, XMLUtils.serialize(node, lastTransformOutputProps)); } } } catch (Throwable aAny) { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); logger.error(ExceptionUtils.getFullStackTrace(aAny)); Utils.showErrorDialog(this, aAny); } } }
From source file:client.ui.FilePane.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./*from ww w . ja va 2 s . co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { fileButtonPane = new JPanel(); uploadFileButton = new JButton(); downloadFileButton = new JButton(); deleteFileButton = new JButton(); renameFileButton = new JButton(); authorizationButton = new JButton(); jSeparator1 = new JSeparator(); addNoteButton = new JButton(); deleteNoteButton = new JButton(); jSeparator2 = new JSeparator(); targetIDField = new JTextField(); searchUserButton = new JButton(); returnButton = new JButton(); jSeparator3 = new JSeparator(); refreshButton = new JButton(); jSeparator4 = new JSeparator(); changePasswdButton = new JButton(); fileSplitPane = new JSplitPane(); jSplitPane2 = new JSplitPane(); fileInfoScroll = new JScrollPane(); fileInfoTable = new JTable(); noteDisplayScroll = new JScrollPane(); noteTable = new JTable(); jSplitPane1 = new JSplitPane(); fileDisplayScroll = new JScrollPane(); fileContentArea = new JTextArea(); noteInputScroll = new JScrollPane(); noteInputArea = new JTextArea(); FormListener formListener = new FormListener(); setForeground(new Color(240, 240, 240)); setFont(new Font("", 0, 12)); // NOI18N setMaximumSize(new Dimension(1366, 768)); setPreferredSize(new Dimension(1366, 700)); fileButtonPane.setMaximumSize(new Dimension(32767, 50)); fileButtonPane.setMinimumSize(new Dimension(404, 50)); uploadFileButton.setFont(new Font("", 0, 12)); // NOI18N uploadFileButton.setText(""); uploadFileButton.setActionCommand("JButton1"); uploadFileButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); uploadFileButton.setBorderPainted(false); uploadFileButton.setContentAreaFilled(false); uploadFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); uploadFileButton.setFocusPainted(false); uploadFileButton.setMaximumSize(new Dimension(30, 20)); uploadFileButton.setMinimumSize(new Dimension(30, 20)); uploadFileButton.addMouseListener(formListener); uploadFileButton.addActionListener(formListener); downloadFileButton.setFont(new Font("", 0, 12)); // NOI18N downloadFileButton.setText(""); downloadFileButton.setActionCommand("JButton1"); downloadFileButton.setBorder(null); downloadFileButton.setBorderPainted(false); downloadFileButton.setContentAreaFilled(false); downloadFileButton.setEnabled(false); downloadFileButton.setFocusPainted(false); downloadFileButton.setMaximumSize(new Dimension(30, 20)); downloadFileButton.setMinimumSize(new Dimension(30, 20)); downloadFileButton.setPreferredSize(new Dimension(30, 20)); downloadFileButton.addMouseListener(formListener); downloadFileButton.addActionListener(formListener); deleteFileButton.setFont(new Font("", 0, 12)); // NOI18N deleteFileButton.setText(""); deleteFileButton.setBorder(null); deleteFileButton.setBorderPainted(false); deleteFileButton.setContentAreaFilled(false); deleteFileButton.setEnabled(false); deleteFileButton.setFocusPainted(false); deleteFileButton.addMouseListener(formListener); deleteFileButton.addActionListener(formListener); renameFileButton.setFont(new Font("", 0, 12)); // NOI18N renameFileButton.setText("???"); renameFileButton.setBorder(null); renameFileButton.setBorderPainted(false); renameFileButton.setContentAreaFilled(false); renameFileButton.setEnabled(false); renameFileButton.setFocusPainted(false); renameFileButton.addMouseListener(formListener); renameFileButton.addActionListener(formListener); authorizationButton.setFont(new Font("", 0, 12)); // NOI18N authorizationButton.setText("??"); authorizationButton.setBorder(null); authorizationButton.setBorderPainted(false); authorizationButton.setContentAreaFilled(false); authorizationButton.setEnabled(false); authorizationButton.setFocusPainted(false); authorizationButton.addMouseListener(formListener); authorizationButton.addActionListener(formListener); jSeparator1.setOrientation(SwingConstants.VERTICAL); addNoteButton.setFont(new Font("", 0, 12)); // NOI18N addNoteButton.setText(""); addNoteButton.setActionCommand("JButton1"); addNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); addNoteButton.setBorderPainted(false); addNoteButton.setContentAreaFilled(false); addNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); addNoteButton.setEnabled(false); addNoteButton.setFocusPainted(false); addNoteButton.setMaximumSize(new Dimension(30, 20)); addNoteButton.setMinimumSize(new Dimension(30, 20)); addNoteButton.addMouseListener(formListener); addNoteButton.addActionListener(formListener); deleteNoteButton.setFont(new Font("", 0, 12)); // NOI18N deleteNoteButton.setText(""); deleteNoteButton.setActionCommand("JButton1"); deleteNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); deleteNoteButton.setBorderPainted(false); deleteNoteButton.setContentAreaFilled(false); deleteNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); deleteNoteButton.setEnabled(false); deleteNoteButton.setFocusPainted(false); deleteNoteButton.setMaximumSize(new Dimension(30, 20)); deleteNoteButton.setMinimumSize(new Dimension(30, 20)); deleteNoteButton.addMouseListener(formListener); deleteNoteButton.addActionListener(formListener); jSeparator2.setOrientation(SwingConstants.VERTICAL); targetIDField.setFont(new Font("", 0, 12)); // NOI18N searchUserButton.setFont(new Font("", 0, 12)); // NOI18N searchUserButton.setText(""); searchUserButton.setActionCommand("JButton1"); searchUserButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); searchUserButton.setBorderPainted(false); searchUserButton.setContentAreaFilled(false); searchUserButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); searchUserButton.setFocusPainted(false); searchUserButton.setMaximumSize(new Dimension(30, 20)); searchUserButton.setMinimumSize(new Dimension(30, 20)); searchUserButton.addMouseListener(formListener); searchUserButton.addActionListener(formListener); returnButton.setFont(new Font("", 0, 12)); // NOI18N returnButton.setText(""); returnButton.setActionCommand("JButton1"); returnButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); returnButton.setBorderPainted(false); returnButton.setContentAreaFilled(false); returnButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); returnButton.setFocusPainted(false); returnButton.setMaximumSize(new Dimension(30, 20)); returnButton.setMinimumSize(new Dimension(30, 20)); returnButton.addMouseListener(formListener); returnButton.addActionListener(formListener); jSeparator3.setOrientation(SwingConstants.VERTICAL); refreshButton.setFont(new Font("", 0, 12)); // NOI18N refreshButton.setText(""); refreshButton.setActionCommand("JButton1"); refreshButton.setBorder(null); refreshButton.setBorderPainted(false); refreshButton.setContentAreaFilled(false); refreshButton.setFocusPainted(false); refreshButton.setMaximumSize(new Dimension(30, 20)); refreshButton.setMinimumSize(new Dimension(30, 20)); refreshButton.setPreferredSize(new Dimension(30, 20)); refreshButton.addMouseListener(formListener); refreshButton.addActionListener(formListener); jSeparator4.setOrientation(SwingConstants.VERTICAL); changePasswdButton.setFont(new Font("", 0, 12)); // NOI18N changePasswdButton.setText("?"); changePasswdButton.setActionCommand("JButton1"); changePasswdButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); changePasswdButton.setBorderPainted(false); changePasswdButton.setContentAreaFilled(false); changePasswdButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); changePasswdButton.setFocusPainted(false); changePasswdButton.setMaximumSize(new Dimension(30, 20)); changePasswdButton.setMinimumSize(new Dimension(30, 20)); changePasswdButton.addMouseListener(formListener); changePasswdButton.addActionListener(formListener); GroupLayout fileButtonPaneLayout = new GroupLayout(fileButtonPane); fileButtonPane.setLayout(fileButtonPaneLayout); fileButtonPaneLayout.setHorizontalGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(fileButtonPaneLayout.createSequentialGroup() .addComponent(uploadFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(downloadFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(renameFileButton, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(authorizationButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(addNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(deleteNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(targetIDField, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(searchUserButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(returnButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator4, GroupLayout.PREFERRED_SIZE, 2, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(changePasswdButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE) .addContainerGap(18, Short.MAX_VALUE))); fileButtonPaneLayout.setVerticalGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, fileButtonPaneLayout.createSequentialGroup().addContainerGap().addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSeparator4) .addGroup(fileButtonPaneLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.TRAILING) .addComponent(changePasswdButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addGroup(fileButtonPaneLayout .createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.TRAILING, false) .addComponent(jSeparator2) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(addNoteButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(deleteNoteButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator1) .addGroup(fileButtonPaneLayout .createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(downloadFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(deleteFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(renameFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(authorizationButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(uploadFileButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)) .addComponent(jSeparator3) .addGroup(GroupLayout.Alignment.LEADING, fileButtonPaneLayout.createParallelGroup( GroupLayout.Alignment.BASELINE) .addComponent(targetIDField) .addComponent(searchUserButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE) .addComponent(returnButton, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE))))))) .addGap(15, 15, 15))); fileSplitPane.setBackground(new Color(255, 255, 255)); fileSplitPane.setDividerLocation(750); fileSplitPane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); fileSplitPane.setMaximumSize(new Dimension(1366, 768)); fileSplitPane.setPreferredSize(new Dimension(701, 646)); jSplitPane2.setDividerLocation(400); jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT); jSplitPane2.setContinuousLayout(true); jSplitPane2.setMaximumSize(new Dimension(1366, 768)); fileInfoScroll.setBackground(new Color(255, 255, 255)); fileInfoScroll.setFont(new Font("", 0, 12)); // NOI18N fileInfoScroll.getViewport().setBackground(Color.WHITE); fileInfoScroll.addMouseListener(formListener); fileInfoTable.setAutoCreateRowSorter(true); fileInfoTable.setFont(new Font("", 0, 12)); // NOI18N fileInfoTable.setModel(fileTableModel); fileInfoTable.getTableHeader().setFont(new Font("", 0, 12)); fileInfoTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); fileInfoTable.setRowHeight(20); fileInfoTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); fileInfoTable.setShowHorizontalLines(false); fileInfoTable.setShowVerticalLines(false); fileInfoTable.addMouseListener(formListener); fileInfoTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { fileSelectedChanged(evt); } }); fileInfoScroll.setViewportView(fileInfoTable); jSplitPane2.setTopComponent(fileInfoScroll); noteDisplayScroll.setBackground(new Color(255, 255, 255)); noteDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N noteDisplayScroll.getViewport().setBackground(Color.WHITE); noteDisplayScroll.addMouseListener(formListener); noteTable.setAutoCreateRowSorter(true); noteTable.setFont(new Font("", 0, 12)); // NOI18N noteTable.setModel(noteTableModel); noteTable.getTableHeader().setFont(new Font("", 0, 12)); noteTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); noteTable.setRowHeight(20); noteTable.setShowHorizontalLines(false); noteTable.setShowVerticalLines(false); noteTable.addMouseListener(formListener); noteTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { noteSelectedChanged(evt); } }); noteDisplayScroll.setViewportView(noteTable); jSplitPane2.setBottomComponent(noteDisplayScroll); fileSplitPane.setLeftComponent(jSplitPane2); jSplitPane1.setDividerLocation(500); jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT); fileDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N fileDisplayScroll.setMinimumSize(new Dimension(30, 30)); fileContentArea.setEditable(false); fileContentArea.setColumns(20); fileContentArea.setFont(new Font("", 0, 12)); // NOI18N fileContentArea.setRows(5); fileContentArea.setToolTipText(""); fileContentArea .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N fileDisplayScroll.setViewportView(fileContentArea); jSplitPane1.setTopComponent(fileDisplayScroll); noteInputScroll.setFont(new Font("", 0, 12)); // NOI18N noteInputScroll.setMaximumSize(new Dimension(1366, 768)); noteInputScroll.setMinimumSize(new Dimension(30, 30)); noteInputArea.setColumns(20); noteInputArea.setFont(new Font("", 0, 12)); // NOI18N noteInputArea.setRows(5); noteInputArea.setToolTipText(""); noteInputArea .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N noteInputScroll.setViewportView(noteInputArea); jSplitPane1.setBottomComponent(noteInputScroll); fileSplitPane.setRightComponent(jSplitPane1); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout .createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(fileSplitPane, GroupLayout.DEFAULT_SIZE, 1346, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(fileSplitPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap())); }
From source file:org.adempiere.apps.graph.Graph.java
public void chartMouseClicked(ChartMouseEvent event) { if ((event.getEntity() != null) && (event.getTrigger().getClickCount() > 1)) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try {//from w w w. ja va 2s . c om GraphColumn bgc = getGraphColumn(event); if (bgc == null) { return; } MQuery query = bgc.getMQuery(builder.getMGoal()); if (query != null) AEnv.zoom(query); else log.warning("Nothing to zoom to - " + bgc); } finally { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } }
From source file:pl.edu.icm.visnow.lib.basic.viewers.Viewer2D.Display2DPanel.java
private void formMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseReleased if (evt.getButton() == MouseEvent.BUTTON1) { move = false;//from w ww .jav a 2 s . c o m this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }
From source file:com.mirth.connect.manager.ManagerController.java
public void stopMirthWorker() { PlatformUI.MANAGER_DIALOG.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setEnabledOptions(false, false, false, false); SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { private String errorMessage = null; public Void doInBackground() { errorMessage = stopMirth();//ww w.j av a2s. co m return null; } public void done() { if (errorMessage == null) { PlatformUI.MANAGER_TRAY.alertInfo("The Mirth Connect Service was stopped successfully."); } else { PlatformUI.MANAGER_TRAY.alertError(errorMessage); } updateMirthServiceStatus(); PlatformUI.MANAGER_DIALOG.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }; worker.execute(); }
From source file:edu.scripps.fl.pubchem.xmltool.gui.PubChemXMLCreatorGUI.java
public void actionPerformed(ActionEvent e) { try {//from w w w .ja v a 2 s . co m setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (e.getSource() == jbnFileTemplate) { gc.fileChooser(jtfFileTemplate, ".xml", "open"); jtfFileTemplate.setEnabled(true); } else if (e.getSource() == jbnFileExcel) { gc.fileChooser(jtfFileExcel, ".xlsx", "open"); } else if (e.getSource() == jbnRunCreator) { String stringTemplate = jtfFileTemplate.getText(); InputStream fileTemplate; if (stringTemplate.equals(template) | stringTemplate.equals("")) { URL url = getClass().getClassLoader().getResource("blank.xml"); fileTemplate = url.openStream(); } else fileTemplate = new FileInputStream(jtfFileTemplate.getText()); File fileExcel = new File(jtfFileExcel.getText()); File fileOutput = File.createTempFile("pubchem", ".xml"); fileOutput.deleteOnExit(); PubChemAssay assay = new PubChemXMLCreatorController().createPubChemXML(fileTemplate, fileExcel, fileOutput); String message = assay.getMessage(); if (!message.equals("")) { int nn = JOptionPane.showOptionDialog(this, notError + message + "\nWould you like to edit your Excel Workbook?", SwingGUI.APP_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if (nn == JOptionPane.YES_OPTION) { log.info("Opening Excel Workbook with Desktop: " + fileExcel); Desktop.getDesktop().open(fileExcel); } else { log.info("Opening XML file: " + fileOutput); Desktop.getDesktop().open(fileOutput); } } else { log.info("Opening XML file: " + fileOutput); Desktop.getDesktop().open(fileOutput); } } else if (e.getSource() == jbnReportCreator) { File fileExcel = new File(jtfFileExcel.getText()); File filePDFOutput = File.createTempFile("PubChem_PDF_Report", ".pdf"); File fileWordOutput = File.createTempFile("PubChem_Word_Report", ".docx"); filePDFOutput.deleteOnExit(); fileWordOutput.deleteOnExit(); ArrayList<PubChemAssay> assay = new ReportController().createReport(pcDep, fileExcel, filePDFOutput, fileWordOutput, isInternal); String message = null; for (PubChemAssay xx : assay) { message = xx.getMessage(); if (!message.equals("")) { int nn = JOptionPane.showOptionDialog(this, notError + message + "\nWould you like to edit your Excel Workbook?", SwingGUI.APP_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null); if (nn == JOptionPane.YES_OPTION) { log.info("Opening Excel Workbook with Desktop: " + fileExcel); Desktop.getDesktop().open(fileExcel); } else { gc.openPDF(isInternal, filePDFOutput, this); Desktop.getDesktop().open(fileWordOutput); } } else { gc.openPDF(isInternal, filePDFOutput, this); Desktop.getDesktop().open(fileWordOutput); } } } setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } catch (Throwable throwable) { SwingGUI.handleError(this, throwable); } }
From source file:com.wet.wired.jsr.recorder.JRecorder.java
public void endWaitForBackgroundProcesses() { control.setEnabled(true); player.setEnabled(true); this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); }
From source file:com.evanbelcher.DrillBook.display.DBMenuBar.java
/** * On any menu item click.//from w ww .j a v a 2 s .co m */ @Override public void actionPerformed(ActionEvent arg0) { State.print(arg0.getActionCommand()); switch (arg0.getActionCommand()) { case "new": //Try to save work, open new show try { newShow(); } catch (InterruptedException e) { e.printStackTrace(); } break; case "open": //Try to save work, get new show openShow(); break; case "save": Main.save(); break; case "saveas": try { saveAs(); } catch (InterruptedException e) { e.printStackTrace(); } break; case "printpage": try { desktop.setCursor(new Cursor(Cursor.WAIT_CURSOR)); desktop.printCurrentPageToPdf(); desktop.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } catch (IOException e) { e.printStackTrace(); } break; case "printshow": try { desktop.setCursor(new Cursor(Cursor.WAIT_CURSOR)); desktop.printAllPagesToPdf(); desktop.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } catch (IOException e) { e.printStackTrace(); } break; case "printdotsheets": try { desktop.setCursor(new Cursor(Cursor.WAIT_CURSOR)); new DotSheetMaker().printDotSheets(); desktop.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } catch (InterruptedException e) { e.printStackTrace(); } break; case "togglegrid": Main.getState().getSettings().setShowGrid(!Main.getState().getSettings().shouldShowGrid()); ((JMenu) getComponent(2)).getMenuComponent(0) .setForeground(Main.getState().getSettings().shouldShowGrid() ? Color.BLACK : Color.RED); break; case "togglenames": Main.getState().getSettings().setShowNames(!Main.getState().getSettings().shouldShowNames()); ((JMenu) getComponent(2)).getMenuComponent(1) .setForeground(Main.getState().getSettings().shouldShowNames() ? Color.BLACK : Color.RED); break; case "toggletext": Main.getState().getSettings().setShowText(!Main.getState().getSettings().shouldShowText()); ((JMenu) getComponent(2)).getMenuComponent(2) .setForeground(Main.getState().getSettings().shouldShowText() ? Color.BLACK : Color.RED); break; case "colordots": Main.getState().getSettings().setColorDots(!Main.getState().getSettings().shouldColorDots()); ((JMenu) getComponent(2)).getMenuComponent(3) .setForeground(Main.getState().getSettings().shouldColorDots() ? Color.BLACK : Color.RED); break; case "changehash": Main.getState().getSettings().setCollegeHashes(!Main.getState().getSettings().useCollegeHashes()); ((JMenuItem) (((JMenu) getComponent(2)).getMenuComponent(4))) .setText(Main.getState().getSettings().useCollegeHashes() ? "Change to High School Hashes" : "Change to College Hashes"); try { desktop.getImage(); } catch (IOException e) { e.printStackTrace(); } desktop.getDotDataFrame().updatePosition(); break; case "fontsize": changeFontSize(); break; case "play": play(); break; case "undo": Main.getState().undo(); desktop.getIO().clearActivePoints(); desktop.getDotDataFrame().updateAll(desktop.getActivePoints()); break; case "redo": Main.getState().redo(); desktop.getIO().clearActivePoints(); desktop.getDotDataFrame().updateAll(desktop.getActivePoints()); break; case "help": help(); break; case "about": about(); break; case "quit": default: gr.dispatchEvent(new WindowEvent(gr, WindowEvent.WINDOW_CLOSING)); } desktop.getIO().fixControl(); }