Class MarkerSheet
- java.lang.Object
-
- ca.cgjennings.apps.arkham.sheet.Sheet<Marker>
-
- ca.cgjennings.apps.arkham.sheet.MarkerSheet
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ca.cgjennings.apps.arkham.sheet.Sheet
Sheet.DeckSnappingHint
-
-
Field Summary
-
Fields inherited from class ca.cgjennings.apps.arkham.sheet.Sheet
ALIGN_CENTER, ALIGN_LEADING, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TRAILING, DEBUG_BLEED_MARGIN, DEBUG_PORTRAIT_REGION, DEBUG_UNSAFE_AREA, ON_PAINT_EVENT_METHOD, ROTATE_LEFT, ROTATE_NONE, ROTATE_RIGHT, ROTATE_UPSIDE_DOWN
-
-
Constructor Summary
Constructors Constructor Description MarkerSheet(Marker marker, boolean isBack)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getBleedMargin()
Returns the size of the bleed margin around the component edge that should be cropped off, measured in points.PrintDimensions
getPrintDimensions()
Return the printed size of the sheet, measured in points.boolean
isTransparent()
Returnstrue
if the sheets for this card are transparent.boolean
isVariableSize()
Returnstrue
if the sheets created by this card can vary in size.protected void
paintSheet(RenderTarget target)
Paints the content of this sheet.-
Methods inherited from class ca.cgjennings.apps.arkham.sheet.Sheet
allowTemplateUseInBleedSynthesis, applyContextHints, applyContextScale, applyFinishingOptions, centerTitle, createGraphics, createGraphics, createTemporaryImage, doStandardRendererInitialization, drawOutlinedTitle, drawPortraitBox, drawPortraitBox, drawRegionBox, drawRotatedTitle, drawTitle, fitTitle, freeCachedResources, getCornerRadius, getDeckSnappingHint, getDestinationBuffer, getExpansionSymbol, getExpansionSymbolKey, getFoldMarks, getGameComponent, getMarkerStyle, getPaintingResolution, getRenderedBleedMargin, getScalingFactor, getSuggestedUpsampleFactor, getTemplateHeight, getTemplateImage, getTemplateKey, getTemplateResolution, getTemplateWidth, getUserBleedMargin, hasChanged, hasCropMarks, hasFoldMarks, initializeTemplate, initializeTemplate, isCachedTemporaryImageInvalid, isMarginSynthesisAllowed, isPrototypeRenderingModeEnabled, markChanged, paint, paint, parseExpansionList, replaceTemplateImage, setCornerRadius, setExpansionSymbolKey, setNamesForRenderer, setPrototypeRenderingModeEnabled, setUserBleedMargin, synthesizeBleedMargin, toString
-
-
-
-
Constructor Detail
-
MarkerSheet
public MarkerSheet(Marker marker, boolean isBack)
-
-
Method Detail
-
getPrintDimensions
public PrintDimensions getPrintDimensions()
Description copied from class:Sheet
Return the printed size of the sheet, measured in points. The returned size will account for the current bleed margin settings.The base class implementation is only valid for fixed-size sheets. Variable-sized sheets must override this method to return the correct size.
- Overrides:
getPrintDimensions
in classSheet<Marker>
- Returns:
- the dimensions of the bounding rectangle of this sheet when printed
-
getBleedMargin
public double getBleedMargin()
Description copied from class:Sheet
Returns the size of the bleed margin around the component edge that should be cropped off, measured in points. This bleed margin allows for slight misalignment when cutting the component from a larger sheet of paper. The bleed margin will be the same on all sides. The height and width of the component after cutting will be less than the original by twice this margin. IfSheet.hasCropMarks()
returnstrue
, then the automatic crop marks will be moved toward the inside of this component by an amount equal to the bleed margin.The base class looks up the setting templateKey
-bleed-margin
to determine the bleed margin, defaulting to 0 if none is defined.In the example below, the actual component to be cut and kept is indicated by the blank area, while the X'd area indicates the bleed margin. Component content covers the entire area, including the bleed margin, but nothing important should appear in the bleed margin or within a distance about the same size as the bleed margin on the component interior.
XXXXXXXXXXXXXXXXXX XX XX X X X X X Actual X X Component X X Content X X (tm) X X X X X X X XX XX XXXXXXXXXXXXXXXXXX
By default, this method returns 0, meaning that the design includes no bleed margin. If the bleed margin is 0, Strange Eons will attempt to synthesize bleed margin graphics, with varying results. Note that Strange Eons will not synthesize a bleed margin for transparent sheet images (i.e., if
Sheet.isTransparent()
is true).- Overrides:
getBleedMargin
in classSheet<Marker>
- Returns:
- the size of the bleed margin, in points (1 point = 1/72 inch)
- See Also:
Sheet.hasCropMarks()
-
paintSheet
protected void paintSheet(RenderTarget target)
Description copied from class:Sheet
Paints the content of this sheet. This method will be called by the framework whenever the sheet needs to be redrawn.A typical procedure to set up for painting is to call
Sheet.createGraphics()
to get a graphics context for the sheet's internal image buffer. The returned context will be scaled so that 1 unit in the graphics context is equal to 1 pixel in the template image, and the context will be configured appropriately for the current rendering target. In some cases you may wish to perform these steps in stages, in which case you can useSheet.createGraphics(java.awt.image.BufferedImage, boolean, boolean)
,Sheet.applyContextHints(java.awt.Graphics2D)
andSheet.applyContextScale(java.awt.Graphics2D)
.- Specified by:
paintSheet
in classSheet<Marker>
- Parameters:
target
- the rendering target
-
isTransparent
public boolean isTransparent()
Description copied from class:Sheet
Returnstrue
if the sheets for this card are transparent. The base class returnsfalse
; subclasses that want to create non-rectangular card faces must override this method. When this method returnstrue
, the framework guarantees the following:- the image buffer used for drawing will have an alpha channel (that is, it will keep track of how opaque each pixel is)
- the image buffer used for drawing will be completely transparent
(alpha = 0) at the start of each call to
Sheet.paint(ca.cgjennings.apps.arkham.sheet.RenderTarget, double)
- Overrides:
isTransparent
in classSheet<Marker>
- Returns:
true
if the card face may contain transparent or translucent areas
-
isVariableSize
public boolean isVariableSize()
Description copied from class:Sheet
Returnstrue
if the sheets created by this card can vary in size. Subclasses that wish to create variably-sized sheets must override this method to returntrue
.Typically a variably-sized sheet is also transparent. When this is the case, and the sheet image has one or more edges that are completely transparent after
Sheet.paint(ca.cgjennings.apps.arkham.sheet.RenderTarget, double)
returns, then the transparent edges will be trimmed from the outside of the sheet and the size adjusted accordingly. Alternatively (or additionally), the size can be altered by replacing the template image at the start of painting.- Overrides:
isVariableSize
in classSheet<Marker>
- Returns:
- true if this card can have different sizes
- See Also:
Sheet.isTransparent()
,Sheet.replaceTemplateImage(java.awt.image.BufferedImage)
-
-