public class DecoratedTextFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BALE_ICON |
static String |
BARREL_ICON |
static String |
COIN_ICON |
private javafx.scene.text.Font |
font |
static String |
IMAGE |
private XMLImageLoader |
imageLoader |
private int |
leftInset |
static String |
SEGMENT_IMAGE |
private int |
topInset |
private int |
wrappingWidth |
| Constructor and Description |
|---|
DecoratedTextFactory(javafx.scene.text.Font font,
int leftInset,
int topInset,
int wrappingWidth) |
| Modifier and Type | Method and Description |
|---|---|
DecoratedText |
createDecoratedText(String template,
Map<String,Object> parameters)
Create a decorated text from the template string.
|
private javafx.scene.shape.Shape |
createSegmentedShape(double width,
double heigth,
List<Integer> visibleSegments) |
private boolean |
isSpecialKey(String key) |
private DecoratedText |
replaceParameters(DecoratedText text,
String template,
Map<String,Object> parameters) |
private DecoratedText |
replaceSimpleParameter(DecoratedText text,
Map<String,Object> parameters,
String head,
String tail,
String key) |
private String |
replaceSimpleParameter(Map<String,Object> parameters,
String head,
String tail,
String key) |
private DecoratedText |
replaceSpecialParameter(DecoratedText text,
Map<String,Object> parameters,
String tail,
String key) |
String |
replaceTextParameters(String template,
Map<String,Object> parameters)
Replace the placeholders in the template with the values from the parameters object
|
public static final String COIN_ICON
public static final String BARREL_ICON
public static final String BALE_ICON
public static final String SEGMENT_IMAGE
public static final String IMAGE
private final javafx.scene.text.Font font
private final int leftInset
private final int topInset
private final int wrappingWidth
@Autowired @Qualifier(value="mainScreenXMLImageLoader") private XMLImageLoader imageLoader
public DecoratedTextFactory(javafx.scene.text.Font font,
int leftInset,
int topInset,
int wrappingWidth)
public DecoratedText createDecoratedText(String template, Map<String,Object> parameters)
template - template stringparameters - Map containing the parameters.public String replaceTextParameters(String template, Map<String,Object> parameters)
template - string containing placeholdersparameters - to replace the parametersprivate DecoratedText replaceParameters(DecoratedText text, String template, Map<String,Object> parameters)
private DecoratedText replaceSpecialParameter(DecoratedText text, Map<String,Object> parameters, String tail, String key)
private javafx.scene.shape.Shape createSegmentedShape(double width,
double heigth,
List<Integer> visibleSegments)
private boolean isSpecialKey(String key)
private DecoratedText replaceSimpleParameter(DecoratedText text, Map<String,Object> parameters, String head, String tail, String key)
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.