Package edu.umd.cs.piccolox.util

Examples of edu.umd.cs.piccolox.util.PBoundsLocator


    addInputEventListener(handleCursorHandler);
  }

  @Override
  public void dragHandle(PDimension aLocalDimension, PInputEvent aEvent) {
    PBoundsLocator l = (PBoundsLocator) getLocator();

    PNode n = l.getNode();
    PBounds b = n.getBounds();

    PNode parent = getParent();
    if (parent != n && parent instanceof PCamera) {
      ((PCamera) parent).localToView(aLocalDimension);
    }

    localToGlobal(aLocalDimension);
    n.globalToLocal(aLocalDimension);

    double dx = aLocalDimension.getWidth();
    double dy = aLocalDimension.getHeight();

    switch (l.getSide()) {
    case SwingConstants.NORTH:
      b.setRect(b.x, b.y + dy, b.width, b.height - dy);
      break;

    case SwingConstants.SOUTH:
View Full Code Here


    n.setBounds(b);
  }

  @Override
  public void endHandleDrag(Point2D aLocalPoint, PInputEvent aEvent) {
    PBoundsLocator l = (PBoundsLocator) getLocator();
    l.getNode().endResizeBounds();
  }
View Full Code Here

    PBoundsLocator l = (PBoundsLocator) getLocator();
    l.getNode().endResizeBounds();
  }

  public void flipHandleIfNeeded(boolean flipX, boolean flipY) {
    PBoundsLocator l = (PBoundsLocator) getLocator();

    if (flipX || flipY) {
      switch (l.getSide()) {
      case SwingConstants.NORTH: {
        if (flipY) {
          l.setSide(SwingConstants.SOUTH);
        }
        break;
      }

      case SwingConstants.SOUTH: {
        if (flipY) {
          l.setSide(SwingConstants.NORTH);
        }
        break;
      }

      case SwingConstants.EAST: {
        if (flipX) {
          l.setSide(SwingConstants.WEST);
        }
        break;
      }

      case SwingConstants.WEST: {
        if (flipX) {
          l.setSide(SwingConstants.EAST);
        }
        break;
      }

      case SwingConstants.NORTH_WEST: {
        if (flipX && flipY) {
          l.setSide(SwingConstants.SOUTH_EAST);
        } else if (flipX) {
          l.setSide(SwingConstants.NORTH_EAST);
        } else if (flipY) {
          l.setSide(SwingConstants.SOUTH_WEST);
        }

        break;
      }

      case SwingConstants.SOUTH_WEST: {
        if (flipX && flipY) {
          l.setSide(SwingConstants.NORTH_EAST);
        } else if (flipX) {
          l.setSide(SwingConstants.SOUTH_EAST);
        } else if (flipY) {
          l.setSide(SwingConstants.NORTH_WEST);
        }
        break;
      }

      case SwingConstants.NORTH_EAST: {
        if (flipX && flipY) {
          l.setSide(SwingConstants.SOUTH_WEST);
        } else if (flipX) {
          l.setSide(SwingConstants.NORTH_WEST);
        } else if (flipY) {
          l.setSide(SwingConstants.SOUTH_EAST);
        }
        break;
      }

      case SwingConstants.SOUTH_EAST: {
        if (flipX && flipY) {
          l.setSide(SwingConstants.NORTH_WEST);
        } else if (flipX) {
          l.setSide(SwingConstants.SOUTH_WEST);
        } else if (flipY) {
          l.setSide(SwingConstants.NORTH_EAST);
        }
        break;
      }
      }
    }
View Full Code Here

    return handleCursorHandler;
  }

  @Override
  public void startHandleDrag(Point2D aLocalPoint, PInputEvent aEvent) {
    PBoundsLocator l = (PBoundsLocator) getLocator();
    l.getNode().startResizeBounds();
  }
View Full Code Here

TOP

Related Classes of edu.umd.cs.piccolox.util.PBoundsLocator

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.