1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /* $Id: PSImageFormResource.java 1616416 2014-08-07 06:46:57Z gadams $ */ 19 20 package org.apache.fop.render.ps; 21 22 import org.apache.xmlgraphics.ps.PSResource; 23 24 /** 25 * PostScript Resource class representing a FOP form. This is used by PSRenderer to keep track 26 * of images. 27 */ 28 public class PSImageFormResource extends PSResource { 29 30 private String uri; 31 32 /** 33 * Create a new Form Resource. 34 * @param id An ID for the form 35 * @param uri the URI to the image 36 */ PSImageFormResource(int id, String uri)37 public PSImageFormResource(int id, String uri) { 38 this("FOPForm:" + Integer.toString(id), uri); 39 } 40 41 /** 42 /** 43 * Create a new Form Resource. 44 * @param name the name of the resource 45 * @param uri the URI to the image 46 */ PSImageFormResource(String name, String uri)47 public PSImageFormResource(String name, String uri) { 48 super(PSResource.TYPE_FORM, name); 49 this.uri = uri; 50 } 51 52 /** 53 * Returns the image URI. 54 * @return the image URI 55 */ getImageURI()56 public String getImageURI() { 57 return this.uri; 58 } 59 60 @Override hashCode()61 public int hashCode() { 62 return super.hashCode(); 63 } 64 65 @Override equals(Object obj)66 public boolean equals(Object obj) { 67 return super.equals(obj); 68 } 69 70 } 71