Package org.openbp.cockpit.modeler.figures.generic

Examples of org.openbp.cockpit.modeler.figures.generic.Orientation


    if (!endConnector.isOrientationLocked())
    {
      endConnector.toggleOrientationLock();
    }

    Orientation startOrientation = startConnector.getLockedOrientation();
    Orientation endOrientation = endConnector.getLockedOrientation();

    // Order of orientations to toggle:
    // ^ ^
    // v ^
    // ^ v
View Full Code Here


  public void layoutAndAdjustConnection()
  {
    TagConnector startConnector = (TagConnector) getStartConnector();
    TagConnector endConnector = (TagConnector) getEndConnector();

    Orientation startOrientation = startConnector.getOrientation();
    Orientation endOrientation = endConnector.getOrientation();

    SocketFigure startSocketFigure = (SocketFigure) ((ParamFigure) startFigure()).getParent();
    SocketFigure endSocketFigure = (SocketFigure) ((ParamFigure) endFigure()).getParent();
    Figure startNodeFigure = startSocketFigure.getParent();
    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

    String paramName = st.nextToken();

    if (paramName.equals("orientation"))
    {
      Orientation startOrientation = Orientation.fromInt(GeometryUtil.parseInt(st, paramName, errName));
      Orientation endOrientation = Orientation.fromInt(GeometryUtil.parseInt(st, paramName, errName));
      ((TagConnector) getStartConnector()).setLockedOrientation(startOrientation);
      ((TagConnector) getEndConnector()).setLockedOrientation(endOrientation);
    }
    else
    {
View Full Code Here

      double ydiff = start.getY() - end.getY();
      ydiff *= ydiff;

      double distance = Math.sqrt(xdiff + ydiff);

      Orientation orientation;
      if (index == 0)
      {
        distance *= getStartFactor();
        orientation = ((TagConnector) getStartConnector()).getOrientation();
      }
View Full Code Here

    Rectangle centerBox = getCenterFigureBox();

    // Determine the quarter from the socket's orientation
    Quarter quarter = CircleConstants.determineQuarter(angle, centerBox);

    Orientation orientation;
    if (vertical)
    {
      orientation = quarter == Quarter.NW || quarter == Quarter.NE ? Orientation.TOP : Orientation.BOTTOM;
    }
    else
View Full Code Here

  // @@ AbstractConnector overrides
  //////////////////////////////////////////////////

  protected Point findPoint(ConnectionFigure connection)
  {
    Orientation direction = getOrientation();

    Rectangle cb = connectorFigure.compactDisplayBox();
    if (!connectorFigure.isVerticalOrientation())
    {
      return new Point((int) (direction == Orientation.LEFT ? cb.getMinX() : cb.getMaxX()), (int) cb.getCenterY());
View Full Code Here

   * @return {@link Orientation#RIGHT}/{@link Orientation#BOTTOM}/{@link Orientation#LEFT}/{@link Orientation#TOP}
   */
  public Orientation getOrientation()
  {
    // Use the fixed quarter setting if given
    Orientation lo = getLockedOrientation();
    if (lo != Orientation.UNDETERMINED)
      return lo;

    // Determine the quarter from the socket's orientation
    return socketFigure.determine2WayOrientation(connectorFigure.isVerticalOrientation());
View Full Code Here

  /**
   * Toggles the orientation lock.
   */
  public void toggleOrientationLock()
  {
    Orientation lo = getLockedOrientation();
    if (lo == Orientation.UNDETERMINED)
    {
      // Lock direction
      lo = connectorFigure.determine2WayOrientation(connectorFigure.isVerticalOrientation());
    }
View Full Code Here

    {
      toggleOrientationLock();
    }

    // Flip
    Orientation lo = getLockedOrientation();
    if (lo == Orientation.TOP)
    {
      lo = Orientation.BOTTOM;
    }
    else if (lo == Orientation.BOTTOM)
View Full Code Here

   * @return {@link Orientation#UNDETERMINED}/{@link Orientation#RIGHT}/{@link Orientation#BOTTOM}/{@link Orientation#LEFT}/{@link Orientation#TOP}
   */
  public Orientation getLockedOrientation()
  {
    // We convert vertical to horizontal orientation constants for locked orientations.
    Orientation ret = lockedOrientation;
    switch (lockedOrientation)
    {
    case UNDETERMINED:
      break;

View Full Code Here

TOP

Related Classes of org.openbp.cockpit.modeler.figures.generic.Orientation

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.