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 classHemfGraphics.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 voidaddObjectTableEntry(HwmfObjectTableEntry entry, int index)Adds or sets an record of typeHwmfObjectTableEntryto the object table.voidaddPlusObjectTableEntry(HwmfObjectTableEntry entry, int index)Adds or sets an record of typeHwmfObjectTableEntryto the plus object table.voidapplyObjectTableEntry(int index)Applies the object table entryvoidapplyPlusObjectTableEntry(int index)voiddraw(Consumer<Path2D> pathConsumer, HwmfGraphics.FillDrawStyle fillDraw)voiddraw(HemfRecord r)voiddraw(HemfPlusRecord r)voidfill(Shape shape)protected PaintgetHatchedFill()protected PaintgetLinearGradient()HwmfObjectTableEntrygetObjectTableEntry(int index)Gets a record which was registered earlierHwmfObjectTableEntrygetPlusObjectTableEntry(int index)HemfDrawPropertiesgetProperties()HemfGraphics.EmfRenderStategetRenderState()protected HemfDrawPropertiesnewProperties(HwmfDrawProperties oldProps)voidrestorePlusProperties(int index)Restores the properties from the plus stackvoidsavePlusProperties(int index)Saves the current properties to the plus stackvoidsetRenderState(HemfGraphics.EmfRenderState renderState)voidupdateWindowMapMode()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:
getPropertiesin classHwmfGraphics
-
newProperties
protected HemfDrawProperties newProperties(HwmfDrawProperties oldProps)
- Overrides:
newPropertiesin 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 typeHwmfObjectTableEntryto 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 typeHwmfObjectTableEntryto 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
nullif it doesn't exist
-
getPlusObjectTableEntry
public HwmfObjectTableEntry getPlusObjectTableEntry(int index)
-
applyObjectTableEntry
public void applyObjectTableEntry(int index)
Description copied from class:HwmfGraphicsApplies the object table entry- Overrides:
applyObjectTableEntryin classHwmfGraphics- Parameters:
index- the index of the object table entry (0-based)
-
applyPlusObjectTableEntry
public void applyPlusObjectTableEntry(int index)
-
getHatchedFill
protected Paint getHatchedFill()
- Overrides:
getHatchedFillin classHwmfGraphics
-
updateWindowMapMode
public void updateWindowMapMode()
Description copied from class:HwmfGraphicsAfter 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:
updateWindowMapModein classHwmfGraphics
-
fill
public void fill(Shape shape)
- Overrides:
fillin classHwmfGraphics
-
getLinearGradient
protected Paint getLinearGradient()
- Overrides:
getLinearGradientin 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
-
-