Package org.apache.poi.hemf.draw
Class HemfGraphics
- java.lang.Object
-
- org.apache.poi.hwmf.draw.HwmfGraphics
-
- org.apache.poi.hemf.draw.HemfGraphics
-
- All Implemented Interfaces:
HwmfCharsetAware
public class HemfGraphics extends HwmfGraphics
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HemfGraphics.EmfRenderState
-
Nested classes/interfaces inherited from class org.apache.poi.hwmf.draw.HwmfGraphics
HwmfGraphics.FillDrawStyle
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hwmf.draw.HwmfGraphics
graphicsCtx, objectIndexes, objectTable, prop
-
-
Constructor Summary
Constructors Constructor Description HemfGraphics(Graphics2D graphicsCtx, Rectangle2D bbox)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObjectTableEntry(HwmfObjectTableEntry entry, int index)
Adds or sets an record of typeHwmfObjectTableEntry
to the object table.void
addPlusObjectTableEntry(HwmfObjectTableEntry entry, int index)
Adds or sets an record of typeHwmfObjectTableEntry
to the plus object table.void
applyObjectTableEntry(int index)
Applies the object table entryvoid
applyPlusObjectTableEntry(int index)
void
draw(Consumer<Path2D> pathConsumer, HwmfGraphics.FillDrawStyle fillDraw)
void
draw(HemfRecord r)
void
draw(HemfPlusRecord r)
void
fill(Shape shape)
protected Paint
getHatchedFill()
protected Paint
getLinearGradient()
HwmfObjectTableEntry
getObjectTableEntry(int index)
Gets a record which was registered earlierHwmfObjectTableEntry
getPlusObjectTableEntry(int index)
HemfDrawProperties
getProperties()
HemfGraphics.EmfRenderState
getRenderState()
protected HemfDrawProperties
newProperties(HwmfDrawProperties oldProps)
void
restorePlusProperties(int index)
Restores the properties from the plus stackvoid
savePlusProperties(int index)
Saves the current properties to the plus stackvoid
setRenderState(HemfGraphics.EmfRenderState renderState)
void
updateWindowMapMode()
After setting various window and viewport related properties, the underlying graphics context needs to be adapted.-
Methods inherited from class org.apache.poi.hwmf.draw.HwmfGraphics
addObjectTableEntry, draw, drawImage, drawImage, drawString, drawString, getFill, getImageRenderer, getInitTransform, getPatternFromLong, getPatternPaint, getSolidFill, getStroke, getTransform, restoreProperties, saveProperties, setCharsetProvider, setClip, setTransform, unsetObjectTableEntry
-
-
-
-
Constructor Detail
-
HemfGraphics
public HemfGraphics(Graphics2D graphicsCtx, Rectangle2D bbox)
-
-
Method Detail
-
getProperties
public HemfDrawProperties getProperties()
- Overrides:
getProperties
in classHwmfGraphics
-
newProperties
protected HemfDrawProperties newProperties(HwmfDrawProperties oldProps)
- Overrides:
newProperties
in classHwmfGraphics
-
getRenderState
public HemfGraphics.EmfRenderState getRenderState()
-
setRenderState
public void setRenderState(HemfGraphics.EmfRenderState renderState)
-
draw
public void draw(HemfRecord r)
-
draw
public void draw(HemfPlusRecord r)
-
draw
@Internal public void draw(Consumer<Path2D> pathConsumer, HwmfGraphics.FillDrawStyle fillDraw)
-
addObjectTableEntry
public void addObjectTableEntry(HwmfObjectTableEntry entry, int index)
Adds or sets an record of typeHwmfObjectTableEntry
to the object table. The index must be > 0- Parameters:
entry
- the record to be storedindex
- the index to be overwritten, regardless if its content was unset before- See Also:
HwmfGraphics.addObjectTableEntry(HwmfObjectTableEntry)
-
addPlusObjectTableEntry
public void addPlusObjectTableEntry(HwmfObjectTableEntry entry, int index)
Adds or sets an record of typeHwmfObjectTableEntry
to the plus object table. The index must be in the range [0..63]- Parameters:
entry
- the record to be storedindex
- the index to be overwritten, regardless if its content was unset before- See Also:
HwmfGraphics.addObjectTableEntry(HwmfObjectTableEntry)
-
getObjectTableEntry
public HwmfObjectTableEntry getObjectTableEntry(int index)
Gets a record which was registered earlier- Parameters:
index
- the record index- Returns:
- the record or
null
if it doesn't exist
-
getPlusObjectTableEntry
public HwmfObjectTableEntry getPlusObjectTableEntry(int index)
-
applyObjectTableEntry
public void applyObjectTableEntry(int index)
Description copied from class:HwmfGraphics
Applies the object table entry- Overrides:
applyObjectTableEntry
in classHwmfGraphics
- Parameters:
index
- the index of the object table entry (0-based)
-
applyPlusObjectTableEntry
public void applyPlusObjectTableEntry(int index)
-
getHatchedFill
protected Paint getHatchedFill()
- Overrides:
getHatchedFill
in classHwmfGraphics
-
updateWindowMapMode
public void updateWindowMapMode()
Description copied from class:HwmfGraphics
After setting various window and viewport related properties, the underlying graphics context needs to be adapted. This methods gathers and sets the corresponding graphics transformations.- Overrides:
updateWindowMapMode
in classHwmfGraphics
-
fill
public void fill(Shape shape)
- Overrides:
fill
in classHwmfGraphics
-
getLinearGradient
protected Paint getLinearGradient()
- Overrides:
getLinearGradient
in classHwmfGraphics
-
savePlusProperties
public void savePlusProperties(int index)
Saves the current properties to the plus stack
-
restorePlusProperties
public void restorePlusProperties(int index)
Restores the properties from the plus stack- Parameters:
index
- the index of the previously saved properties
-
-