Package com.stimulsoft.base.drawing
Class StiGraphics
java.lang.Object
com.stimulsoft.base.drawing.StiGraphics
Graphics adapter class that translate sti commands to graphics representation.
Copyright Stimulsoft
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis class represents a cubic polynomial -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginFill(StiBrush brush, StiPen pen, StiRectangle rect, Double zoom) Set fill formatvoidClear coordinates offsetvoidPop rotation from stackdrawAttributedString(String allText, Font awtFont, StiRectangle rect, Boolean underline, Boolean wordWrap, StiTextHorAlignment horAlignment, float lineSpacing, Boolean draw, List<StiLineInfo> lines, Boolean useRightToLeft) Draw attribute stringvoidDraw curvevoiddrawEllise(StiRectangle rect, StiPen pen, StiBrush brush, Double zoom, Double pageZoom) Draw ellipsevoiddrawElliseBegin(StiRectangle rect, StiPen pen, StiBrush brush, Double zoom) Begin draw ellipsevoiddrawElliseEnd(StiRectangle rect) End draw ellipsevoiddrawHTMLText(String text, StiRectangle rect, StiFont font, StiColor color, StiTextHorAlignment horAlignment, StiVertAlignment vertAlignment, Boolean wordWrap, StiPenStyle linesOfUnderline, StiBorder border, StiTextOptions textOptions, float lineSpacing, Double zoom) Draw HTML textvoiddrawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, double zoom) DrawBufferedImagewith scaling alpha value 1voiddrawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, Boolean scaleBitmap, float alpha, Double zoom) DrawBufferedImagevoiddrawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, Boolean scaleBitmap, Double zoom) DrawBufferedImagewith alpha value 1voidDraw line by start invalid input: '&' endStiPointwith transofmation coordinates with stored offsetsvoidDraw line by start invalid input: '&' endStiPointvoidDraw line by coordinatesvoiddrawLineXY(Double x1, Double y1, Double x2, Double y2, StiPen pen, Double zoom, Boolean transformRect) Draw line by coordinatesvoiddrawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, double zoom, double pageZoom) Draw path sotred in ListStiPathCommanddrawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, Boolean transformCoord, double zoom, double pageZoom) Draw path sotred in ListStiPathCommanddrawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, Boolean transformCoord, double zoom, double pageZoom, boolean draw) Draw path sotred in ListStiPathCommandvoiddrawRectangle(StiRectangle rect, StiPen pen, StiBrush brush, Double zoom, Double pageZoom) Draw rectanglevoiddrawRectangle(StiRectangle rect, StiPen pen, StiBrush brush, Double cornerRadius, Double zoom, Double pageZoom) Draw rounded rectanglevoiddrawRTFText(String text, StiRectangle rect, Double zoom) Draw RFT textvoiddrawText(String text, StiRectangle rect, StiFont font, StiBrush brush, StiTextHorAlignment horAlignment, StiVertAlignment vertAlignment, Boolean wordWrap, float lineSpacing, Double zoom, StiPenStyle linesOfUnderline, StiBorder border, StiTextOptions textOptions) Draw textvoidfillPolygon(StiBrush brush, List<StiPoint> points, double zoom, double pageZoom) static StiGraphicsfromImage(BufferedImage image) getG()Round coorditates before paintingReturn X offsetReturn Y offsetRestore clip from clip stackvoidsetClip(StiRectangle rect) Set clip invalid input: '&' fit it in old(stored in stack) clipvoidsetFixedClip(StiRectangle rect) Set clip without fiting to old(stored in stack) clipvoidsetG(Graphics2D g) voidsetIntegerCoords(Boolean value) Round coordinatessetLineStyle(StiPen pen, StiRectangle rect, double zoom) Set line stylevoidsetOffset(double x, double y) Set coordinates offsetvoidsetRotate(double angle, double centerX, double centerY) Set rotation params invalid input: '&' store it in stackvoidSet clip (push it to stack) with trasnform it with offsets invalid input: '&' fit clip in older(stored) cliptransformCoords(Double x, Double y, Double ox, Double oy) Tramsform coordinatestransformPoint(StiPoint point, Double ox, Double oy) TransformStiPointwith offsetstransformPointRound(StiPoint point, Double ox, Double oy) TransformStiPointwith offsets invalid input: '&' round coordinates with stored digits after pointtransformRect(StiRectangle rect) TransformStiRectangletransformRect(StiRectangle rect, Double ox, Double oy) TransformStiRectanglewith offsetsTransformStiRectanglewith stored offsets invalid input: '&' round with stored digits after pointtransformRectRound(StiRectangle rect, Double ox, Double oy, Integer digits) TransformStiRectangleinvalid input: '&' round it with digits after point
-
Field Details
-
HTML_SCALE
HTMLJTextPanescale
-
-
Constructor Details
-
StiGraphics
Constructor- Parameters:
g-
-
-
Method Details
-
fromImage
-
getIntegerCoords
Round coorditates before painting- Returns:
-
setIntegerCoords
Round coordinates- Parameters:
value-
-
setOffset
public void setOffset(double x, double y) Set coordinates offset- Parameters:
x-y-
-
clearOffset
public void clearOffset()Clear coordinates offset -
setTransformedClip
Set clip (push it to stack) with trasnform it with offsets invalid input: '&' fit clip in older(stored) clip- Parameters:
rect-
-
restoreClip
Restore clip from clip stack- Returns:
- rstored clip
-
setFixedClip
Set clip without fiting to old(stored in stack) clip- Parameters:
rect-
-
setClip
Set clip invalid input: '&' fit it in old(stored in stack) clip- Parameters:
rect-
-
setRotate
public void setRotate(double angle, double centerX, double centerY) Set rotation params invalid input: '&' store it in stack- Parameters:
angle-centerX- x coordinate to rotatecenterY- y coordinate to rotate
-
clearRotate
public void clearRotate()Pop rotation from stack -
transformCoords
Tramsform coordinates- Parameters:
x-y-ox-oy-- Returns:
-
transformPointRound
TransformStiPointwith offsets invalid input: '&' round coordinates with stored digits after point- Parameters:
point-StiPointox- X offsetoy- Y offset- Returns:
-
transformPoint
TransformStiPointwith offsets- Parameters:
point-StiPointox-oy-- Returns:
-
transformRectRound
TransformStiRectangleinvalid input: '&' round it with digits after point- Parameters:
rect-StiRectangleox- X offsetoy- Y offsetdigits- Round to digits after point- Returns:
-
transformRectRound
TransformStiRectanglewith stored offsets invalid input: '&' round with stored digits after point- Parameters:
rect-StiRectangle- Returns:
-
transformRect
TransformStiRectangle- Parameters:
rect-StiRectangle- Returns:
-
transformRect
TransformStiRectanglewith offsets- Parameters:
rect-StiRectangleox- X offsetoy- Y offset- Returns:
-
setLineStyle
Set line style- Parameters:
pen-StiPointrect-StiRectanglezoom-- Returns:
-
beginFill
Set fill format- Parameters:
brush-StiBrushpen-StiPenrect-StiRectangleto paint inzoom-- Returns:
-
fillPolygon
-
drawPath
public void drawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, double zoom, double pageZoom) Draw path sotred in ListStiPathCommand- Parameters:
path- ListStiPathCommandpen-StiPenbrush-StiBrushzoom-pageZoom-
-
drawPath
public StiRectangle drawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, Boolean transformCoord, double zoom, double pageZoom) Draw path sotred in ListStiPathCommand- Parameters:
path- ListStiPathCommandpen-StiPenbrush-StiBrushtransformCoord- is need to transform coordinates with stored offsetszoom-pageZoom-draw-- Returns:
- Bounds rect
-
drawPath
public StiRectangle drawPath(List<StiPathCommand> path, StiPen pen, StiBrush brush, Boolean transformCoord, double zoom, double pageZoom, boolean draw) Draw path sotred in ListStiPathCommand- Parameters:
path- ListStiPathCommandpen-StiPenbrush-StiBrushtransformCoord- is need to transform coordinates with stored offsetszoom-pageZoom-draw-- Returns:
- Bounds rect
-
drawRectangle
public void drawRectangle(StiRectangle rect, StiPen pen, StiBrush brush, Double zoom, Double pageZoom) Draw rectangle- Parameters:
rect-StiRectanglepen-StiPenbrush-StiBrushzoom-pageZoom-
-
drawRectangle
public void drawRectangle(StiRectangle rect, StiPen pen, StiBrush brush, Double cornerRadius, Double zoom, Double pageZoom) Draw rounded rectangle- Parameters:
rect-StiRectanglepen-StiPenbrush-StiBrushcornerRadius-zoom-pageZoom-
-
drawEllise
Draw ellipse- Parameters:
rect-StiRectanglepen-StiPenbrush-StiBrushzoom-pageZoom-
-
drawElliseBegin
Begin draw ellipse- Parameters:
rect-StiRectanglepen-StiPenbrush-StiBrushzoom-
-
drawElliseEnd
End draw ellipse- Parameters:
rect-StiRectangle
-
drawLineXY
public void drawLineXY(Double x1, Double y1, Double x2, Double y2, StiPen pen, Double zoom, Boolean transformRect) Draw line by coordinates- Parameters:
x1-y1-x2-y2-pen-StiPenzoom-transformRect- is need to transform coordinates with stored offsets
-
drawLineXY
Draw line by coordinates- Parameters:
x1-y1-x2-y2-pen-StiPenzoom-
-
drawLine
Draw line by start invalid input: '&' endStiPointwith transofmation coordinates with stored offsets -
drawLine
Draw line by start invalid input: '&' endStiPoint -
drawCurve
Draw curve- Parameters:
pen-zoom-transformRect-polygon-
-
drawImage
public void drawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, double zoom) DrawBufferedImagewith scaling alpha value 1- Parameters:
image-BufferedImagerect-StiRectanglestretch- is need to stretch imagesmooth- is need to smooth imagezoom-
-
drawImage
public void drawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, Boolean scaleBitmap, Double zoom) DrawBufferedImagewith alpha value 1- Parameters:
image-BufferedImagerect-StiRectanglestretch- is need to stretch imagesmooth- is need to smooth imagescaleBitmap- is need to scale imagezoom-
-
drawImage
public void drawImage(BufferedImage image, StiRectangle rect, Boolean stretch, Boolean smooth, Boolean scaleBitmap, float alpha, Double zoom) DrawBufferedImage- Parameters:
image-BufferedImagerect-StiRectanglestretch- is need to stretch imagesmooth- is need to smooth imagescaleBitmap- is need to scale imagealpha- alphe valuezoom-
-
drawRTFText
Draw RFT text- Parameters:
text-rect-StiRectanglewith RTF textzoom-
-
drawHTMLText
public void drawHTMLText(String text, StiRectangle rect, StiFont font, StiColor color, StiTextHorAlignment horAlignment, StiVertAlignment vertAlignment, Boolean wordWrap, StiPenStyle linesOfUnderline, StiBorder border, StiTextOptions textOptions, float lineSpacing, Double zoom) Draw HTML text- Parameters:
text-rect-StiRectanglefont-StiFontcolor-StiColorhorAlignment-StiTextHorAlignmentvertAlignment-StiVertAlignmentwordWrap- is need wo wrap wordslinesOfUnderline- is need do draw lines of underlineborder-StiBordertextOptions-StiTextOptionszoom-
-
drawText
public void drawText(String text, StiRectangle rect, StiFont font, StiBrush brush, StiTextHorAlignment horAlignment, StiVertAlignment vertAlignment, Boolean wordWrap, float lineSpacing, Double zoom, StiPenStyle linesOfUnderline, StiBorder border, StiTextOptions textOptions) Draw text- Parameters:
text-rect-StiRectangletext rectanglefont-StiFontbrush-StiBrushhorAlignment-StiTextHorAlignmentvertAlignment-StiVertAlignmentwordWrap- is need to wrap wordszoom-linesOfUnderline- is need to draw liens of underlineborder-StiBordertextOptions-StiTextOptions
-
drawAttributedString
public StiRectangle drawAttributedString(String allText, Font awtFont, StiRectangle rect, Boolean underline, Boolean wordWrap, StiTextHorAlignment horAlignment, float lineSpacing, Boolean draw, List<StiLineInfo> lines, Boolean useRightToLeft) Draw attribute string- Parameters:
allText-awtFont-Fontrect-StiRectangleunderline- in underline fornwordWrap- is need to wrap wordshorAlignment-StiTextHorAlignmentdraw- is need to draw or only calculate text rectlines- - returns string fit linesuseRightToLeft- - Right to left text- Returns:
- rect that fill text
-
getG
- Returns:
Graphics2D
-
getOffsetX
Return X offset- Returns:
-
getOffsetY
Return Y offset- Returns:
-
setG
- Parameters:
g- the g to set
-