当前位置: 首页>>代码示例>>Java>>正文


Java Insets.equals方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:Test6657026.java

示例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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SynthSliderUI.java

示例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));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:Axis.java

示例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!");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:InsetsEncapsulation.java

示例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;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:FullScreenInsets.java

示例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());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:10,代码来源:Test4856008.java

示例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();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:JMenuBar.java

示例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();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:SynthSliderUI.java

示例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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:JMenuBar.java


注:本文中的java.awt.Insets.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。