Codota Logo
Composite.toDisplay
Code IndexAdd Codota to your IDE (free)

How to use
toDisplay
method
in
org.eclipse.swt.widgets.Composite

Best Java code snippets using org.eclipse.swt.widgets.Composite.toDisplay (Showing top 20 results out of 315)

  • Common ways to obtain Composite
private void myMethod () {
Composite c =
  • Codota IconControl control;control.getParent()
  • Codota IconStatusDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Codota IconTitleAreaDialog zuper;(Composite) zuper.createDialogArea(parent)
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

@Override
public void menuDetected( MenuDetectEvent e ) {
 Point screen = new Point( e.x, e.y );
 Point widgetScreen = widget.toDisplay( 1, 1 );
 Point wRel = new Point( screen.x - widgetScreen.x, screen.y - widgetScreen.y );
 int area = getAreaCode( wRel );
 setMenu( area, wRel );
}
origin: pentaho/pentaho-kettle

public static Point calculateControlPosition( Control control ) {
 // Calculate the exact location...
 //
 Rectangle r = control.getBounds();
 Point p = control.getParent().toDisplay( r.x, r.y );
 return p;
 /*
  * Point location = control.getLocation();
  *
  * Composite parent = control.getParent(); while (parent!=null) {
  *
  * Composite newParent = parent.getParent(); if (newParent!=null) { location.x+=parent.getLocation().x;
  * location.y+=parent.getLocation().y; } else { if (parent instanceof Shell) { // Top level shell. Shell shell =
  * (Shell)parent; Rectangle bounds = shell.getBounds(); Rectangle clientArea = shell.getClientArea(); location.x +=
  * bounds.width-clientArea.width; location.y += bounds.height-clientArea.height; } } parent = newParent; }
  *
  * return location;
  */
}
origin: BiglySoftware/BiglyBT

@Override
public Rectangle getBoundsOnDisplay() {
  Rectangle bounds = getBounds();
  Point pt = composite.toDisplay(bounds.x, bounds.y);
  bounds.x = pt.x;
  bounds.y = pt.y;
  return bounds;
}
origin: ch.unibas.cs.gravis/scalismo-native-stub

  public void run() {
    parentLoc[0] = getParent().toDisplay(0,0);
  } } );
return new Point(parentLoc[0].x, parentLoc[0].y);
origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * An accessor for the current location of this status line contribution
 * item -- relative to the display.
 * 
 * @return The current location of this status line; <code>null</code> if
 *         not yet initialized.
 */
