Package org.openbp.cockpit.modeler.drawing

Examples of org.openbp.cockpit.modeler.drawing.WorkspaceDrawingView.applyScale()


    // ALT key pressed. Move the drawing accordingly using heuristic values.
    int xDiff = CommonUtil.rnd((e.getX() - lastPoint.x) / 1.5);
    int yDiff = CommonUtil.rnd((e.getY() - lastPoint.y) / 1.5);

    // Convert to document coordinates
    xDiff = view.applyScale(xDiff, true);
    yDiff = view.applyScale(yDiff, true);

    if (xDiff != 0 || yDiff != 0)
    {
      ((Trackable) getEditor()).moveTrackerBy(xDiff, yDiff);
View Full Code Here


    int xDiff = CommonUtil.rnd((e.getX() - lastPoint.x) / 1.5);
    int yDiff = CommonUtil.rnd((e.getY() - lastPoint.y) / 1.5);

    // Convert to document coordinates
    xDiff = view.applyScale(xDiff, true);
    yDiff = view.applyScale(yDiff, true);

    if (xDiff != 0 || yDiff != 0)
    {
      ((Trackable) getEditor()).moveTrackerBy(xDiff, yDiff);
    }
View Full Code Here

    if (flavors.contains(ModelerFlavors.COLOR))
    {
      // Use the whole section as target
      Rectangle r = presentationFigure.displayBox();
      r = view.applyScale(r, false);
      return Collections.singletonList(new ViewDropRegion(REGION_COLOR, this, r, view));
    }

    String regionId = null;
    if (flavors.contains(ClientFlavors.TYPE_ITEM))
View Full Code Here

        {
          List result = new ArrayList();
          for (int i = 0; i < bounds.length; i++)
          {
            // Add a green drop region with a small black border around each parameter
            Rectangle r = view.applyScale(bounds[i], false);

            ViewDropRegion region = new ViewDropRegion(regionId + ":" + i, this, r, view);
            region.setPaint(ModelerColors.DROP_REGION);
            region.setFrameColor(Color.BLACK);
View Full Code Here

        }

        // Params are not shown, so we need only a single region.
        // Use the whole section as target
        Rectangle r = presentationFigure.displayBox();
        r = view.applyScale(r, false);
        ViewDropRegion region = new ViewDropRegion(regionId, this, r, view);
        region.setPaint(ModelerColors.DROP_REGION);
        return Collections.singletonList(region);
      }
    }
View Full Code Here

    // We are a region
    WorkspaceDrawingView view = getDrawing().getView();

    RectangularShape shape = presentationFigure.createRectangularShape();
    Rectangle r = presentationFigure.displayBox();
    r = view.applyScale(r, false);
    shape.setFrame(r);

    Color color = ModelerColors.DROP_REGION;
    if (flavors.contains(ModelerFlavors.COLOR))
      color = null;
View Full Code Here

      }
      else
      {
        r = new Rectangle();
      }
      r = view.applyScale(r, false);

      ViewDropRegion region = new ViewDropRegion("global", this, r, view);
      region.setPaint(ModelerColors.DROP_REGION);
      return Collections.singletonList(region);
    }
View Full Code Here

  {
    if (flavors.contains(ModelerFlavors.COLOR))
    {
      // Use the whole figure as target
      WorkspaceDrawingView view = getDrawing().getView();
      Rectangle r = view.applyScale(displayBox(), false);
      return Collections.singletonList(new ViewDropRegion(REGION_COLOR, this, r, view));
    }

    return null;
  }
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.