本文整理了Java中org.eclipse.swt.widgets.Shell.computeTrim()
方法的一些代码示例,展示了Shell.computeTrim()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.computeTrim()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:computeTrim
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
addInternalTrim(trim);
return trim;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
addInternalTrim(trim);
return trim;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
addInternalTrim(trim);
return trim;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
addInternalTrim(trim);
return trim;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.editors
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
addInternalTrim(trim);
return trim;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Computes the trim (status text and tool bar are considered as trim).
* Subclasses can extend this method to add additional trim (e.g. scroll
* bars for resizable information controls).
*
* @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim()
*/
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
if (fStatusComposite != null)
trim.height+= fStatusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
return trim;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Computes the trim (status text and tool bar are considered as trim).
* Subclasses can extend this method to add additional trim (e.g. scroll
* bars for resizable information controls).
*
* @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim()
*/
@Override
public Rectangle computeTrim() {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
if (fStatusComposite != null)
trim.height+= fStatusComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
return trim;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
public void setLocation(Point location) {
Rectangle trim = fShell.computeTrim(0, 0, 0, 0);
Point textLocation = fComposite.getLocation();
location.x += trim.x - textLocation.x;
location.y += trim.y - textLocation.y;
fShell.setLocation(location);
}
代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui
public void setLocation(Point location) {
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
Point textLocation= fText.getLocation();
location.x += trim.x - textLocation.x;
location.y += trim.y - textLocation.y;
fShell.setLocation(location);
}
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
@Override
public void setLocation(Point location) {
Rectangle trim = mShell.computeTrim(0, 0, 0, 0);
Point textLocation = mControl.getLocation();
location.x += trim.x - textLocation.x;
location.y += trim.y - textLocation.y;
mShell.setLocation(location);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ant.ui
@Override
public void setLocation(Point location) {
Rectangle trim = fShell.computeTrim(0, 0, 0, 0);
Point textLocation = fText.getLocation();
location.x += trim.x - textLocation.x;
location.y += trim.y - textLocation.y;
fShell.setLocation(location);
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void setLocation(Point location) {
Rectangle trim = fShell.computeTrim(0, 0, 0, 0);
Point textLocation = fComposite.getLocation();
location.x += trim.x - textLocation.x;
location.y += trim.y - textLocation.y;
fShell.setLocation(location);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
@Override
protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) {
Point location= super.computeLocation(subjectArea, controlSize, anchor);
/*
* The location is computed using subjectControl.toDisplay(), which does not include the
* trim of the subject control. As we want the additional info popup aligned with the outer
* coordinates of the proposal popup, adjust this here
*/
Rectangle trim= fProposalTable.getShell().computeTrim(0, 0, 0, 0);
location.x += trim.x;
location.y += trim.y;
return location;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
@Override
protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) {
Point location= super.computeLocation(subjectArea, controlSize, anchor);
/*
* The location is computed using subjectControl.toDisplay(), which does not include the
* trim of the subject control. As we want the additional info popup aligned with the outer
* coordinates of the proposal popup, adjust this here
*/
Rectangle trim= fProposalTable.getShell().computeTrim(0, 0, 0, 0);
location.x += trim.x;
location.y += trim.y;
return location;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public Point computeSizeHint() {
Point preferedSize= getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
Point constrains= getSizeConstraints();
if (constrains == null)
return preferedSize;
int trimWidth= getShell().computeTrim(0, 0, 0, 0).width;
Point constrainedSize= getShell().computeSize(constrains.x - trimWidth, SWT.DEFAULT, true);
int width= Math.min(preferedSize.x, constrainedSize.x);
int height= Math.max(preferedSize.y, constrainedSize.y);
return new Point(width, height);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public Point computeSizeHint() {
Point preferedSize= getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
Point constrains= getSizeConstraints();
if (constrains == null)
return preferedSize;
int trimWidth= getShell().computeTrim(0, 0, 0, 0).width;
Point constrainedSize= getShell().computeSize(constrains.x - trimWidth, SWT.DEFAULT, true);
int width= Math.min(preferedSize.x, constrainedSize.x);
int height= Math.max(preferedSize.y, constrainedSize.y);
return new Point(width, height);
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt
public Overlay(Shell shell) {
baseShell = shell;
Rectangle cr = baseShell.getClientArea();
Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height);
offsetX = -trim.x;
offsetY = -trim.y;
overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP);
overlayShell.setBounds(baseShell.getBounds());
overlayShell.setBackground(baseShell.getDisplay().getSystemColor(
SWT.COLOR_DARK_GREEN));
overlayShell.setAlpha(128);
blue = new Color(baseShell.getDisplay(), 0, 0, 128);
overlayShell.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent e) {
e.gc.setForeground(blue);
e.gc.setBackground(blue);
for (Adornment adornment : adornments) {
adornment.drawAdornment(e.gc);
}
}
});
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
Rectangle trim= fShell.computeTrim(0, 0, width, height);
int x= toolbarBounds.x + toolbarBounds.width + 2 + trim.x - imageBoundsX;
if (!isLTR())
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
Rectangle trim= fShell.computeTrim(0, 0, width, height);
int x= toolbarBounds.x + toolbarBounds.width + 2 + trim.x - imageBoundsX;
if (!isLTR())
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
public Overlay(Shell shell) {
baseShell = shell;
Rectangle cr = baseShell.getClientArea();
Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height);
offsetX = -trim.x;
offsetY = -trim.y;
overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP);
overlayShell.setBounds(baseShell.getBounds());
overlayShell.setBackground(baseShell.getDisplay().getSystemColor(
SWT.COLOR_DARK_GREEN));
overlayShell.setAlpha(128);
blue = new Color(baseShell.getDisplay(), 0, 0, 128);
overlayShell.addPaintListener(e -> {
e.gc.setForeground(blue);
e.gc.setBackground(blue);
for (Adornment adornment : adornments) {
adornment.drawAdornment(e.gc);
}
});
}
内容来源于网络,如有侵权,请联系作者删除!