/* 507 */ ParameterBlock newPB = (ParameterBlock)oldPB.clone();
/* 508 */ Vector sources = oldPB.getSources();
/* 509 */ newPB.removeSources();
/* */
/* 512 */ ImageServer remoteImage = getImageServer(rop.getServerName());
/* 513 */ ImagingListener listener = ImageUtil.getImagingListener(rop.getRenderingHints());
/* */
/* 515 */ Long opID = new Long(0L);
/* */ try {
/* 517 */ opID = remoteImage.getRemoteID();
/* 518 */ remoteImage.createRenderableOp(opID, rop.getOperationName(), newPB);
/* */ }
/* */ catch (RemoteException e)
/* */ {
/* 522 */ String message = JaiI18N.getString("RMIServerProxy8");
/* 523 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* 530 */ if (sources != null)
/* */ {
/* 532 */ for (int i = 0; i < sources.size(); i++)
/* */ {
/* 534 */ Object source = sources.elementAt(i);
/* */
/* 536 */ if ((source instanceof RemoteRenderedOp))
/* */ {
/* 540 */ RMIServerProxy rmisp = (RMIServerProxy)((RemoteRenderedOp)source).getRendering();
/* */ try
/* */ {
/* 544 */ if (rmisp.getServerName().equalsIgnoreCase(rop.getServerName()))
/* */ {
/* 549 */ remoteImage.setRenderedSource(opID, rmisp.getRMIID(), i);
/* */
/* 552 */ newPB.setSource(rmisp, i);
/* */ }
/* */ else
/* */ {
/* 557 */ remoteImage.setRenderedSource(opID, rmisp.getRMIID(), rmisp.getServerName(), rmisp.getOperationName(), i);
/* */
/* 563 */ newPB.setSource(rmisp, i);
/* */ }
/* */ } catch (RemoteException e) {
/* 566 */ String message = JaiI18N.getString("RMIServerProxy6");
/* 567 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* */ }
/* 573 */ else if ((source instanceof RenderedOp))
/* */ {
/* 579 */ RenderedImage ri = ((RenderedOp)source).getRendering();
/* */ try {
/* 581 */ SerializableRenderedImage sri = new SerializableRenderedImage(ri);
/* */
/* 583 */ remoteImage.setRenderedSource(opID, sri, i);
/* 584 */ newPB.setSource(sri, i);
/* */ } catch (RemoteException e) {
/* 586 */ String message = JaiI18N.getString("RMIServerProxy6");
/* 587 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* */ }
/* 593 */ else if ((source instanceof RenderedImage))
/* */ {
/* 599 */ RenderedImage ri = (RenderedImage)source;
/* */ try {
/* 601 */ SerializableRenderedImage sri = new SerializableRenderedImage(ri);
/* */
/* 603 */ remoteImage.setRenderedSource(opID, sri, i);
/* 604 */ newPB.setSource(sri, i);
/* */ } catch (RemoteException e) {
/* 606 */ String message = JaiI18N.getString("RMIServerProxy6");
/* 607 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* */ }
/* 613 */ else if ((source instanceof RemoteRenderableOp))
/* */ {
/* 618 */ RenderableRMIServerProxy rrmisp = createProxy((RemoteRenderableOp)source);
/* */ try
/* */ {
/* 625 */ if (rrmisp.getServerName().equalsIgnoreCase(rop.getServerName()))
/* */ {
/* 627 */ remoteImage.setRenderableSource(opID, rrmisp.getRMIID(), i);
/* */
/* 630 */ newPB.setSource(rrmisp, i);
/* */ }
/* */ else
/* */ {
/* 635 */ remoteImage.setRenderableRMIServerProxyAsSource(opID, rrmisp.getRMIID(), rrmisp.getServerName(), rrmisp.getOperationName(), i);
/* */
/* 641 */ newPB.setSource(rrmisp, i);
/* */ }
/* */ } catch (RemoteException e) {
/* 644 */ String message = JaiI18N.getString("RMIServerProxy6");
/* 645 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* */ }
/* 651 */ else if ((source instanceof RenderableImage))
/* */ {
/* 657 */ RenderableImage ri = (RenderableImage)source;
/* */ try {
/* 659 */ SerializableRenderableImage sri = new SerializableRenderableImage(ri);
/* */
/* 661 */ remoteImage.setRenderableSource(opID, sri, i);
/* 662 */ newPB.setSource(sri, i);
/* */ } catch (RemoteException e) {
/* 664 */ String message = JaiI18N.getString("RMIServerProxy6");
/* 665 */ listener.errorOccurred(message, new RemoteImagingException(message, e), this, false);
/* */ }
/* */
/* */ }
/* */
/* */ }