/** * */ public void startEditingAtCell(Object cell) { startEditingAtCell(cell, null); }
/** * */ public void startEditingAtCell(Object cell) { startEditingAtCell(cell, null); }
/** * */ public void startEditing() { startEditingAtCell(null); }
/** * */ public void startEditing() { startEditingAtCell(null); }
private void multiEditSpotName( final ArrayList< mxCell > vertices, final EventObject triggerEvent ) { /* * We want to display the editing window in the cell that is the closer * to where the user clicked. That is not perfect, because we can * imagine the click is made for from the selected cells, and that the * editing window will not even be displayed on the screen. No idea for * that yet, because JGraphX is expecting to receive a cell as location * for the editing window. */ final mxCell tc = getClosestCell( vertices ); vertices.remove( tc ); final mxGraphComponent graphComponent = trackScheme.getGUI().graphComponent; graphComponent.startEditingAtCell( tc, triggerEvent ); graphComponent.addListener( mxEvent.LABEL_CHANGED, new mxIEventListener() { @Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } ); }
private void multiEditSpotName( final ArrayList< mxCell > vertices, final EventObject triggerEvent ) { /* * We want to display the editing window in the cell that is the closer * to where the user clicked. That is not perfect, because we can * imagine the click is made for from the selected cells, and that the * editing window will not even be displayed on the screen. No idea for * that yet, because JGraphX is expecting to receive a cell as location * for the editing window. */ final mxCell tc = getClosestCell( vertices ); vertices.remove( tc ); final mxGraphComponent graphComponent = trackScheme.getGUI().graphComponent; graphComponent.startEditingAtCell( tc, triggerEvent ); graphComponent.addListener( mxEvent.LABEL_CHANGED, new mxIEventListener() { @Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } ); }
public void mouseReleased(MouseEvent e) { if (isEnabled()) { if (!e.isConsumed() && isEditEvent(e)) { Object cell = getCellAt(e.getX(), e.getY(), false); if (cell != null && getGraph().isCellEditable(cell)) { startEditingAtCell(cell, e); } } else { // Other languages use focus traversal here, in Java // we explicitely stop editing after a click elsewhere stopEditing(!invokesStopCellEditing); } } }
public void mouseReleased(MouseEvent e) { if (isEnabled()) { if (!e.isConsumed() && isEditEvent(e)) { Object cell = getCellAt(e.getX(), e.getY(), false); if (cell != null && getGraph().isCellEditable(cell)) { startEditingAtCell(cell, e); } } else { // Other languages use focus traversal here, in Java // we explicitely stop editing after a click elsewhere stopEditing(!invokesStopCellEditing); } } }