本文整理汇总了Java中com.haulmont.cuba.gui.components.Component.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Component.getWidth方法的具体用法?Java Component.getWidth怎么用?Java Component.getWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.gui.components.Component
的用法示例。
在下文中一共展示了Component.getWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateComponent
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void updateComponent(Component child) {
boolean componentReAdded = false;
if (DesktopContainerHelper.mayHaveExternalCaption(child)
|| DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
if (captions.containsKey(child)
&& !DesktopContainerHelper.hasExternalCaption(child)
&& !DesktopContainerHelper.hasExternalContextHelp(child)) {
reAddChild(child);
componentReAdded = true;
} else if (!captions.containsKey(child)
&& (DesktopContainerHelper.hasExternalCaption(child)
|| DesktopContainerHelper.hasExternalContextHelp(child))) {
reAddChild(child);
componentReAdded = true;
} else if (captions.containsKey(child)) {
ComponentCaption caption = captions.get(child);
caption.update();
BoxLayoutAdapter adapterForCaption = layoutAdapter;
if (wrappers.containsKey(child)) {
adapterForCaption = wrappers.get(child).getSecond();
}
adapterForCaption.updateConstraints(caption, adapterForCaption.getCaptionConstraints(child));
}
}
if (!componentReAdded) {
JComponent composition;
if (wrappers.containsKey(child)) {
composition = wrappers.get(child).getFirst();
CC constraints = MigLayoutHelper.getConstraints(child);
if (child.getHeight() == -1.0) {
MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
}
if (child.getWidth() == -1.0) {
MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
}
BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
} else {
composition = DesktopComponentsHelper.getComposition(child);
}
layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
}
requestRepaint();
}
示例2: updateComponentInternal
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
protected void updateComponentInternal(Component child) {
boolean componentReAdded = false;
if (DesktopContainerHelper.mayHaveExternalCaption(child)
|| DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
if (captions.containsKey(child)
&& !DesktopContainerHelper.hasExternalCaption(child)
&& !DesktopContainerHelper.hasExternalContextHelp(child)) {
reAddChild(child);
componentReAdded = true;
} else if (!captions.containsKey(child)
&& (DesktopContainerHelper.hasExternalCaption(child)
|| DesktopContainerHelper.hasExternalContextHelp(child))) {
reAddChild(child);
componentReAdded = true;
} else if (captions.containsKey(child)) {
ComponentCaption caption = captions.get(child);
caption.update();
BoxLayoutAdapter adapterForCaption = layoutAdapter;
if (wrappers.containsKey(child)) {
adapterForCaption = wrappers.get(child).getSecond();
}
adapterForCaption.updateConstraints(caption, adapterForCaption.getCaptionConstraints(child));
}
}
if (!componentReAdded) {
JComponent composition;
if (wrappers.containsKey(child)) {
composition = wrappers.get(child).getFirst();
CC constraints = MigLayoutHelper.getConstraints(child);
if (child.getHeight() == -1.0) {
MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
}
if (child.getWidth() == -1.0) {
MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
}
BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
} else {
composition = DesktopComponentsHelper.getComposition(child);
}
layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
}
}
示例3: updateComponent
import com.haulmont.cuba.gui.components.Component; //导入方法依赖的package包/类
@Override
public void updateComponent(Component child) {
boolean componentReAdded = false;
if (DesktopContainerHelper.mayHaveExternalCaption(child)
|| DesktopContainerHelper.mayHaveExternalContextHelp(child)) {
if (captions.containsKey(child)
&& !DesktopContainerHelper.hasExternalCaption(child)
&& !DesktopContainerHelper.hasExternalContextHelp(child)) {
reAddChild(child);
componentReAdded = true;
} else if (!captions.containsKey(child)
&& (DesktopContainerHelper.hasExternalCaption(child)
|| DesktopContainerHelper.hasExternalContextHelp(child))) {
reAddChild(child);
componentReAdded = true;
} else if (captions.containsKey(child)) {
ComponentCaption caption = captions.get(child);
caption.update();
if (!wrappers.containsKey(child)) {
CC c = (CC) layoutAdapter.getConstraints(child);
layoutAdapter.updateConstraints(caption, layoutAdapter.getCaptionConstraints(child,
c.getCellX(), c.getCellY(), c.getCellX(), c.getCellY()));
}
}
}
if (!componentReAdded) {
JComponent composition;
if (wrappers.containsKey(child)) {
composition = wrappers.get(child).getFirst();
CC constraints = MigLayoutHelper.getConstraints(child);
if (child.getHeight() == -1.0) {
MigLayoutHelper.applyHeight(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyHeight(constraints, 100, UNITS_PERCENTAGE, false);
}
if (child.getWidth() == -1.0) {
MigLayoutHelper.applyWidth(constraints, -1, UNITS_PIXELS, false);
} else {
MigLayoutHelper.applyWidth(constraints, 100, UNITS_PERCENTAGE, false);
}
BoxLayoutAdapter adapter = wrappers.get(child).getSecond();
adapter.updateConstraints(DesktopComponentsHelper.getComposition(child), constraints);
} else {
composition = DesktopComponentsHelper.getComposition(child);
}
layoutAdapter.updateConstraints(composition, layoutAdapter.getConstraints(child));
}
requestRepaint();
requestContainerUpdate();
}