Class UndecoratedCardBack
- java.lang.Object
-
- ca.cgjennings.apps.arkham.sheet.Sheet<GameComponent>
-
- ca.cgjennings.apps.arkham.sheet.UndecoratedCardBack
-
public class UndecoratedCardBack extends Sheet<GameComponent>
A component face that simply draws the template image. This is useful for plain card backs that never change.- Author:
- Chris Jennings
-
-
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 UndecoratedCardBack(GameComponent component, java.lang.String templateKey)
UndecoratedCardBack(GameComponent component, java.lang.String templateKey, double bleedMargin)
UndecoratedCardBack(GameComponent component, java.lang.String templateKey, double bleedMargin, double cornerRadius)
-
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.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, getPrintDimensions, getRenderedBleedMargin, getScalingFactor, getSuggestedUpsampleFactor, getTemplateHeight, getTemplateImage, getTemplateKey, getTemplateResolution, getTemplateWidth, getUserBleedMargin, hasChanged, hasCropMarks, hasFoldMarks, initializeTemplate, initializeTemplate, isCachedTemporaryImageInvalid, isMarginSynthesisAllowed, isPrototypeRenderingModeEnabled, isTransparent, isVariableSize, markChanged, paint, paint, parseExpansionList, replaceTemplateImage, setCornerRadius, setExpansionSymbolKey, setNamesForRenderer, setPrototypeRenderingModeEnabled, setUserBleedMargin, synthesizeBleedMargin, toString
-
-
-
-
Constructor Detail
-
UndecoratedCardBack
public UndecoratedCardBack(GameComponent component, java.lang.String templateKey)
-
UndecoratedCardBack
public UndecoratedCardBack(GameComponent component, java.lang.String templateKey, double bleedMargin)
-
UndecoratedCardBack
public UndecoratedCardBack(GameComponent component, java.lang.String templateKey, double bleedMargin, double cornerRadius)
-
-
Method Detail
-
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<GameComponent>
- Parameters:
target
- the rendering target
-
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<GameComponent>
- Returns:
- the size of the bleed margin, in points (1 point = 1/72 inch)
- See Also:
Sheet.hasCropMarks()
-
-