示例#1
0
 public Point2D.Double findStart(ConnectionFigure connection) {
   Figure startFigure = connection.getStartConnector().getOwner();
   Point2D.Double from;
   if (connection.getPointCount() <= 2 || connection.getLiner() != null) {
     if (connection.getEndConnector() == null) {
       from = connection.getEndPoint();
     } else {
       Rectangle2D.Double r1 =
           getConnectorTarget(connection.getEndConnector().getOwner()).getBounds();
       from = new Point2D.Double(r1.x + r1.width / 2, r1.y + r1.height / 2);
     }
   } else {
     from = connection.getPoint(1);
   }
   return chop(startFigure, from);
 }
 public String getToolTipText(Point p) {
   ConnectionFigure f = (ConnectionFigure) getOwner();
   if (f.getLiner() == null && savedLiner == null) {
     ResourceBundleUtil labels = ResourceBundleUtil.getLAFBundle("org.jhotdraw.draw.Labels");
     BezierPath.Node node = getBezierNode();
     return (node == null)
         ? null
         : labels.getFormatted(
             "bezierNodeHandle.tip",
             labels.getFormatted(
                 (node.getMask() == 0)
                     ? "bezierNode.linearNode"
                     : ((node.getMask() == BezierPath.C1C2_MASK)
                         ? "bezierNode.cubicNode"
                         : "bezierNode.quadraticNode")));
   } else {
     return null;
   }
 }