Package edu.wpi.first.smartdashboard.util

Examples of edu.wpi.first.smartdashboard.util.DisplayElement


    public void mouseReleased(MouseEvent me) {
      if (dragging) {
        Point clickPoint = SwingUtilities.convertPoint(glassPane,
            me.getPoint(), m_elemPanel);
        DisplayElement dragTargetDE = (DisplayElement) dragTarget;

        int xoffset = clickPoint.x - dragPosition.x;
        int yoffset = clickPoint.y - dragPosition.y;
        Point newLocation = new Point(xoffset + dragTarget.getX(),
            yoffset + dragTarget.getY());

        // This code assumes that dragTargetDE.getLayoutAllocation()
        // will never be null since
        // objects are put on the screen (and are this draggable) only
        // if they were assigned an allocation
        LayoutAllocation newLa = LayoutAllocator.forceMoveAllocation(
            dragTargetDE.getLayoutAllocation(), newLocation);
        dragTargetDE.setLayoutAllocation(newLa);
        dragTargetDE.setLocation(newLa.point);
      }
      dragging = false;
      captureMouse(me);
    }
View Full Code Here

TOP

Related Classes of edu.wpi.first.smartdashboard.util.DisplayElement

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.