Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Control.toControl()


        // In order to know where to draw the string we have to calculate where the
        // drop event has taken place with respect to the ViewportPane.
        // The Event returns the location but it is w.r.t the Display.
        // All SWT widgets have helper methods to determine this so:
        Control control=pane.getControl();
        final Point drawLocation = control.toControl(getEvent().x, getEvent().y);
       
        // By Adding a custom draw command we can draw on the viewport model...
        pane.addDrawCommand(new AbstractDrawCommand(){

            public Rectangle getValidArea() {
View Full Code Here


       
        if( message!=null ){
            if( messageBubble!=null && messageBubble.isValid() )
                messageBubble.setValid(false);
            Control control=(Control) mapDisplay;
            Point mouseLocation = control.toControl(display.getCursorLocation());
            messageBubble = new MessageBubble(mouseLocation.x, mouseLocation.y,
                                message, PreferenceUtil.instance().getMessageDisplayDelay());
            AnimationUpdater.runTimer(mapDisplay, messageBubble);
        }
    }
View Full Code Here

        }
        if( message!=null ){
            if( messageBubble!=null && messageBubble.isValid() )
                messageBubble.setValid(false);
            Control control=(Control) mapDisplay;
            Point mouseLocation = control.toControl(display.getCursorLocation());
            messageBubble = new MessageBubble(mouseLocation.x, mouseLocation.y,
                                message, PreferenceUtil.instance().getMessageDisplayDelay());
            AnimationUpdater.runTimer(mapDisplay, messageBubble);
        }
    }
View Full Code Here

      private float getHeightInItem(DropTargetEvent event) {
        if(event.item == null) return .5f;
        if (event.item instanceof TreeItem) {
          TreeItem treeItem = (TreeItem) event.item;
          Control control = treeItem.getParent();
          Point point = control.toControl(new Point(event.x, event.y));
          Rectangle bounds = treeItem.getBounds();
          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else if (event.item instanceof TableItem) {
          TableItem tableItem = (TableItem) event.item;
View Full Code Here

          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else if (event.item instanceof TableItem) {
          TableItem tableItem = (TableItem) event.item;
          Control control = tableItem.getParent();
          Point point = control.toControl(new Point(event.x, event.y));
          Rectangle bounds = tableItem.getBounds(0);
          return (float) (point.y - bounds.y) / (float) bounds.height;
        }
        else {
          return 0.0F;
View Full Code Here

          if (event.item == null)
            return .5f;
          if (event.item instanceof TreeItem) {
            TreeItem treeItem = (TreeItem) event.item;
            Control control = treeItem.getParent();
            Point point = control.toControl(new Point(event.x, event.y));
            Rectangle bounds = treeItem.getBounds();
            return (float) (point.y - bounds.y) / (float) bounds.height;
          }
          else if (event.item instanceof TableItem) {
            TableItem tableItem = (TableItem) event.item;
View Full Code Here

            return (float) (point.y - bounds.y) / (float) bounds.height;
          }
          else if (event.item instanceof TableItem) {
            TableItem tableItem = (TableItem) event.item;
            Control control = tableItem.getParent();
            Point point = control.toControl(new Point(event.x, event.y));
            Rectangle bounds = tableItem.getBounds(0);
            return (float) (point.y - bounds.y) / (float) bounds.height;
          }
          else {
            return 0.0F;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.