/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* CSS-style borders for HTML elements.
*
* @author Sergey Groznyh
*/
/** Indices for the attribute groups. */
/** Indices for the box sides within the attribute group. */
/** The attribute groups. */
};
/** Parsers for the border properties. */
};
/** Default values for the border properties. */
};
/** Attribute set containing border properties. */
/**
* Initialize the attribute set.
*/
}
/**
* Return the border color for the given side.
*/
if (o instanceof ColorValue) {
cv = (ColorValue) o;
} else {
// Marker for the default value. Use 'color' property value as the
// computed value of the 'border-color' property (CSS2 8.5.2)
}
}
}
/**
* Return the border width for the given side.
*/
int width = 0;
// The 'border-style' value of "none" forces the computed value
// of 'border-width' to be 0 (CSS2 8.5.3)
}
}
return width;
}
/**
* Return an array of border widths in the TOP, RIGHT, BOTTOM, LEFT order.
*/
private int[] getWidths() {
int[] widths = new int[4];
widths[i] = getBorderWidth(i);
}
return widths;
}
/**
* Return the border style for the given side.
*/
}
}
/**
* Return border shape for {@code side} as if the border has zero interior
* length. Shape start is at (0,0); points are added clockwise.
*/
}
return shape;
}
/**
* Return the border painter appropriate for the given side.
*/
}
/**
* Return the color with brightness adjusted by the specified factor.
*
* The factor values are between 0.0 (no change) and 1.0 (turn into white).
* Negative factor values decrease brigthness (ie, 1.0 turns into black).
*/
}
/* The javax.swing.border.Border methods. */
return insets;
}
if (!(g instanceof Graphics2D)) {
return;
}
// Position and size of the border interior.
// Coordinates of the interior corners, from NW clockwise.
int[][] intCorners = {
};
// Draw the borders for all sides.
for (int i = 0; i < 4; i++) {
// "stretch" the border shape by the interior area dimension
}
}
}
/* Border painters. */
interface BorderPainter {
/**
* The painter should paint the border as if it were at the top and the
* coordinates of the NW corner of the interior area is (0, 0). The
* caller is responsible for the appropriate affine transformations.
*
* Clip is set by the caller to the exact border shape so it's safe to
* simply draw into the shape's bounding rectangle.
*/
}
/**
* Painter for the "none" and "hidden" CSS border styles.
*/
// Do nothing.
}
}
/**
* Painter for the "solid" CSS border style.
*/
g.fillPolygon(shape);
}
}
/**
* Defines a method for painting strokes in the specified direction using
* the given length and color patterns.
*/
/**
* Paint strokes repeatedly using the given length and color patterns.
*/
int start = 0;
break;
}
int length = lengthPattern[i];
Color c = colorPattern[i];
if (c != null) {
g.setColor(c);
}
}
}
}
}
/**
* Painter for the "double" CSS border style.
*/
}
}
/**
* Painter for the "dotted" and "dashed" CSS border styles.
*/
final int factor;
}
}
}
/**
* Painter that defines colors for "shadow" and "light" border sides.
*/
/**
* Return the "shadow" border side color.
*/
}
/**
* Return the "light" border side color.
*/
}
}
/**
* Painter for the "groove" and "ridge" CSS border styles.
*/
}
Color[] colorPattern =
}
}
/**
* Painter for the "inset" and "outset" CSS border styles.
*/
}
g.fillPolygon(shape);
}
}
/**
* Add the specified painter to the painters map.
*/
}
/** Map the border style values to the border painter objects. */
/* Initialize the border painters map with the pre-defined values. */
static {
}
}