类javax.swing.text.html.CSS.Value源码实例Demo

下面列出了怎么用javax.swing.text.html.CSS.Value的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: jdk1.8-source-analysis   文件: CSSBorder.java
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 项目: jdk8u_jdk   文件: CSSBorder.java
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);
}
 
源代码3 项目: hottub   文件: CSSBorder.java
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);
}
 
源代码4 项目: dragonwell8_jdk   文件: CSSBorder.java
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);
}
 
源代码5 项目: TencentKona-8   文件: CSSBorder.java
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);
}
 
源代码6 项目: jdk8u-jdk   文件: CSSBorder.java
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);
}
 
源代码7 项目: jdk8u60   文件: CSSBorder.java
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);
}
 
源代码8 项目: JDKSourceCode1.8   文件: CSSBorder.java
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);
}
 
源代码9 项目: jdk8u-dev-jdk   文件: CSSBorder.java
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);
}
 
源代码10 项目: openjdk-jdk8u   文件: CSSBorder.java
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);
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: CSSBorder.java
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);
}
 
源代码12 项目: openjdk-8-source   文件: CSSBorder.java
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);
}
 
源代码13 项目: jdk8u-jdk   文件: CSSBorder.java
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);
}
 
源代码14 项目: jdk1.8-source-analysis   文件: CSSBorder.java
/**
 * Return the border painter appropriate for the given side.
 */
private BorderPainter getBorderPainter(int side) {
    Value style = getBorderStyle(side);
    return borderPainters.get(style);
}
 
源代码15 项目: jdk8u_jdk   文件: CSSBorder.java
public void paint(Polygon shape, Graphics g, Color color, int side) {
    g.setColor(((side + 1) % 4 < 2) == (type == Value.INSET) ?
                        getShadowColor(color) : getLightColor(color));
    g.fillPolygon(shape);
}
 
源代码16 项目: openjdk-8   文件: CSSBorder.java
InsetOutsetPainter(Value type) {
    this.type = type;
}
 
源代码17 项目: jdk1.8-source-analysis   文件: CSSBorder.java
public void paint(Polygon shape, Graphics g, Color color, int side) {
    g.setColor(((side + 1) % 4 < 2) == (type == Value.INSET) ?
                        getShadowColor(color) : getLightColor(color));
    g.fillPolygon(shape);
}
 
源代码18 项目: openjdk-8   文件: CSSBorder.java
GrooveRidgePainter(Value type) {
    this.type = type;
}
 
源代码19 项目: dragonwell8_jdk   文件: CSSBorder.java
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();
}
 
源代码20 项目: dragonwell8_jdk   文件: CSSBorder.java
GrooveRidgePainter(Value type) {
    this.type = type;
}
 
源代码21 项目: openjdk-8   文件: CSSBorder.java
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();
}
 
源代码22 项目: dragonwell8_jdk   文件: CSSBorder.java
public void paint(Polygon shape, Graphics g, Color color, int side) {
    g.setColor(((side + 1) % 4 < 2) == (type == Value.INSET) ?
                        getShadowColor(color) : getLightColor(color));
    g.fillPolygon(shape);
}
 
源代码23 项目: hottub   文件: CSSBorder.java
InsetOutsetPainter(Value type) {
    this.type = type;
}
 
源代码24 项目: TencentKona-8   文件: CSSBorder.java
/**
 * Return the border painter appropriate for the given side.
 */
private BorderPainter getBorderPainter(int side) {
    Value style = getBorderStyle(side);
    return borderPainters.get(style);
}
 
源代码25 项目: TencentKona-8   文件: CSSBorder.java
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();
}
 
源代码26 项目: TencentKona-8   文件: CSSBorder.java
GrooveRidgePainter(Value type) {
    this.type = type;
}
 
源代码27 项目: TencentKona-8   文件: CSSBorder.java
InsetOutsetPainter(Value type) {
    this.type = type;
}
 
源代码28 项目: TencentKona-8   文件: CSSBorder.java
public void paint(Polygon shape, Graphics g, Color color, int side) {
    g.setColor(((side + 1) % 4 < 2) == (type == Value.INSET) ?
                        getShadowColor(color) : getLightColor(color));
    g.fillPolygon(shape);
}
 
源代码29 项目: TencentKona-8   文件: CSSBorder.java
/**
 * Add the specified painter to the painters map.
 */
static void registerBorderPainter(Value style, BorderPainter painter) {
    borderPainters.put(style, painter);
}
 
源代码30 项目: jdk8u60   文件: CSSBorder.java
/**
 * Return the border painter appropriate for the given side.
 */
private BorderPainter getBorderPainter(int side) {
    Value style = getBorderStyle(side);
    return borderPainters.get(style);
}
 
 类所在包
 类方法
 同包方法