public abstract class BaseDisplay extends Object implements DynamicVectorRenderer
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
addBackground
set flag to show if we add a background
|
protected Vector_Rectangle_Int |
areas
holds rectangular outline to test in redraw
|
protected Color |
backgroundColor
background color
|
protected boolean |
changeLineArtAndText |
protected static int |
colorThresholdToReplace |
protected int |
currentItem |
int |
currentTokenNumber |
protected static int |
defaultSize
default array size
|
protected int |
endItem |
protected static boolean |
enhanceFractionalLines |
protected Map<Integer,String> |
imageIDtoName |
static boolean |
invertHighlight |
protected int |
itemToRender |
protected ObjectStore |
objectStoreRef |
protected Vector_Int |
objectType
holds object type
|
protected Vector_Object |
pageObjects
initial Q & D object to hold data
|
int |
rawPageNumber |
protected static Color |
textColor |
protected int |
type |
static RenderingHints |
userHints
allow user to control
|
AF, ALT_BACKGROUND_COLOR, ALT_FOREGROUND_COLOR, BLENDMODE, CLIP, COLOR, COLOR_REPLACEMENT_THRESHOLD, CREATE_EPOS, CREATE_HTML, CREATE_PATTERN, CREATE_SVG, CREATE_T3, CUSTOM, CUSTOM_COLOR_HANDLER, CUSTOM_IMAGE_HANDLER, debugPaint, DISPLAY_IMAGE, DISPLAY_SCREEN, ENHANCE_FRACTIONAL_LINES, FILLCOLOR, FILLEDSHAPE, FILLOPACITY, FLUSH, FLUSH_ADDITIONAL_OBJECTS_ON_PAGE, FontMode, FONTSIZE, FOREGROUND_INCLUDE_LINEART, IMAGE, IsRealText, IsSVGMode, IsTextSelectable, LINEWIDTH, MARKER, PAGE_DECODING_FINISHED, PAINT_BACKGROUND, RESET_COLORSPACE, REUSED_IMAGE, SAVE_EMBEDDED_FONT, SHAPE, STRING, STROKE, STROKECOLOR, STROKEDSHAPE, STROKEOPACITY, TEXT, TEXT_STRUCTURE_CLOSE, TEXT_STRUCTURE_OPEN, TEXTCOLOR, TOKEN_NUMBER, TR, TRUETYPE, TYPE1C, TYPE3| Constructor and Description |
|---|
BaseDisplay() |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
checkColorThreshold(int col) |
void |
drawAdditionalObjectsOverPage(int[] type,
Color[] colors,
Object[] obj)
Method to add Shape, Text or image to main display on page over PDF - will be flushed on redraw
|
void |
drawClip(GraphicsState currentGraphicsState,
Shape defaultClip,
boolean alwaysDraw) |
void |
drawEmbeddedText(float[][] Trm,
int fontSize,
PdfGlyph embeddedGlyph,
Object javaGlyph,
int type,
GraphicsState gs,
double[] at,
String glyf,
PdfFont currentFontData,
float glyfWidth)
Store glyph info
|
int |
drawImage(int pageNumber,
BufferedImage image,
GraphicsState currentGraphicsState,
boolean alreadyCached,
String name,
int previousUse)
save image in array to draw
|
void |
drawShape(Object currentShape,
GraphicsState currentGraphicsState)
Used by FX to Draw shape
|
void |
drawShape(PdfShape pdfShape,
GraphicsState currentGraphicsState,
int cmd)
Used by Swing to Draw shape
|
void |
drawText(float[][] Trm,
String text,
GraphicsState currentGraphicsState,
float x,
float y,
Font javaFont)
Saves text object with attributes for rendering
|
void |
drawTR(int value) |
void |
eliminateHiddenText(Shape currentShape,
GraphicsState gs,
int count,
boolean ignoreScaling) |
boolean |
getBooleanValue(int key)
allow user to read
|
int |
getValue(int key)
Generic method to access int values
|
void |
init(int width,
int height,
Color backgroundColor)
Set page values
|
boolean |
isHTMLorSVG()
Allows generic code to identify if it is doing HTML/SVG conversion
|
void |
paint(Rectangle[] highlights,
AffineTransform viewScaling,
Rectangle userAnnot)
Renders all the objects onto the g2 surface for screen display
|
protected void |
paintBackground(Shape dirtyRegion) |
protected void |
renderComposite(float alpha) |
void |
saveAdvanceWidth(int fontObjID,
String s,
int potentialWidth)
only used in HTML5 and SVG conversion
|
byte[] |
serializeToByteArray(Set<String> fontsAlreadyOnClient)
turn object into byte[] so we can move across
this way should be much faster than the stadard Java serialise.
|
void |
setG2(Graphics2D g2)
Used to pass in Graphics2D for all versions
|
void |
setGraphicsState(int fillType,
float value,
int BM)
save opacity settings
|
void |
setScalingValues(double cropX,
double cropH,
float scaling) |
void |
setValue(int key,
int i)
Generic method to set int values
|
void |
writeCustom(int key,
Object value)
used by some custom version of DynamicVectorRenderer
|
protected Vector_Int objectType
protected static final int defaultSize
protected int type
public int currentTokenNumber
protected boolean addBackground
protected Vector_Rectangle_Int areas
protected ObjectStore objectStoreRef
protected int currentItem
protected int itemToRender
protected int endItem
public int rawPageNumber
public static boolean invertHighlight
protected Vector_Object pageObjects
protected Color backgroundColor
protected static Color textColor
protected static int colorThresholdToReplace
protected static boolean enhanceFractionalLines
protected boolean changeLineArtAndText
public static RenderingHints userHints
public void setG2(Graphics2D g2)
DynamicVectorRenderersetG2 in interface DynamicVectorRendererpublic void init(int width,
int height,
Color backgroundColor)
DynamicVectorRendererinit in interface DynamicVectorRendererprotected void paintBackground(Shape dirtyRegion)
protected static boolean checkColorThreshold(int col)
public void setScalingValues(double cropX,
double cropH,
float scaling)
setScalingValues in interface DynamicVectorRendererpublic byte[] serializeToByteArray(Set<String> fontsAlreadyOnClient) throws IOException
serializeToByteArray in interface DynamicVectorRendererIOExceptionpublic void drawShape(PdfShape pdfShape, GraphicsState currentGraphicsState, int cmd)
DynamicVectorRendererdrawShape in interface DynamicVectorRendererpublic void drawEmbeddedText(float[][] Trm,
int fontSize,
PdfGlyph embeddedGlyph,
Object javaGlyph,
int type,
GraphicsState gs,
double[] at,
String glyf,
PdfFont currentFontData,
float glyfWidth)
DynamicVectorRendererdrawEmbeddedText in interface DynamicVectorRendererpublic void paint(Rectangle[] highlights, AffineTransform viewScaling, Rectangle userAnnot)
DynamicVectorRendererpaint in interface DynamicVectorRendererpublic int drawImage(int pageNumber,
BufferedImage image,
GraphicsState currentGraphicsState,
boolean alreadyCached,
String name,
int previousUse)
DynamicVectorRendererdrawImage in interface DynamicVectorRendererpublic void drawAdditionalObjectsOverPage(int[] type,
Color[] colors,
Object[] obj)
throws PdfException
DynamicVectorRendererdrawAdditionalObjectsOverPage in interface DynamicVectorRendererPdfExceptionpublic void drawText(float[][] Trm,
String text,
GraphicsState currentGraphicsState,
float x,
float y,
Font javaFont)
DynamicVectorRendererdrawText in interface DynamicVectorRendererpublic void setGraphicsState(int fillType,
float value,
int BM)
DynamicVectorRenderersetGraphicsState in interface DynamicVectorRendererpublic void drawTR(int value)
drawTR in interface DynamicVectorRendererpublic void drawClip(GraphicsState currentGraphicsState, Shape defaultClip, boolean alwaysDraw)
drawClip in interface DynamicVectorRendererpublic void writeCustom(int key,
Object value)
writeCustom in interface DynamicVectorRendererkey - key value defined in this interface or inheriting classvalue - value for key settingspublic void setValue(int key,
int i)
DynamicVectorRenderersetValue in interface DynamicVectorRendererkey - key value defined in this interface or inheriting classi - value for key settingspublic int getValue(int key)
DynamicVectorRenderergetValue in interface DynamicVectorRendererkey - - int key value defined in this interface or inheriting classpublic boolean getBooleanValue(int key)
getBooleanValue in interface DynamicVectorRendererkey - - int key value defined in this interface or inheriting classpublic void saveAdvanceWidth(int fontObjID,
String s,
int potentialWidth)
saveAdvanceWidth in interface DynamicVectorRendererfontObjID - s - potentialWidth - public void drawShape(Object currentShape, GraphicsState currentGraphicsState)
DynamicVectorRendererdrawShape in interface DynamicVectorRendererpublic void eliminateHiddenText(Shape currentShape, GraphicsState gs, int count, boolean ignoreScaling)
eliminateHiddenText in interface DynamicVectorRendererprotected void renderComposite(float alpha)
public boolean isHTMLorSVG()
DynamicVectorRendererisHTMLorSVG in interface DynamicVectorRendererCopyright © 2017. All rights reserved.