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:grisu.frontend.view.swing.files.preview.fileViewers.JobStatusGridFileViewer.java
private JCheckBox getChckbxShowMinutes() { if (chckbxShowMinutes == null) { chckbxShowMinutes = new JCheckBox("Display minutes"); chckbxShowMinutes.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (chckbxShowMinutes.isSelected()) { showMinutes = true;/*from w w w .jav a2s. c om*/ } else { showMinutes = false; } new Thread() { @Override public void run() { chckbxShowMinutes.setEnabled(false); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); generateGraph(); setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); chckbxShowMinutes.setEnabled(true); } }.start(); } }); } return chckbxShowMinutes; }
From source file:grisu.frontend.view.swing.jobmonitoring.single.appSpecific.Gold.java
private JButton getBtnHistory() { if (btnHistory == null) { btnHistory = new JButton("History"); btnHistory.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); File temp;//from w ww .jav a 2 s . co m try { temp = downloadJobStatusFile(); } catch (final FileTransactionException e1) { final ErrorInfo ei = new ErrorInfo("Download error", "Error while trying to download job status file.", e1.getLocalizedMessage(), (String) null, e1, Level.SEVERE, (Map) null); JXErrorPane.showDialog(Gold.this.getPanel(), ei); return; } final JobStatusFileDialog dialog = new JobStatusFileDialog(); dialog.setFileManagerAndUrl(fm, job_status_url); dialog.setFile(null, temp); setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); dialog.setVisible(true); } }); } return btnHistory; }
From source file:graphviewer.GraphCreate.java
/** * Create an instance of a directed graph *///ww w.j av a 2 s .c o m public GraphCreate() { super("SCCFinder"); this.graph = new DirectedSparseMultigraph<Integer, Integer>(); this.layout = new StaticLayout<Integer, Integer>(this.graph, new Dimension(600, 600)); final Transformer<Integer, Paint> redVertexPaint = new Transformer<Integer, Paint>() { public Paint transform(Integer i) { return Color.RED; } }; this.vv = new VisualizationViewer<Integer, Integer>(this.layout); this.vv.setBackground(Color.white); this.vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller<Integer>()); this.vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR); Container content = getContentPane(); content.add(this.vv); this.vv.getRenderContext().setVertexFillPaintTransformer(redVertexPaint); // add listeners to our visual component Factory<Integer> vertexFactory = new VertexFactory(); Factory<Integer> edgeFactory = new EdgeFactory(); this.graphMouse = new EditingModalGraphMouse<Integer, Integer>(this.vv.getRenderContext(), vertexFactory, edgeFactory); this.vv.setGraphMouse(this.graphMouse); this.vv.addKeyListener(new MyKeyListener()); final MouseListener[] mls = (MouseListener[]) (this.vv.getListeners(MouseListener.class)); final MouseListener wrapper = new MyWrapperMouseListener(mls[1]); this.graphMouse.setMode(ModalGraphMouse.Mode.EDITING); this.vv.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); this.controls = new JPanel(); final ScalingControl scaler = new CrossoverScalingControl(); // add some buttons this.plus = new JButton("+"); this.plus.setToolTipText("Press this button or use the mouse wheel to zoom out"); this.plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1.1f, vv.getCenter()); setFocusable(false); } }); this.minus = new JButton("-"); this.minus.setToolTipText("Press this button or use the mouse wheel to zoom in"); this.minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1 / 1.1f, vv.getCenter()); setFocusable(false); } }); this.edit = new JRadioButton("Editing"); this.edit.setToolTipText("You can just press 'e' to select this radiobutton"); this.edit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { graphMouse.setMode(ModalGraphMouse.Mode.EDITING); vv.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); setFocusable(false); } }); this.transform = new JRadioButton("Transforming"); this.transform.setToolTipText("You can just press 't' to select this radiobutton"); this.transform.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { graphMouse.setMode(ModalGraphMouse.Mode.TRANSFORMING); vv.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); setFocusable(false); } }); this.pick = new JRadioButton("Picking"); this.pick.setToolTipText("You can just press 'p' to select this radiobutton"); this.pick.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { graphMouse.setMode(ModalGraphMouse.Mode.PICKING); vv.setCursor(new Cursor(Cursor.HAND_CURSOR)); setFocusable(false); } }); GraphCreate.scc = new JButton("SCC"); GraphCreate.scc.setToolTipText("Strongly Connected Components algorithm"); GraphCreate.scc.setEnabled(false); GraphCreate.scc.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { createMathgraph(); GraphCreate.scc.setEnabled(false); edit.setEnabled(false); pick.setSelected(true); setFocusable(false); sccButtonPressed = true; graphMouse.setMode(ModalGraphMouse.Mode.PICKING); vv.setCursor(new Cursor(Cursor.HAND_CURSOR)); vv.removeMouseListener(mls[1]); vv.addMouseListener(wrapper); } }); GraphCreate.clear = new JButton("Clear"); GraphCreate.clear.setToolTipText("Clears our graph"); GraphCreate.clear.setEnabled(false); GraphCreate.clear.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { for (int k = 0; k <= numberOfVertices; k++) { graph.removeVertex(k); } GraphCreate.scc.setEnabled(false); GraphCreate.clear.setEnabled(false); edit.setEnabled(true); edit.setSelected(true); setFocusable(false); graphMouse.setMode(ModalGraphMouse.Mode.EDITING); vv.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); vv.getRenderContext().setVertexFillPaintTransformer(redVertexPaint); if (sccButtonPressed) { vv.removeMouseListener(wrapper); vv.addMouseListener(mls[1]); } vv.repaint(); // calling garbage collector here Runtime r = Runtime.getRuntime(); r.gc(); GraphCreate.numberOfEdges = 0; GraphCreate.numberOfVertices = 0; sccButtonPressed = false; } }); ButtonGroup actions = new ButtonGroup(); actions.add(this.edit); actions.add(this.transform); actions.add(this.pick); this.edit.setSelected(true); this.controls.add(this.plus); this.controls.add(this.minus); this.controls.add(this.edit); this.controls.add(this.transform); this.controls.add(this.pick); this.controls.add(GraphCreate.scc); controls.add(GraphCreate.clear); this.help = new JButton("Help"); this.help.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(vv, instructions); setFocusable(false); } }); this.controls.add(this.help); content.add(this.controls, BorderLayout.SOUTH); }
From source file:com.openbravo.pos.customers.JCustomerFinder.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 www . j a v a2 s . com*/ */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new javax.swing.JPanel(); m_jKeys = new com.openbravo.editor.JEditorKeys(); jPanel3 = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel7 = new javax.swing.JPanel(); jLblTaxID = new javax.swing.JLabel(); m_jtxtTaxID = new com.openbravo.editor.JEditorString(); jLblSearchKey = new javax.swing.JLabel(); m_jtxtSearchKey = new com.openbravo.editor.JEditorString(); jLblPostal = new javax.swing.JLabel(); m_jtxtPostal = new com.openbravo.editor.JEditorString(); jLblName = new javax.swing.JLabel(); m_jtxtName = new com.openbravo.editor.JEditorString(); jLblPhone = new javax.swing.JLabel(); jLblEmail = new javax.swing.JLabel(); m_jtxtEmail = new com.openbravo.editor.JEditorString(); m_jtxtPhone = new com.openbravo.editor.JEditorString(); jPanel6 = new javax.swing.JPanel(); jcmdReset = new javax.swing.JButton(); jcmdExecute = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); jListCustomers = new javax.swing.JList(); jPanel8 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jcmdCancel = new javax.swing.JButton(); jcmdOK = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle(AppLocal.getIntString("form.customertitle")); // NOI18N setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel2.setLayout(new java.awt.BorderLayout()); jPanel2.add(m_jKeys, java.awt.BorderLayout.NORTH); getContentPane().add(jPanel2, java.awt.BorderLayout.LINE_END); jPanel3.setLayout(new java.awt.BorderLayout()); jPanel5.setLayout(new java.awt.BorderLayout()); jLblTaxID.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLblTaxID.setText(AppLocal.getIntString("label.taxid")); // NOI18N jLblTaxID.setMaximumSize(new java.awt.Dimension(120, 25)); jLblTaxID.setMinimumSize(new java.awt.Dimension(120, 25)); jLblTaxID.setPreferredSize(new java.awt.Dimension(120, 25)); m_jtxtTaxID.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtTaxID.setPreferredSize(new java.awt.Dimension(220, 25)); jLblSearchKey.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLblSearchKey.setText(AppLocal.getIntString("label.searchkey")); // NOI18N jLblSearchKey.setMaximumSize(new java.awt.Dimension(120, 25)); jLblSearchKey.setMinimumSize(new java.awt.Dimension(120, 25)); jLblSearchKey.setPreferredSize(new java.awt.Dimension(120, 25)); m_jtxtSearchKey.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtSearchKey.setPreferredSize(new java.awt.Dimension(220, 25)); jLblPostal.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLblPostal.setText("Postal"); jLblPostal.setMaximumSize(new java.awt.Dimension(120, 25)); jLblPostal.setMinimumSize(new java.awt.Dimension(120, 25)); jLblPostal.setPreferredSize(new java.awt.Dimension(120, 25)); m_jtxtPostal.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtPostal.setPreferredSize(new java.awt.Dimension(220, 25)); jLblName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLblName.setText(AppLocal.getIntString("label.prodname")); // NOI18N jLblName.setMaximumSize(new java.awt.Dimension(120, 25)); jLblName.setMinimumSize(new java.awt.Dimension(120, 25)); jLblName.setPreferredSize(new java.awt.Dimension(120, 25)); m_jtxtName.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtName.setPreferredSize(new java.awt.Dimension(220, 25)); jLblPhone.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("pos_messages"); // NOI18N jLblPhone.setText(bundle.getString("label.phone")); // NOI18N jLblPhone.setMaximumSize(new java.awt.Dimension(120, 25)); jLblPhone.setPreferredSize(new java.awt.Dimension(120, 25)); jLblEmail.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jLblEmail.setText(bundle.getString("label.companyemail")); // NOI18N jLblEmail.setMaximumSize(new java.awt.Dimension(120, 25)); jLblEmail.setMinimumSize(new java.awt.Dimension(120, 25)); jLblEmail.setPreferredSize(new java.awt.Dimension(120, 25)); m_jtxtEmail.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtEmail.setPreferredSize(new java.awt.Dimension(220, 25)); m_jtxtPhone.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N m_jtxtPhone.setPreferredSize(new java.awt.Dimension(220, 25)); jcmdReset.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jcmdReset.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/reload.png"))); // NOI18N jcmdReset.setText(bundle.getString("button.reset")); // NOI18N jcmdReset.setToolTipText("Clear Filter"); jcmdReset.setActionCommand("Reset "); jcmdReset.setFocusable(false); jcmdReset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdResetActionPerformed(evt); } }); jPanel6.add(jcmdReset); jcmdReset.getAccessibleContext().setAccessibleDescription(""); jcmdExecute.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jcmdExecute.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ok.png"))); // NOI18N jcmdExecute.setText(AppLocal.getIntString("button.executefilter")); // NOI18N jcmdExecute.setToolTipText("Execute Filter"); jcmdExecute.setFocusPainted(false); jcmdExecute.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdExecuteActionPerformed(evt); } }); jPanel6.add(jcmdExecute); jcmdExecute.getAccessibleContext().setAccessibleDescription(""); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLblPostal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLblTaxID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLblSearchKey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLblPhone, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( jLblName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel7Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(m_jtxtSearchKey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( m_jtxtTaxID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtPostal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel7Layout.createSequentialGroup() .addComponent(jLblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(m_jtxtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 35, Short.MAX_VALUE))) .addContainerGap())); jPanel7Layout .setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addGap(11, 11, 11) .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(m_jtxtTaxID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLblTaxID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(6, 6, 6) .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLblSearchKey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtSearchKey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6) .addGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLblPostal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtPostal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(m_jtxtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLblName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLblPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(m_jtxtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); m_jtxtName.getAccessibleContext().setAccessibleName(""); jPanel5.add(jPanel7, java.awt.BorderLayout.CENTER); jPanel3.add(jPanel5, java.awt.BorderLayout.PAGE_START); jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); jPanel4.setLayout(new java.awt.BorderLayout()); jListCustomers.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jListCustomers.setFocusable(false); jListCustomers.setRequestFocusEnabled(false); jListCustomers.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jListCustomersMouseClicked(evt); } }); jListCustomers.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { jListCustomersValueChanged(evt); } }); jScrollPane1.setViewportView(jListCustomers); jPanel4.add(jScrollPane1, java.awt.BorderLayout.CENTER); jPanel3.add(jPanel4, java.awt.BorderLayout.CENTER); jPanel8.setLayout(new java.awt.BorderLayout()); jcmdCancel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jcmdCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/cancel.png"))); // NOI18N jcmdCancel.setText(AppLocal.getIntString("Button.Cancel")); // NOI18N jcmdCancel.setFocusPainted(false); jcmdCancel.setFocusable(false); jcmdCancel.setMargin(new java.awt.Insets(8, 16, 8, 16)); jcmdCancel.setRequestFocusEnabled(false); jcmdCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdCancelActionPerformed(evt); } }); jPanel1.add(jcmdCancel); jcmdOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/ok.png"))); // NOI18N jcmdOK.setText(AppLocal.getIntString("Button.OK")); // NOI18N jcmdOK.setEnabled(false); jcmdOK.setFocusPainted(false); jcmdOK.setFocusable(false); jcmdOK.setMargin(new java.awt.Insets(8, 16, 8, 16)); jcmdOK.setMaximumSize(new java.awt.Dimension(103, 44)); jcmdOK.setMinimumSize(new java.awt.Dimension(103, 44)); jcmdOK.setPreferredSize(new java.awt.Dimension(103, 44)); jcmdOK.setRequestFocusEnabled(false); jcmdOK.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jcmdOKActionPerformed(evt); } }); jPanel1.add(jcmdOK); jPanel8.add(jPanel1, java.awt.BorderLayout.LINE_END); jPanel3.add(jPanel8, java.awt.BorderLayout.SOUTH); getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER); setSize(new java.awt.Dimension(613, 497)); setLocationRelativeTo(null); }
From source file:com.mirth.connect.manager.ManagerController.java
public void restartMirthWorker() { 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 = restartMirth(); return null; }/*from w w w . j a v a 2 s .c om*/ public void done() { if (errorMessage == null) { PlatformUI.MANAGER_TRAY.alertInfo("The Mirth Connect Service was restarted successfully."); } else { PlatformUI.MANAGER_TRAY.alertError(errorMessage); } updateMirthServiceStatus(); PlatformUI.MANAGER_DIALOG.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }; worker.execute(); }
From source file:org.revager.tools.GUITools.java
/** * Creates a new standard table./*from ww w. j a v a 2 s . c om*/ * * @param model * the table model * @param showHeader * true if the header of the table should be visible * * @return the newly created table */ @SuppressWarnings("serial") public static JTable newStandardTable(TableModel model, boolean showHeader) { /* * Prep. for rollover */ if (lastRolloverKey == Integer.MAX_VALUE) { lastRolloverKey = 0; } else { lastRolloverKey++; } final int keyIdx = lastRolloverKey; rollOverRowIndex.put(keyIdx, -1); final JTable table = new JTable(model) { @Override public boolean editCellAt(int row, int column, java.util.EventObject e) { boolean result = super.editCellAt(row, column, e); final Component editor = getEditorComponent(); TableCellRenderer renderer = this.getColumnModel().getColumn(column).getCellRenderer(); Font cellFont = null; if (renderer instanceof DefaultTableCellRenderer) { cellFont = ((DefaultTableCellRenderer) renderer).getFont(); } if (editor != null && editor instanceof JTextComponent) { JTextComponent jTextComponent = (JTextComponent) editor; if (e == null) { jTextComponent.selectAll(); } else { SwingUtilities.invokeLater(jTextComponent::selectAll); } jTextComponent.setBorder(UI.MARKED_BORDER_INLINE); if (cellFont != null) { jTextComponent.setFont(cellFont); } editor.requestFocusInWindow(); } return result; } @Override public TableCellRenderer getCellRenderer(int row, int column) { TableCellRenderer renderer = super.getCellRenderer(row, column); if (renderer instanceof DefaultTableCellRenderer) { ((DefaultTableCellRenderer) renderer).setBorder(new EmptyBorder(3, 3, 3, 3)); } return renderer; } @Override public Component prepareRenderer(TableCellRenderer renderer, int row, int col) { Component comp = super.prepareRenderer(renderer, row, col); // Rollover comp.setBackground(getBackground()); comp = super.prepareRenderer(renderer, row, col); if (!isRowSelected(row) && row == rollOverRowIndex.get(keyIdx)) { comp.setForeground(getForeground()); comp.setBackground(UI.BLUE_BACKGROUND_COLOR); } // Tooltips JComponent jcomp = (JComponent) comp; if (renderer instanceof DefaultTableCellRenderer) { String toolTip = ((DefaultTableCellRenderer) renderer).getToolTipText(); if (!StringUtils.isEmpty(toolTip)) { jcomp.setToolTipText(toolTip); } } return comp; } }; // Table properties table.setRowHeight(UI.TABLE_ROW_HEIGHT); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setShowGrid(false); table.setShowHorizontalLines(true); table.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); // Rollover MouseInputAdapter rolloverListener = new MouseInputAdapter() { @Override public void mouseExited(MouseEvent e) { rollOverRowIndex.put(keyIdx, -1); table.repaint(); } @Override public void mouseMoved(MouseEvent e) { int row = table.rowAtPoint(e.getPoint()); if (row != rollOverRowIndex.get(keyIdx)) { rollOverRowIndex.put(keyIdx, row); table.repaint(); } } }; table.addMouseMotionListener(rolloverListener); table.addMouseListener(rolloverListener); // Header if (!showHeader) { table.setTableHeader(null); } return table; }
From source file:edu.harvard.mcz.imagecapture.ImageCaptureApp.java
/** * Carry out actions to set user interface into nobody logged in yet state. */// w w w.ja v a 2 s .c o m public static void doStartUpNot() { Singleton.getSingletonInstance().getMainFrame().setStatusMessage("Select File/Change User to login."); Singleton.getSingletonInstance().getMainFrame() .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); Singleton.getSingletonInstance().getMainFrame().setState(MainFrame.STATE_RESET); }
From source file:JavaXWin.java
public WindowWatcher(JDesktopPane desktop) { m_desktop = desktop;/* w ww . j av a2 s .co m*/ setOpaque(true); m_northResizer = new NorthResizeEdge(this); m_southResizer = new SouthResizeEdge(this); m_eastResizer = new EastResizeEdge(this); m_westResizer = new WestResizeEdge(this); setLayout(new BorderLayout()); add(m_northResizer, BorderLayout.NORTH); add(m_southResizer, BorderLayout.SOUTH); add(m_eastResizer, BorderLayout.EAST); add(m_westResizer, BorderLayout.WEST); MouseInputAdapter ma = new MouseInputAdapter() { public void mousePressed(MouseEvent e) { m_XDifference = e.getX(); m_YDifference = e.getY(); } public void mouseDragged(MouseEvent e) { int vx = 0; int vy = 0; if (m_desktop.getParent() instanceof JViewport) { vx = ((JViewport) m_desktop.getParent()).getViewPosition().x; vy = ((JViewport) m_desktop.getParent()).getViewPosition().y; } int w = m_desktop.getParent().getWidth(); int h = m_desktop.getParent().getHeight(); int x = getX(); int y = getY(); int ex = e.getX(); int ey = e.getY(); if ((ey + y > vy && ey + y < h + vy) && (ex + x > vx && ex + x < w + vx)) { setLocation(ex - m_XDifference + x, ey - m_YDifference + y); } else if (!(ey + y > vy && ey + y < h + vy) && (ex + x > vx && ex + x < w + vx)) { if (!(ey + y > vy) && ey + y < h + vy) setLocation(ex - m_XDifference + x, vy - m_YDifference); else if (ey + y > vy && !(ey + y < h + vy)) setLocation(ex - m_XDifference + x, (h + vy) - m_YDifference); } else if ((ey + y > vy && ey + y < h + vy) && !(ex + x > vx && ex + x < w + vx)) { if (!(ex + x > vx) && ex + x < w + vx) setLocation(vx - m_XDifference, ey - m_YDifference + y); else if (ex + x > vx && !(ex + x < w)) setLocation((w + vx) - m_XDifference, ey - m_YDifference + y); } else if (!(ey + y > vy) && ey + y < h + vy && !(ex + x > vx) && ex + x < w + vx) setLocation(vx - m_XDifference, vy - m_YDifference); else if (!(ey + y > vy) && ey + y < h + vy && ex + x > vx && !(ex + x < w + vx)) setLocation((w + vx) - m_XDifference, vy - m_YDifference); else if (ey + y > vy && !(ey + y < h + vy) && !(ex + x > vx) && ex + x < w + vx) setLocation(vx - m_XDifference, (h + vy) - m_YDifference); else if (ey + y > vy && !(ey + y < h + vy) && ex + x > vx && !(ex + x < w + vx)) setLocation((w + vx) - m_XDifference, (h + vy) - m_YDifference); } public void mouseEntered(MouseEvent e) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } public void mouseExited(MouseEvent e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }; addMouseListener(ma); addMouseMotionListener(ma); }
From source file:org.ut.biolab.medsavant.client.variant.ImportVariantsWizard.java
private AbstractWizardPage getAddTagsPage() { //setup page/*w ww . j a va 2s .c o m*/ final DefaultWizardPage page = new DefaultWizardPage("Add Tags") { @Override public void setupWizardButtons() { fireButtonEvent(ButtonEvent.HIDE_BUTTON, ButtonNames.FINISH); fireButtonEvent(ButtonEvent.SHOW_BUTTON, ButtonNames.BACK); fireButtonEvent(ButtonEvent.ENABLE_BUTTON, ButtonNames.NEXT); } }; page.addText("Variants can be filtered by tag value in the Filter section."); page.addText("Add tags for this set of variants:"); final String[] patternExamples = { "<Tag Name>", "Sequencer", "Sequencer Version", "Variant Caller", "Variant Caller Version", "Technician" }; locationField = new JComboBox(patternExamples); locationField.setEditable(true); final JPanel tagContainer = new JPanel(); ViewUtil.applyVerticalBoxLayout(tagContainer); final JTextField valueField = new JTextField(); final String startingValue = "<Value>"; valueField.setText(startingValue); final JTextArea ta = new JTextArea(); ta.setRows(10); ta.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); ta.setEditable(false); JLabel button = ViewUtil.createIconButton(IconFactory.getInstance().getIcon(IconFactory.StandardIcon.ADD)); button.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (locationField.getSelectedItem().toString().isEmpty()) { DialogUtils.displayError("Tag cannot be empty"); locationField.requestFocus(); return; } else if (locationField.getSelectedItem().toString().equals(patternExamples[0])) { DialogUtils.displayError("Enter a valid tag name"); locationField.requestFocus(); return; } if (valueField.getText().toString().isEmpty()) { DialogUtils.displayError("Value cannot be empty"); valueField.requestFocus(); return; } else if (valueField.getText().equals(startingValue)) { DialogUtils.displayError("Enter a valid value"); valueField.requestFocus(); return; } VariantTag tag = new VariantTag((String) locationField.getSelectedItem(), valueField.getText()); variantTags.add(tag); ta.append(tag.toString() + "\n"); valueField.setText(""); } }); JPanel container2 = new JPanel(); ViewUtil.clear(container2); ViewUtil.applyHorizontalBoxLayout(container2); container2.add(locationField); container2.add(ViewUtil.clear(new JLabel(" = "))); container2.add(valueField); container2.add(button); page.addComponent(container2); locationField.setToolTipText("Current display range"); locationField.setPreferredSize(LOCATION_SIZE); locationField.setMinimumSize(LOCATION_SIZE); valueField.setPreferredSize(LOCATION_SIZE); valueField.setMinimumSize(LOCATION_SIZE); page.addComponent(tagContainer); page.addComponent(new JScrollPane(ta)); JButton clear = new JButton("Clear"); clear.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) { variantTags.clear(); ta.setText(""); addDefaultTags(variantTags, ta); } }); addDefaultTags(variantTags, ta); page.addComponent(ViewUtil.alignRight(clear)); return page; }
From source file:nz.govt.natlib.ndha.manualdeposit.CMSSearchResults.java
public void setWaitCursor(boolean isWaiting) { // NOPMD glass.setVisible(isWaiting);// w w w . j a va2 s.c om if (isWaiting) { final Cursor hourglass = new Cursor(Cursor.WAIT_CURSOR); setCursor(hourglass); } else { final Cursor normal = new Cursor(Cursor.DEFAULT_CURSOR); setCursor(normal); } }