/*
* 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. 2005 - All Rights Reserved
*
* The original version of this source code and documentation is
* copyrighted and owned by IBM. These materials are provided
* under terms of a License Agreement between IBM and Sun.
* This technology is protected by multiple US and International
* patents. This notice and attribution to IBM may not be removed.
*/
private int defined;
private int nondefault;
// (can be either Attribute wrapping IMH, or IMH itself
// type-specific API
: new AffineTransform(f);
}
: f.getTransform();
}
public void setSuperscript(int f) {
public void setUnderline(int f) {
public void setStrikethrough(boolean f) {
public void setRunDirection(int f) {
public void setBidiEmbedding(int f) {
public void setJustification(float f) {
public void setInputMethodUnderline(int f) {
public void setSwapColors(boolean f) {
public void setKerning(int f) {
public void setTracking(float f) {
public void setLigatures(int f) {
// mask api
}
int mask = 0;
for (EAttribute a: atts) {
}
return mask;
}
public static final int MASK_ALL =
public void unsetDefault() {
defined &= nondefault;
}
throw new InternalError("can't define derived attribute");
}
}
}
}
}
// generic EAttribute API
}
}
throw new InternalError("can't set default derived attribute: " + a);
}
nondefault &= ~a.mask;
}
throw new InternalError("can't unset derived attribute: " + a);
}
nondefault &= ~a.mask;
}
throw new InternalError("can't set derived attribute: " + a);
}
setDefault(a);
} else {
update(a);
}
}
}
throw new InternalError("can't set derived attribute: " + a);
}
if (o != null) {
try {
i_set(a, o);
update(a);
return;
} catch (Exception e) {
}
}
setDefault(a);
}
throw new InternalError("can't get derived attribute: " + a);
}
return i_get(a);
}
return null;
}
// merging
}
int mask) {
if (map instanceof AttributeMap &&
try {
}
} catch (ClassCastException cce) {
// IGNORED
}
}
}
return this;
}
}
if (m == 0) {
break;
}
}
}
return this;
}
// creation API
}
int mask) {
}
}
}
}
return fill;
}
// key must be serializable, so use String, not Object
"sun.font.attributevalues.defined_key";
}
public static AttributeValues
{
} else {
try {
EAttribute ea =
}
}
catch (ClassCastException ex) {
}
}
}
}
return result;
}
if (o == null) {
// hashkey will handle it
} else if (o instanceof Serializable) { // check all...
} else {
}
}
}
return ht;
}
// boilerplate
public int hashCode() {
}
try {
}
catch (ClassCastException e) {
}
return false;
}
// test in order of most likely to differ and easiest to compare
// also assumes we're generally calling this only if family,
// size, weight, posture are the same
if (rhs == this) return true;
}
try {
}
// if transform is null, derived transforms are null
// so there's nothing to do
return result;
}
catch (CloneNotSupportedException e) {
// never happens
return null;
}
}
StringBuilder b = new StringBuilder();
b.append('{');
if (b.length() > 1) {
b.append(", ");
}
b.append('=');
switch (ea) {
b.append('"'); break;
default: throw new InternalError();
}
b.append('*');
}
}
}
b.append('}');
return b.toString();
}
// internal utilities
}
if (i_validate(a)) {
nondefault &= ~a.mask;
} else {
nondefault |= a.mask;
}
} else {
setDefault(a);
}
}
// dispatch
switch (a) {
default: throw new InternalError();
}
}
switch (a) {
default: throw new InternalError();
}
}
switch (a) {
case ETRANSFORM: {
if (o instanceof TransformAttribute) {
if (ta.isIdentity()) {
} else {
}
} else {
}
} break;
case ERUN_DIRECTION: {
if (o instanceof Boolean) {
} else {
}
} break;
case EINPUT_METHOD_HIGHLIGHT: {
if (o instanceof Annotation) {
} else {
}
} break;
break;
default: throw new InternalError();
}
}
switch (a) {
case ETRANSFORM:
: new TransformAttribute(transform);
case ECHAR_REPLACEMENT: return charReplacement;
case EFOREGROUND: return foreground;
case EBACKGROUND: return background;
case ERUN_DIRECTION: {
switch (runDirection) {
// todo: figure out a way to indicate this value
// case -1: return Integer.valueOf(runDirection);
default: return null;
}
} // not reachable
case EINPUT_METHOD_HIGHLIGHT: return imHighlight;
case ENUMERIC_SHAPING: return numericShaping;
default: throw new InternalError();
}
}
switch (a) {
case EFONT: return true;
case ECHAR_REPLACEMENT: return true;
case EFOREGROUND: return true;
case EBACKGROUND: return true;
case ESTRIKETHROUGH: return true;
return true;
case EINPUT_METHOD_HIGHLIGHT: return true;
case ESWAP_COLORS: return true;
case ENUMERIC_SHAPING: return true;
default: throw new InternalError("unknown attribute: " + a);
}
}
// Until textlayout is fixed to use AttributeValues, we'll end up
// creating a map from the values for it. This is a compromise between
// creating the whole map and just checking a particular value.
// Plan to remove these.
if (map instanceof AttributeMap &&
}
}
}
return DEFAULT.justification;
}
if (map instanceof AttributeMap &&
}
return (NumericShaper)obj;
}
}
return DEFAULT.numericShaping;
}
/**
* If this has an imHighlight, create copy of this with those attributes
* applied to it. Otherwise return this unchanged.
*/
if (imHighlight != null) {
if (imHighlight instanceof InputMethodHighlight) {
} else {
}
}
}
}
return this;
}
if (map instanceof AttributeMap &&
}
return av.baselineTransform;
}
}
return null;
}
if (map instanceof AttributeMap &&
}
return av.charTransform;
}
}
return null;
}
public void updateDerivedTransforms() {
// this also updates the mask for the baseline transform
} else {
if (charTransform.isIdentity()) {
}
if (baselineTransform.isIdentity()) {
}
}
if (baselineTransform == null) {
} else {
}
}
boolean andTranslation) {
}
boolean andTranslation) {
}
try {
if (andTranslation) {
}
}
}
catch (NoninvertibleTransformException e) {
return null;
}
return rtx;
}
}