Package megameklab.printing
Class PrintRecordSheet
java.lang.Object
megameklab.printing.PrintRecordSheet
- All Implemented Interfaces:
Printable,IdConstants
- Direct Known Subclasses:
PrintCompositeTankSheet,PrintEntity,PrintSmallUnitSheet
Base class for rendering record sheets. This is mostly a collection of utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final floatstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final floatstatic final floatstatic final floatstatic final floatprotected final RecordSheetOptionsstatic final Stringstatic final doubleScale factor for record sheets with reference tablesFields inherited from interface megameklab.printing.IdConstants
AFT_HEAT, AFT_SIDES_HEAT, AMMO_PIPS, ARMOR_DIAGRAM, ARMOR_DIVISOR, ARMOR_KIT, ARMOR_PIPS, ARMOR_TYPE, ASF_BLANK_GUNNERY_SKILL, ASF_BLANK_PILOTING_SKILL, ASF_GUNNERY_SKILL, ASF_PILOTING_SKILL, AVIONICS_HIT, BLANK_CREW_NAME, BLANK_GUNNERY_SKILL, BLANK_PILOTING_SKILL, BLANKS_CREW, BOMB_BOXES, BROADSIDES_HEAT, BV, CANON_ARMOR_PIPS, CANON_STRUCTURE_PIPS, CHECK_AP, CHECK_LEG, CHECK_MECHANIZED, CHECK_SWARM, CIC_HIT, COMMANDER_HIT, COPILOT_HIT, COPYRIGHT, COST, CREW_DAMAGE, CREW_HIT, CREW_NAME, CRITS, DAMAGE, DC_PIPS, DEFAULT_FLUFF_IMAGE, DEST_MODS, DOCKING_COLLAR_HIT, DOUBLE_HS_COUNT, DRIVER_HIT, ENGINE_HIT, ENGINE_TYPE, ERA_ICON, EXTERNAL_STORES, EXTERNAL_STORES_KEY, FCS_HIT, FIELD_GUN_AMMO, FIELD_GUN_COLUMNS, FIELD_GUN_CREW, FIELD_GUN_DMG, FIELD_GUN_DMG_2, FIELD_GUN_LONG, FIELD_GUN_MED, FIELD_GUN_MIN_RANGE, FIELD_GUN_QTY, FIELD_GUN_SHORT, FIELD_GUN_TYPE, FLIGHT_STABILIZER_HIT, FLUFF_DUAL_PILOT, FLUFF_IMAGE, FLUFF_NAME, FLUFF_SINGLE_PILOT, FLUFF_TRIPLE_PILOT, FOOTER, FORE_SIDES_HEAT, FRAME, FUEL_TANK_HIT, GUNNERY_SKILL, GUNNERY_SKILL_TEXT, GYRO_HIT, HEAT_SINK_PIPS, HEAVY_DUTY_GYRO_PIP, HS_COUNT, HS_TYPE, INVENTORY, IS_PIPS, IS_PIPS_HD, IS_PIPS_HD_SH, KF_BOOM_HIT, KF_PIPS, LANDING_GEAR_HIT, LBL_BATTLEARMOR, LBL_JUMP, LBL_ROLE, LBL_VEE_MODE, LIFE_BOATS, LIFE_SUPPORT_HIT, MAG_CLAMP_NOTE, MAIN_GUN_ARMOR, MAIN_GUN_SHADOW, MAIN_GUN_TEXT, MINUS_1_MP, MINUS_2_MP, MINUS_3_MP, MINUS_4_MP, MINUS_5_MP, MINUS_6_MP, MINUS_7_MP, MINUS_8_MP, MINUS_9_MP, MML_COLOR_ELEMENTS, MML_FIELD_WIDTH, MML_GAP, MML_MULTISECTION, MODE_1, MODE_2, MODE_2_LABEL, MOTIVE_SYSTEM_HIT, MOVEMENT_TYPE, MP_1, MP_2, MP_2_LABEL, MP_AIR_MEK_CRUISE, MP_AIR_MEK_FLANK, MP_AIR_MEK_RUN, MP_AIR_MEK_WALK, MP_CRUISE, MP_FLANK, MP_GROUND, MP_JUMP, MP_MAX_THRUST, MP_RUN, MP_SAFE_THRUST, MP_WALK, N_BATTLEARMOR, N_CREW, N_MARINES, N_OTHER, N_PASSENGERS, NO_SOLDIER, NOSE_HEAT, NOTES, PARTIAL_WING_BONUS, PATCHWORK, PILOT_HIT, PILOT_NAME, PILOTING_SKILL, PILOTING_SKILL_TEXT, PIPS, PROTOMEK_INDEX, RANGE, RANGE_IN_HEXES, RANGE_MOD, ROLE, ROW_SHADING, RS_TEMPLATE, RULES_LEVEL, SAIL_PIPS, SENSOR_HIT, SHIELD, SHIELD_DA, SHIELD_DC, SI_PIPS, SNEAK_CAMO_MODS, SNEAK_IR_MODS, SOLDIER, SPAS, SQUAD, STABILIZER_HIT_FRONT, STABILIZER_HIT_LEFT, STABILIZER_HIT_REAR, STABILIZER_HIT_RIGHT, STABILIZER_HIT_TURRET, STABILIZER_HIT_TURRET_FRONT, STABILIZER_HIT_TURRET_REAR, STRUCTURE_PIPS, STRUCTURE_TYPE, SUIT, TECH_BASE, TEXT_ARMOR, TEXT_DOCKING_COLLARS, TEXT_IS, TEXT_KF_DRIVE, TEXT_SAIL, TEXT_SI, THRUSTER_LEFT_HIT, THRUSTER_RIGHT_HIT, TITLE, TONNAGE, TORSO_WEAPON, TRACKS, TRANSPORT_WT, TURRET_LOCKED, TURRET_LOCKED_FRONT, TURRET_LOCKED_REAR, TYPE, TYPE2, UNIT_SCALE, UNIT_TYPE, UW_LABEL, UW_RANGE_MOD, WARRIOR_DATA_DUAL, WARRIOR_DATA_SINGLE, WARRIOR_DATA_TRIPLE, WHEELSFields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrintRecordSheet(int firstPage, RecordSheetOptions options) Creates an SVG object for the record sheet -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddLineThrough(Element parent, double x, double y, double width) Add a line through the text at the given coordinates.protected voidaddLineThrough(Element parent, double x, double y, double width, String color) Add a line through the text at the given coordinates.protected intaddMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight) Adds a text element to a region with limited width.protected intaddMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight, String fontStyle, String className) Adds a text element to a region with limited width.protected intaddMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight, String fontStyle, String fill, char delimiter, String className) Adds a text element to a region with limited width.protected voidaddReferenceCharts(PageFormat pageFormat) Adds reference charts to the right side of the record sheet.protected doubleaddTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight) Convenience method for creating a new SVG Text element and adding it to the parent.protected doubleaddTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight, String fontStyle, String fill) Convenience method for creating a new SVG Text element and adding it to the parent.protected doubleaddTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight, String fontStyle, String fill, String id, String className) Convenience method for creating a new SVG Text element and adding it to the parent.protected voidaddTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight) Creates a new text element with black fill and adds it to the parent.protected voidaddTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight, String fill) Creates a new text element and adds it to the parent.protected voidaddTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight, String fill, String id, String className) Creates a new text element and adds it to the parent.protected voidApplies the critical damage to the core components of the unit and crew.org.apache.batik.gvt.GraphicsNodebuild()booleancreateDocument(int pageIndex, PageFormat pageFormat, boolean addMargin) booleancreateDocument(int pageIndex, PageFormat pageFormat, boolean addMargin, boolean useUnitTestTemplateDirectory) protected ElementcreatePip(double x, double y, double radius, double strokeWidth) Deprecated, for removal: This API element is subject to removal in a future version.protected ElementApproximates a circle using four Bézier curves.protected ElementcreatePip(double x, double y, double radius, double strokeWidth, PipType type, String fill, String className, String loc, boolean rear) Approximates a circle using four Bézier curves.protected ElementcreateRoundedRectangle(double x, double y, double width, double height, double radius, double control, double strokeWidth, String stroke) Creates a rectangle with Bézier curves on the cornersvoidembedImage(Image image, Element canvas, Rectangle2D bbox, boolean center, String className) Inserts an image into the SVG diagram scaled to fit into the provided bounds.voidembedImage(File imageFile, Element canvas, Rectangle2D bbox, boolean center) Inserts an image into the SVG diagram scaled to fit into the provided bounds.exportPDF(int pageNumber, PageFormat pageFormat) protected voidfillCoreComponentCriticalDamage(String id, boolean damaged) protected voidfillCoreComponentCriticalDamage(String idPrefix, int damage) protected final FontgetBoldFont(float size) Used for measuring font metrics of a bold weight fontprotected final FontgetBoldItalicFont(float size) Used for measuring font metrics of a bold italic fontdoublegetBoldItalicTextLength(String text, float fontSize) doublegetBoldTextLength(String text, float fontSize) Used to build an outline of a PDF documentprotected Stringprotected final intfloatgetFontHeight(float fontSize) Determines the vertical space taken up by a line of text.protected floatgetFontHeight(float fontSize, Font font) Determines the vertical space taken up by a line of text.protected final FontgetItalicFont(float size) Used for measuring font metrics of an italic fontdoublegetItalicTextLength(String text, float fontSize) protected final FontgetNormalFont(float size) Used for measuring font metrics of a normal weight fontdoublegetNormalTextLength(String text, float fontSize) intprotected abstract Stringstatic Rectangle2DgetRectBBox(org.w3c.dom.svg.SVGRectElement rect) protected List<ReferenceTable> final Documentprotected abstract StringgetSVGFileName(int pageNumber) doublegetTextLength(String text, float fontSize) doublegetTextLength(String text, float fontSize, String weight) doublegetTextLength(String text, float fontSize, String weight, String fontStyle) protected final Stringprotected voidhideElement(String id) protected voidhideElement(String id, boolean hide) protected voidhideElement(Element element) Sets the visibility attribute to "hidden"protected voidhideElement(Element element, boolean hide) Sets an element's visibility attributeprotected booleanUsed to determine whether to scale the record sheet to make room for charts.protected DocumentloadTemplate(int pageIndex, PageFormat pageFormat) Deprecated, for removal: This API element is subject to removal in a future version.protected DocumentloadTemplate(int pageIndex, PageFormat pageFormat, boolean useUnitTestTemplateDirectory) Creates the base template document.protected voidplaceReferenceCharts(List<ReferenceTable> tables, Node parent, double x, double y, double width, double height) Adds a list of reference tables to the document, sizing to fit withing the available space.intprint(Graphics graphics, PageFormat pageFormat, int pageIndex) protected voidprocessImage(int pageNum, PageFormat pageFormat) Renders the sheet to the Graphics object.protected voidremoveElement(String id) voidsetCallback(Consumer<Integer> callback) Provides a callback function that can be used to provide updates on printing progress.final voidsetSVGDocument(Document svgDocument) protected voidsetTextField(String id, int i) protected voidsetTextField(String id, String text) protected voidsetTextField(String id, String text, boolean unhide) Sets the text content of the text element in the SVG diagram corresponding with the given id.
-
Field Details
-
DEFAULT_TYPEFACE
- See Also:
-
DEFAULT_PIP_SIZE
public static final float DEFAULT_PIP_SIZE- See Also:
-
DEFAULT_PIP_STROKE
public static final float DEFAULT_PIP_STROKE- See Also:
-
FONT_SIZE_LARGE
public static final float FONT_SIZE_LARGE- See Also:
-
FONT_SIZE_MEDIUM
public static final float FONT_SIZE_MEDIUM- See Also:
-
FONT_SIZE_SMALL
public static final float FONT_SIZE_SMALL- See Also:
-
FONT_SIZE_VERY_SMALL
public static final float FONT_SIZE_VERY_SMALL- See Also:
-
FILL_BLACK
- See Also:
-
FILL_GREY
- See Also:
-
FILL_SHADOW
- See Also:
-
FILL_WHITE
- See Also:
-
FILL_RED
- See Also:
-
TABLE_RATIO
public static final double TABLE_RATIOScale factor for record sheets with reference tables- See Also:
-
svgNS
- See Also:
-
options
-
-
Constructor Details
-
PrintRecordSheet
Creates an SVG object for the record sheet- Parameters:
firstPage- The print job page number for this sheetoptions- Overrides the global options for which elements are printed
-
-
Method Details
-
getFirstPage
protected final int getFirstPage()- Returns:
- The page number of the first page of this record sheet within the book.
-
getSVGDocument
-
setSVGDocument
-
setCallback
Provides a callback function that can be used to provide updates on printing progress. As each page is rendered, the callback is invoked with the page number.- Parameters:
callback- The function to call with the current page number.
-
getTypeface
- Returns:
- The name of the typeface to use when printing record sheets.
-
getNormalFont
Used for measuring font metrics of a normal weight font- Parameters:
size- The font size- Returns:
- A font derived from the default
-
getBoldFont
Used for measuring font metrics of a bold weight font- Parameters:
size- The font size- Returns:
- A font derived from the default bold
-
getItalicFont
Used for measuring font metrics of an italic font- Parameters:
size- The font size- Returns:
- A font derived from the default italic
-
getBoldItalicFont
Used for measuring font metrics of a bold italic font- Parameters:
size- The font size- Returns:
- A font derived from the default italic
-
loadTemplate
@Nullable protected Document loadTemplate(int pageIndex, PageFormat pageFormat, boolean useUnitTestTemplateDirectory) Creates the base template document. This is usually loaded from a file, but some composite record sheets override this to create a document in memory which is then filled in using the individual record sheet templates.- Parameters:
pageIndex- The index of this page in the print jobpageFormat- The page format selected by the useruseUnitTestTemplateDirectory-trueif the unit test template directory should be used- Returns:
- An SVG document for one page of the print job
-
loadTemplate
@Deprecated(since="0.51.0", forRemoval=true) @Nullable protected Document loadTemplate(int pageIndex, PageFormat pageFormat) Deprecated, for removal: This API element is subject to removal in a future version.Creates the base template document. This is usually loaded from a file, but some composite record sheets override this to create a document in memory which is then filled in using the individual record sheet templates.- Parameters:
pageIndex- The index of this page in the print jobpageFormat- The page format selected by the user- Returns:
- An SVG document for one page of the print job
-
createDocument
-
createDocument
public boolean createDocument(int pageIndex, PageFormat pageFormat, boolean addMargin, boolean useUnitTestTemplateDirectory) - Returns:
- true if the document was created successfully, otherwise false
-
applyCoreComponentsCriticalDamage
protected void applyCoreComponentsCriticalDamage()Applies the critical damage to the core components of the unit and crew. This should be overridden by subclasses that have core components. -
fillCoreComponentCriticalDamage
-
fillCoreComponentCriticalDamage
-
print
-
exportPDF
- Throws:
Exception
-
build
public org.apache.batik.gvt.GraphicsNode build() -
getPageCount
public int getPageCount()- Returns:
- The number of pages required to print this record sheet
-
processImage
Renders the sheet to the Graphics object.- Parameters:
pageNum- Indicates which page of multipage sheets to print. The first page is 0.
-
getSVGFileName
- Parameters:
pageNumber- The page number in the current record sheet, where the first page is numbered zero.- Returns:
- The file name for the current page in the record sheet image directory
-
getRecordSheetTitle
- Returns:
- The title to use for the record sheet
-
getBookmarkNames
Used to build an outline of a PDF document- Returns:
- Names of outline entries
-
setTextField
-
setTextField
-
setTextField
Sets the text content of the text element in the SVG diagram corresponding with the given id. If the element does not exist, does nothing. If the text is null, hides the element instead. Any text previously in the element is cleared.- Parameters:
id- The String id of a text elementtext- The text to set as contentunhide- Sets the element visible if the text is non-null
-
addLineThrough
Add a line through the text at the given coordinates. The line is drawn at the center of the text.- Parameters:
parent- The SVG element to add the line to.x- The X position of the line.y- The Y position of the line.width- The width of the line.
-
addLineThrough
Add a line through the text at the given coordinates. The line is drawn at the center of the text.- Parameters:
parent- The SVG element to add the line to.x- The X position of the line.y- The Y position of the line.width- The width of the line.color- The color of the line.
-
addTextElement
protected double addTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight) Convenience method for creating a new SVG Text element and adding it to the parent. The width of the text is returned, to aid in layout.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.- Returns:
- The width of the text in the current font size
-
addTextElement
protected double addTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight, String fontStyle, String fill) Convenience method for creating a new SVG Text element and adding it to the parent. The height of the text is returned, to aid in layout.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.fontStyle- The font style, either normal or italic.fill- The fill color for the text (e.g. foreground color)- Returns:
- The width of the added text element
-
addTextElement
protected double addTextElement(Element parent, double x, double y, String text, float fontSize, String anchor, String weight, String fontStyle, String fill, String id, String className) Convenience method for creating a new SVG Text element and adding it to the parent. The height of the text is returned, to aid in layout.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.fontStyle- The font style, either normal or italic.fill- The fill color for the text (e.g. foreground color)id- The id of the text element, or null if not needed.className- The class name of the text element, or null if not needed.- Returns:
- The width of the added text element
-
addTextElementToFit
protected void addTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight) Creates a new text element with black fill and adds it to the parent. If the text is wider than the available space, the text is compressed to fit.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.width- The width of the space the text has to fit.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.
-
addTextElementToFit
protected void addTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight, String fill) Creates a new text element and adds it to the parent. If the text is wider than the available space, the text is compressed to fit.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.width- The width of the space the text has to fit.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.fill- The fill color for the text (e.g. foreground color)
-
addTextElementToFit
protected void addTextElementToFit(Element parent, double x, double y, double width, String text, float fontSize, String anchor, String weight, String fill, String id, String className) Creates a new text element and adds it to the parent. If the text is wider than the available space, the text is compressed to fit.- Parameters:
parent- The SVG element to add the text element to.x- The X position of the new element.y- The Y position of the new element.width- The width of the space the text has to fit.text- The text to display.fontSize- Font size of the text.anchor- Set the Text elements text-anchor. Should be either start, middle, or end.weight- The font weight, either normal or bold.fill- The fill color for the text (e.g. foreground color)id- The id of the text element, or null if not needed.className- The class name of the text element, or null if not needed.
-
addMultilineTextElement
protected int addMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight) Adds a text element to a region with limited width. If there are multiple lines, the text will be split over multiple lines, broken on a space character. The space will still be included on the next line as a small indent.- Parameters:
canvas- The parentSVGElementto the newText.x- The x coordinate of the upper left corner of the text regiony- The y coordinate of the upper left corner of the text regionwidth- The allowable width of the text element.lineHeight- The amount to increase the y coordinate for a new linetext- The text to addfontSize- The font-size attributeanchor- The text-anchor attributeweight- The font-weight attribute- Returns:
- The number of lines of text added
-
addMultilineTextElement
protected int addMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight, String fontStyle, String className) Adds a text element to a region with limited width. If there are multiple lines, the text will be split over multiple lines, broken on a space character. The space will still be included on the next line as a small indent.- Parameters:
canvas- The parentSVGElementto the newText.x- The x coordinate of the upper left corner of the text regiony- The y coordinate of the upper left corner of the text regionwidth- The allowable width of the text element.lineHeight- The amount to increase the y coordinate for a new linetext- The text to addfontSize- The font-size attributeanchor- The text-anchor attributeweight- The font-weight attributefontStyle- The font style, e.g., normal or italic.- Returns:
- The number of lines of text added
-
addMultilineTextElement
protected int addMultilineTextElement(Element canvas, double x, double y, double width, double lineHeight, String text, float fontSize, String anchor, String weight, String fontStyle, String fill, char delimiter, String className) Adds a text element to a region with limited width. If there are multiple lines, the text will be split over multiple lines, broken on the provided character. The line break character will be included on the next line.- Parameters:
canvas- The parentSVGElementto the newText.x- The x coordinate of the upper left corner of the text regiony- The y coordinate of the upper left corner of the text regionwidth- The allowable width of the text element.lineHeight- The amount to increase the y coordinate for a new linetext- The text to addfontSize- The font-size attributeanchor- The text-anchor attributeweight- The font-weight attributefontStyle- The font style, e.g., normal or italic.fill- The fill color for the text (e.g. foreground color)delimiter- The character to use as an acceptable line ending- Returns:
- The number of lines of text added
-
createPip
@Deprecated(since="0.51.0", forRemoval=true) protected Element createPip(double x, double y, double radius, double strokeWidth) Deprecated, for removal: This API element is subject to removal in a future version. -
createPip
protected Element createPip(double x, double y, double radius, double strokeWidth, PipType type, String fill) Approximates a circle using four Bézier curves.- Parameters:
x- Position of left of bounding rectangle.y- Position of top of bounding rectangle.radius- Radius of the circlestrokeWidth- Width of the stroketype- PipTypefill- Fill color for the pip- Returns:
- A Path describing the circle
-
createPip
protected Element createPip(double x, double y, double radius, double strokeWidth, PipType type, String fill, String className, String loc, boolean rear) Approximates a circle using four Bézier curves.- Parameters:
x- Position of left of bounding rectangle.y- Position of top of bounding rectangle.radius- Radius of the circlestrokeWidth- Width of the stroketype- PipTypefill- Fill color for the pipclassName- Class name for the pip, or null if not neededloc- Location of the pip, or null if not neededrear- If true, the pip is a rear pip- Returns:
- A Path describing the circle
-
createRoundedRectangle
protected Element createRoundedRectangle(double x, double y, double width, double height, double radius, double control, double strokeWidth, String stroke) Creates a rectangle with Bézier curves on the corners- Parameters:
x- The x coordinate of the top left cornery- The y coordinate of the top left cornerwidth- The width of the rectangleheight- The height of the rectangleradius- The radius of the curve in the cornerscontrol- The length from the endpoint of each curve to its control pointstrokeWidth- The width of the strokestroke- The fill color of the stroke- Returns:
- A path element
-
hideElement
-
hideElement
-
removeElement
-
hideElement
Sets the visibility attribute to "hidden"- Parameters:
element- The element to hide
-
hideElement
Sets an element's visibility attribute- Parameters:
element- The element to hide or showhide- If true, visibility will be set to hidden. If false, the
-
getFontHeight
public float getFontHeight(float fontSize) Determines the vertical space taken up by a line of text.- Parameters:
fontSize- Value of CSS font-size attribute- Returns:
- The height of the bounding box of a text element
-
getFontHeight
Determines the vertical space taken up by a line of text.- Parameters:
fontSize- Value of CSS font-size attributefont- The font to use for the text- Returns:
- The height of the bounding box of a text element
-
getNormalTextLength
-
getBoldTextLength
-
getItalicTextLength
-
getBoldItalicTextLength
-
getTextLength
-
getTextLength
-
getTextLength
-
getRectBBox
-
embedImage
Inserts an image into the SVG diagram scaled to fit into the provided bounds.- Parameters:
imageFile- The file containing the image to embed.canvas- The parent element for the image element.bbox- The bounding box for the image. The image will be scaled to fit.center- Whether to center the image vertically and horizontally.
-
embedImage
public void embedImage(@Nullable Image image, Element canvas, Rectangle2D bbox, boolean center, @Nullable String className) Inserts an image into the SVG diagram scaled to fit into the provided bounds.- Parameters:
image- The file containing the image to embed.canvas- The parent element for the image element.bbox- The bounding box for the image. The image will be scaled to fit.center- Whether to center the image vertically and horizontally.
-
includeReferenceCharts
protected boolean includeReferenceCharts()Used to determine whether to scale the record sheet to make room for charts. This depends both on whether the option is selected and on whether the sheet supports reference charts.- Returns:
- Whether to include reference tables
-
getRightSideReferenceTables
-
addReferenceCharts
Adds reference charts to the right side of the record sheet.- Parameters:
pageFormat- The document's page format.
-
placeReferenceCharts
protected void placeReferenceCharts(List<ReferenceTable> tables, Node parent, double x, double y, double width, double height) Adds a list of reference tables to the document, sizing to fit withing the available space. Layout is vertical.- Parameters:
tables- The list of tables to add.parent- The parent node of the tableElement.x- The x coordinate of the top left corner of the tables, relative to the parent node.y- The y coordinate of the top left corder of the tables, relative to the parent node.width- The width of the table column.height- The height of the table column.
-
getDamageFillColor
- Returns:
- The color to use for the damage fill
-