/** * Returns the average character width, measured in pixels, * of the font described by the receiver. * * @return the average character width of the font */ public int getAverageCharWidth() { return DPIUtil.autoScaleDown(handle.tmAveCharWidth); }
void setLocationInPixels (int x, int y) { this.x = DPIUtil.autoScaleDown(x); this.y = DPIUtil.autoScaleDown(y); }
void setBounds() { Rectangle area = DPIUtil.autoScaleUp(frame.getClientArea()); // To Pixels setBounds(DPIUtil.autoScaleDown(borderWidths.left), DPIUtil.autoScaleDown(borderWidths.top), DPIUtil.autoScaleDown(area.width - borderWidths.left - borderWidths.right), DPIUtil.autoScaleDown(area.height - borderWidths.top - borderWidths.bottom)); setObjectRects(); } private void setExtent(int width, int height){
/** * Auto-scale up float array dimensions if enabled for Drawable class. */ public static float[] autoScaleDown (Drawable drawable, float size[]) { if (drawable != null && !drawable.isAutoScalable ()) return size; return autoScaleDown (size); }
/** * Auto-scale down int dimensions if enabled for Drawable class. */ public static int autoScaleDown (Drawable drawable, int size) { if (drawable != null && !drawable.isAutoScalable ()) return size; return autoScaleDown (size); }
/** * Returns a new scaled down Point if enabled for Drawable class. */ public static Point autoScaleDown (Drawable drawable, Point point) { if (drawable != null && !drawable.isAutoScalable ()) return point; return autoScaleDown (point); }
/** * Auto-scale down int dimensions if enabled for Drawable class. */ public static int autoScaleDown (Drawable drawable, int size) { if (drawable != null && !drawable.isAutoScalable ()) return size; return autoScaleDown (size); }
/** * Returns a new scaled down Point if enabled for Drawable class. */ public static Point autoScaleDown (Drawable drawable, Point point) { if (drawable != null && !drawable.isAutoScalable ()) return point; return autoScaleDown (point); }
/** * Auto-scale up float array dimensions if enabled for Drawable class. */ public static float[] autoScaleDown (Drawable drawable, float size[]) { if (drawable != null && !drawable.isAutoScalable ()) return size; return autoScaleDown (size); }
/** * Returns a new scaled down Point if enabled for Drawable class. */ public static Point autoScaleDown (Drawable drawable, Point point) { if (drawable != null && !drawable.isAutoScalable ()) return point; return autoScaleDown (point); }
public static int[] autoScaleDown(Drawable drawable, int[] pointArray) { if (drawable != null && !drawable.isAutoScalable ()) return pointArray; return autoScaleDown (pointArray); }
/** * Returns the receiver's border width in points. * * @return the border width * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public int getBorderWidth () { return DPIUtil.autoScaleDown(getBorderWidthInPixels()); }
/** * Returns a rectangle describing the receiver's size and location. * * @return the bounding rectangle * * @exception SWTException <ul> * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> * </ul> */ public Rectangle getBounds() { checkDevice (); return DPIUtil.autoScaleDown(getBoundsInPixels()); }
@Override int setBounds(int x, int y, int width, int height, boolean move, boolean resize) { int result = super.setBounds (x, y, width,height, move, resize); if ((result & RESIZED) != 0) { layout.setWidth (DPIUtil.autoScaleDown((width > 0 ? width : -1))); redraw (); } return result; }
@Override int setBounds(int x, int y, int width, int height, boolean move, boolean resize) { int result = super.setBounds (x, y, width,height, move, resize); if ((result & RESIZED) != 0) { layout.setWidth (DPIUtil.autoScaleDown((width > 0 ? width : -1))); redraw (); } return result; }
/** * Returns the width of the receiver. * * @return the width * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public int getWidth () { checkLayout (); return DPIUtil.autoScaleDown(getDevice(), getWidthInPixels()); }
/** * Returns the tab list of the receiver. * * @return the tab list * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public int[] getTabs() { checkLayout(); return DPIUtil.autoScaleDown (getDevice(), getTabsInPixels ()); }
/** * Returns the tab list of the receiver. * * @return the tab list * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public int[] getTabs() { checkLayout(); return DPIUtil.autoScaleDown (getDevice(), getTabsInPixels ()); }
/** * Returns the width of the receiver. * * @return the width * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public int getWidth () { checkLayout (); return DPIUtil.autoScaleDown(getDevice(), getWidthInPixels()); }
/** * Returns the tab list of the receiver. * * @return the tab list * * @exception SWTException <ul> * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> * </ul> */ public int[] getTabs() { checkLayout(); return DPIUtil.autoScaleDown (getDevice(), getTabsInPixels ()); }