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


Java Insets.set方法代码示例

本文整理汇总了Java中java.awt.Insets.set方法的典型用法代码示例。如果您正苦于以下问题:Java Insets.set方法的具体用法?Java Insets.set怎么用?Java Insets.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Insets的用法示例。


在下文中一共展示了Insets.set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
    insets.set(1,1,1,1);
    if (!(c instanceof JToolBar)) {
        return insets;
    }
    if (((JToolBar)c).isFloatable()) {
        int gripInset = (XPStyle.getXP() != null) ? 12 : 9;
        if (((JToolBar)c).getOrientation() == HORIZONTAL) {
            if (c.getComponentOrientation().isLeftToRight()) {
                insets.left = gripInset;
            } else {
                insets.right = gripInset;
            }
        } else {
            insets.top = gripInset;
        }
    }
    return insets;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:WindowsBorders.java

示例2: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
private static Insets getBorderInsets(Border border, Component c, Insets insets) {
    if (border == null) {
        insets.set(0, 0, 0, 0);
    }
    else if (border instanceof AbstractBorder) {
        AbstractBorder ab = (AbstractBorder) border;
        insets = ab.getBorderInsets(c, insets);
    }
    else {
        Insets i = border.getBorderInsets(c);
        insets.set(i.top, i.left, i.bottom, i.right);
    }
    return insets;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:TitledBorder.java

示例3: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
    insets.set(2, 2, 2, 0);
    return insets;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:MetalBorders.java

示例4: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
    insets.set(1, 1, 1, 1);
    return insets;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:MotifBorders.java

示例5: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets newInsets) {
    newInsets.set(3, 3, 3, 3);
    return newInsets;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:MetalBorders.java

示例6: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets newInsets) {
    newInsets.set(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE);
    return newInsets;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:MotifBorders.java

示例7: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
    insets.set(1,1,1,1);
    return insets;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:5,代码来源:WindowsBorders.java

示例8: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
/**
 * Reinitializes the {@code insets} parameter
 * with this border's current insets.
 * Every inset is the smallest (closest to negative infinity) integer value
 * that is greater than or equal to the line width of the stroke
 * that is used to paint the border.
 *
 * @param c       the component for which this border insets value applies
 * @param insets  the {@code Insets} object to be reinitialized
 * @return the reinitialized {@code insets} parameter
 *
 * @throws NullPointerException if the specified {@code insets} is {@code null}
 *
 * @see Math#ceil
 */
@Override
public Insets getBorderInsets(Component c, Insets insets) {
    int size = (int) Math.ceil(this.stroke.getLineWidth());
    insets.set(size, size, size, size);
    return insets;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:StrokeBorder.java

示例9: getBorderInsets

import java.awt.Insets; //导入方法依赖的package包/类
/**
 * Reinitialize the insets parameter with this Border's current Insets.
 * @param c the component for which this border insets value applies
 * @param insets the object to be reinitialized
 */
public Insets getBorderInsets(Component c, Insets insets) {
    insets.set(2, 2, 2, 2);
    return insets;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BevelBorder.java


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