/** * Subclassers can override this to decide whether or not "port magic" * should appear on a given edge. (Port magic means the port tries to make * the edge horizontal or vertical if the closest control point lies within * the bounds of the parent vertex.) */ protected boolean shouldInvokePortMagic(EdgeView edge) { return allowPortMagic && !(getParentView() instanceof EdgeView) && edge.getPointCount() > 2 && GraphConstants.getLineStyle(edge.getAllAttributes()) == GraphConstants.STYLE_ORTHOGONAL; }
CellView vertex = getParentView(); Point2D pos = null; if (vertex != null) {
/** * Description of the Method * *@param g Description of Parameter */ protected void paintPort(Graphics g) { // If Current Port is Valid if (port != null) { // If Not Floating Port... boolean o = (GraphConstants.getOffset(port.getAttributes()) != null); // ...Then use Parent's Bounds Rectangle r = (o) ? port.getBounds().getBounds() : port.getParentView().getBounds().getBounds(); // Scale from Model to Screen r = getGraph().toScreen(new Rectangle(r)).getBounds(); // Add Space For the Highlight Border r.setBounds(r.x - 3, r.y - 3, r.width + 6, r.height + 6); // Paint Port in Preview (=Highlight) Mode //getGraph().getUI().paintCell(g, port, r, true); } }