本文整理汇总了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;
}
示例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;
}
示例3: getBorderInsets
import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(2, 2, 2, 0);
return insets;
}
示例4: getBorderInsets
import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(1, 1, 1, 1);
return insets;
}
示例5: getBorderInsets
import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets newInsets) {
newInsets.set(3, 3, 3, 3);
return newInsets;
}
示例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;
}
示例7: getBorderInsets
import java.awt.Insets; //导入方法依赖的package包/类
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(1,1,1,1);
return insets;
}
示例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;
}
示例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;
}