Examples of ViewDropRegion


Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

    if (regionId != null)
    {
      WorkspaceDrawingView view = getView();

      Rectangle viewSize = new Rectangle(view.getSize());
      return Collections.singletonList(new ViewDropRegion(regionId, this, viewSize, view));
    }

    return null;
  }
View Full Code Here

Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

    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))
    {
      regionId = REGION_PARAM_BY_TYPE;
    }
    else if (flavors.contains(ClientFlavors.PROCESS_VARIABLE))
    {
      regionId = REGION_PARAM_BY_VARIABLE;
    }

    if (regionId != null)
    {
      if (mouseEvent == null || ! mouseEvent.isControlDown())
      {
        // Accept type items only if the CTRL button is not pressed to prevent overlaying the region
        // exposed by the ParamFigure in this case.
        Rectangle[] bounds = getParamRegions();

        if (bounds.length > 1)
        {
          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);

            result.add(region);
          }
          return result;
        }

        // 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);
      }
    }

    return null;
View Full Code Here

Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

    Color color = ModelerColors.DROP_REGION;
    if (flavors.contains(ModelerFlavors.COLOR))
      color = null;

    ViewDropRegion region = new ViewDropRegion(regionId, this, shape, view);
    region.setPaint(color);
    return region;
  }
View Full Code Here

Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

      {
        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);
    }

    return null;
  }
View Full Code Here

Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

    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

Examples of org.openbp.jaspira.gui.interaction.ViewDropRegion

  public List getDropRegions(List flavors, Transferable data, MouseEvent mouseEvent)
  {
    if (acceptDrop())
    {
      if (flavors.contains(ClientFlavors.ITEM) || flavors.contains(ModelerFlavors.COLOR))
        return Collections.singletonList(new ViewDropRegion(MAINREGION, this, SwingUtilities.getLocalBounds(toolBoxItemPanel),
          toolBoxItemPanel));
    }
    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.