Package CH.ifa.draw.framework

Examples of CH.ifa.draw.framework.Figure.displayBox()


        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


    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

      }

      maintainRatio = presentationFigure instanceof XTriangleFigure;
      heightOnly = presentationFigure instanceof XCircleFigure;

      Rectangle db = presentationFigure.displayBox();
      origX = db.width;
      origY = db.height;
    }
  }
View Full Code Here

    }

    if (firstFigure != null)
    {
      // Get the bounding rectangle
      Rectangle rect = new Rectangle(firstFigure.displayBox());

      // Enlarge by 100 pixel to prevent it from hanging in the corners
      rect.grow(50, 50);

      workspaceView.scrollRectToVisible(rect);
View Full Code Here

      {
        // Line figures have an inifinite dimension, so we skip them
        continue;
      }

      r.add(f.displayBox());
    }

    // Ensure that the display box of the drawing itself always starts at (0,0)
    r.x = r.y = 0;
View Full Code Here

    Figure endNodeFigure = endSocketFigure.getParent();

    Point startCenter = startSocketFigure.center();
    Point endCenter = endSocketFigure.center();
    Orientation startSocketOrientation = CircleConstants.determineOrientation(startSocketFigure.getAngle(), startNodeFigure.displayBox());
    Orientation endSocketOrientation = CircleConstants.determineOrientation(endSocketFigure.getAngle(), endNodeFigure.displayBox());
    boolean startSocketIsVertical = startSocketOrientation == Orientation.TOP || startSocketOrientation == Orientation.BOTTOM;
    boolean endSocketIsVertical = endSocketOrientation == Orientation.TOP || endSocketOrientation == Orientation.BOTTOM;
    boolean socketsInSync = startSocketIsVertical == endSocketIsVertical;

    // TODO Fix 4: Param autoconnector orientation doesn't work optimal, test...
View Full Code Here

      {
        r = ((LayoutableTag) subFigure).getLayouter().calculateSize();
      }
      else
      {
        r = subFigure.displayBox();
      }

      height = Math.max(r.height, height);

      // Add sub figure width and horizontal insets
View Full Code Here

      {
        r = ((LayoutableTag) subFigure).getLayouter().calculateSize();
      }
      else
      {
        r = subFigure.displayBox();
      }

      // Set the sub figure position and size
      int y = yBaseLine + CommonUtil.rnd(yFactor * r.height);
      r.setLocation(xPos, y);
View Full Code Here

      }

      // Set the sub figure position and size
      int y = yBaseLine + CommonUtil.rnd(yFactor * r.height);
      r.setLocation(xPos, y);
      subFigure.displayBox(r);

      // Add sub figure width and horizontal insets
      xPos += insets.left + insets.right + r.width;
    }
  }
View Full Code Here

        // So we use the compact display box, which should be constant, if possible.
        centerBox = ((Expandable) centerFigure).compactDisplayBox();
      }
      else
      {
        centerBox = centerFigure.displayBox();
      }
    }
    return centerBox;
  }
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.