/*
* 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.
*
*/
/*
* (C) Copyright IBM Corp. 1999-2003, All Rights Reserved
*
*/
/**
* This class handles underlining, strikethrough, and foreground and
* background styles on text. Clients simply acquire instances
* of this class and hand them off to ExtendedTextLabels or GraphicComponents.
*/
public class Decoration {
/**
* This interface is implemented by clients that use Decoration.
* Unfortunately, interface methods have to public; ideally these
* would be package-private.
*/
public interface Label {
}
private Decoration() {
}
/**
* Return a Decoration which does nothing.
*/
return PLAIN;
}
private static final int VALUES_MASK =
return PLAIN;
}
}
/**
* Return a Decoration appropriate for the the given Map.
* @param attributes the Map used to determine the Decoration
*/
if (attributes == null) {
return PLAIN;
}
}
float x,
float y) {
}
return label.handleGetVisualBounds();
}
}
float x,
float y) {
return label.handleGetOutline(x, y);
}
private boolean swapColors = false;
private boolean strikethrough = false;
boolean swapColors,
boolean strikethrough,
this.swapColors = swapColors;
this.strikethrough = strikethrough;
this.stdUnderline = stdUnderline;
this.imUnderline = imUnderline;
}
}
else {
}
}
if (rhs == this) {
return true;
}
return false;
}
try {
}
catch(ClassCastException e) {
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
}
public int hashCode() {
int hc = 1;
if (strikethrough) {
hc |= 2;
}
if (swapColors) {
hc |= 4;
}
if (stdUnderline != null) {
}
return hc;
}
/**
* Return the bottom of the Rectangle which encloses pixels
* drawn by underlines.
*/
float maxY = 0;
if (stdUnderline != null) {
}
if (imUnderline != null) {
}
return maxY;
}
float x,
float y) {
return;
}
float x1 = x;
if (strikethrough) {
}
if (stdUnderline != null) {
}
if (imUnderline != null) {
}
}
float x,
float y) {
}
else {
if (swapColors) {
if (background instanceof Color) {
// 30/59/11 is standard weights, tweaked a bit
} else {
}
} else {
}
}
else {
}
if (background != null) {
}
}
}
float minX = 0;
}
}
return visBounds;
}
float x,
float y) {
return label.handleGetOutline(x, y);
}
// NOTE: The performace of the following code may
// be very poor.
float x1 = x;
if (stdUnderline != null) {
}
if (strikethrough) {
} else {
}
}
if (imUnderline != null) {
}
else {
}
}
// area won't be null here, since at least one underline exists.
return new GeneralPath(area);
}
}
}
}