下面列出了怎么用java.awt.color.ProfileDataException的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Removes a ProfileActivator object from the vector of ProfileActivator
* objects whose activate method will be called if the CMM needs to be
* activated.
*/
public static void activateProfiles() {
int i, n;
deferring = false;
if (aVector == null) {
return;
}
n = aVector.size();
for (ProfileActivator pa : aVector) {
try {
pa.activate();
} catch (ProfileDataException e) {
/*
* Ignore profile activation error for now:
* such exception is pssible due to absence
* or corruption of standard color profile.
* As for now we expect all profiles should
* be shiped with jre and presence of this
* exception is indication of some configuration
* problem in jre installation.
*
* NB: we still are greedy loading deferred profiles
* and load them all if any of them is needed.
* Therefore broken profile (if any) might be never used.
* If there will be attempt to use broken profile then
* it will result in CMMException.
*/
}
}
aVector.removeAllElements();
aVector = null;
return;
}
/**
* Create a Java colorspace for this colorspace.
*
* @return A color space that can be used for Java AWT operations.
*
* @throws IOException If there is an error creating the color space.
*/
protected ColorSpace createColorSpace() throws IOException
{
InputStream profile = null;
ColorSpace cSpace = null;
try
{
profile = stream.createInputStream();
ICC_Profile iccProfile = ICC_Profile.getInstance( profile );
cSpace = new ICC_ColorSpace( iccProfile );
// there maybe a ProfileDataException or a CMMException as there
// are some issues when loading ICC_Profiles, see PDFBOX-1295
// Try to create a color as test ...
new Color(cSpace,new float[getNumberOfComponents()],1f);
}
catch (RuntimeException e)
{
if (e instanceof ProfileDataException
|| e instanceof CMMException
|| e instanceof IllegalArgumentException)
{
// we are using an alternate colorspace as fallback
List alternateCSList = getAlternateColorSpaces();
PDColorSpace alternate = (PDColorSpace) alternateCSList.get(0);
LOG.error("Can't read ICC-profile, using alternate colorspace instead: " + alternate);
cSpace = alternate.getJavaColorSpace();
}
else
{
throw e;
}
}
finally
{
if( profile != null )
{
profile.close();
}
}
return cSpace;
}
/**
* Create a Java colorspace for this colorspace.
*
* @return A color space that can be used for Java AWT operations.
*
* @throws IOException If there is an error creating the color space.
*/
protected ColorSpace createColorSpace() throws IOException
{
InputStream profile = null;
ColorSpace cSpace = null;
try
{
profile = stream.createInputStream();
ICC_Profile iccProfile = ICC_Profile.getInstance( profile );
cSpace = new ICC_ColorSpace( iccProfile );
// there maybe a ProfileDataException or a CMMException as there
// are some issues when loading ICC_Profiles, see PDFBOX-1295
// Try to create a color as test ...
new Color(cSpace,new float[getNumberOfComponents()],1f);
}
catch (RuntimeException e)
{
if (e instanceof ProfileDataException
|| e instanceof CMMException
|| e instanceof IllegalArgumentException)
{
// we are using an alternate colorspace as fallback
List alternateCSList = getAlternateColorSpaces();
PDColorSpace alternate = (PDColorSpace) alternateCSList.get(0);
LOG.error("Can't read ICC-profile, using alternate colorspace instead: " + alternate);
cSpace = alternate.getJavaColorSpace();
}
else
{
throw e;
}
}
finally
{
if( profile != null )
{
profile.close();
}
}
return cSpace;
}
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;
/**
* Activate a previously deferred ICC_Profile object.
*/
public void activate() throws ProfileDataException;