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 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) { } }
@Override public void mouseMoved(MouseEvent e) { Point pt = e.getPoint(); int prevRow = row; int prevCol = col; row = table.rowAtPoint(pt); col = table.columnAtPoint(pt); if (row < 0 || col < 0) { row = -1; col = -1; } // >>>> HyperlinkCellRenderer.java // @see // http://java.net/projects/swingset3/sources/svn/content/trunk/SwingSet3/src/com/sun/swingset3/demos/table/HyperlinkCellRenderer.java if (row == prevRow && col == prevCol) { return; } Rectangle repaintRect; if (row >= 0 && col >= 0) { Rectangle r = table.getCellRect(row, col, false); if (prevRow >= 0 && prevCol >= 0) { repaintRect = r.union(table.getCellRect(prevRow, prevCol, false)); } else { repaintRect = r; } } else { repaintRect = table.getCellRect(prevRow, prevCol, false); } table.repaint(repaintRect); // <<<< // table.repaint(); }
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(); } }
protected void internalDoubleClick(MouseEvent e) { if (!(e.getComponent() instanceof JComponent)) return; JComponent inComponent = (JComponent) e.getComponent(); if (inComponent instanceof JTable) { JTable thisTable = (JTable) inComponent; int rowPoint = thisTable.rowAtPoint(new Point(e.getX(), e.getY())); Searcher whichSearch = (Searcher) thisTable.getValueAt(rowPoint, -1); whichSearch.execute(); } }
@Nullable private SvnFileRevision getSelectedRevision(final MouseEvent e) { JTable table = (JTable) e.getSource(); int row = table.rowAtPoint(e.getPoint()); int column = table.columnAtPoint(e.getPoint()); final Object value = table.getModel().getValueAt(row, column); if (value instanceof SvnFileRevision) { return (SvnFileRevision) value; } return null; }
protected void selectEditor(MouseEvent e) { int row; if (e == null) { row = table.getSelectionModel().getAnchorSelectionIndex(); } else { row = table.rowAtPoint(e.getPoint()); } editor = (TableCellEditor) editors.get(new Integer(row)); if (editor == null) { editor = defaultEditor; } }
@Override public void mouseClicked(MouseEvent e) { int col = table.columnAtPoint(new Point(e.getX(), e.getY())); String header = table.getColumnName(col); if (columnHeader.contains(header)) { int row = table.rowAtPoint(new Point(e.getX(), e.getY())); TableModel tableModel = table.getModel(); Object val = tableModel.getValueAt( table.convertRowIndexToModel(row), table.convertColumnIndexToModel(col)); if (val != null) { String text = val.toString(); textDialog.setText(text); textDialog.setVisible(true); } } }
private int getResizingRow(Point p) { return getResizingRow(p, table.rowAtPoint(p)); }