public int getRadius() { return shape.getRadius(); }
public boolean isLineOriented() { return shape.isLineOriented(); }
boolean isSourceCutDistance = sourceAnchorShape.getCutDistance () != 0.0; boolean isTargetCutDistance = targetAnchorShape.getCutDistance () != 0.0; firstControlPoint != null && (sourceAnchorShape.isLineOriented () || isSourceCutDistance) ? getSourceAnchorShapeRotation () : 0.0; double lastControlPointRotation = lastControlPoint != null && (targetAnchorShape.isLineOriented () || isTargetCutDistance) ? getTargetAnchorShapeRotation () : 0.0; points = new ArrayList<Point> (controlPoints); points.set (0, new Point ( firstControlPoint.x + (int) (sourceAnchorShape.getCutDistance () * Math.cos (firstControlPointRotation)), firstControlPoint.y + (int) (sourceAnchorShape.getCutDistance () * Math.sin (firstControlPointRotation)) )); points.set (controlPoints.size () - 1, new Point ( lastControlPoint.x + (int) (targetAnchorShape.getCutDistance () * Math.cos (lastControlPointRotation)), lastControlPoint.y + (int) (targetAnchorShape.getCutDistance () * Math.sin (lastControlPointRotation)) )); } else { previousTransform = gr.getTransform (); gr.translate (firstControlPoint.x, firstControlPoint.y); if (sourceAnchorShape.isLineOriented ()) gr.rotate (firstControlPointRotation); sourceAnchorShape.paint (gr, true); gr.setTransform (previousTransform);
public void paint(Graphics2D graphics, boolean source) { int distance = getAdditionalDistance(); graphics.translate(distance, 0); shape.paint(graphics, source); graphics.translate(-distance, 0); }
public double getCutDistance() { return shape.getCutDistance() + getAdditionalDistance(); }
boolean isSourceCutDistance = sourceAnchorShape.getCutDistance () != 0.0; boolean isTargetCutDistance = targetAnchorShape.getCutDistance () != 0.0; firstControlPoint != null && (sourceAnchorShape.isLineOriented () || isSourceCutDistance) ? getSourceAnchorShapeRotation () : 0.0; double lastControlPointRotation = lastControlPoint != null && (targetAnchorShape.isLineOriented () || isTargetCutDistance) ? getTargetAnchorShapeRotation () : 0.0; points = new ArrayList<Point> (controlPoints); points.set (0, new Point ( firstControlPoint.x + (int) (sourceAnchorShape.getCutDistance () * Math.cos (firstControlPointRotation)), firstControlPoint.y + (int) (sourceAnchorShape.getCutDistance () * Math.sin (firstControlPointRotation)) )); points.set (controlPoints.size () - 1, new Point ( lastControlPoint.x + (int) (targetAnchorShape.getCutDistance () * Math.cos (lastControlPointRotation)), lastControlPoint.y + (int) (targetAnchorShape.getCutDistance () * Math.sin (lastControlPointRotation)) )); } else { previousTransform = gr.getTransform (); gr.translate (firstControlPoint.x, firstControlPoint.y); if (sourceAnchorShape.isLineOriented ()) gr.rotate (firstControlPointRotation); sourceAnchorShape.paint (gr, true); gr.setTransform (previousTransform);
public void paint(Graphics2D graphics, boolean source) { int distance = getAdditionalDistance(); graphics.translate(distance, 0); shape.paint(graphics, source); graphics.translate(-distance, 0); }
public double getCutDistance() { return shape.getCutDistance() + getAdditionalDistance(); }
public int getRadius() { return shape.getRadius(); }
public boolean isLineOriented() { return shape.isLineOriented(); }
/** * Sets the anchor shape of the source of the connection widget. * @param sourceAnchorShape the source anchor shape */ public void setSourceAnchorShape (AnchorShape sourceAnchorShape) { assert sourceAnchorShape != null; boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius (); this.sourceAnchorShape = sourceAnchorShape; revalidate (repaintOnly); }
/** * Sets the anchor shape of the target of the connection widget. * @param targetAnchorShape the target anchor shape */ public void setTargetAnchorShape (AnchorShape targetAnchorShape) { assert targetAnchorShape != null; boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius (); this.targetAnchorShape = targetAnchorShape; revalidate (repaintOnly); }
/** * Sets the anchor shape of the target of the connection widget. * @param targetAnchorShape the target anchor shape */ public void setTargetAnchorShape (AnchorShape targetAnchorShape) { assert targetAnchorShape != null; boolean repaintOnly = this.targetAnchorShape.getRadius () == targetAnchorShape.getRadius (); this.targetAnchorShape = targetAnchorShape; revalidate (repaintOnly); }
/** * Sets the anchor shape of the source of the connection widget. * @param sourceAnchorShape the source anchor shape */ public void setSourceAnchorShape (AnchorShape sourceAnchorShape) { assert sourceAnchorShape != null; boolean repaintOnly = this.sourceAnchorShape.getRadius () == sourceAnchorShape.getRadius (); this.sourceAnchorShape = sourceAnchorShape; revalidate (repaintOnly); }