/** * */ public boolean isConnectable() { return connectionHandler.isEnabled(); }
/** * @param connectable */ public void setConnectable(boolean connectable) { connectionHandler.setEnabled(connectable); }
/** * */ protected mxConnectionHandler createConnectionHandler() { return new mxConnectionHandler(this); }
protected boolean intersects(mxCellState state, MouseEvent e) { if (!isHighlighting() || isConnecting()) { return true; } return super.intersects(state, e); } };
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("graph")) { removeGraphListeners((mxGraph) evt.getOldValue()); addGraphListeners((mxGraph) evt.getNewValue()); } } });
if (isActive()) && (marker.hasValidState() || isCreateTarget() || graph .isAllowDanglingEdges())) if (!marker.hasValidState() && isCreateTarget()) Object vertex = createTargetVertex(e, source.getCell()); dropTarget = graph.getDropTarget( new Object[] { vertex }, e.getPoint(), reset();
/** * */ public void mousePressed(MouseEvent e) { if (!graphComponent.isForceMarqueeEvent(e) && !graphComponent.isPanningEvent(e) && !e.isPopupTrigger() && graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && ((isHighlighting() && marker.hasValidState()) || (!isHighlighting() && bounds != null && bounds.contains(e.getPoint())))) { start(e, marker.getValidState()); e.consume(); } }
protected Object getCell(MouseEvent e) { Object cell = super.getCell(e); if (isConnecting()) { if (source != null) { error = validateConnection(source.getCell(), cell); if (error != null && error.length() == 0) { cell = null; // Enables create target inside groups if (createTarget) { error = null; } } } } else if (!isValidSource(cell)) { cell = null; } return cell; }
/** * Toggles whether drag-&-drop linking is allowed. * * @return the current settings value, after toggling. */ public boolean toggleLinking() { final boolean enabled = gui.graphComponent.getConnectionHandler().isEnabled(); gui.graphComponent.getConnectionHandler().setEnabled( !enabled ); return !enabled; }
connectPreview = createConnectPreview(); addGraphListeners(graphComponent.getGraph());
String ret = super.validateConnection(source, target);
protected boolean isValidState(mxCellState state) { if (isConnecting()) { return error == null; } else { return super.isValidState(state); } }
if (isActive()) && (marker.hasValidState() || isCreateTarget() || graph .isAllowDanglingEdges())) if (!marker.hasValidState() && isCreateTarget()) Object vertex = createTargetVertex(e, source.getCell()); dropTarget = graph.getDropTarget( new Object[] { vertex }, e.getPoint(), reset();
/** * */ public void mousePressed(MouseEvent e) { if (!graphComponent.isForceMarqueeEvent(e) && !graphComponent.isPanningEvent(e) && !e.isPopupTrigger() && graphComponent.isEnabled() && isEnabled() && !e.isConsumed() && ((isHighlighting() && marker.hasValidState()) || (!isHighlighting() && bounds != null && bounds.contains(e.getPoint())))) { start(e, marker.getValidState()); e.consume(); } }
protected Object getCell(MouseEvent e) { Object cell = super.getCell(e); if (isConnecting()) { if (source != null) { error = validateConnection(source.getCell(), cell); if (error != null && error.length() == 0) { cell = null; // Enables create target inside groups if (createTarget) { error = null; } } } } else if (!isValidSource(cell)) { cell = null; } return cell; }
/** * Toggles whether drag-&-drop linking is allowed. * * @return the current settings value, after toggling. */ public boolean toggleLinking() { final boolean enabled = gui.graphComponent.getConnectionHandler().isEnabled(); gui.graphComponent.getConnectionHandler().setEnabled( !enabled ); return !enabled; }
protected Color getMarkerColor(MouseEvent e, mxCellState state, boolean isValid) { return (isHighlighting() || isConnecting()) ? super .getMarkerColor(e, state, isValid) : null; }
public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("graph")) { removeGraphListeners((mxGraph) evt.getOldValue()); addGraphListeners((mxGraph) evt.getNewValue()); } } });