~slub.team/goobi-production/bug-1013622

« back to all changes in this revision

Viewing changes to src/de/unigoettingen/sub/commons/util/datasource/WrappedImage.java

  • Committer: Ralf Claussnitzer
  • Date: 2012-05-29 10:55:34 UTC
  • mfrom: (66.1.1 integrate-util)
  • Revision ID: ralf.claussnitzer@slub-dresden.de-20120529105534-t5u5vxj9x5v2vifb
fixes lp:1005844 integrate sub-commons util library

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is a contribution to the the ContentServer project, mainly for research purposes.
 
3
 * 
 
4
 * Copyright 2009, Christian Mahnke<cmahnke@gmail.com>.
 
5
 * 
 
6
 * Licensed under the Apache License, Version 2.0 (the “License”);
 
7
 * you may not use this file except in compliance with the License.
 
8
 * You may obtain a copy of the License at
 
9
 * 
 
10
 *  http://www.apache.org/licenses/LICENSE-2.0
 
11
 * 
 
12
 * Unless required by applicable law or agreed to in writing, software
 
13
 * distributed under the License is distributed on an “AS IS” BASIS,
 
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
15
 * See the License for the specific language governing permissions and
 
16
 * limitations under the License.
 
17
 */
 
18
 
 
19
 
 
20
package de.unigoettingen.sub.commons.util.datasource;
 
21
 
 
22
import java.awt.image.RenderedImage;
 
23
import java.io.IOException;
 
24
 
 
25
/**
 
26
 * The Class WrappedImage is a simple wrapper for java.awt.image.RenderedImage instances.
 
27
 */
 
28
public class WrappedImage implements Image {
 
29
        
 
30
        /** The page nr. */
 
31
        protected Integer pageNr = -1;
 
32
        
 
33
        /** The image. */
 
34
        protected RenderedImage image = null;
 
35
        
 
36
        /**
 
37
         * Instantiates a new wrapped image.
 
38
         * 
 
39
         * @param pagenr the page number
 
40
         * @param image the RenderedImage
 
41
         */
 
42
        public WrappedImage (Integer pagenr, RenderedImage image) {
 
43
                this.pageNr = pagenr;
 
44
                this.image = image;
 
45
        }
 
46
 
 
47
        /* (non-Javadoc)
 
48
         * @see de.unigoettingen.sub.commons.util.datasource.Image#getPageNumber()
 
49
         */
 
50
        public Integer getPageNumber() {
 
51
                return pageNr;
 
52
        }
 
53
 
 
54
        /* (non-Javadoc)
 
55
         * @see de.unigoettingen.sub.commons.util.datasource.Image#getRenderedImage()
 
56
         */
 
57
        public RenderedImage getRenderedImage() throws IOException {
 
58
                return image;
 
59
        }
 
60
 
 
61
}