public void mouseDragged(MouseEvent e) { if (isEnabled()) { // System.out.println("LinkTool::mouseDragged"); if (e.getSource() instanceof ONLGraphic) buttonAction.setIntermediate(e.getPoint(), (ONLGraphic) e.getSource()); } }
public void mousePressed(MouseEvent e) { if (ltool.isEnabled()) { startComponent = ((ONLComponentButton) e.getSource()).getONLComponent(); if (startComponent instanceof GigEDescriptor) { ExpCoordinator.print( new String( "LinkTool.ComponentListener.mousePressed gige startComponent:" + startComponent.getLabel()), TEST_GIGE); startComponent = ((GigEDescriptor) startComponent).getUnlinkedPort(); if (startComponent != null) ExpCoordinator.print( new String(" unlinked port: " + startComponent.getLabel()), TEST_GIGE); else ExpCoordinator.print(" unlinked port: null", TEST_GIGE); } if (startComponent instanceof HardwareHost) startComponent = ((HardwareHost) startComponent).getPort(0); endComponent = null; if (startComponent.isLinkable() && (!startComponent.isLinked())) { LinkDescriptor ld = ltool.createLinkDescriptor( startComponent); // new LinkDescriptor(ltool.getNextLabel(), startComponent, // ltool.currentBW, ltool.expCoordinator); linkGraphic = (LinkGraphic) ld.getGraphic(); if (linkGraphic.getONLComponent() == null) ExpCoordinator.print("LinkTool.ComponentListener::mousePressed onlcomp == null", 2); // linkGraphic = new LinkGraphic(); // linkGraphic.setPoint1(startComponent.getGraphic()); linkGraphic.setVisible(true); ltool .getTopologyPanel() .addLink(linkGraphic); // expCoordinator.getMainWindow().getTopologyPanel() // System.out.println("LinkTool.ComponentListener::mousePressed component " + // startComponent.getLabel()); setIntermediate( e.getPoint(), ((ONLComponentButton) e.getSource()).getONLComponent().getGraphic()); } else { ExpCoordinator.print( new String( "LinkTool::mousePressed startComponent " + startComponent.getLabel() + " is Linked"), 2); startComponent = null; ltool.setEnabled(false); } } }
public void mouseClicked(MouseEvent e) { JTableHeader h = (JTableHeader) e.getSource(); TableColumnModel columnModel = h.getColumnModel(); int viewColumn = columnModel.getColumnIndexAtX(e.getX()); int column = columnModel.getColumn(viewColumn).getModelIndex(); if (column != -1) { sorting_column = column; // 0 == priority icon column // 4 == priority text column if (column == 0) sorting_column = 4; if (e.isControlDown()) sorting_column = -1; else opposite = !opposite; TaskTable treetable = ((TaskTable) h.getTable()); // java.util.Collection expanded = treetable.getExpandedTreeNodes(); treetable.tableChanged(); // treetable.setExpandedTreeNodes(expanded); // h.updateUI(); h.resizeAndRepaint(); } }
public void mouseMoved(MouseEvent ev) { JRootPane root = getRootPane(); if (root.getWindowDecorationStyle() == JRootPane.NONE) { return; } Window w = (Window) ev.getSource(); Frame f = null; Dialog d = null; if (w instanceof Frame) { f = (Frame) w; } else if (w instanceof Dialog) { d = (Dialog) w; } // Update the cursor int cursor = getCursor(calculateCorner(w, ev.getX(), ev.getY())); if (cursor != 0 && ((f != null && (f.isResizable() && (f.getExtendedState() & Frame.MAXIMIZED_BOTH) == 0)) || (d != null && d.isResizable()))) { w.setCursor(Cursor.getPredefinedCursor(cursor)); } else { w.setCursor(lastCursor); } }
public void mousePressed(MouseEvent e) { if (e.getButton() != MouseEvent.BUTTON1) { return; } if (e.getClickCount() != 2) { return; } JTable table = (JTable) e.getSource(); Point p = e.getPoint(); int row = table.rowAtPoint(p); if (row < 0) { return; } FinderTableModel model = getDataModel(); ICFSecurityISOTimezoneObj o = (ICFSecurityISOTimezoneObj) model.getValueAt(row, COLID_ROW_HEADER); if (o == null) { return; } JInternalFrame frame = swingSchema.getISOTimezoneFactory().newViewEditJInternalFrame(o); ((ICFSecuritySwingISOTimezoneJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); if (frame == null) { return; } Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } }
public void mouseClicked(MouseEvent ev) { Window w = (Window) ev.getSource(); Frame f = null; if (w instanceof Frame) { f = (Frame) w; } else { return; } Point convertedPoint = SwingUtilities.convertPoint(w, ev.getPoint(), getTitlePane()); int state = f.getExtendedState(); if (getTitlePane() != null && getTitlePane().contains(convertedPoint)) { if ((ev.getClickCount() % 2) == 0 && ((ev.getModifiers() & InputEvent.BUTTON1_MASK) != 0)) { if (f.isResizable()) { if ((state & Frame.MAXIMIZED_BOTH) != 0) { f.setExtendedState(state & ~Frame.MAXIMIZED_BOTH); } else { f.setExtendedState(state | Frame.MAXIMIZED_BOTH); } return; } } } }
@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { doubleClicked((JComponent) e.getSource()); } super.mouseClicked(e); }
public void mousePressed(MouseEvent e) { if (e.getButton() != MouseEvent.BUTTON1) { return; } if (e.getClickCount() != 2) { return; } JTable table = (JTable) e.getSource(); Point p = e.getPoint(); int row = table.rowAtPoint(p); if (row < 0) { return; } PickerTableModel model = getDataModel(); ICFInternetISOCountryObj o = (ICFInternetISOCountryObj) model.getValueAt(row, COLID_ROW_HEADER); invokeWhenChosen.choseISOCountry(o); try { Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { ((JInternalFrame) cont).setClosed(true); } } catch (Exception x) { } }
public void mouseExited(MouseEvent e) { if (ltool.isEnabled() && startComponent != null && endComponent != null) { if (endComponent == ((ONLComponentButton) e.getSource()).getONLComponent()) endComponent = null; // if (endComponent != null) System.out.println("LinkTool.ComponentListener::mouseEntered // component " + endComponent.getLabel()); } }
public void mouseDragged(MouseEvent e) { if (ltool.isEnabled()) { // System.out.println("LinkTool.ComponentListener::mouseDragged"); // translate point to real coordinates since point is in relation to the source component setIntermediate( e.getPoint(), ((ONLComponentButton) e.getSource()).getONLComponent().getGraphic()); } }
public void mousePressed(MouseEvent e) { if (e.getClickCount() == 2) { JList list = (JList) e.getSource(); int index = list.locationToIndex(e.getPoint()); optionPane.setInputValue(list.getModel().getElementAt(index)); } }
public void mouseEntered(MouseEvent e) { if (ltool.isEnabled()) { endComponent = ((ONLComponentButton) e.getSource()).getONLComponent(); if (endComponent instanceof HardwareHost) endComponent = ((HardwareHost) endComponent).getPort(0); // System.out.println("LinkTool.ComponentListener::mouseEntered component " + // endComponent.getLabel()); } }
public void mouseExited(MouseEvent e) { JButton jbutton = (JButton) e.getSource(); int comm = Integer.parseInt(jbutton.getActionCommand()); int today = getNowCalendar().get(Calendar.DAY_OF_MONTH); if (comm == today) { jbutton.setBackground(todayBtnColor); } else { jbutton.setBackground(palletTableColor); } }
public void mouseClicked(MouseEvent e) { if (e.getSource() == bottomText) { try { getAppletContext().showDocument(new URL(linkURL), "_blank"); } catch (java.net.MalformedURLException ex) { } } else { maybeShowPopup(e); } }
public void mousePressed(MouseEvent e) { if (e.getButton() != MouseEvent.BUTTON1) { return; } if (e.getClickCount() != 2) { return; } JTable table = (JTable) e.getSource(); Point p = e.getPoint(); int row = table.rowAtPoint(p); if (row < 0) { return; } ListTableModel model = getDataModel(); ICFInternetVersionObj o = (ICFInternetVersionObj) model.getValueAt(row, COLID_ROW_HEADER); if (o == null) { return; } JInternalFrame frame = null; String classCode = o.getClassCode(); if (classCode.equals("VERN")) { frame = swingSchema.getVersionFactory().newViewEditJInternalFrame(o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("MJVR")) { frame = swingSchema .getMajorVersionFactory() .newViewEditJInternalFrame((ICFInternetMajorVersionObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMajorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("MNVR")) { frame = swingSchema .getMinorVersionFactory() .newViewEditJInternalFrame((ICFInternetMinorVersionObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMinorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else { frame = null; } if (frame == null) { return; } Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } }
@Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { JTable table = (JTable) e.getSource(); ListTableModel<PatientModel> tableModel = getTableModel(); PatientModel value = (PatientModel) tableModel.getObject(table.getSelectedRow()); if (value != null) { openKarte(); } } }
@Override public void mousePressed(MouseEvent e) { Object o = e.getSource(); if (o instanceof TableCellEditor) { actionPerformed(null); } else if (o instanceof JButton) { // DEBUG: view button click -> control key down + edit button(same cell) press -> remain // selection color ButtonModel m = ((JButton) e.getComponent()).getModel(); if (m.isPressed() && table.isRowSelected(table.getEditingRow()) && e.isControlDown()) { setBackground(table.getBackground()); } } }
/** Handles mouse dragged event */ public void mouseDragged(MouseEvent ev) { Window w = (Window) ev.getSource(); if (isMovingWindow) { Point windowPt; try { windowPt = (Point) AccessController.doPrivileged(getLocationAction); windowPt.x = windowPt.x - dragOffsetX; windowPt.y = windowPt.y - dragOffsetY; w.setLocation(windowPt); windowMoved = true; } catch (PrivilegedActionException e) { } } }
public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 1) { JButton source = (JButton) e.getSource(); String value = source.getText(); int day = Integer.parseInt(value); calendar.set(Calendar.DAY_OF_MONTH, day); Date selectDate = this.getSelectDate(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); MyDateChooseBtn.this.setText(simpleDateFormat.format(selectDate)); Jtext.setText(simpleDateFormat.format(selectDate)); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH) + 1; // System.out.println(year + "骞�" + month + "鏈�" + day + "鏃�"); f.dispose(); } }
public void mousePressed(MouseEvent ev) { JRootPane rootPane = getRootPane(); if (rootPane.getWindowDecorationStyle() == JRootPane.NONE) { return; } Point dragWindowOffset = ev.getPoint(); Window w = (Window) ev.getSource(); if (w != null) { w.toFront(); } Point convertedDragWindowOffset = SwingUtilities.convertPoint(w, dragWindowOffset, getTitlePane()); Frame f = null; Dialog d = null; if (w instanceof Frame) { f = (Frame) w; } else if (w instanceof Dialog) { d = (Dialog) w; } int frameState = (f != null) ? f.getExtendedState() : 0; if (getTitlePane() != null && getTitlePane().contains(convertedDragWindowOffset)) { if ((f != null && ((frameState & Frame.MAXIMIZED_BOTH) == 0) || (d != null)) && dragWindowOffset.y >= BORDER_DRAG_THICKNESS && dragWindowOffset.x >= BORDER_DRAG_THICKNESS && dragWindowOffset.x < w.getWidth() - BORDER_DRAG_THICKNESS) { isMovingWindow = true; dragOffsetX = dragWindowOffset.x; dragOffsetY = dragWindowOffset.y; } } else if (f != null && f.isResizable() && ((frameState & Frame.MAXIMIZED_BOTH) == 0) || (d != null && d.isResizable())) { dragOffsetX = dragWindowOffset.x; dragOffsetY = dragWindowOffset.y; dragWidth = w.getWidth(); dragHeight = w.getHeight(); dragCursor = getCursor(calculateCorner(w, dragWindowOffset.x, dragWindowOffset.y)); } }
// int jlabel3_state=0; public void mouseClicked(MouseEvent e) { JLabel source = (JLabel) e.getSource(); if (label_state.get(source) == 0) { if (source.getName() == "jLabel11") { if (challenge_file == null) { JOptionPane.showMessageDialog(null, "Challenge File Not Loaded"); } else { reset_labelState(); active_label = (JLabel) source; label_state.put(source, 1); try { ImageIcon icon = new javax.swing.ImageIcon(getClass().getResource("resources/images/pause.jpg")); jLabel11.setIcon(icon); } catch (Exception et) { JOptionPane.showMessageDialog(null, et.toString()); } } } else { reset_labelState(); active_label = (JLabel) source; label_state.put(source, 1); } source.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.BLUE)); } else { active_label = null; label_state.put(source, 0); if (source.getName() == "jLabel11") { try { ImageIcon icon = new javax.swing.ImageIcon(getClass().getResource("resources/images/play.jpg")); jLabel11.setIcon(icon); } catch (Exception et) { JOptionPane.showMessageDialog(null, et.toString()); } } source.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, Color.BLUE)); } }
// {{{ mousePressed() method @Override public void mousePressed(MouseEvent evt) { Point p = evt.getPoint(); if (evt.getSource() != table) { p.x -= table.getX(); p.y -= table.getY(); } int row = table.rowAtPoint(p); int column = table.columnAtPoint(p); if (column == 0 && row != -1) { VFSDirectoryEntryTableModel.Entry entry = (VFSDirectoryEntryTableModel.Entry) table.getModel().getValueAt(row, 0); if (FileCellRenderer.ExpansionToggleBorder.isExpansionToggle(entry.level, p.x)) { table.toggleExpanded(row); return; } } if (GUIUtilities.isMiddleButton(evt.getModifiers())) { if (row == -1) /* nothing */ ; else if (evt.isShiftDown()) table.getSelectionModel().addSelectionInterval(row, row); else table.getSelectionModel().setSelectionInterval(row, row); } else if (GUIUtilities.isPopupTrigger(evt)) { if (popup != null && popup.isVisible()) { popup.setVisible(false); popup = null; return; } if (row == -1) showFilePopup(null, table, evt.getPoint()); else { if (!table.getSelectionModel().isSelectedIndex(row)) table.getSelectionModel().setSelectionInterval(row, row); showFilePopup(getSelectedFiles(), table, evt.getPoint()); } } } // }}}
public void mouseEntered(MouseEvent e) { if (e.getSource() == bottomText) { bottomText.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } }
public void mouseExited(MouseEvent ev) { Window w = (Window) ev.getSource(); w.setCursor(lastCursor); }
public void mouseEntered(MouseEvent ev) { Window w = (Window) ev.getSource(); lastCursor = w.getCursor(); mouseMoved(ev); }
public void mouseDragged(MouseEvent ev) { Window w = (Window) ev.getSource(); Point pt = ev.getPoint(); if (isMovingWindow) { Point windowPt; try { windowPt = (Point) AccessController.doPrivileged(getLocationAction); windowPt.x = windowPt.x - dragOffsetX; windowPt.y = windowPt.y - dragOffsetY; w.setLocation(windowPt); } catch (PrivilegedActionException e) { } } else if (dragCursor != 0) { Rectangle r = w.getBounds(); Rectangle startBounds = new Rectangle(r); Dimension min = w.getMinimumSize(); switch (dragCursor) { case Cursor.E_RESIZE_CURSOR: adjust(r, min, 0, 0, pt.x + (dragWidth - dragOffsetX) - r.width, 0); break; case Cursor.S_RESIZE_CURSOR: adjust(r, min, 0, 0, 0, pt.y + (dragHeight - dragOffsetY) - r.height); break; case Cursor.N_RESIZE_CURSOR: adjust(r, min, 0, pt.y - dragOffsetY, 0, -(pt.y - dragOffsetY)); break; case Cursor.W_RESIZE_CURSOR: adjust(r, min, pt.x - dragOffsetX, 0, -(pt.x - dragOffsetX), 0); break; case Cursor.NE_RESIZE_CURSOR: adjust( r, min, 0, pt.y - dragOffsetY, pt.x + (dragWidth - dragOffsetX) - r.width, -(pt.y - dragOffsetY)); break; case Cursor.SE_RESIZE_CURSOR: adjust( r, min, 0, 0, pt.x + (dragWidth - dragOffsetX) - r.width, pt.y + (dragHeight - dragOffsetY) - r.height); break; case Cursor.NW_RESIZE_CURSOR: adjust( r, min, pt.x - dragOffsetX, pt.y - dragOffsetY, -(pt.x - dragOffsetX), -(pt.y - dragOffsetY)); break; case Cursor.SW_RESIZE_CURSOR: adjust( r, min, pt.x - dragOffsetX, 0, -(pt.x - dragOffsetX), pt.y + (dragHeight - dragOffsetY) - r.height); break; default: break; } if (!r.equals(startBounds)) { w.setBounds(r); // Defer repaint/validate on mouseReleased unless dynamic // layout is active. if (Toolkit.getDefaultToolkit().isDynamicLayoutActive()) { w.validate(); getRootPane().repaint(); } } } }
public void mouseEntered(MouseEvent e) { JButton jbutton = (JButton) e.getSource(); jbutton.setBackground(moveButtonColor); }
public void mouseExited(MouseEvent e) { if (e.getSource() == bottomText) { bottomText.setCursor(Cursor.getDefaultCursor()); } }
public void mousePressed(MouseEvent e) { scrollTimer.start(); button = (JButton) e.getSource(); }