public class XMLImage
extends org.docgene.model.AbstractJustifiedElement
implements org.docgene.model.ImageReference, org.docgene.model.BorderedElement, org.docgene.model.ImageHeightType, org.docgene.model.Alignment
HEIGHT_ABSOLUTE, HEIGHT_RELATIVE, HEIGHT_TEXT
TYPE_NONE
Constructor and Description |
---|
XMLImage(org.docgene.model.globals.XMLRootElement element,
java.io.File href)
Constructor.
|
XMLImage(org.docgene.model.globals.XMLRootElement element,
java.lang.String id,
java.lang.String pack)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptExtension()
Return true if the image accept an extension (which an be an ImageMap, a
reference, or an external link).
|
void |
addArea(org.docgene.model.ImageMap.Area area)
Do nothing.
|
void |
addCategoryReference(XMLCategoryReference catRef)
Do nothing.
|
void |
addExternalLink(XMLExternalLink link)
Do nothing.
|
void |
addReference(XMLReference ref)
Do nothing.
|
void |
bind(org.docgene.model.globals.ImageDefinition image)
Bind this image reference to its associated image definition.
|
XMLExtendedImage |
createExtendedImage()
Creates an extended image from this image.
|
char |
getAlignment()
Return the alignment of the image.
|
short |
getBorderType()
Return the image border type.
|
java.lang.String |
getCaption()
Return the image caption.
|
XMLCategoryReference |
getCategoryReference()
Return the category reference on the image.
|
java.awt.Image |
getConcreteImage()
Return the associated concrete Image.
|
java.lang.String |
getDeclaration()
Return the declaration ID of the element.
|
org.docgene.model.globals.XMLRootElement |
getElement()
Return the element in which this image reference is used.
|
short |
getExtensionType()
Return the extension type.
|
XMLExternalLink |
getExternalLink()
Return the external link on the image.
|
int |
getHeight()
Return the image height.
|
char |
getHeightType()
Return the image height type.
|
java.io.File |
getHRef()
Return the image path.
|
org.docgene.model.globals.ImageDefinition |
getImage()
Return the associated image definition.
|
java.awt.Dimension |
getImageDimension()
Return the underlying image dimension (ie the width and height).
|
java.lang.String |
getImageID()
Return the image reference ID.
|
org.docgene.model.ImageMap |
getImageMap()
Return null.
|
java.awt.Dimension |
getImageReferenceDimension()
Return the underlying image reference dimension (ie the width and height).
|
java.io.File |
getInputFile()
Return the input File for the image.
|
java.net.URL |
getInputURL()
Return the input URL for the image.
|
int |
getLineNumber()
Return the line where the reference appear.
|
char |
getMargin()
Return the associated Image margin.
|
java.lang.String |
getPackage()
Return the image reference package.
|
XMLReference |
getReference()
Return the reference on the image.
|
char |
getVerticalAlignment()
Return the vertical alignment of the image.
|
int |
getWidth()
Return the image width.
|
boolean |
hasBorder()
Return true if the image has a border.
|
boolean |
hasCaption()
Return true if the image has a caption.
|
boolean |
hasConcreteImage()
Return true if the image definition has an associated concrete image.
|
boolean |
hasHeight()
Return true if the image has a specified height.
|
boolean |
hasHRef()
Return true if this image reference an image path.
|
boolean |
hasID()
Return true if this image reference an mageDef ID
|
boolean |
hasImageDefinition()
Return true if this image references an image definition
|
boolean |
hasImageMap()
Return false.
|
boolean |
hasImageReference()
Return true if this image reference an image definition or path
|
boolean |
hasShadow()
Return true if the image has a shadowed border.
|
boolean |
hasSize()
Return true if the image has a specified size.
|
boolean |
hasWidth()
Return true if the image has a specified width.
|
boolean |
isExtendedImage()
Return true if the image is an extended image.
|
boolean |
isFloat()
Return true if the image element should have the "float" attribute.
|
boolean |
isRelativeHeight()
Return true if the image height is relative (in %).
|
boolean |
isRelativeWidth()
Return true if the image width is relative (in %).
|
boolean |
isUsingMaximumSize()
Return true if the image must not have a size greater than the image
definition size.
|
void |
setAbsoluteWidth(int width)
Set the image absolute width.
|
void |
setAlignment(char align)
Set the alignment of the image.
|
void |
setBorderType(short borderType)
Set if the image border type.
|
void |
setCaption(java.lang.String caption)
Set the image caption.
|
void |
setFirstInLine(boolean isFirstInLine)
Set if the image is the first element in its line.
|
void |
setFloat(boolean isFloat)
Set if the image element should have the "float" attribute.
|
void |
setHeight(int height,
boolean relHeight)
Set the image height.
|
void |
setHeightAsText()
Set the image height as the same height as the text.
|
void |
setID(java.lang.String id)
Set the image ID.
|
void |
setLineNumber(int lineNumber)
Set the line number where the reference appear.
|
void |
setMargin(char margin)
Set the image margin.
|
void |
setRelativeWidth(int width)
Set the image relative width.
|
void |
setVerticalAlignment(char valign)
Set the vertical alignment of the image.
|
void |
setWidth(int width,
boolean relWidth)
Set the image width.
|
void |
useMaximumSize(boolean useMaxSize)
Set if the image must not have a size greater than the image definition
size.
|
boolean |
useTextHeight()
Return true if the image height has the same height as the text.
|
getCustomStyles, getInlinedStyle, setCustomStyles, setInlinedStyle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStyle, hasInlinedStyle, setCustomStyles
public XMLImage(org.docgene.model.globals.XMLRootElement element, java.lang.String id, java.lang.String pack)
element
- the element which use the imageid
- the image reference IDpack
- the packagepublic XMLImage(org.docgene.model.globals.XMLRootElement element, java.io.File href)
element
- the element which use the imagehref
- the image filepublic boolean isExtendedImage()
public XMLExtendedImage createExtendedImage()
public void setFirstInLine(boolean isFirstInLine)
setFirstInLine
in class org.docgene.model.AbstractJustifiedElement
isFirstInLine
- true if the element is the first element in its linepublic void setLineNumber(int lineNumber)
lineNumber
- the line numberpublic int getLineNumber()
getLineNumber
in interface org.docgene.model.ElementReference
public java.lang.String getDeclaration()
getDeclaration
in interface StyledElement
public org.docgene.model.globals.XMLRootElement getElement()
public void setFloat(boolean isFloat)
isFloat
- true if the image element should have the "float" attributepublic boolean isFloat()
public void addReference(XMLReference ref)
ref
- the referencepublic void addCategoryReference(XMLCategoryReference catRef)
catRef
- the category referencepublic void addExternalLink(XMLExternalLink link)
link
- the external linkpublic void addArea(org.docgene.model.ImageMap.Area area)
area
- the areapublic boolean hasImageMap()
public boolean acceptExtension()
public short getExtensionType()
public org.docgene.model.ImageMap getImageMap()
public XMLReference getReference()
public XMLCategoryReference getCategoryReference()
public XMLExternalLink getExternalLink()
public void setBorderType(short borderType)
borderType
- the image border typeBorderType
public short getBorderType()
getBorderType
in interface org.docgene.model.BorderedElement
BorderType
public void setMargin(char margin)
margin
- the image marginpublic char getMargin()
public boolean hasShadow()
hasShadow
in interface org.docgene.model.BorderedElement
public boolean hasBorder()
hasBorder
in interface org.docgene.model.BorderedElement
public void setAlignment(char align)
setAlignment
in interface org.docgene.model.Alignment
align
- the alignmentAlignment
public char getAlignment()
getAlignment
in interface org.docgene.model.Alignment
Alignment
public void setVerticalAlignment(char valign)
valign
- the alignmentVerticalAlignment
public char getVerticalAlignment()
VerticalAlignment
public void useMaximumSize(boolean useMaxSize)
useMaxSize
- true if the image must not have a size greater than the
image definition sizepublic boolean isUsingMaximumSize()
public void setAbsoluteWidth(int width)
width
- the image widthpublic void setRelativeWidth(int width)
width
- the image widthpublic void setWidth(int width, boolean relWidth)
width
- the image widthrelWidth
- true if the width is relative (in percent)public boolean isRelativeWidth()
public void setHeight(int height, boolean relHeight)
height
- the image heightrelHeight
- true if the height is relative (in percent)public void setHeightAsText()
public boolean useTextHeight()
public char getHeightType()
public boolean isRelativeHeight()
public void setCaption(java.lang.String caption)
caption
- the image captionpublic java.lang.String getCaption()
public boolean hasCaption()
public void setID(java.lang.String id)
id
- the image IDpublic void bind(org.docgene.model.globals.ImageDefinition image)
bind
in interface org.docgene.model.ImageReference
image
- the image definitionpublic org.docgene.model.globals.ImageDefinition getImage()
getImage
in interface org.docgene.model.ImageReference
public boolean hasImageDefinition()
hasImageDefinition
in interface org.docgene.model.ImageReference
public java.net.URL getInputURL()
public java.io.File getInputFile()
public java.lang.String getImageID()
getImageID
in interface org.docgene.model.ImageReference
public boolean hasID()
hasID
in interface org.docgene.model.ImageReference
public java.io.File getHRef()
getHRef
in interface org.docgene.model.ImageReference
public boolean hasHRef()
hasHRef
in interface org.docgene.model.ImageReference
public boolean hasImageReference()
hasImageReference
in interface org.docgene.model.ImageReference
public boolean hasConcreteImage()
public java.awt.Image getConcreteImage()
public java.awt.Dimension getImageReferenceDimension()
public java.awt.Dimension getImageDimension()
public java.lang.String getPackage()
getPackage
in interface org.docgene.model.ImageReference
public int getWidth()
public int getHeight()
public boolean hasSize()
public boolean hasWidth()
public boolean hasHeight()
Copyright © 2016-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence