Package org.apache.poi.hwmf.usermodel
Class HwmfPicture
- java.lang.Object
-
- org.apache.poi.hwmf.usermodel.HwmfPicture
-
- All Implemented Interfaces:
Iterable<HwmfRecord>,GenericRecord
public class HwmfPicture extends Object implements Iterable<HwmfRecord>, GenericRecord
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_RECORD_LENGTHMax.static intMAX_RECORD_LENGTH
-
Constructor Summary
Constructors Constructor Description HwmfPicture(InputStream inputStream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(Graphics2D ctx)voiddraw(Graphics2D ctx, Rectangle2D graphicsBounds)Rectangle2DgetBounds()Returns the bounding box in device-independent units.Rectangle2DgetBoundsInPoints()Return the image bound in pointsCharsetgetDefaultCharset()Iterable<HwmfEmbedded>getEmbeddings()List<? extends GenericRecord>getGenericChildren()Map<String,Supplier<?>>getGenericProperties()HwmfHeadergetHeader()Rectangle2DgetInnnerBounds()Returns the bounding box in device-independent units taken from the WmfSetWindowOrg/Ext recordsstatic intgetMaxRecordLength()HwmfPlaceableHeadergetPlaceableHeader()List<HwmfRecord>getRecords()Dimension2DgetSize()Return the image size in pointsIterator<HwmfRecord>iterator()voidsetDefaultCharset(Charset defaultCharset)static voidsetMaxRecordLength(int length)Spliterator<HwmfRecord>spliterator()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericRecordType
-
-
-
-
Field Detail
-
DEFAULT_MAX_RECORD_LENGTH
public static final int DEFAULT_MAX_RECORD_LENGTH
Max. record length - processing longer records will throw an exception- See Also:
- Constant Field Values
-
MAX_RECORD_LENGTH
public static int MAX_RECORD_LENGTH
-
-
Constructor Detail
-
HwmfPicture
public HwmfPicture(InputStream inputStream) throws IOException
- Parameters:
inputStream- The InputStream to read data from- Throws:
IOException- If reading data from the file failsRuntimeException- a number of runtime exceptions can be thrown, especially if there are problems with the input format
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length- the max record length allowed for HwmfPicture
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for HwmfPicture
-
getRecords
public List<HwmfRecord> getRecords()
-
draw
public void draw(Graphics2D ctx)
-
draw
public void draw(Graphics2D ctx, Rectangle2D graphicsBounds)
-
getBounds
public Rectangle2D getBounds()
Returns the bounding box in device-independent units. Usually this is taken from the placeable header.- Returns:
- the bounding box
- Throws:
RuntimeException- if neither WmfSetWindowOrg/Ext nor the placeableHeader are set
-
getInnnerBounds
public Rectangle2D getInnnerBounds()
Returns the bounding box in device-independent units taken from the WmfSetWindowOrg/Ext records- Returns:
- the bounding box or null, if the WmfSetWindowOrg/Ext records aren't set
-
getPlaceableHeader
public HwmfPlaceableHeader getPlaceableHeader()
-
getHeader
public HwmfHeader getHeader()
-
getBoundsInPoints
public Rectangle2D getBoundsInPoints()
Return the image bound in points- Returns:
- the image bound in points
-
getSize
public Dimension2D getSize()
Return the image size in points- Returns:
- the image size in points
-
getEmbeddings
public Iterable<HwmfEmbedded> getEmbeddings()
-
iterator
public Iterator<HwmfRecord> iterator()
- Specified by:
iteratorin interfaceIterable<HwmfRecord>
-
spliterator
public Spliterator<HwmfRecord> spliterator()
- Specified by:
spliteratorin interfaceIterable<HwmfRecord>
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericPropertiesin interfaceGenericRecord
-
getGenericChildren
public List<? extends GenericRecord> getGenericChildren()
- Specified by:
getGenericChildrenin interfaceGenericRecord
-
setDefaultCharset
public void setDefaultCharset(Charset defaultCharset)
-
getDefaultCharset
public Charset getDefaultCharset()
-
-