Package CH.ifa.draw.framework

Examples of CH.ifa.draw.framework.Figure


   * or null for any type of child figure
   * @return The figure or null if the point does not lie within the figure or its sub figures
   */
  public static Figure findInnermostFigure(Figure figure, int x, int y, Class figureClass)
  {
    Figure child = findChildFigure(figure, x, y, figureClass);
    if (child != null)
    {
      // There is a direct child figure that contains the point, recurse down
      Figure cc = findInnermostFigure(child, x, y, figureClass);
      if (cc != null)
        return cc;
    }

    return figure;
View Full Code Here


  {
    if (figure instanceof CompositeFigure)
    {
      for (FigureEnumeration fe = ((CompositeFigure) figure).figures(); fe.hasMoreElements();)
      {
        Figure child = fe.nextFigure();

        if (figureClass == null || figureClass.isInstance(child))
        {
          if (child.containsPoint(x, y))
          {
            return child;
          }
        }
      }
View Full Code Here

    if (figure instanceof CompositeFigure)
    {
      // Recurse down
      for (FigureEnumeration en = ((CompositeFigure) figure).figures(); en.hasMoreElements();)
      {
        Figure subFigure = en.nextFigure();
        updateSkin(subFigure);
      }
    }
  }
View Full Code Here

    AffineTransform trans = g2.getTransform();
    g2.translate(dx, dy);

    while (en.hasMoreElements())
    {
      Figure next = en.nextFigure();

      next.draw(g);
    }

    g2.setTransform(trans);
  }
View Full Code Here

   * - the presentation figure is supported by this method<br>
   * or null otherwise.
   */
  private static Figure getOverlay(Object owner, XFigure [] overlayFigures)
  {
    Figure presentationFigure = null;

    // Determine the presentation figure of the owner
    if (owner instanceof VisualElement)
      presentationFigure = ((VisualElement) owner).getPresentationFigure();
    else if (owner instanceof Figure)
      presentationFigure = (Figure) owner;

    if (presentationFigure != null)
    {
      // Check if we support this type of figure
      Class presentationClass = presentationFigure.getClass();
      for (int i = 0; i < overlayFigures.length; ++i)
      {
        XFigure figure = overlayFigures [i];

        if (figure.getClass().isAssignableFrom(presentationClass))
        {
          // Yes, we do. Adjust the overlay figure position and orientation accordingly and return it
          figure.displayBox(presentationFigure.displayBox());
          if (presentationFigure instanceof XFigure)
          {
            figure.setOrientation(((XFigure) presentationFigure).getOrientation());
          }

View Full Code Here

      return true;

    int n = socketFigure.getNumberOfContents();
    for (int i = 0; i < n; ++i)
    {
      Figure c = socketFigure.getContentFigureAt(i);
      if (view.isFigureSelected(c))
        return true;
    }

    return false;
View Full Code Here

          configuratorSupport.addConfiguratorMenuOptions(mo, group);
        }

        if (flavor [i].equals(ModelerFlavors.FIGURE))
        {
          Figure figure = (Figure) ie.getSafeTransferData(flavor [i]);
          workspaceView.singleSelect(figure);
        }

        if (flavor [i].equals(ModelerFlavors.PARAM_FIGURE))
        {
View Full Code Here

    public Object doDecorate(Object owner, String key, Object value)
    {
      if (key == XFigure.DECO_OVERLAY && (owner instanceof SocketFigure))
      {
        // Make the breakpoint decoriation 2 pixels larger than the flow access figure
        Figure overlay = FigureResources.getBreakpointOverlay(owner);

        return overlay;
      }

      if (key == AbstractTagFigure.DECO_TAGCONTENTTYPE)
View Full Code Here

    String text = pec.getReferredProcessElement().getName();
    int nChars = text != null ? text.length() : 1;
    Dimension textDim = textOverlay.getPreferredSize(nChars);

    Figure f = pec.getPresentationFigure();
    if (f == null)
      f = pec;
    Rectangle figureRect = f.displayBox();
    figureRect = getView().applyScale(figureRect, false);
    int figureWidth = figureRect.width;
    int textWidth = textDim.width;

    int w = figureWidth - 10;
View Full Code Here

      view.clearSelection();

      for (Iterator it = modeler.getDrawing().getAllFigures(); it.hasNext();)
      {
        Figure figure = (Figure) it.next();
        view.addToSelection(figure);
      }

      return EVENT_CONSUMED;
    }
View Full Code Here

TOP

Related Classes of CH.ifa.draw.framework.Figure

Copyright © 2018 www.massapicom. 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.