本文整理汇总了Java中javax.swing.text.html.CSS.Value类的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Value类属于javax.swing.text.html.CSS包,在下文中一共展示了Value类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paint
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
public void paint(Polygon shape, Graphics g, Color color, int side) {
Rectangle r = shape.getBounds();
int length = Math.max(r.height / 2, 1);
int[] lengthPattern = { length, length };
Color[] colorPattern =
((side + 1) % 4 < 2) == (type == Value.GROOVE) ?
new Color[] { getShadowColor(color), getLightColor(color) } :
new Color[] { getLightColor(color), getShadowColor(color) };
paintStrokes(r, g, View.Y_AXIS, lengthPattern, colorPattern);
}
示例2: getBorderPainter
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
/**
* Return the border painter appropriate for the given side.
*/
private BorderPainter getBorderPainter(int side) {
Value style = getBorderStyle(side);
return borderPainters.get(style);
}
示例3: paintBorder
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
public void paintBorder(Component c, Graphics g,
int x, int y, int width, int height) {
if (!(g instanceof Graphics2D)) {
return;
}
Graphics2D g2 = (Graphics2D) g.create();
int[] widths = getWidths();
// Position and size of the border interior.
int intX = x + widths[LEFT];
int intY = y + widths[TOP];
int intWidth = width - (widths[RIGHT] + widths[LEFT]);
int intHeight = height - (widths[TOP] + widths[BOTTOM]);
// Coordinates of the interior corners, from NW clockwise.
int[][] intCorners = {
{ intX, intY },
{ intX + intWidth, intY },
{ intX + intWidth, intY + intHeight },
{ intX, intY + intHeight, },
};
// Draw the borders for all sides.
for (int i = 0; i < 4; i++) {
Value style = getBorderStyle(i);
Polygon shape = getBorderShape(i);
if ((style != Value.NONE) && (shape != null)) {
int sideLength = (i % 2 == 0 ? intWidth : intHeight);
// "stretch" the border shape by the interior area dimension
shape.xpoints[2] += sideLength;
shape.xpoints[3] += sideLength;
Color color = getBorderColor(i);
BorderPainter painter = getBorderPainter(i);
double angle = i * Math.PI / 2;
g2.setClip(g.getClip()); // Restore initial clip
g2.translate(intCorners[i][0], intCorners[i][1]);
g2.rotate(angle);
g2.clip(shape);
painter.paint(shape, g2, color, i);
g2.rotate(-angle);
g2.translate(-intCorners[i][0], -intCorners[i][1]);
}
}
g2.dispose();
}
示例4: GrooveRidgePainter
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
GrooveRidgePainter(Value type) {
this.type = type;
}
示例5: InsetOutsetPainter
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
InsetOutsetPainter(Value type) {
this.type = type;
}
示例6: registerBorderPainter
import javax.swing.text.html.CSS.Value; //导入依赖的package包/类
/**
* Add the specified painter to the painters map.
*/
static void registerBorderPainter(Value style, BorderPainter painter) {
borderPainters.put(style, painter);
}