2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.model
.common
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.hibernate
.envers
.Audited
;
18 import eu
.etaxonomy
.cdm
.model
.media
.ImageFile
;
19 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
20 import eu
.etaxonomy
.cdm
.model
.media
.MediaRepresentation
;
21 import eu
.etaxonomy
.cdm
.model
.media
.ReferencedMediaBase
;
23 import javax
.persistence
.*;
24 import javax
.xml
.bind
.annotation
.XmlAccessType
;
25 import javax
.xml
.bind
.annotation
.XmlAccessorType
;
26 import javax
.xml
.bind
.annotation
.XmlType
;
31 * @created 08-Nov-2007 13:06:25
33 @XmlAccessorType(XmlAccessType
.FIELD
)
34 @XmlType(name
= "Figure")
37 public class Figure
extends ReferencedMediaBase
{
38 private static final long serialVersionUID
= -1712467725277327725L;
39 @SuppressWarnings("unused")
40 private static final Logger logger
= Logger
.getLogger(Figure
.class);
46 public static Figure
NewInstance(){
51 * Factory method which creates a new figure, adds a reprsentation including mime type and suffix information
52 * and adds to the later a representation part for a given uri and size
53 * Returns <code>null</code> if uri is empty
56 public static Media
NewInstance(URI uri
, Integer size
, String mimeType
, String suffix
){
57 MediaRepresentation representation
= MediaRepresentation
.NewInstance(mimeType
, suffix
, uri
, size
, ImageFile
.class);
58 if (representation
== null){
61 Figure figure
= Figure
.NewInstance();
62 figure
.addRepresentation(representation
);