Tabnine Logo
Font.setWeight
Code IndexAdd Tabnine to your IDE (free)

How to use
setWeight
method
in
org.geotools.styling.Font

Best Java code snippets using org.geotools.styling.Font.setWeight (Showing top 10 results out of 315)

origin: geotools/geotools

font.setWeight(exp);
origin: geotools/geotools

/**
 * 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;
}
origin: geotools/geotools

  @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));
    }
  }
}
origin: robward-scisys/sldeditor

/** Revert to original. */
public void revertToOriginal() {
  if (this.font != null) {
    this.font.getFamily().clear();
    this.font.getFamily().addAll(originalFontName);
    this.font.setWeight(originalFontWeight);
    this.font.setStyle(originalFontStyle);
    this.font.setSize(originalFontSize);
  }
}
origin: org.geotools/gt-main

/**
 * 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;
}
origin: robward-scisys/sldeditor

/**
 * Extract font.
 *
 * @return the font
 */
private Font extractFont() {
  Expression fontFamily = fieldConfigVisitor.getExpression(FieldIdEnum.FONT_FAMILY);
  List<Expression> fontFamilyList = new ArrayList<>();
  if (fontFamily != null) {
    fontFamilyList.add(fontFamily);
  }
  Font font = getStyleFactory().getDefaultFont();
  font.getFamily().clear();
  font.getFamily().addAll(fontFamilyList);
  Expression fontSize = fieldConfigVisitor.getExpression(FieldIdEnum.FONT_SIZE);
  Expression fontStyle = fieldConfigVisitor.getExpression(FieldIdEnum.FONT_STYLE);
  Expression fontWeight = fieldConfigVisitor.getExpression(FieldIdEnum.FONT_WEIGHT);
  font.setStyle(fontStyle);
  font.setWeight(fontWeight);
  font.setSize(fontSize);
  return font;
}
origin: robward-scisys/sldeditor

/**
 * Sets the font.
 *
 * @param newFont the new font
 */
public void setFont(Font newFont) {
  if (newFont != null) {
    this.font = styleFactory.getDefaultFont();
    font.getFamily().clear();
    font.getFamily().addAll(newFont.getFamily());
    font.setStyle(newFont.getStyle());
    font.setWeight(newFont.getWeight());
    font.setSize(newFont.getSize());
    setOriginalData(newFont);
  }
}
origin: robward-scisys/sldeditor

/**
 * Update font.
 *
 * @param fontData the font data
 */
public void updateFont(Font fontData) {
  if ((fontData != null) && (font != null)) {
    if (!fontData.getFamily().isEmpty()
        && (!(fontData.getFamily().equals(font.getFamily())))) {
      font.getFamily().clear();
      font.getFamily().addAll(fontData.getFamily());
    }
    if ((fontData.getWeight() != null)
        && (!(fontData.getWeight().equals(font.getWeight())))) {
      font.setWeight(fontData.getWeight());
    }
    if ((fontData.getStyle() != null) && (!(fontData.getStyle().equals(font.getStyle())))) {
      font.setStyle(fontData.getStyle());
    }
    if ((fontData.getSize() != null) && (!(fontData.getSize().equals(font.getSize())))) {
      font.setSize(fontData.getSize());
    }
  }
}
origin: robward-scisys/sldeditor

localFont.setWeight(ff.literal(this.font.getWeight()));
origin: org.geotools/gt-ysld

  @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));
    }
  }
}
org.geotools.stylingFontsetWeight

Popular methods of Font

  • getFamily
  • getSize
  • getStyle
  • getWeight
  • getFontFamily
  • getFontSize
  • getFontStyle
  • getFontWeight
  • setSize
  • setStyle
  • setFontFamily
  • setFontSize
  • setFontFamily,
  • setFontSize,
  • setFontStyle,
  • setFontWeight

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now