Class StringOverlay
java.lang.Object
is.galia.operation.overlay.Overlay
is.galia.operation.overlay.StringOverlay
- All Implemented Interfaces:
Operation
Encapsulates a string overlay applied to an image.
Instances should be obtained from the
OverlayFactory
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColor()
getFont()
int
float
boolean
Simpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList)
.boolean
void
setBackgroundColor
(Color color) void
void
void
setMinSize
(int minSize) void
void
setStrokeColor
(Color color) void
setStrokeWidth
(float width) void
setWordWrap
(boolean wordWrap) toMap
(Size fullSize, ScaleConstraint scaleConstraint) toString()
Methods inherited from class is.galia.operation.overlay.Overlay
freeze, getInset, getPosition, getResultingSize, hasEffect, setInset, setPosition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface is.galia.operation.Operation
freeze, getResultingSize, hasEffect, validate
-
Constructor Details
-
StringOverlay
-
-
Method Details
-
getBackgroundColor
-
getColor
-
getFont
-
getMinSize
public int getMinSize() -
getString
-
getStrokeColor
-
getStrokeWidth
public float getStrokeWidth() -
hasEffect
public boolean hasEffect()Description copied from interface:Operation
Simpler but less-accurate counterpart ofOperation.hasEffect(Size, OperationList)
. -
isWordWrap
public boolean isWordWrap() -
setBackgroundColor
- Parameters:
color
- Background color to set.- Throws:
IllegalStateException
- If the instance is frozen.
-
setColor
- Parameters:
color
- Color to set.- Throws:
IllegalStateException
- If the instance is frozen.
-
setFont
- Parameters:
font
- Font to set.- Throws:
IllegalStateException
- If the instance is frozen.
-
setMinSize
public void setMinSize(int minSize) - Parameters:
minSize
- Minimum size in pixels- Throws:
IllegalStateException
- If the instance is frozen.
-
setString
- Parameters:
string
- String to set.- Throws:
IllegalStateException
- If the instance is frozen.
-
setStrokeColor
- Parameters:
color
- Color to set.- Throws:
IllegalStateException
- If the instance is frozen.
-
setStrokeWidth
public void setStrokeWidth(float width) - Parameters:
width
- Width in pixels.- Throws:
IllegalStateException
- If the instance is frozen.
-
setWordWrap
public void setWordWrap(boolean wordWrap) - Parameters:
wordWrap
- Whether to auto-wrap text.- Throws:
IllegalStateException
- If the instance is frozen.
-
toMap
- Specified by:
toMap
in interfaceOperation
- Parameters:
fullSize
- Full size of the source image on which the operation is being applied.scaleConstraint
- Scale constraint applied to the given full size.- Returns:
- Map with background_color, class, color, font, font_size, font_weight, glyph_spacing, inset, position, string, stroke_color, and stroke_width keys.
-
toString
-