本文整理汇总了Java中java.awt.Insets.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Insets.equals方法的具体用法?Java Insets.equals怎么用?Java Insets.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Insets
的用法示例。
在下文中一共展示了Insets.equals方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import java.awt.Insets; //导入方法依赖的package包/类
private static void test(Border border) {
Insets actual = border.getBorderInsets(null);
if (NEGATIVE.equals(actual)) {
throw new Error("unexpected insets in " + border.getClass());
}
Insets expected = (Insets) actual.clone();
// modify
actual.top++;
actual.left++;
actual.right++;
actual.bottom++;
// validate
if (!expected.equals(border.getBorderInsets(null))) {
throw new Error("shared insets in " + border.getClass());
}
}
示例2: recalculateIfInsetsChanged
import java.awt.Insets; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void recalculateIfInsetsChanged() {
SynthContext context = getContext(slider);
Insets newInsets = style.getInsets(context, null);
Insets compInsets = slider.getInsets();
newInsets.left += compInsets.left; newInsets.right += compInsets.right;
newInsets.top += compInsets.top; newInsets.bottom += compInsets.bottom;
if (!newInsets.equals(insetCache)) {
insetCache = newInsets;
calculateGeometry();
}
context.dispose();
}
示例3: setLabelInsets
import java.awt.Insets; //导入方法依赖的package包/类
/**
* Sets the insets for the axis label, and sends an {@link AxisChangeEvent} to all
* registered listeners.
*
* @param insets the insets (<code>null</code> not permitted).
*/
public void setLabelInsets(Insets insets) {
if (insets == null) {
throw new IllegalArgumentException("Null 'insets' argument.");
}
if (!insets.equals(this.labelInsets)) {
this.labelInsets = insets;
notifyListeners(new AxisChangeEvent(this));
}
}
示例4: test
import java.awt.Insets; //导入方法依赖的package包/类
void test(final JComponent component) {
final Insets p = component.getInsets();
p.top += 3;
if (p.equals(component.getInsets())) {
throw new RuntimeException("Insets altered by altering Insets!");
}
}
示例5: testInsets
import java.awt.Insets; //导入方法依赖的package包/类
private static void testInsets(final Insets actual, final Insets exp) {
if (!actual.equals(exp)) {
System.err.println(" Wrong window insets:" +
" Expected: " + exp + " Actual: " + actual);
passed = false;
}
}
示例6: test
import java.awt.Insets; //导入方法依赖的package包/类
private static void test(Border border, Insets insets) {
Insets result = border.getBorderInsets(getComponent(border));
if (insets == result) {
throw new Error("both instances are the same for " + border.getClass());
}
if (!insets.equals(result)) {
throw new Error("both insets are not equal for " + border.getClass());
}
}
示例7: setMargin
import java.awt.Insets; //导入方法依赖的package包/类
/**
* Sets the margin between the menubar's border and
* its menus. Setting to <code>null</code> will cause the menubar to
* use the default margins.
*
* @param m an Insets object containing the margin values
* @see Insets
*/
@BeanProperty(visualUpdate = true, description
= "The space between the menubar's border and its contents")
public void setMargin(Insets m) {
Insets old = margin;
this.margin = m;
firePropertyChange("margin", old, m);
if (old == null || !old.equals(m)) {
revalidate();
repaint();
}
}
示例8: recalculateIfInsetsChanged
import java.awt.Insets; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void recalculateIfInsetsChanged() {
SynthContext context = getContext(slider);
Insets newInsets = style.getInsets(context, null);
Insets compInsets = slider.getInsets();
newInsets.left += compInsets.left; newInsets.right += compInsets.right;
newInsets.top += compInsets.top; newInsets.bottom += compInsets.bottom;
if (!newInsets.equals(insetCache)) {
insetCache = newInsets;
calculateGeometry();
}
}
示例9: setMargin
import java.awt.Insets; //导入方法依赖的package包/类
/**
* Sets the margin between the menubar's border and
* its menus. Setting to <code>null</code> will cause the menubar to
* use the default margins.
*
* @param m an Insets object containing the margin values
* @see Insets
* @beaninfo
* bound: true
* attribute: visualUpdate true
* description: The space between the menubar's border and its contents
*/
public void setMargin(Insets m) {
Insets old = margin;
this.margin = m;
firePropertyChange("margin", old, m);
if (old == null || !old.equals(m)) {
revalidate();
repaint();
}
}