src/share/classes/java/awt/image/renderable/RenderableImageOp.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2014, Oracle and/or its affiliates. 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. Oracle designates this
*** 81,99 ****
* return an empty vector, to indicate that the image has no sources,
* or null, to indicate that no information is available.
*
* @return a (possibly empty) Vector of RenderableImages, or null.
*/
public Vector<RenderableImage> getSources() {
! return getRenderableSources();
}
! private Vector getRenderableSources() {
! Vector sources = null;
if (paramBlock.getNumSources() > 0) {
! sources = new Vector();
int i = 0;
while (i < paramBlock.getNumSources()) {
Object o = paramBlock.getSource(i);
if (o instanceof RenderableImage) {
sources.add((RenderableImage)o);
--- 81,100 ----
* return an empty vector, to indicate that the image has no sources,
* or null, to indicate that no information is available.
*
* @return a (possibly empty) Vector of RenderableImages, or null.
*/
+ @SuppressWarnings("unchecked")
public Vector<RenderableImage> getSources() {
! return (Vector<RenderableImage>)(Vector)getRenderableSources();
}
! private Vector<Object> getRenderableSources() {
! Vector<Object> sources = null;
if (paramBlock.getNumSources() > 0) {
! sources = new Vector<>();
int i = 0;
while (i < paramBlock.getNumSources()) {
Object o = paramBlock.getSource(i);
if (o instanceof RenderableImage) {
sources.add((RenderableImage)o);
*** 312,329 ****
// Clone the original ParameterBlock; if the ParameterBlock
// contains RenderableImage sources, they will be replaced by
// RenderedImages.
ParameterBlock renderedParamBlock = (ParameterBlock)paramBlock.clone();
! Vector sources = getRenderableSources();
try {
// This assumes that if there is no renderable source, that there
// is a rendered source in paramBlock
if (sources != null) {
! Vector renderedSources = new Vector();
for (int i = 0; i < sources.size(); i++) {
rcOut = myCRIF.mapRenderContext(i, renderContext,
paramBlock, this);
RenderedImage rdrdImage =
((RenderableImage)sources.elementAt(i)).createRendering(rcOut);
--- 313,330 ----
// Clone the original ParameterBlock; if the ParameterBlock
// contains RenderableImage sources, they will be replaced by
// RenderedImages.
ParameterBlock renderedParamBlock = (ParameterBlock)paramBlock.clone();
! Vector<Object> sources = getRenderableSources();
try {
// This assumes that if there is no renderable source, that there
// is a rendered source in paramBlock
if (sources != null) {
! Vector<Object> renderedSources = new Vector<>();
for (int i = 0; i < sources.size(); i++) {
rcOut = myCRIF.mapRenderContext(i, renderContext,
paramBlock, this);
RenderedImage rdrdImage =
((RenderableImage)sources.elementAt(i)).createRendering(rcOut);