本文整理了Java中org.netbeans.api.visual.widget.Widget.resolveBounds()
方法的一些代码示例,展示了Widget.resolveBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.resolveBounds()
方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:resolveBounds
[英]Sets resolved location and bounds of the widget This method is usually called from implementations of Layout
interface.
[中]设置小部件的解析位置和边界此方法通常从Layout
接口的实现中调用。
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void layout (Widget widget) {
Collection<Widget> children = widget.getChildren ();
for (Widget child : children) {
if (child.isVisible ())
child.resolveBounds (child.getPreferredLocation (), null);
else
child.resolveBounds (null, new Rectangle ());
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void layout (Widget widget) {
Collection<Widget> children = widget.getChildren ();
for (Widget child : children) {
if (child.isVisible ())
child.resolveBounds (child.getPreferredLocation (), null);
else
child.resolveBounds (null, new Rectangle ());
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void justify (Widget widget) {
Rectangle clientArea = widget.getClientArea ();
for (Widget child : widget.getChildren ()) {
if (child.isVisible ()) {
Point location = child.getPreferredBounds ().getLocation ();
child.resolveBounds (new Point (clientArea.x - location.x, clientArea.y - location.y), new Rectangle (location, clientArea.getSize ()));
} else {
child.resolveBounds (clientArea.getLocation (), new Rectangle ());
}
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void justify (Widget widget) {
Rectangle clientArea = widget.getClientArea ();
for (Widget child : widget.getChildren ()) {
if (child.isVisible ()) {
Point location = child.getPreferredBounds ().getLocation ();
child.resolveBounds (new Point (clientArea.x - location.x, clientArea.y - location.y), new Rectangle (location, clientArea.getSize ()));
} else {
child.resolveBounds (clientArea.getLocation (), new Rectangle ());
}
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private void layoutSingleChildAt (Point linePoint, ConnectionWidgetLayoutAlignment alignment, ConnectionWidget connectionWidget, Widget childWidget) {
Rectangle preferredBounds = childWidget.getPreferredBounds ();
Point referencePoint = getReferencePointForAdjustedAlignment (alignment, preferredBounds);
Point location = childWidget.getPreferredLocation ();
if (location != null)
referencePoint.translate (-location.x, -location.y);
childWidget.resolveBounds (new Point (linePoint.x - referencePoint.x, linePoint.y - referencePoint.y), preferredBounds);
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private void layoutSingleChildAt (Point linePoint, ConnectionWidgetLayoutAlignment alignment, ConnectionWidget connectionWidget, Widget childWidget) {
Rectangle preferredBounds = childWidget.getPreferredBounds ();
Point referencePoint = getReferencePointForAdjustedAlignment (alignment, preferredBounds);
Point location = childWidget.getPreferredLocation ();
if (location != null)
referencePoint.translate (-location.x, -location.y);
childWidget.resolveBounds (new Point (linePoint.x - referencePoint.x, linePoint.y - referencePoint.y), preferredBounds);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
viewport.resolveBounds (scrollWidgetClientAreaLocation, new Rectangle (viewportBounds.getSize ()));
upArrow.resolveBounds (new Point (x2, y1), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
downArrow.resolveBounds (new Point (x2, y2 - BAR_VERTICAL_SIZE), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
verticalSlider.resolveBounds (new Point (x2, y1 + BAR_VERTICAL_SIZE), new Rectangle (BAR_HORIZONTAL_SIZE, viewportBounds.height - BAR_VERTICAL_SIZE - BAR_VERTICAL_SIZE));
} else {
upArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
downArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
verticalSlider.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
leftArrow.resolveBounds (new Point (x1, y2), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
rightArrow.resolveBounds (new Point (x2 - BAR_HORIZONTAL_SIZE, y2), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
horizontalSlider.resolveBounds (new Point (x1 + BAR_HORIZONTAL_SIZE, y2), new Rectangle (viewportBounds.width - BAR_HORIZONTAL_SIZE - BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
} else {
leftArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
rightArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
horizontalSlider.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
viewport.resolveBounds (scrollWidgetClientAreaLocation, new Rectangle (viewportBounds.getSize ()));
upArrow.resolveBounds (new Point (x2, y1), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
downArrow.resolveBounds (new Point (x2, y2 - BAR_VERTICAL_SIZE), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
verticalSlider.resolveBounds (new Point (x2, y1 + BAR_VERTICAL_SIZE), new Rectangle (BAR_HORIZONTAL_SIZE, viewportBounds.height - BAR_VERTICAL_SIZE - BAR_VERTICAL_SIZE));
} else {
upArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
downArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
verticalSlider.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
leftArrow.resolveBounds (new Point (x1, y2), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
rightArrow.resolveBounds (new Point (x2 - BAR_HORIZONTAL_SIZE, y2), new Rectangle (BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
horizontalSlider.resolveBounds (new Point (x1 + BAR_HORIZONTAL_SIZE, y2), new Rectangle (viewportBounds.width - BAR_HORIZONTAL_SIZE - BAR_HORIZONTAL_SIZE, BAR_VERTICAL_SIZE));
} else {
leftArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
rightArrow.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
horizontalSlider.resolveBounds (POINT_EMPTY, RECTANGLE_EMPTY);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void layout (Widget widget) {
Dimension total = new Dimension ();
for (Widget child : widget.getChildren ()) {
if (! child.isVisible ())
continue;
Dimension size = child.getPreferredBounds ().getSize ();
if (size.width > total.width)
total.width = size.width;
if (size.height > total.height)
total.height = size.height;
}
for (Widget child : widget.getChildren ()) {
Point location = child.getPreferredBounds ().getLocation ();
child.resolveBounds (new Point (- location.x, - location.y), new Rectangle (location, total));
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
childWidget.resolveBounds (new Point (x, y), preferredBounds);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
childWidget.resolveBounds (new Point (x, y), preferredBounds);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void layout (Widget widget) {
Dimension total = new Dimension ();
for (Widget child : widget.getChildren ()) {
if (! child.isVisible ())
continue;
Dimension size = child.getPreferredBounds ().getSize ();
if (size.width > total.width)
total.width = size.width;
if (size.height > total.height)
total.height = size.height;
}
for (Widget child : widget.getChildren ()) {
Point location = child.getPreferredBounds ().getLocation ();
child.resolveBounds (new Point (- location.x, - location.y), new Rectangle (location, total));
}
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void layout (Widget widget) {
assert widget == cardLayoutWidget;
Point preferredLocation = null;
Rectangle preferredBounds = null;
if (activeChildWidget != null && activeChildWidget.isVisible ())
for (Widget child : cardLayoutWidget.getChildren ())
if (child == activeChildWidget) {
preferredLocation = child.getPreferredLocation ();
preferredBounds = child.getPreferredBounds ();
break;
}
if (preferredLocation == null)
preferredLocation = POINT_EMPTY;
if (preferredBounds == null)
preferredBounds = RECTANGLE_EMPTY;
Rectangle otherBounds = new Rectangle (preferredBounds.x, preferredBounds.y, 0, 0);
for (Widget child : cardLayoutWidget.getChildren ())
child.resolveBounds (preferredLocation, child == activeChildWidget ? preferredBounds : otherBounds);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void layout (Widget widget) {
assert widget == cardLayoutWidget;
Point preferredLocation = null;
Rectangle preferredBounds = null;
if (activeChildWidget != null && activeChildWidget.isVisible ())
for (Widget child : cardLayoutWidget.getChildren ())
if (child == activeChildWidget) {
preferredLocation = child.getPreferredLocation ();
preferredBounds = child.getPreferredBounds ();
break;
}
if (preferredLocation == null)
preferredLocation = POINT_EMPTY;
if (preferredBounds == null)
preferredBounds = RECTANGLE_EMPTY;
Rectangle otherBounds = new Rectangle (preferredBounds.x, preferredBounds.y, 0, 0);
for (Widget child : cardLayoutWidget.getChildren ())
child.resolveBounds (preferredLocation, child == activeChildWidget ? preferredBounds : otherBounds);
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
w.resolveBounds(p, bounds);
w.resolveBounds(p, bounds);
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
w.resolveBounds(p, bounds);
w.resolveBounds(p, bounds);
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public void justify (Widget widget) {
assert widget == cardLayoutWidget;
if (activeChildWidget != null && activeChildWidget.isVisible ())
for (Widget child : cardLayoutWidget.getChildren ())
if (child == activeChildWidget) {
Rectangle bounds = widget.getClientArea ();
Point location = child.getLocation ();
Rectangle childBounds = child.getBounds ();
bounds.translate (- location.x, - location.y);
childBounds.add (bounds);
child.resolveBounds (location, bounds);
return;
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public void justify (Widget widget) {
assert widget == cardLayoutWidget;
if (activeChildWidget != null && activeChildWidget.isVisible ())
for (Widget child : cardLayoutWidget.getChildren ())
if (child == activeChildWidget) {
Rectangle bounds = widget.getClientArea ();
Point location = child.getLocation ();
Rectangle childBounds = child.getBounds ();
bounds.translate (- location.x, - location.y);
childBounds.add (bounds);
child.resolveBounds (location, bounds);
return;
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
viewport.resolveBounds (scrollWidgetClientAreaLocation, new Rectangle (viewportBounds.getSize ()));
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
viewport.resolveBounds (scrollWidgetClientAreaLocation, new Rectangle (viewportBounds.getSize ()));
内容来源于网络,如有侵权,请联系作者删除!