public Point getDisplayLocation() {
  if ((label != null) && (statusLine != null)) {
    return statusLine.toDisplay(label.getLocation());
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.jface

/**
 * An accessor for the current location of this status line contribution
 * item -- relative to the display.
 *
 * @return The current location of this status line; <code>null</code> if
 *         not yet initialized.
 */
public Point getDisplayLocation() {
  if ((label != null) && (statusLine != null)) {
    return statusLine.toDisplay(label.getLocation());
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * An accessor for the current location of this status line contribution
 * item -- relative to the display.
 *
 * @return The current location of this status line; <code>null</code> if
 *         not yet initialized.
 */
public Point getDisplayLocation() {
  if ((label != null) && (statusLine != null)) {
    return statusLine.toDisplay(label.getLocation());
  }
  return null;
}
origin: org.eclipse.swt.cocoa.macosx/x86_64

public void getLocation (AccessibleControlEvent e) {
  Rectangle location = getBounds ();
  Point pt = getParent().toDisplay (location.x, location.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}

origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
public void getLocation (AccessibleControlEvent e) {
  Rectangle location = getBounds ();
  Point pt = getParent().toDisplay (location.x, location.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}
origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
public void getLocation (AccessibleControlEvent e) {
  Rectangle location = getBounds ();
  Point pt = getParent().toDisplay (location.x, location.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
public void getLocation (AccessibleControlEvent e) {
  Rectangle location = getBounds ();
  Point pt = getParent().toDisplay (location.x, location.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}
origin: openaudible/openaudible

public void updateFakeTooltipOver(String tooltip, Composite c) {
  
  Point pos = c.toDisplay(0, 0);
  
  
  Rectangle rect = c.getBounds();
  rect.x = pos.x;
  rect.y = pos.y;
  
  updateFakeTooltip(tooltip, rect, true);
}

origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
public void getLocation (AccessibleControlEvent e) {
  Rectangle location = getBounds ();
  Point pt = getParent().toDisplay (location.x, location.y);
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}
origin: org.eclipse.mylyn.commons/screenshots

@Override
public void clickMenu(int x, int y) {
  dropDownMenu = new Menu(parent.getShell(), SWT.POP_UP);
  addActionsToMenu();
  Point p = parent.toDisplay(x, y);
  dropDownMenu.setLocation(p.x, p.y);
  dropDownMenu.setVisible(true);
  dropDownMenu = null;
}
origin: org.eclipse.platform/org.eclipse.swt.examples

@Override
public void getLocation(AccessibleControlEvent e) {
  Rectangle location = null;
  Point pt = null;
  int childID = e.childID;
  if (childID == ACC.CHILDID_SELF) {
    location = getClientArea();
    pt = getParent().toDisplay(location.x, location.y);
  } else {
    location = itemBounds(childID);
    pt = toDisplay(location.x, location.y);
  }
  e.x = pt.x;
  e.y = pt.y;
  e.width = location.width;
  e.height = location.height;
}
@Override
origin: BiglySoftware/BiglyBT

  @Override
  public void paintControl(PaintEvent e){
    GC gc = e.gc;
    
    gc.setAdvanced(true);
    gc.setAntialias(SWT.ON);
        
    Point pp = parent.toDisplay(0, 0);
    Point cp = child.toDisplay(0, 0 );
    
    Rectangle bounds = child.getBounds();
    
    
    int	width 	= bounds.width;
    int height	= bounds.height;
    
    gc.setForeground(Colors.fadedRed );
    
    gc.drawRectangle( cp.x-pp.x-1, cp.y-pp.y-1, width+2, height+2 );						
  }
});
origin: BiglySoftware/BiglyBT

@Override
public boolean isMouseOver() {
  if (isDisposed()) {
    return false;
  }
  Rectangle r = composite.getBounds();
  if (cellArea != null) {
    r = new Rectangle(r.x + cellArea.x, r.y + cellArea.y, cellArea.width,
        cellArea.height);
  }
  Point ptStart = composite.toDisplay(r.x, r.y);
  r.x = ptStart.x;
  r.y = ptStart.y;
  Point ptCursor = composite.getDisplay().getCursorLocation();
  return r.contains(ptCursor);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  private void showMenu(Button button, IContributionItem menuContribution) {
    Menu menu = new Menu(button);
    Point p = button.getLocation();
    p.y = p.y + button.getSize().y;
    p = button.getParent().toDisplay(p);

    menu.setLocation(p);
    menuContribution.fill(menu, 0);
    menu.setVisible(true);
  }
}
origin: BiglySoftware/BiglyBT

@Override
public int[] getMouseOffset() {
  if (isDisposed()) {
    return null;
  }
  Rectangle r = composite.getBounds();
  if (cellArea != null) {
    r = new Rectangle(r.x + cellArea.x, r.y + cellArea.y, cellArea.width,
        cellArea.height);
  }
  Point ptStart = composite.toDisplay(r.x, r.y);
  r.x = ptStart.x;
  r.y = ptStart.y;
  Point ptCursor = composite.getDisplay().getCursorLocation();
  if (!r.contains(ptCursor)) {
    return null;
  }
  return new int[] { ptCursor.x - r.x, ptCursor.y - r.y };
}
origin: org.xworker/xworker_swt

public OpenDesignShellRunnable(MouseEvent event, DesignListener listener){
  this.display = event.display;
  this.widget = event.widget;
  this.listener = listener;
  
  Control control = (Control) event.getSource();
  if(control == null || control.getParent() == null){
    return;
  }
  point = control.getParent().toDisplay(control.getLocation());
  point.y = point.y - 16;
  
  ac = new ActionContext();
  ac.getScope(0).put("parent", ((Control) widget).getShell());
  ac.getScope(0).put("listener", listener);
  ac.getScope(0).put("theControl", widget);
}
 
org.eclipse.swt.widgetsCompositetoDisplay

Popular methods of Composite

  • setLayout
    Sets the layout which is associated with the receiver to be the argument which may be null.
  • <init>
    Constructs a new instance of this class given its parent and a style value describing its behavior a
  • setLayoutData
  • layout
    Forces a lay out (that is, sets the size and location) of all widgets that are in the parent hierarc
  • getDisplay
  • getChildren
    Returns a (possibly empty) array containing the receiver's children. Children are returned in the or
  • getShell
  • getFont
  • getLayout
    Returns layout which is associated with the receiver, or null if one has not been set.
  • setFont
  • getParent
  • computeSize
  • getParent,
  • computeSize,
  • dispose,
  • setBackground,
  • getClientArea,
  • isDisposed,
  • getBackground,
  • setVisible,
  • setSize,
  • setData

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now