Package pl.tecna.gwt.connectors.client.elements

Examples of pl.tecna.gwt.connectors.client.elements.EndPoint


      @Override
      public void onDragStart(DragStartEvent event) {
        endPointDragging = true;
        if (event != null) {
          EndPoint ep = (EndPoint) event.getSource();
          ep.connector.select();
        }

        int startX =
            Diagram.this.boundaryPanel.getWidgetLeft(event.getContext().draggable)
                - Diagram.this.boundaryPanel.getAbsoluteLeft();
        int startY =
            Diagram.this.boundaryPanel.getWidgetTop(event.getContext().draggable)
                - Diagram.this.boundaryPanel.getAbsoluteTop();
        Diagram.this.onElementDrag(new ElementDragEvent(event.getContext().draggable, startX, startY,
            ElementDragEvent.DragEventType.DRAG_START));
      }

      @Override
      public void onDragEnd(DragEndEvent event) {

        endPointDragging = false;
        EndPoint endPoint = (EndPoint) event.getSource();
        endPoint.connector.fixEndSectionDirection(endPoint);
        endPoint.connector.drawSections(endPoint.connector.getCorners());

        try {
          endPoint.connector.cornerPoints =
View Full Code Here


  @Override
  public void onEnter(DragContext context) {
    if (context.draggable instanceof EndPoint) {
      if (getDropTarget() instanceof Shape) {
        Shape dropTarget = (Shape) getDropTarget();
        EndPoint ep = (EndPoint) context.draggable;
        if (ep.connector.startEndPoint.isGluedToConnectionPoint()
            && ep.connector.startEndPoint.gluedConnectionPoint.getParentShape().equals(dropTarget)) {

        } else {
          dropTarget.showConnectionPoints(dropTarget.diagram);
View Full Code Here

  public void onDrop(DragContext context) {
    if (context.draggable instanceof EndPoint) {
      // Glue end point to the nearest connection point
      if (getDropTarget() instanceof Shape) {
        Shape dropTarget = (Shape) getDropTarget();
        EndPoint endPoint = (EndPoint) context.draggable;
        endPoint
            .glueToConnectionPoint(dropTarget.findNearestFreeConnectionPoint(endPoint.getLeft(), endPoint.getTop()));

        // Unglue if EndPoints are glued to the same element
        Connector conn = endPoint.connector;
        if (conn.startEndPoint.isGluedToConnectionPoint() && conn.endEndPoint.isGluedToConnectionPoint()) {
          if (conn.endEndPoint.gluedConnectionPoint.getParentWidget() == conn.startEndPoint.gluedConnectionPoint
View Full Code Here

  }

  @Override
  public void dragMove() {

    EndPoint draggedEP = (EndPoint) context.draggable;
    draggedEP.connector.select();
    // Update left and top position for dragged EndPoint
    draggedEP.setLeft(getDraggableCenterLeft(draggedEP));
    draggedEP.setTop(getDraggableCenterTop(draggedEP));

    if (draggedEP.connector.sections.size() <= 3) {
      fixConnectorPath(draggedEP);
    } else {
      if (diagram.ctrlPressed) {
        fixConnectorPath(draggedEP);
      } else {
        if (sectionOrientation == VERTICAL) {
          draggedEP.updateOpositeEndPointOfVerticalSection();
        } else if (sectionOrientation == HORIZONTAL) {
          draggedEP.updateOpositeEndPointOfHorizontalSection();
        }
      }

    }
    super.dragMove();
View Full Code Here

TOP

Related Classes of pl.tecna.gwt.connectors.client.elements.EndPoint

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.