
      private static final int DRAGGING = 2;
      private static final int RESIZING = 1;
      private static final int NONE = 0;
      private int function = NONE;
      private Point offset1 = new Point(), offset2 = new Point(), offset3 = new Point();
      private long lastTime;

      public void mouseDragged(MouseEvent e) {
        
        //Vector temp = selectedComponents;
        //parseComponents(e.getX(), e.getY());

            long currentTime = System.currentTimeMillis();
            if (currentTime - lastTime >= 100) {
                doFunctions(e);
                lastTime = currentTime;
            }

        //selectedComponents = temp;
      }
      
      public void moveComponent() {
      }
      
      public void resizeComponent() {
      }
      
      public void mouseMoved(MouseEvent e) {
      }

      public void mousePressed(MouseEvent e) {
        //parseComponents(e.getX(), e.getY());
        if (selectedComponent != null && selectedComponents.contains(selectedComponent)) {
                Dimension comSize = selectedComponent.getSize();
                if (offset1.x < (comSize.width + 3) && offset1.x > (comSize.width - 10) && offset1.y < (comSize.height + 3) && offset1.y > (comSize.height - 10))
                    function = RESIZING;
                else
                    function = DRAGGING;
		    offset2 = new Point(e.getX() - selectedComponent.getLocation().x, e.getY() - selectedComponent.getLocation().y);
		    offset3 = new Point(e.getX() - selectedComponent.getSize().width, e.getY() - selectedComponent.getSize().height);
		}
        
       /* if (selectedComponent != null && selectedComponents.size() > 0) {
            
            
        } */
      }
      
      public void mouseReleased(MouseEvent e) {
        doFunctions(e);
        function = NONE;
      }

      public void doFunctions(MouseEvent e) {
         if (function == RESIZING)
            selectedComponent.setSize(e.getX() - offset3.x, e.getY() - offset3.y);
         else if (function == DRAGGING)
            selectedComponent.setLocation(e.getX() - offset2.x, e.getY() - offset2.y);
         //client.validate();
      }
