Package java.awt.geom

Examples of java.awt.geom.Point2D.clone()


  public boolean init(MouseEvent e) {   
    Point2D pt = editor.locatePoint(e.getPoint());
   
    if (model == null) {
      model = new LineModel()
      model.addPoint((Point2D) pt.clone());
      ctr = new PolyLineController(model)
      editor.getEditControllers().add(ctr);
      index = 0;
     
      // add property chane listener
View Full Code Here


      model.addPropertyChangeListener(editor);
    }
   
    if (e.getClickCount() == 1 && e.getButton() == MouseEvent.BUTTON1) {
      // add new point
      model.addPoint((Point2D) pt.clone());
      // add modification index
      index++;
      return false;
    }
    index = -1;
View Full Code Here

   
    if (model == null) {
      System.out.println("Init New Model");
      model = new BezierCurveModel()
      model.addPoint(pt);
      model.addPoint((Point2D) pt.clone());
      ctr = new BezierCurveController(model)
      editor.getEditControllers().add(ctr);
      index = 1;
     
      // add property change listener
View Full Code Here

      index++;
     
      if (index < 4) {
        // add new point
        System.out.println("Adding point: " + index);
        model.addPoint((Point2D) pt.clone());
      }
      // last click defines the last point
      return index > 3;
    }
    index = -1;
View Full Code Here

      }
      if (extraLabelLocations != null) {
        for (int i = 0; i < extraLabelLocations.length; i++) {
          Point2D p = er.getExtraLabelPosition(e, i);
          if (p != null) {
            p = graph.toScreen((Point2D) p.clone());
            Dimension d = er.getExtraLabelSize(graph, e, i);
            if (d != null) {
              Point2D s = graph.toScreen(new Point2D.Double(
                  d.width, d.height));
              extraLabelLocations[i].setFrame(p.getX() - s.getX()
View Full Code Here

      GraphConstants.setExtraLabelPositions(newMap,
          clonePoints(positions));
    // Clone Edge Label
    Point2D label = GraphConstants.getLabelPosition(newMap);
    if (label != null)
      GraphConstants.setLabelPosition(newMap, (Point2D) label.clone());
    return newMap;
  }

  public static class SerializablePoint2D extends Point2D.Double implements
      Serializable {
View Full Code Here

      }
      if (extraLabelLocations != null) {
        for (int i = 0; i < extraLabelLocations.length; i++) {
          Point2D p = er.getExtraLabelPosition(e, i);
          if (p != null) {
            p = graph.toScreen((Point2D) p.clone());
            Dimension d = er.getExtraLabelSize(graph, e, i);
            if (d != null) {
              Point2D s = graph.toScreen(new Point2D.Double(
                  d.width, d.height));
              extraLabelLocations[i].setFrame(p.getX() - s.getX()
View Full Code Here

      GraphConstants.setExtraLabelPositions(newMap,
          clonePoints(positions));
    // Clone Edge Label
    Point2D label = GraphConstants.getLabelPosition(newMap);
    if (label != null)
      GraphConstants.setLabelPosition(newMap, (Point2D) label.clone());
    return newMap;
  }

  public static class SerializablePoint2D extends Point2D.Double implements
      Serializable {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.