public Font createFont( Expression fontFamily, Expression fontStyle, Expression fontWeight, Expression fontSize) { Font font = new FontImpl(); if (fontFamily == null) { throw new IllegalArgumentException("Null font family specified"); } font.setFontFamily(fontFamily); if (fontSize == null) { throw new IllegalArgumentException("Null font size specified"); } font.setFontSize(fontSize); if (fontStyle == null) { throw new IllegalArgumentException("Null font Style specified"); } font.setFontStyle(fontStyle); if (fontWeight == null) { throw new IllegalArgumentException("Null font weight specified"); } font.setFontWeight(fontWeight); return font; }
/** * Utility method to capture the default font in one place. * * @return */ static Font createDefault(FilterFactory filterFactory) { Font font = new FontImpl(); try { font.setSize(filterFactory.literal(Integer.valueOf(10))); font.setStyle(filterFactory.literal("normal")); font.setWeight(filterFactory.literal("normal")); font.setFontFamily(filterFactory.literal("Serif")); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating default", ife); } return font; }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { sym.setFont(font); YamlMap map = obj.map(); if (map.has("font-family")) { font.setFontFamily(Util.expression(map.str("font-family"), factory)); } if (map.has("font-size")) { font.setSize(Util.expression(map.str("font-size"), factory)); } if (map.has("font-style")) { font.setStyle(Util.expression(map.str("font-style"), factory)); } if (map.has("font-weight")) { font.setWeight(Util.expression(map.str("font-weight"), factory)); } } }
public Font createFont(Expression fontFamily, Expression fontStyle, Expression fontWeight, Expression fontSize) { Font font = new FontImpl(); if (fontFamily == null) { throw new IllegalArgumentException("Null font family specified"); } font.setFontFamily(fontFamily); if (fontSize == null) { throw new IllegalArgumentException("Null font size specified"); } font.setFontSize(fontSize); if (fontStyle == null) { throw new IllegalArgumentException("Null font Style specified"); } font.setFontStyle(fontStyle); if (fontWeight == null) { throw new IllegalArgumentException("Null font weight specified"); } font.setFontWeight(fontWeight); return font; }
public Font createFont(Expression fontFamily, Expression fontStyle, Expression fontWeight, Expression fontSize) { Font font = new FontImpl(); if (fontFamily == null) { throw new IllegalArgumentException("Null font family specified"); } font.setFontFamily(fontFamily); if (fontSize == null) { throw new IllegalArgumentException("Null font size specified"); } font.setFontSize(fontSize); if (fontStyle == null) { throw new IllegalArgumentException("Null font Style specified"); } font.setFontStyle(fontStyle); if (fontWeight == null) { throw new IllegalArgumentException("Null font weight specified"); } font.setFontWeight(fontWeight); return font; }
font.setFontFamily(parseCssParameter(child));
font.setFontFamily(parseCssParameter(child)); } else if (res.equalsIgnoreCase("font-style")) { font.setFontStyle(parseCssParameter(child));
/** * Utility method to capture the default font in one place. * @return */ static Font createDefault( FilterFactory filterFactory ) { Font font = new FontImpl(); try { font.setSize(filterFactory.literal( new Integer(10))); font.setStyle(filterFactory.literal("normal")); font.setWeight(filterFactory.literal("normal")); font.setFontFamily(filterFactory.literal("Serif")); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating default", ife); } return font; }
/** * Creates a defaultFont which is valid on all machines. The font is of * size 10, Style and Weight normal and uses a serif font. * * @return the default Font * * @throws RuntimeException DOCUMENT ME! */ public Font getDefaultFont() { Font font = new FontImpl(); try { font.setFontSize(filterFactory.literal( new Integer(10))); font.setFontStyle(filterFactory.literal("normal")); font.setFontWeight(filterFactory.literal("normal")); font.setFontFamily(filterFactory.literal("Serif")); } catch (org.geotools.filter.IllegalFilterException ife) { throw new RuntimeException("Error creating font", ife); } return font; }
public void apply(){ if(font != null){ font.setFontFamily(guiFamily.getExpression()); font.setFontSize(guiSize.getExpression()); font.setFontStyle(guiStyle.getExpression()); font.setFontWeight(guiWeight.getExpression()); } }
@Override public void handle(YamlObject<?> obj, YamlParseContext context) { sym.setFont(font); YamlMap map = obj.map(); if (map.has("font-family")) { font.setFontFamily(Util.expression(map.str("font-family"), factory)); } if (map.has("font-size")) { font.setSize(Util.expression(map.str("font-size"), factory)); } if (map.has("font-style")) { font.setStyle(Util.expression(map.str("font-style"), factory)); } if (map.has("font-weight")) { font.setWeight(Util.expression(map.str("font-weight"), factory)); } } }