提交 bada5967 编写于 作者: D duke

Merge

cfeea66a3fa8ca3686a7cfa2d0ce8ab0169f168d jdk7-b24
cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
9410f77cc30c604d1caf7c9fe3a57fa19e1acbe8 jdk7-b26
11b4dc9f2be3523ef989a0db8459eb56b3045c3a jdk7-b27
55540e827aef970ecc010b7e06b912d991c8e3ce jdk7-b24
5e61d5df62586474414d1058e9186441aa908f51 jdk7-b25
0043eb3d4e628f049ff80a8c223b5657136085e7 jdk7-b26
e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27
a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24
7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25
ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26
e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27
6ce5f4757bde08f7470cbb9f0b46da8f2f3d4f56 jdk7-b24
a3b3ba7d6034dc754b51ddc3d281399ac1cae5f1 jdk7-b25
da43cb85fac1646d6f97e4a35e510bbfdff97bdb jdk7-b26
bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27
37a05a11f281b4d238e2f9e7ebb67c63f64d0e77 jdk7-b24
75fca0b0ab83ab1392e615910cea020f66535390 jdk7-b25
fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
3e599d98875ddf919c8ea11cff9b3a99ba631a9b jdk7-b27
......@@ -126,44 +126,10 @@ com/sun/media/sound/SimpleInputDeviceProvider\$$1.class \
com/sun/media/sound/SimpleInputDeviceProvider\$$InputDeviceInfo.class \
com/sun/media/sound/SimpleInputDeviceProvider.class
PLUG_AWT_CLASS_NAMES = \
java/awt/color/CMMException.class \
java/awt/color/ColorSpace.class \
java/awt/color/ICC_ColorSpace.class \
java/awt/color/ICC_Profile\$$1.class \
java/awt/color/ICC_Profile\$$2.class \
java/awt/color/ICC_Profile\$$3.class \
java/awt/color/ICC_Profile.class \
java/awt/color/ICC_ProfileGray.class \
java/awt/color/ICC_ProfileRGB.class \
java/awt/image/BandedSampleModel.class \
java/awt/image/ColorConvertOp.class \
java/awt/image/ComponentSampleModel.class \
java/awt/image/DataBuffer\$$1.class \
java/awt/image/DataBuffer.class \
java/awt/image/DataBufferByte.class \
java/awt/image/DataBufferInt.class \
java/awt/image/DataBufferShort.class \
java/awt/image/DataBufferUShort.class \
java/awt/image/MultiPixelPackedSampleModel.class \
java/awt/image/Raster.class \
java/awt/image/RenderedImage.class \
java/awt/image/SampleModel.class \
java/awt/image/SinglePixelPackedSampleModel.class \
java/awt/image/WritableRaster.class \
java/awt/image/WritableRenderedImage.class \
java/awt/image/renderable/ContextualRenderedImageFactory.class \
java/awt/image/renderable/ParameterBlock.class \
java/awt/image/renderable/RenderContext.class \
java/awt/image/renderable/RenderableImage.class \
java/awt/image/renderable/RenderableImageOp.class \
java/awt/image/renderable/RenderableImageProducer.class \
java/awt/image/renderable/RenderedImageFactory.class
# Class list temp files (used by both import and export of plugs)
PLUG_TEMPDIR=$(ABS_TEMPDIR)/plugs
PLUG_CLASS_AREAS = jmf sound awt
PLUG_CLASS_AREAS = jmf sound
PLUG_CLISTS = $(PLUG_CLASS_AREAS:%=$(PLUG_TEMPDIR)/%.clist)
# Create jargs file command
......@@ -186,11 +152,6 @@ $(PLUG_TEMPDIR)/sound.clist:
@for i in $(PLUG_SOUND_CLASS_NAMES) ; do \
$(ECHO) "$$i" >> $@ ; \
done
$(PLUG_TEMPDIR)/awt.clist:
@$(prep-target)
@for i in $(PLUG_AWT_CLASS_NAMES) ; do \
$(ECHO) "$$i" >> $@ ; \
done
$(PLUG_TEMPDIR)/all.clist: $(PLUG_CLISTS)
@$(prep-target)
$(CAT) $(PLUG_CLISTS) > $@
......@@ -198,8 +159,6 @@ $(PLUG_TEMPDIR)/jmf.jargs: $(PLUG_TEMPDIR)/jmf.clist
$(plug-create-jargs)
$(PLUG_TEMPDIR)/sound.jargs: $(PLUG_TEMPDIR)/sound.clist
$(plug-create-jargs)
$(PLUG_TEMPDIR)/awt.jargs: $(PLUG_TEMPDIR)/awt.clist
$(plug-create-jargs)
$(PLUG_TEMPDIR)/all.jargs: $(PLUG_TEMPDIR)/all.clist
$(plug-create-jargs)
......@@ -235,15 +194,12 @@ import-binary-plug-jmf-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/jmf.clist
$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/jmf.clist)
import-binary-plug-sound-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/sound.clist
$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/sound.clist)
import-binary-plug-awt-classes: $(PLUG_IMPORT_JARFILE) $(PLUG_TEMPDIR)/awt.clist
$(call import-binary-plug-classes,$(PLUG_TEMPDIR)/awt.clist)
# Import all classes from the jar file
import-binary-plug-jar: \
import-binary-plug-jmf-classes \
import-binary-plug-sound-classes \
import-binary-plug-awt-classes
import-binary-plug-sound-classes
# Import native libraries
......@@ -286,7 +242,6 @@ import-binary-plugs: \
import-binary-plug-jar \
import-binary-plug-jmf-classes \
import-binary-plug-sound-classes \
import-binary-plug-awt-classes \
import-binary-plug-jsound-library
else # !OPENJDK
......
......@@ -148,13 +148,15 @@ ifeq ($(PLATFORM),windows)
ECHO = $(UNIXCOMMAND_PATH)echo -e
ZIPEXE = $(UNIXCOMMAND_PATH)zip
UNZIP = $(UNIXCOMMAND_PATH)unzip
# Some CYGWIN nawk versions require BINMODE=w for proper '\r' interpretation
NAWK = $(UNIXCOMMAND_PATH)awk -v BINMODE=w
else
ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
UNZIP = $(UTILS_DEVTOOL_PATH)unzip
NAWK = $(UNIXCOMMAND_PATH)awk
endif
# Re-define some utilities
LEX =# override GNU Make intrinsic: no lex on windows
NAWK = $(UNIXCOMMAND_PATH)awk
endif
# Linux specific
......
......@@ -28,24 +28,12 @@ PACKAGE = java.awt
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
# WARNING: Make sure the OPENJDK plugs are up-to-date, see make/common/internal/BinaryPlugs.gmk
#
# Files
#
AUTO_FILES_JAVA_DIRS = java/awt sun/awt/geom
#
# Specific to OPENJDK
#
ifdef OPENJDK
build: import-binary-plug-awt-classes
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
endif
build: properties cursors
#
......
......@@ -394,7 +394,7 @@ LOCALES_GEN_SH = localelist.sh
$(GENSRCDIR)/sun/util/CoreResourceBundleControl.java: \
$(SHARE_SRC)/classes/sun/util/CoreResourceBundleControl-XLocales.java $(LOCALES_GEN_SH)
@$(prep-target)
NAWK=$(NAWK) SED=$(SED) $(SH) $(LOCALES_GEN_SH) "$(JRE_NONEXIST_LOCALES)" \
NAWK="$(NAWK)" SED="$(SED)" $(SH) $(LOCALES_GEN_SH) "$(JRE_NONEXIST_LOCALES)" \
$< $@
clean::
$(RM) $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java
......
......@@ -191,7 +191,7 @@ sources: $(SPP) $(FILES_genout)
GEN_BUFFER_SH = genBuffer.sh
GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK=$(NAWK) SED=$(SED) SH=$(SH) \
GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK="$(NAWK)" SED="$(SED)" SH="$(SH)" \
$(SH) $(GEN_BUFFER_SH)
# Public abstract buffer classes
......@@ -582,7 +582,7 @@ $(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.jav
GEN_CODER_SH = genCoder.sh
GEN_CODER_CMD = SPP="$(SPP_CMD)" SED=$(SED) NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_CODER_SH)
GEN_CODER_CMD = SPP="$(SPP_CMD)" SED="$(SED)" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_CODER_SH)
$(CS_GEN)/CharsetDecoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
$(prep-target)
......@@ -602,7 +602,7 @@ $(CS_GEN)/CharsetEncoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
GEN_EX_SH = genExceptions.sh
GEN_EX_CMD = NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_EX_SH)
GEN_EX_CMD = NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_EX_SH)
$(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
$(prep-target)
......@@ -635,7 +635,7 @@ $(SCS_GEN)/StandardCharsets.java: genCharsetProvider.sh \
$(HASHER_JARFILE) $(SCS_SRC)/standard-charsets
$(prep-target)
@$(RM) $@.temp
NAWK=$(NAWK) TEMPDIR=$(TEMPDIR) SH=$(SH) \
NAWK="$(NAWK)" TEMPDIR="$(TEMPDIR)" SH="$(SH)" \
HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
$(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
......
......@@ -41,12 +41,8 @@ endif # OPENJDK
ICCPROFILE_DEST_DIR = $(LIBDIR)/cmm
iccprofiles: $(ICCPROFILE_DEST_DIR)/sRGB.pf $(ICCPROFILE_DEST_DIR)/GRAY.pf \
$(ICCPROFILE_DEST_DIR)/CIEXYZ.pf
ifndef OPENJDK
iccprofiles: $(ICCPROFILE_DEST_DIR)/PYCC.pf \
$(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf
endif
$(ICCPROFILE_DEST_DIR)/CIEXYZ.pf $(ICCPROFILE_DEST_DIR)/PYCC.pf \
$(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf
$(ICCPROFILE_DEST_DIR)/sRGB.pf: $(ICCPROFILE_SRC_DIR)/sRGB.pf
$(RM) $(ICCPROFILE_DEST_DIR)/sRGB.pf
......
......@@ -113,7 +113,9 @@ FILES_cpp_shared = \
ifeq ($(PLATFORM),windows)
FILES_c_platform = fontpath.c
FILES_c_platform = fontpath.c \
lcdglyph.c
FILES_cpp_platform = D3DTextRenderer.cpp
else
FILES_c_platform = X11FontScaler.c \
......
......@@ -63,6 +63,7 @@ FILES_export = \
java/awt/Font.java \
java/text/Bidi.java \
sun/font/FileFont.java \
sun/font/FileFontStrike.java \
sun/font/FontManager.java \
sun/font/GlyphList.java \
sun/font/NativeFont.java \
......
......@@ -233,7 +233,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
MBeanRegistrationException, MBeanException,
NotCompliantMBeanException, InstanceNotFoundException {
ObjectName logicalName = name;
Class theClass;
if (className == null) {
......@@ -519,8 +518,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
QueryExp query) {
// Query the MBeans on the repository
//
Set<NamedObject> list = null;
list = repository.query(name, query);
Set<NamedObject> list = repository.query(name, query);
if (queryByRepo) {
// The repository performs the filtering
......@@ -576,8 +574,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
private Set<ObjectName> queryNamesImpl(ObjectName name, QueryExp query) {
// Query the MBeans on the repository
//
Set<NamedObject> list = null;
list = repository.query(name, query);
Set<NamedObject> list = repository.query(name, query);
if (queryByRepo) {
// The repository performs the filtering
......@@ -1042,7 +1039,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
if (registerFailed && moi instanceof DynamicMBean2)
((DynamicMBean2) moi).registerFailed();
try {
moi.postRegister(new Boolean(registrationDone));
moi.postRegister(registrationDone);
} catch (RuntimeException e) {
throw new RuntimeMBeanException(e,
"RuntimeException thrown in postRegister method");
......@@ -1094,8 +1091,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
IllegalArgumentException("Object name cannot be null"),
"Exception occurred trying to get an MBean");
}
DynamicMBean obj = null;
obj = repository.retrieve(name);
DynamicMBean obj = repository.retrieve(name);
if (obj == null) {
if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
MBEANSERVER_LOGGER.logp(Level.FINER,
......@@ -1568,7 +1564,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
query.setMBeanServer(server);
try {
for (NamedObject no : list) {
final DynamicMBean obj = no.getObject();
boolean res;
try {
res = query.apply(no.getName());
......
......@@ -205,7 +205,7 @@ public class MBeanInstantiator {
*/
public Object instantiate(Class theClass)
throws ReflectionException, MBeanException {
Object moi = null;
Object moi;
// ------------------------------
......@@ -265,7 +265,7 @@ public class MBeanInstantiator {
// ------------------------------
// ------------------------------
final Class[] tab;
Object moi= null;
Object moi;
try {
// Build the signature of the method
//
......@@ -283,8 +283,7 @@ public class MBeanInstantiator {
}
// Query the metadata service to get the right constructor
Constructor cons = null;
cons = findConstructor(theClass, tab);
Constructor cons = findConstructor(theClass, tab);
if (cons == null) {
throw new ReflectionException(new
......@@ -408,7 +407,7 @@ public class MBeanInstantiator {
throw new RuntimeOperationsException(new
IllegalArgumentException(), "Null className passed in parameter");
}
Class theClass = null;
Class theClass;
if (loaderName == null) {
// Load the class using the agent class loader
theClass = findClass(className, loader);
......@@ -621,7 +620,7 @@ public class MBeanInstantiator {
static Class loadClass(String className, ClassLoader loader)
throws ReflectionException {
Class theClass = null;
Class theClass;
if (className == null) {
throw new RuntimeOperationsException(new
IllegalArgumentException("The class name cannot be null"),
......
......@@ -89,7 +89,6 @@ public class Repository {
/* This class is used to match an ObjectName against a pattern. */
private final static class ObjectNamePattern {
private final char[] domain;
private final String[] keys;
private final String[] values;
private final String properties;
......@@ -106,8 +105,7 @@ public class Repository {
* @param pattern The ObjectName pattern under examination.
**/
public ObjectNamePattern(ObjectName pattern) {
this(pattern.getDomain(),
pattern.isPropertyListPattern(),
this(pattern.isPropertyListPattern(),
pattern.isPropertyValuePattern(),
pattern.getCanonicalKeyPropertyListString(),
pattern.getKeyPropertyList(),
......@@ -124,13 +122,11 @@ public class Repository {
* @param keyPropertyList pattern.getKeyPropertyList().
* @param pattern The ObjectName pattern under examination.
**/
ObjectNamePattern(String domain,
boolean propertyListPattern,
ObjectNamePattern(boolean propertyListPattern,
boolean propertyValuePattern,
String canonicalProps,
Map<String,String> keyPropertyList,
ObjectName pattern) {
this.domain = domain.toCharArray();
this.isPropertyListPattern = propertyListPattern;
this.isPropertyValuePattern = propertyValuePattern;
this.properties = canonicalProps;
......@@ -538,7 +534,7 @@ public class Repository {
// "domain:*", "domain:[key=value],*" : names in the specified domain
// Surely one of the most frequent case ... query on the whole world
ObjectName name = null;
ObjectName name;
if (pattern == null ||
pattern.getCanonicalName().length() == 0 ||
pattern.equals(ObjectName.WILDCARD))
......@@ -660,7 +656,7 @@ public class Repository {
* @return Number of MBeans.
*/
public Integer getCount() {
return new Integer(nbElements);
return nbElements;
}
/**
......@@ -669,7 +665,7 @@ public class Repository {
*
* @return A string giving the name of the default domain name.
*/
public String getDefaultDomain() {
public String getDefaultDomain() {
return domain;
}
......
......@@ -435,7 +435,6 @@ public abstract class ClientNotifForwarder {
clientSequenceNumber = nr.getNextSequenceNumber();
final int size = infoList.size();
listeners = new HashMap<Integer, ClientListenerInfo>();
for (int i = 0 ; i < len ; i++) {
......@@ -792,9 +791,6 @@ public abstract class ClientNotifForwarder {
private Thread currentFetchThread;
// admin stuff
private boolean inited = false;
// state
/**
* This state means that a thread is being created for fetching and forwarding notifications.
......
......@@ -269,7 +269,7 @@ public class ServerNotifForwarder {
", the maxNotifications is " + maxNotifications);
}
NotificationResult nr = null;
NotificationResult nr;
final long t = Math.min(connectionTimeout, timeout);
try {
nr = notifBuffer.fetchNotifications(bufferFilter,
......@@ -322,7 +322,7 @@ public class ServerNotifForwarder {
private Integer getListenerID() {
synchronized(listenerCounterLock) {
return new Integer(listenerCounter++);
return listenerCounter++;
}
}
......@@ -336,7 +336,7 @@ public class ServerNotifForwarder {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
AccessControlContext acc = AccessController.getContext();
ObjectInstance oi = null;
ObjectInstance oi;
try {
oi = AccessController.doPrivileged(
new PrivilegedExceptionAction<ObjectInstance>() {
......
......@@ -437,7 +437,7 @@ public class FileLoginModule implements LoginModule {
// get the username and password
getUsernamePassword(usePasswdFromSharedState);
String localPassword = null;
String localPassword;
// userCredentials is initialized in login()
if (((localPassword = userCredentials.getProperty(username)) == null) ||
......@@ -487,10 +487,14 @@ public class FileLoginModule implements LoginModule {
throw ace;
}
}
BufferedInputStream bis = new BufferedInputStream(fis);
userCredentials = new Properties();
userCredentials.load(bis);
bis.close();
try {
BufferedInputStream bis = new BufferedInputStream(fis);
userCredentials = new Properties();
userCredentials.load(bis);
bis.close();
} finally {
fis.close();
}
}
/**
......
......@@ -295,7 +295,7 @@ private final class JMXCallbackHandler implements CallbackHandler {
private static class FileLoginConfig extends Configuration {
// The JAAS configuration for file-based authentication
private static AppConfigurationEntry[] entries;
private AppConfigurationEntry[] entries;
// The classname of the login module for file-based authentication
private static final String FILE_LOGIN_MODULE =
......
......@@ -231,10 +231,13 @@ public class MBeanServerFileAccessController
private static Properties propertiesFromFile(String fname)
throws IOException {
FileInputStream fin = new FileInputStream(fname);
Properties p = new Properties();
p.load(fin);
fin.close();
return p;
try {
Properties p = new Properties();
p.load(fin);
return p;
} finally {
fin.close();
}
}
private void checkAccessLevel(String accessLevel) {
......
......@@ -711,7 +711,7 @@ public class Font implements java.io.Serializable
EBIDI_EMBEDDING, EJUSTIFICATION,
EINPUT_METHOD_HIGHLIGHT, EINPUT_METHOD_UNDERLINE,
ESWAP_COLORS, ENUMERIC_SHAPING, EKERNING,
ELIGATURES, ETRACKING);
ELIGATURES, ETRACKING, ESUPERSCRIPT);
private static final int EXTRA_MASK =
AttributeValues.getMask(ETRANSFORM, ESUPERSCRIPT, EWIDTH);
......@@ -1970,7 +1970,6 @@ public class Font implements java.io.Serializable
* in the JDK - and the only likely caller - is in this same class.
*/
private float getItalicAngle(FontRenderContext frc) {
AffineTransform at = (isTransformed()) ? getTransform() : identityTx;
Object aa, fm;
if (frc == null) {
aa = RenderingHints.VALUE_TEXT_ANTIALIAS_OFF;
......@@ -1979,7 +1978,7 @@ public class Font implements java.io.Serializable
aa = frc.getAntiAliasingHint();
fm = frc.getFractionalMetricsHint();
}
return getFont2D().getItalicAngle(this, at, aa, fm);
return getFont2D().getItalicAngle(this, identityTx, aa, fm);
}
/**
......
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
Created by gbp, October 25, 1997
*
*/
/**********************************************************************
**********************************************************************
**********************************************************************
*** COPYRIGHT (c) Eastman Kodak Company, 1997 ***
*** As an unpublished work pursuant to Title 17 of the United ***
*** States Code. All rights reserved. ***
**********************************************************************
**********************************************************************
**********************************************************************/
package java.awt.color;
/**
* This exception is thrown if the native CMM returns an error.
*/
public class CMMException extends java.lang.RuntimeException {
/**
* Constructs a CMMException with the specified detail message.
* @param s the specified detail message
*/
public CMMException (String s) {
super (s);
}
}
此差异已折叠。
此差异已折叠。
/*
* Portions Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**********************************************************************
**********************************************************************
**********************************************************************
*** COPYRIGHT (c) Eastman Kodak Company, 1997 ***
*** As an unpublished work pursuant to Title 17 of the United ***
*** States Code. All rights reserved. ***
**********************************************************************
**********************************************************************
**********************************************************************/
package java.awt.color;
import java.awt.image.LookupTable;
import sun.java2d.cmm.ProfileDeferralInfo;
/**
*
* A subclass of the ICC_Profile class which represents profiles
* which meet the following criteria: the color space type of the
* profile is TYPE_GRAY and the profile includes the grayTRCTag and
* mediaWhitePointTag tags. Examples of this kind of profile are
* monochrome input profiles, monochrome display profiles, and
* monochrome output profiles. The getInstance methods in the
* ICC_Profile class will
* return an ICC_ProfileGray object when the above conditions are
* met. The advantage of this class is that it provides a lookup
* table that Java or native methods may be able to use directly to
* optimize color conversion in some cases.
* <p>
* To transform from a GRAY device profile color space to the CIEXYZ Profile
* Connection Space, the device gray component is transformed by
* a lookup through the tone reproduction curve (TRC). The result is
* treated as the achromatic component of the PCS.
<pre>
&nbsp; PCSY = grayTRC[deviceGray]
</pre>
* The inverse transform is done by converting the PCS Y components to
* device Gray via the inverse of the grayTRC.
* <p>
*/
public class ICC_ProfileGray
extends ICC_Profile {
static final long serialVersionUID = -1124721290732002649L;
/**
* Constructs a new ICC_ProfileGray from a CMM ID.
*/
ICC_ProfileGray(long ID) {
super(ID);
}
/**
* Constructs a new ICC_ProfileGray from a ProfileDeferralInfo object.
*/
ICC_ProfileGray(ProfileDeferralInfo pdi) {
super(pdi);
}
/**
* Returns a float array of length 3 containing the X, Y, and Z
* components of the mediaWhitePointTag in the ICC profile.
* @return an array containing the components of the
* mediaWhitePointTag in the ICC profile.
*/
public float[] getMediaWhitePoint() {
return super.getMediaWhitePoint();
}
/**
* Returns a gamma value representing the tone reproduction
* curve (TRC). If the profile represents the TRC as a table rather
* than a single gamma value, then an exception is thrown. In this
* case the actual table can be obtained via getTRC(). When
* using a gamma value, the PCS Y component is computed as follows:
<pre>
&nbsp; gamma
&nbsp; PCSY = deviceGray
</pre>
* @return the gamma value as a float.
* @exception ProfileDataException if the profile does not specify
* the TRC as a single gamma value.
*/
public float getGamma() {
float theGamma;
theGamma = super.getGamma(ICC_Profile.icSigGrayTRCTag);
return theGamma;
}
/**
* Returns the TRC as an array of shorts. If the profile has
* specified the TRC as linear (gamma = 1.0) or as a simple gamma
* value, this method throws an exception, and the getGamma() method
* should be used to get the gamma value. Otherwise the short array
* returned here represents a lookup table where the input Gray value
* is conceptually in the range [0.0, 1.0]. Value 0.0 maps
* to array index 0 and value 1.0 maps to array index length-1.
* Interpolation may be used to generate output values for
* input values which do not map exactly to an index in the
* array. Output values also map linearly to the range [0.0, 1.0].
* Value 0.0 is represented by an array value of 0x0000 and
* value 1.0 by 0xFFFF, i.e. the values are really unsigned
* short values, although they are returned in a short array.
* @return a short array representing the TRC.
* @exception ProfileDataException if the profile does not specify
* the TRC as a table.
*/
public short[] getTRC() {
short[] theTRC;
theTRC = super.getTRC(ICC_Profile.icSigGrayTRCTag);
return theTRC;
}
}
/*
* Portions Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/**********************************************************************
**********************************************************************
**********************************************************************
*** COPYRIGHT (c) Eastman Kodak Company, 1997 ***
*** As an unpublished work pursuant to Title 17 of the United ***
*** States Code. All rights reserved. ***
**********************************************************************
**********************************************************************
**********************************************************************/
package java.awt.color;
import java.awt.image.LookupTable;
import sun.java2d.cmm.ProfileDeferralInfo;
/**
*
* The ICC_ProfileRGB class is a subclass of the ICC_Profile class
* that represents profiles which meet the following criteria:
* <ul>
* <li>The profile's color space type is RGB.</li>
* <li>The profile includes the <code>redColorantTag</code>,
* <code>greenColorantTag</code>, <code>blueColorantTag</code>,
* <code>redTRCTag</code>, <code>greenTRCTag</code>,
* <code>blueTRCTag</code>, and <code>mediaWhitePointTag</code> tags.</li>
* </ul>
* The <code>ICC_Profile</code> <code>getInstance</code> method will
* return an <code>ICC_ProfileRGB</code> object when these conditions are met.
* Three-component, matrix-based input profiles and RGB display profiles are
* examples of this type of profile.
* <p>
* This profile class provides color transform matrices and lookup tables
* that Java or native methods can use directly to
* optimize color conversion in some cases.
* <p>
* To transform from a device profile color space to the CIEXYZ Profile
* Connection Space, each device color component is first linearized by
* a lookup through the corresponding tone reproduction curve (TRC).
* The resulting linear RGB components are converted to the CIEXYZ PCS
* using a a 3x3 matrix constructed from the RGB colorants.
* <pre>
*
* &nbsp; linearR = redTRC[deviceR]
*
* &nbsp; linearG = greenTRC[deviceG]
*
* &nbsp; linearB = blueTRC[deviceB]
*
* &nbsp; _ _ _ _ _ _
* &nbsp;[ PCSX ] [ redColorantX greenColorantX blueColorantX ] [ linearR ]
* &nbsp;[ ] [ ] [ ]
* &nbsp;[ PCSY ] = [ redColorantY greenColorantY blueColorantY ] [ linearG ]
* &nbsp;[ ] [ ] [ ]
* &nbsp;[_ PCSZ _] [_ redColorantZ greenColorantZ blueColorantZ _] [_ linearB _]
*
* </pre>
* The inverse transform is performed by converting PCS XYZ components to linear
* RGB components through the inverse of the above 3x3 matrix, and then converting
* linear RGB to device RGB through inverses of the TRCs.
* <p>
*/
public class ICC_ProfileRGB
extends ICC_Profile {
static final long serialVersionUID = 8505067385152579334L;
/**
* Used to get a gamma value or TRC for the red component.
*/
public static final int REDCOMPONENT = 0;
/**
* Used to get a gamma value or TRC for the green component.
*/
public static final int GREENCOMPONENT = 1;
/**
* Used to get a gamma value or TRC for the blue component.
*/
public static final int BLUECOMPONENT = 2;
/**
* Constructs an new <code>ICC_ProfileRGB</code> from a CMM ID.
*
* @param ID The CMM ID for the profile.
*
*/
ICC_ProfileRGB(long ID) {
super(ID);
}
/**
* Constructs a new <code>ICC_ProfileRGB</code> from a
* ProfileDeferralInfo object.
*
* @param pdi
*/
ICC_ProfileRGB(ProfileDeferralInfo pdi) {
super(pdi);
}
/**
* Returns an array that contains the components of the profile's
* <CODE>mediaWhitePointTag</CODE>.
*
* @return A 3-element <CODE>float</CODE> array containing the x, y,
* and z components of the profile's <CODE>mediaWhitePointTag</CODE>.
*/
public float[] getMediaWhitePoint() {
return super.getMediaWhitePoint();
}
/**
* Returns a 3x3 <CODE>float</CODE> matrix constructed from the
* X, Y, and Z components of the profile's <CODE>redColorantTag</CODE>,
* <CODE>greenColorantTag</CODE>, and <CODE>blueColorantTag</CODE>.
* <p>
* This matrix can be used for color transforms in the forward
* direction of the profile--from the profile color space
* to the CIEXYZ PCS.
*
* @return A 3x3 <CODE>float</CODE> array that contains the x, y, and z
* components of the profile's <CODE>redColorantTag</CODE>,
* <CODE>greenColorantTag</CODE>, and <CODE>blueColorantTag</CODE>.
*/
public float[][] getMatrix() {
float[][] theMatrix = new float[3][3];
float[] tmpMatrix;
tmpMatrix = getXYZTag(ICC_Profile.icSigRedColorantTag);
theMatrix[0][0] = tmpMatrix[0];
theMatrix[1][0] = tmpMatrix[1];
theMatrix[2][0] = tmpMatrix[2];
tmpMatrix = getXYZTag(ICC_Profile.icSigGreenColorantTag);
theMatrix[0][1] = tmpMatrix[0];
theMatrix[1][1] = tmpMatrix[1];
theMatrix[2][1] = tmpMatrix[2];
tmpMatrix = getXYZTag(ICC_Profile.icSigBlueColorantTag);
theMatrix[0][2] = tmpMatrix[0];
theMatrix[1][2] = tmpMatrix[1];
theMatrix[2][2] = tmpMatrix[2];
return theMatrix;
}
/**
* Returns a gamma value representing the tone reproduction curve
* (TRC) for a particular component. The component parameter
* must be one of REDCOMPONENT, GREENCOMPONENT, or BLUECOMPONENT.
* <p>
* If the profile
* represents the TRC for the corresponding component
* as a table rather than a single gamma value, an
* exception is thrown. In this case the actual table
* can be obtained through the {@link #getTRC(int)} method.
* When using a gamma value,
* the linear component (R, G, or B) is computed as follows:
* <pre>
*
* &nbsp; gamma
* &nbsp; linearComponent = deviceComponent
*
*</pre>
* @param component The <CODE>ICC_ProfileRGB</CODE> constant that
* represents the component whose TRC you want to retrieve
* @return the gamma value as a float.
* @exception ProfileDataException if the profile does not specify
* the corresponding TRC as a single gamma value.
*/
public float getGamma(int component) {
float theGamma;
int theSignature;
switch (component) {
case REDCOMPONENT:
theSignature = ICC_Profile.icSigRedTRCTag;
break;
case GREENCOMPONENT:
theSignature = ICC_Profile.icSigGreenTRCTag;
break;
case BLUECOMPONENT:
theSignature = ICC_Profile.icSigBlueTRCTag;
break;
default:
throw new IllegalArgumentException("Must be Red, Green, or Blue");
}
theGamma = super.getGamma(theSignature);
return theGamma;
}
/**
* Returns the TRC for a particular component as an array.
* Component must be <code>REDCOMPONENT</code>,
* <code>GREENCOMPONENT</code>, or <code>BLUECOMPONENT</code>.
* Otherwise the returned array
* represents a lookup table where the input component value
* is conceptually in the range [0.0, 1.0]. Value 0.0 maps
* to array index 0 and value 1.0 maps to array index length-1.
* Interpolation might be used to generate output values for
* input values that do not map exactly to an index in the
* array. Output values also map linearly to the range [0.0, 1.0].
* Value 0.0 is represented by an array value of 0x0000 and
* value 1.0 by 0xFFFF. In other words, the values are really unsigned
* <code>short</code> values even though they are returned in a
* <code>short</code> array.
*
* If the profile has specified the corresponding TRC
* as linear (gamma = 1.0) or as a simple gamma value, this method
* throws an exception. In this case, the {@link #getGamma(int)}
* method should be used to get the gamma value.
*
* @param component The <CODE>ICC_ProfileRGB</CODE> constant that
* represents the component whose TRC you want to retrieve:
* <CODE>REDCOMPONENT</CODE>, <CODE>GREENCOMPONENT</CODE>, or
* <CODE>BLUECOMPONENT</CODE>.
*
* @return a short array representing the TRC.
* @exception ProfileDataException if the profile does not specify
* the corresponding TRC as a table.
*/
public short[] getTRC(int component) {
short[] theTRC;
int theSignature;
switch (component) {
case REDCOMPONENT:
theSignature = ICC_Profile.icSigRedTRCTag;
break;
case GREENCOMPONENT:
theSignature = ICC_Profile.icSigGreenTRCTag;
break;
case BLUECOMPONENT:
theSignature = ICC_Profile.icSigBlueTRCTag;
break;
default:
throw new IllegalArgumentException("Must be Red, Green, or Blue");
}
theTRC = super.getTRC(theSignature);
return theTRC;
}
}
......@@ -31,9 +31,9 @@ package java.awt.font;
* <i>sfnt</i> tables from the font. A particular
* <code>Font</code> object can implement this interface.
* <p>
* For more information on TrueType fonts, see the
* Apple TrueType Reference Manual
* ( <a href="http://fonts.apple.com/TTRefMan/index.html">http://fonts.apple.com/TTRefMan/index.html</a> ).
* For more information on TrueType and OpenType fonts, see the
* OpenType specification.
* ( <a href=http://www.microsoft.com/typography/otspec/">http://www.microsoft.com/typography/otspec/l</a> ).
*/
public interface OpenType {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
/*
* Portions Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/* ****************************************************************
******************************************************************
******************************************************************
*** COPYRIGHT (c) Eastman Kodak Company, 1997
*** As an unpublished work pursuant to Title 17 of the United
*** States Code. All rights reserved.
******************************************************************
******************************************************************
******************************************************************/
package java.awt.image;
import java.awt.Rectangle;
import java.util.Dictionary;
import java.util.Vector;
/**
* RenderedImage is a common interface for objects which contain
* or can produce image data in the form of Rasters. The image
* data may be stored/produced as a single tile or a regular array
* of tiles.
*/
public interface RenderedImage {
/**
* Returns a vector of RenderedImages that are the immediate sources of
* image data for this RenderedImage. This method returns null if
* the RenderedImage object has no information about its immediate
* sources. It returns an empty Vector if the RenderedImage object has
* no immediate sources.
* @return a Vector of <code>RenderedImage</code> objects.
*/
Vector<RenderedImage> getSources();
/**
* Gets a property from the property set of this image. The set of
* properties and whether it is immutable is determined by the
* implementing class. This method returns
* java.awt.Image.UndefinedProperty if the specified property is
* not defined for this RenderedImage.
* @param name the name of the property
* @return the property indicated by the specified name.
* @see java.awt.Image#UndefinedProperty
*/
Object getProperty(String name);
/**
* Returns an array of names recognized by
* {@link #getProperty(String) getProperty(String)}
* or <code>null</code>, if no property names are recognized.
* @return a <code>String</code> array containing all of the
* property names that <code>getProperty(String)</code> recognizes;
* or <code>null</code> if no property names are recognized.
*/
String[] getPropertyNames();
/**
* Returns the ColorModel associated with this image. All Rasters
* returned from this image will have this as their ColorModel. This
* can return null.
* @return the <code>ColorModel</code> of this image.
*/
ColorModel getColorModel();
/**
* Returns the SampleModel associated with this image. All Rasters
* returned from this image will have this as their SampleModel.
* @return the <code>SampleModel</code> of this image.
*/
SampleModel getSampleModel();
/**
* Returns the width of the RenderedImage.
* @return the width of this <code>RenderedImage</code>.
*/
int getWidth();
/**
* Returns the height of the RenderedImage.
* @return the height of this <code>RenderedImage</code>.
*/
int getHeight();
/**
* Returns the minimum X coordinate (inclusive) of the RenderedImage.
* @return the X coordinate of this <code>RenderedImage</code>.
*/
int getMinX();
/**
* Returns the minimum Y coordinate (inclusive) of the RenderedImage.
* @return the Y coordinate of this <code>RenderedImage</code>.
*/
int getMinY();
/**
* Returns the number of tiles in the X direction.
* @return the number of tiles in the X direction.
*/
int getNumXTiles();
/**
* Returns the number of tiles in the Y direction.
* @return the number of tiles in the Y direction.
*/
int getNumYTiles();
/**
* Returns the minimum tile index in the X direction.
* @return the minimum tile index in the X direction.
*/
int getMinTileX();
/**
* Returns the minimum tile index in the Y direction.
* @return the minimum tile index in the X direction.
*/
int getMinTileY();
/**
* Returns the tile width in pixels. All tiles must have the same
* width.
* @return the tile width in pixels.
*/
int getTileWidth();
/**
* Returns the tile height in pixels. All tiles must have the same
* height.
* @return the tile height in pixels.
*/
int getTileHeight();
/**
* Returns the X offset of the tile grid relative to the origin,
* i.e., the X coordinate of the upper-left pixel of tile (0, 0).
* (Note that tile (0, 0) may not actually exist.)
* @return the X offset of the tile grid relative to the origin.
*/
int getTileGridXOffset();
/**
* Returns the Y offset of the tile grid relative to the origin,
* i.e., the Y coordinate of the upper-left pixel of tile (0, 0).
* (Note that tile (0, 0) may not actually exist.)
* @return the Y offset of the tile grid relative to the origin.
*/
int getTileGridYOffset();
/**
* Returns tile (tileX, tileY). Note that tileX and tileY are indices
* into the tile array, not pixel locations. The Raster that is returned
* is live and will be updated if the image is changed.
* @param tileX the X index of the requested tile in the tile array
* @param tileY the Y index of the requested tile in the tile array
* @return the tile given the specified indices.
*/
Raster getTile(int tileX, int tileY);
/**
* Returns the image as one large tile (for tile based
* images this will require fetching the whole image
* and copying the image data over). The Raster returned is
* a copy of the image data and will not be updated if the image
* is changed.
* @return the image as one large tile.
*/
Raster getData();
/**
* Computes and returns an arbitrary region of the RenderedImage.
* The Raster returned is a copy of the image data and will not
* be updated if the image is changed.
* @param rect the region of the RenderedImage to be returned.
* @return the region of the <code>RenderedImage</code>
* indicated by the specified <code>Rectangle</code>.
*/
Raster getData(Rectangle rect);
/**
* Computes an arbitrary rectangular region of the RenderedImage
* and copies it into a caller-supplied WritableRaster. The region
* to be computed is determined from the bounds of the supplied
* WritableRaster. The supplied WritableRaster must have a
* SampleModel that is compatible with this image. If raster is null,
* an appropriate WritableRaster is created.
* @param raster a WritableRaster to hold the returned portion of the
* image, or null.
* @return a reference to the supplied or created WritableRaster.
*/
WritableRaster copyData(WritableRaster raster);
}
此差异已折叠。
......@@ -83,7 +83,7 @@ class NumericValueExp extends QueryEval implements ValueExp {
* <p>The <b>serialVersionUID</b> of this class is <code>-4679739485102359104L</code>.
*/
private static final ObjectStreamField[] serialPersistentFields;
private Number val = new Double(0);
private Number val = 0.0;
private static boolean compat = false;
static {
......@@ -213,11 +213,11 @@ class NumericValueExp extends QueryEval implements ValueExp {
}
if (isLong)
{
this.val = new Long(longVal);
this.val = longVal;
}
else
{
this.val = new Double(doubleVal);
this.val = doubleVal;
}
}
else
......
......@@ -449,7 +449,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
// parses domain part
domain_parsing:
while (index < len) {
switch (c = name_chars[index]) {
switch (name_chars[index]) {
case ':' :
_domain_length = index++;
break domain_parsing;
......@@ -619,7 +619,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
case '\n' :
final String ichar = ((c1=='\n')?"\\n":""+c1);
throw new MalformedObjectNameException(
"Invalid character '" + c1 +
"Invalid character '" + ichar +
"' in value part of property");
default :
in_index++;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册