List of usage examples for java.awt Cursor Cursor
protected Cursor(String name)
Note: this constructor should only be used by AWT implementations as part of their support for custom cursors.
From source file:au.org.ala.delta.editor.ui.CharacterTree.java
public void expandAll() { try {/*from w w w .j a v a 2 s. c o m*/ setCursor(new Cursor(Cursor.WAIT_CURSOR)); for (int i = 0; i < getRowCount(); i++) { expandRow(i); } } finally { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }
From source file:au.org.ala.delta.editor.ui.CharacterTree.java
public void collapseAll() { try {//from w ww .ja va 2 s . com setCursor(new Cursor(Cursor.WAIT_CURSOR)); for (int i = 0; i < getRowCount(); i++) { collapseRow(i); } } finally { setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }
From source file:com.microsoft.intellij.forms.CreateWebSiteForm.java
@Override protected void doOKAction() { boolean isOK = true; AzureManager manager = AzureManagerImpl.getManager(project); mainPanel.getRootPane().getParent().setCursor(new Cursor(Cursor.WAIT_CURSOR)); try {//from w w w. j av a2 s. com WebSite webSite = manager.createWebSite(subscription.getId(), webHostingPlan, nameTextField.getText().trim()); WebSiteConfiguration webSiteConfiguration = manager.getWebSiteConfiguration(subscription.getId(), webSite.getWebSpaceName(), webSite.getName()); if (customJDK.isSelected() || customJDKUser.isSelected()) { CustomJdk task = new CustomJdk(webSiteConfiguration); task.queue(); } webSiteConfiguration.setJavaVersion("1.8.0_73"); String selectedContainer = (String) webContainerComboBox.getSelectedItem(); if (selectedContainer.equalsIgnoreCase(WebAppsContainers.TOMCAT_8.getName())) { webSiteConfiguration.setJavaContainer("TOMCAT"); webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.TOMCAT_8.getValue()); } else if (selectedContainer.equalsIgnoreCase(WebAppsContainers.TOMCAT_7.getName())) { webSiteConfiguration.setJavaContainer("TOMCAT"); webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.TOMCAT_7.getValue()); } else if (selectedContainer.equalsIgnoreCase(WebAppsContainers.JETTY_9.getName())) { webSiteConfiguration.setJavaContainer("JETTY"); webSiteConfiguration.setJavaContainerVersion(WebAppsContainers.JETTY_9.getValue()); } manager.updateWebSiteConfiguration(subscription.getId(), webSite.getWebSpaceName(), webSite.getName(), webSite.getLocation(), webSiteConfiguration); webAppCreated = webSite.getName(); Map<WebSite, WebSiteConfiguration> tempMap = AzureSettings.getSafeInstance(project).loadWebApps(); tempMap.put(webSite, webSiteConfiguration); AzureSettings.getSafeInstance(project).saveWebApps(tempMap); if (customJDK.isSelected() || customJDKUser.isSelected()) { copyWebConfigForCustom(webSiteConfiguration); } } catch (AzureCmdException e) { String errorMessage = e.getMessage(); if (errorMessage.contains(message("nameConflict"))) { errorMessage = message("inUseErrMsg"); isOK = false; } PluginUtil.displayErrorDialogAndLog(message("webAppErrTtl"), errorMessage, e); } finally { mainPanel.getRootPane().getParent().setCursor(Cursor.getDefaultCursor()); } if (isOK) { super.doOKAction(); } }
From source file:com.josescalia.tumblr.app.MainFrame.java
private void executeMenu(final String beanName) { mainPanel.setCursor(new Cursor(Cursor.WAIT_CURSOR)); progressBar.setIndeterminate(true);//from w w w . j a v a 2 s . c o m new SwingWorker<BaseForm, BaseForm>() { @Override protected BaseForm doInBackground() throws Exception { return (BaseForm) context.getBean(beanName); } @Override protected void done() { BaseForm frm; try { removePanelFromMain(); frm = get(); frm.showForm(); frm.setVisible(true); mainPanel.setLayout(new BorderLayout()); mainPanel.add(frm); mainPanel.validate(); } catch (InterruptedException ex) { logger.error(ex.getMessage()); UIAlert.showError(mainPanel, "No Such Form Defined"); } catch (ExecutionException ex) { logger.error(ex.getMessage()); UIAlert.showError(mainPanel, "Something wrong with the system"); } progressBar.setIndeterminate(false); mainPanel.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }.execute(); //this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:com.ssn.listener.SSNHiveAlbumSelectionListner.java
public void createCompontents(String mediaPath, SSNHomeForm ssnHomeForm, boolean fileShowFlag) { ssnHomeForm.getFileNamesToBeDeleted().clear(); SSNHelper.toggleDeleteAndShareImages(false, ssnHomeForm); // System.out.println("mediaPath-createCompontents::"+mediaPath); SSNHelper.toggleDeleteImage(true, ssnHomeForm); try {/*from w w w . j av a 2 s . c o m*/ if (fileShowFlag) { ssnHomeForm.setCursor(new Cursor(Cursor.WAIT_CURSOR)); contentPane = new SSNGalleryHelper(mediaPath, ssnHomeForm, "ALL"); contentPane.setBackground(SSNConstants.SSN_BLACK_BACKGROUND_COLOR); ssnHomeForm.getSsnHomeCenterMainPanel().removeAll(); ssnHomeForm.getSsnHomeCenterPanel().removeAll(); ssnHomeForm.getSsnHomeCenterPanel().add(ssnHomeForm.getScrollPane(contentPane, SSNHelper.getAlbumNameFromPath(ssnHomeForm.ssnFileExplorer.m_display.getText()))); ssnHomeForm .getSsnHomeCenterMainPanel().add( ssnHomeForm.getSortPanel("Date", false, SSNHelper.getAlbumNameFromPath( ssnHomeForm.ssnFileExplorer.m_display.getText())), BorderLayout.NORTH); ssnHomeForm.getSsnHomeCenterMainPanel().add(ssnHomeForm.getSsnHomeCenterPanel(), BorderLayout.CENTER); ssnHomeForm.revalidate(); ssnHomeForm.repaint(); ssnHomeForm.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } else { if (contentPane != null) { ssnHomeForm.remove(contentPane); } addWelcomeIcons(); ssnHomeForm.revalidate(); } } catch (Exception ex) { ex.printStackTrace(); } }
From source file:org.photovault.swingui.PhotoViewController.java
/** This method is called when selection in the thumbnail view changes. @param e The selection event/*from ww w . j av a2s . co m*/ */ void thumbSelectionChanged(SelectionChangeEvent e) { Collection selection = thumbPane.getSelection(); if (selection.size() == 1) { Cursor oldCursor = getView().getCursor(); getView().setCursor(new Cursor(Cursor.WAIT_CURSOR)); PhotoInfo selected = (PhotoInfo) (selection.toArray())[0]; try { previewPane.setPhoto(selected); } catch (FileNotFoundException ex) { JOptionPane.showMessageDialog(getView(), "Image file for this photo was not found", "File not found", JOptionPane.ERROR_MESSAGE); } getView().setCursor(oldCursor); } else { try { previewPane.setPhoto(null); } catch (FileNotFoundException ex) { // No exception expected when calling with null } } this.fireEvent(e); }
From source file:com.mirth.connect.client.ui.alert.AlertChannelPane.java
private void initComponents() { setBackground(UIConstants.BACKGROUND_COLOR); setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Channels")); setLayout(new MigLayout("insets 0", "[grow][grow]", "[][][grow]")); filterLabel = new JLabel("Filter: "); filterTextField = new JTextField(); filterTextField.addKeyListener(new KeyListener() { @Override//from ww w .java 2 s . c om public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { updateFilter(filterTextField.getText()); } }); expandLabel = new JLabel("<html><u>Expand All</u></html>"); expandLabel.setForeground(Color.blue); expandLabel.setToolTipText("Expand all nodes below."); expandLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); expandLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { channelTreeTable.expandAll(); } }); collapseLabel = new JLabel("<html><u>Collapse All</u></html>"); collapseLabel.setForeground(Color.blue); collapseLabel.setToolTipText("Collapse all nodes below."); collapseLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); collapseLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { channelTreeTable.collapseAll(); } }); enableButton = new JButton("Enable"); enableButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { toggleSelectedRows(true); PlatformUI.MIRTH_FRAME.setSaveEnabled(true); } }); disableButton = new JButton("Disable"); disableButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { toggleSelectedRows(false); PlatformUI.MIRTH_FRAME.setSaveEnabled(true); } }); channelTreeTable = new MirthTreeTable(); channelScrollPane = new JScrollPane(channelTreeTable); add(filterLabel, "span 2, split"); add(filterTextField, "growx, span, wrap"); add(enableButton, "split 2, alignx left, width 50"); add(disableButton, "alignx left, width 50"); add(expandLabel, "split 2, alignx right"); add(collapseLabel, "alignx right, wrap"); add(channelScrollPane, "height 100:100:, width 100:100:, grow, span"); }
From source file:com.cmsoftware.keyron.vista.Login.java
private void panelContenidoMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panelContenidoMouseReleased this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); }
From source file:de.juwimm.cms.content.panel.PanDocuments.java
public void regionSelected() { setCursor(new Cursor(Cursor.WAIT_CURSOR)); Integer intSelItem = ((CboModel) this.cboRegion.getSelectedItem()).getRegionId(); loadThumbs(intSelItem);// w w w. j av a 2s . c om try { if (intRootUnit.equals(intSelItem)) { if (comm.isUserInRole(UserRights.SITE_ROOT) || intActUnit.equals(intRootUnit)) { this.btnDelete.setVisible(true); this.btnAdd.setVisible(true); this.btnPreview.setVisible(true); } else { this.btnDelete.setVisible(false); this.btnAdd.setVisible(false); this.btnPreview.setVisible(false); } } else { this.btnDelete.setVisible(true); this.btnAdd.setVisible(true); this.btnPreview.setVisible(true); } } catch (Exception ex) { } setCursor(Cursor.getDefaultCursor()); }
From source file:es.mityc.firmaJava.libreria.pkcs7.ValidaTarjeta.java
private void validarTarjeta() { Runnable doWorkRunnable = new Runnable() { public void run() { ConexionTarjeta c = ConexionTarjeta.getInstance(); try { ks = c.conectar(jPinPasswordField.getPassword(), jLibreriaTextField.getText()); ValidaTarjeta.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); dispose();//from w w w . j a v a2 s.c o m } catch (ProviderException e1) { JOptionPane.showMessageDialog(jPanel, e1.getMessage(), I18n.getResource(LIBRERIAXADES_VALIDARTARJETA_TEXTO_23), JOptionPane.ERROR_MESSAGE); } catch (PKCS11Exception e1) { String mensajeError = mensajeErrorConexion(String.valueOf(e1.getErrorCode())); JOptionPane.showMessageDialog(jPanel, mensajeError, I18n.getResource(LIBRERIAXADES_VALIDARTARJETA_TEXTO_23), JOptionPane.ERROR_MESSAGE); } ValidaTarjeta.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }; ValidaTarjeta.this.setCursor(new Cursor(Cursor.WAIT_CURSOR)); SwingUtilities.invokeLater(doWorkRunnable); }