public class SwingDisplay extends G2Display
| Modifier and Type | Field and Description |
|---|---|
protected GlyphFactory |
factory |
static boolean |
testSampling |
addBackground, areas, backgroundColor, changeLineArtAndText, colorThresholdToReplace, currentItem, currentTokenNumber, defaultSize, endItem, enhanceFractionalLines, imageIDtoName, invertHighlight, itemToRender, objectStoreRef, objectType, pageObjects, rawPageNumber, textColor, type, userHintsAF, 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 |
|---|
SwingDisplay() |
SwingDisplay(byte[] stream,
Map<Object,Object> fonts)
rebuild serialised version
|
SwingDisplay(int pageNumber,
boolean addBackground,
int defaultSize,
ObjectStore newObjectRef) |
SwingDisplay(int pageNumber,
ObjectStore newObjectRef,
boolean isPrinting) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkFontSaved(Object glyph,
String name,
PdfFont currentFontData)
for font if we are generatign glyph on first render
|
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 canBeCached) |
void |
drawCustom(Object value) |
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(PdfShape pdfShape,
GraphicsState currentGraphicsState,
int cmd)
Used by Swing to Draw shape
|
void |
drawStroke(Stroke current) |
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 |
drawUserContent(int[] type1,
Object[] obj,
Color[] colors) |
void |
flushAdditionalObjOnPage()
Do not make private
|
int[] |
getAreaAsArray(int i)
Returns a Rectangles X,Y,W,H as an Array of integers
Where 0 = x, 1 = y, 2 = w, 3 = h.
|
int |
getObjectUnderneath(int x,
int y)
return number of image in display queue or -1 if none.
|
Rectangle |
getOccupiedArea()
return which part of page drawn onto
|
int |
isInsideImage(int x,
int y)
return number of image in display queue
or -1 if none
|
void |
paint(Rectangle[] highlights,
AffineTransform viewScaling,
Rectangle userAnnot)
Renders all the objects onto the g2 surface for screen display
|
void |
saveImage(int id,
String des,
String type) |
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 |
setGraphicsState(int fillType,
float value,
int BM)
save opacity settings
|
void |
setMessageFrame(Container frame)
allow user to set component for waring message in renderer to appear -
if unset no message will appear
|
void |
setneedsHorizontalInvert(boolean b) |
void |
setneedsVerticalInvert(boolean b) |
void |
setPrintPage(int currentPrintPage) |
void |
stopClearOnNextRepaint(boolean flag)
stop screen being cleared on repaint - used by Canoo code
|
void |
stopG2HintSetting(boolean isSet) |
void |
writeCustom(int section,
Object str)
Add output to correct area so we can assemble later.
|
checkColorThreshold, drawShape, eliminateHiddenText, getBooleanValue, getValue, init, isHTMLorSVG, paintBackground, renderComposite, saveAdvanceWidth, setG2, setScalingValues, setValuepublic static final boolean testSampling
protected GlyphFactory factory
public SwingDisplay()
public SwingDisplay(int pageNumber,
boolean addBackground,
int defaultSize,
ObjectStore newObjectRef)
public SwingDisplay(int pageNumber,
ObjectStore newObjectRef,
boolean isPrinting)
public void stopG2HintSetting(boolean isSet)
public void paint(Rectangle[] highlights, AffineTransform viewScaling, Rectangle userAnnot)
DynamicVectorRendererpaint in interface DynamicVectorRendererpaint in class BaseDisplaypublic void setMessageFrame(Container frame)
frame - public void drawText(float[][] Trm,
String text,
GraphicsState currentGraphicsState,
float x,
float y,
Font javaFont)
DynamicVectorRendererdrawText in interface DynamicVectorRendererdrawText in class BaseDisplaypublic int drawImage(int pageNumber,
BufferedImage image,
GraphicsState currentGraphicsState,
boolean alreadyCached,
String name,
int previousUse)
DynamicVectorRendererdrawImage in interface DynamicVectorRendererdrawImage in class BaseDisplaypublic Rectangle getOccupiedArea()
public void drawShape(PdfShape pdfShape, GraphicsState currentGraphicsState, int cmd)
DynamicVectorRendererdrawShape in interface DynamicVectorRendererdrawShape in class BaseDisplaypublic void writeCustom(int section,
Object str)
writeCustom in interface DynamicVectorRendererwriteCustom in class BaseDisplaysection - key value defined in this interface or inheriting classstr - value for key settingspublic void setGraphicsState(int fillType,
float value,
int BM)
DynamicVectorRenderersetGraphicsState in interface DynamicVectorRenderersetGraphicsState in class BaseDisplaypublic void drawAdditionalObjectsOverPage(int[] type,
Color[] colors,
Object[] obj)
throws PdfException
DynamicVectorRendererdrawAdditionalObjectsOverPage in interface DynamicVectorRendererdrawAdditionalObjectsOverPage in class BaseDisplayPdfExceptionpublic void flushAdditionalObjOnPage()
public void drawCustom(Object value)
public void drawTR(int value)
drawTR in interface DynamicVectorRendererdrawTR in class BaseDisplaypublic void drawStroke(Stroke current)
public void drawClip(GraphicsState currentGraphicsState, Shape defaultClip, boolean canBeCached)
drawClip in interface DynamicVectorRendererdrawClip in class BaseDisplaypublic void drawEmbeddedText(float[][] Trm,
int fontSize,
PdfGlyph embeddedGlyph,
Object javaGlyph,
int type,
GraphicsState gs,
double[] at,
String glyf,
PdfFont currentFontData,
float glyfWidth)
drawEmbeddedText in interface DynamicVectorRendererdrawEmbeddedText in class BaseDisplaypublic void stopClearOnNextRepaint(boolean flag)
NOT PART OF API and subject to change (DO NOT USE)
public byte[] serializeToByteArray(Set<String> fontsAlreadyOnClient) throws IOException
NOT PART OF API and subject to change (DO NOT USE)
serializeToByteArray in interface DynamicVectorRendererserializeToByteArray in class BaseDisplayIOExceptionpublic void checkFontSaved(Object glyph, String name, PdfFont currentFontData)
public void setPrintPage(int currentPrintPage)
public void setneedsVerticalInvert(boolean b)
public void setneedsHorizontalInvert(boolean b)
public int getObjectUnderneath(int x,
int y)
public int[] getAreaAsArray(int i)
public int isInsideImage(int x,
int y)
public void drawUserContent(int[] type1,
Object[] obj,
Color[] colors)
throws PdfException
PdfExceptionCopyright © 2017. All rights reserved.