本文整理了Java中org.eclipse.jface.util.Geometry.copy()
方法的一些代码示例,展示了Geometry.copy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.copy()
方法的具体详情如下:
包路径:org.eclipse.jface.util.Geometry
类名称:Geometry
方法名:copy
[英]Returns a copy of the given point
[中]返回给定点的副本
代码示例来源:origin: pentaho/pentaho-kettle
Rectangle resizedRect = Geometry.copy( shellSize );
constrainRectangleToContainer( resizedRect, entireClientArea );
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Returns the size constraints.
*
* @return the size constraints or <code>null</code> if not set
* @see #setSizeConstraints(int, int)
*/
protected final Point getSizeConstraints() {
return fSizeConstraints != null ? Geometry.copy(fSizeConstraints) : null;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Returns the size constraints.
*
* @return the size constraints or <code>null</code> if not set
* @see #setSizeConstraints(int, int)
*/
protected final Point getSizeConstraints() {
return fSizeConstraints != null ? Geometry.copy(fSizeConstraints) : null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
public void setRectangle(Rectangle newRect) {
if (tracker == null) {
return;
}
Rectangle[] rectArray = { Geometry.copy(newRect) };
tracker.setRectangles(rectArray);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
public Rectangle getBounds() {
if (areaRectangles.isEmpty())
return new Rectangle(0, 0, 0, 0);
AreaRectangle ar0 = areaRectangles.get(0);
Rectangle bounds = Geometry.copy(ar0.rect);
for (int i = 1; i < areaRectangles.size(); i++) {
AreaRectangle ar = areaRectangles.get(i);
bounds.add(ar.rect);
}
return bounds;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
public Rectangle getBounds() {
if (areaRectangles.size() == 0)
return new Rectangle(0, 0, 0, 0);
AreaRectangle ar0 = areaRectangles.get(0);
Rectangle bounds = Geometry.copy(ar0.rect);
for (int i = 1; i < areaRectangles.size(); i++) {
AreaRectangle ar = areaRectangles.get(i);
bounds.add(ar.rect);
}
return bounds;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
return Geometry.copy(getPreferredSize());
Point result = Geometry.copy(getPreferredSize());
return Geometry.copy(preferredSize);
return Geometry.copy(cachedHeight);
Point result = Geometry.copy(preferredSize);
result.x = widthHint;
return result;
return Geometry.copy(cachedHeight);
return Geometry.copy(preferredSize);
return Geometry.copy(cachedWidth);
return Geometry.copy(cachedWidth);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
return Geometry.copy(getPreferredSize());
Point result = Geometry.copy(getPreferredSize());
return Geometry.copy(preferredSize);
return Geometry.copy(cachedHeight);
return Geometry.copy(cachedHeight);
return Geometry.copy(preferredSize);
return Geometry.copy(cachedWidth);
return Geometry.copy(cachedWidth);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Perform any initialization you want to have happen -before- the
* amination starts
*/
@Override
public boolean jobInit(AnimationEngine engine) {
if (!super.jobInit(engine))
return false;
// Compute the shell's bounds
Rectangle shellBounds = Geometry.copy((Rectangle) getStartRects()
.get(0));
Iterator startIter = getStartRects().iterator();
Iterator endIter = getEndRects().iterator();
while (startIter.hasNext()) {
shellBounds.add((Rectangle) startIter.next());
shellBounds.add((Rectangle) endIter.next());
}
getAnimationShell().setBounds(shellBounds);
// Making the shell visible will be slow on old video cards, so only start
// the timer once it is visible.
getAnimationShell().setVisible(true);
return true; // OK to go...
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
return Geometry.copy(getPreferredSize());
Point result = Geometry.copy(getPreferredSize());
return Geometry.copy(preferredSize);
return Geometry.copy(preferredSize);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Computes the size constraints of the information control in points based on the
* default font of the given subject control as well as the size constraints in character
* width.
*
* @param subjectControl the subject control
* @param informationControl the information control whose size constraints are computed
* @return the computed size constraints in points
*/
protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) {
if (fSizeConstraints == null) {
if (informationControl instanceof IInformationControlExtension5) {
IInformationControlExtension5 iControl5= (IInformationControlExtension5) informationControl;
fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint);
if (fSizeConstraints != null)
return Geometry.copy(fSizeConstraints);
}
if (subjectControl == null)
return null;
GC gc= new GC(subjectControl);
gc.setFont(subjectControl.getFont());
double width= gc.getFontMetrics().getAverageCharacterWidth();
int height = gc.getFontMetrics().getHeight();
gc.dispose();
fSizeConstraints= new Point((int) (fWidthConstraint * width), fHeightConstraint * height);
}
return new Point(fSizeConstraints.x, fSizeConstraints.y);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Computes the size constraints of the information control in points based on the
* default font of the given subject control as well as the size constraints in character
* width.
*
* @param subjectControl the subject control
* @param informationControl the information control whose size constraints are computed
* @return the computed size constraints in points
*/
protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) {
if (fSizeConstraints == null) {
if (informationControl instanceof IInformationControlExtension5) {
IInformationControlExtension5 iControl5= (IInformationControlExtension5) informationControl;
fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint);
if (fSizeConstraints != null)
return Geometry.copy(fSizeConstraints);
}
if (subjectControl == null)
return null;
GC gc= new GC(subjectControl);
gc.setFont(subjectControl.getFont());
int width= gc.getFontMetrics().getAverageCharWidth();
int height = gc.getFontMetrics().getHeight();
gc.dispose();
fSizeConstraints= new Point (fWidthConstraint * width, fHeightConstraint * height);
}
return new Point(fSizeConstraints.x, fSizeConstraints.y);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Tests whether a given mouse location is within the keep-up zone.
* The hover should not be hidden as long as the mouse stays inside this zone.
*
* @param x the x coordinate, relative to the <em>subject control</em>
* @param y the y coordinate, relative to the <em>subject control</em>
* @param controlBounds the bounds of the current control
*
* @return <code>true</code> iff the mouse event occurred in the keep-up zone
*/
private boolean inKeepUpZone(int x, int y, Rectangle controlBounds) {
// +-----------+
// |subjectArea|
// +-----------+
// |also keepUp|
// ++-----------+-------+
// | totalBounds |
// +--------------------+
if (fSubjectArea.contains(x, y))
return true;
Rectangle iControlBounds= fSubjectControl.getDisplay().map(null, fSubjectControl, controlBounds);
Rectangle totalBounds= Geometry.copy(iControlBounds);
if (totalBounds.contains(x, y))
return true;
int keepUpY= fSubjectArea.y + fSubjectArea.height;
Rectangle alsoKeepUp= new Rectangle(fSubjectArea.x, keepUpY, fSubjectArea.width, totalBounds.y - keepUpY);
return alsoKeepUp.contains(x, y);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Tests whether a given mouse location is within the keep-up zone.
* The hover should not be hidden as long as the mouse stays inside this zone.
*
* @param x the x coordinate, relative to the <em>subject control</em>
* @param y the y coordinate, relative to the <em>subject control</em>
* @param controlBounds the bounds of the current control
*
* @return <code>true</code> iff the mouse event occurred in the keep-up zone
*/
private boolean inKeepUpZone(int x, int y, Rectangle controlBounds) {
// +-----------+
// |subjectArea|
// +-----------+
// |also keepUp|
// ++-----------+-------+
// | totalBounds |
// +--------------------+
if (fSubjectArea.contains(x, y))
return true;
Rectangle iControlBounds= fSubjectControl.getDisplay().map(null, fSubjectControl, controlBounds);
Rectangle totalBounds= Geometry.copy(iControlBounds);
if (totalBounds.contains(x, y))
return true;
int keepUpY= fSubjectArea.y + fSubjectArea.height;
Rectangle alsoKeepUp= new Rectangle(fSubjectArea.x, keepUpY, fSubjectArea.width, totalBounds.y - keepUpY);
return alsoKeepUp.contains(x, y);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
Rectangle totalBounds= Geometry.copy(iControlBounds);
if (blowUp && isReplaceInProgress()) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
tracker.setRectangles(new Rectangle[] { Geometry.copy(snapTarget) });
tracker.setRectangles(new Rectangle[] { Geometry.copy(startRect)});
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
Rectangle totalBounds= Geometry.copy(iControlBounds);
if (blowUp && isReplaceInProgress()) {
内容来源于网络,如有侵权,请联系作者删除!