org.geotools.styling.Fill.setBackgroundColor()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(256)

本文整理了Java中org.geotools.styling.Fill.setBackgroundColor()方法的一些代码示例,展示了Fill.setBackgroundColor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fill.setBackgroundColor()方法的具体详情如下:
包路径:org.geotools.styling.Fill
类名称:Fill
方法名:setBackgroundColor

Fill.setBackgroundColor介绍

[英]This parameter gives the solid color that will be used as a background for a Fill.
The color value is RGB-encoded using two hexidecimal digits per primary-color component, in the order Red, Green, Blue, prefixed with the hash (#) sign. The hexidecimal digits beetween A and F may be in either upper or lower case. For example, full red is encoded as "#ff0000" (with no quotation marks).
[中]此参数提供将用作填充背景的纯色。
颜色值是使用每个原色分量的两个十六进制数字进行RGB编码的,顺序为红色、绿色、蓝色,前缀为哈希(#)符号。A和F之间的十六进制数字可以是大写或小写。例如,全红色编码为“#ff0000”(不带引号)。

代码示例

代码示例来源:origin: geotools/geotools

public Fill getDefaultFill() {
  Fill fill = new FillImpl(filterFactory);
  try {
    fill.setColor(filterFactory.literal("#808080"));
    fill.setOpacity(filterFactory.literal(new Double(1.0)));
    fill.setBackgroundColor(filterFactory.literal("#FFFFFF"));
  } catch (org.geotools.filter.IllegalFilterException ife) {
    throw new RuntimeException("Error creating fill", ife);
  }
  return fill;
}

代码示例来源:origin: geotools/geotools

public void visit(Fill fill) {
  Fill copy = sf.getDefaultFill();
  copy.setBackgroundColor(copy(fill.getBackgroundColor()));
  copy.setColor(copy(fill.getColor()));
  copy.setGraphicFill(copy(fill.getGraphicFill()));
  copy.setOpacity(copy(fill.getOpacity()));
  if (STRICT && !copy.equals(fill)) {
    throw new IllegalStateException("Was unable to duplicate provided Fill:" + fill);
  }
  pages.push(copy);
}

代码示例来源:origin: geotools/geotools

/**
 * create a default fill 50% gray
 *
 * @return the fill created
 */
public Fill createFill() {
  Fill f = sf.getDefaultFill();
  f.setColor(literalExpression("#808080"));
  f.setBackgroundColor(literalExpression("#808080"));
  f.setOpacity(literalExpression(1.0));
  return f;
}

代码示例来源:origin: geotools/geotools

public Fill createFill(
    Expression color, Expression backgroundColor, Expression opacity, Graphic graphicFill) {
  Fill fill = new FillImpl(filterFactory);
  if (color == null) {
    color = Fill.DEFAULT.getColor();
  }
  fill.setColor(color);
  if (backgroundColor == null) {
    backgroundColor = Fill.DEFAULT.getBackgroundColor();
  }
  fill.setBackgroundColor(backgroundColor);
  if (opacity == null) {
    opacity = Fill.DEFAULT.getOpacity();
  }
  // would be nice to check if this was within bounds but we have to wait until use since it
  // may depend on an attribute
  fill.setOpacity(opacity);
  fill.setGraphicFill(graphicFill);
  return fill;
}

代码示例来源:origin: org.geotools/gt-main

public Fill getDefaultFill() {
  Fill fill = new FillImpl(filterFactory);
  try {
    fill.setColor(filterFactory.literal("#808080"));
    fill.setOpacity(filterFactory.literal(
        new Double(1.0)));
    fill.setBackgroundColor(filterFactory.literal("#FFFFFF"));
  } catch (org.geotools.filter.IllegalFilterException ife) {
    throw new RuntimeException("Error creating fill", ife);
  }
  return fill;
}

代码示例来源:origin: org.geotools/gt-main

public void visit(Fill fill) {
  Fill copy = sf.getDefaultFill();
  copy.setBackgroundColor( copy( fill.getBackgroundColor()) );
  copy.setColor(copy( fill.getColor()));
  copy.setGraphicFill( copy(fill.getGraphicFill()));
  copy.setOpacity( copy(fill.getOpacity()));
  
  if( STRICT && !copy.equals( fill )){
    throw new IllegalStateException("Was unable to duplicate provided Fill:"+fill );
  }
  pages.push(copy);
}

代码示例来源:origin: org.geotools/gt-main

/**
 * create a default fill 50% gray
 *
 * @return the fill created
 */
public Fill createFill() {
  Fill f = sf.getDefaultFill();
  f.setColor(literalExpression("#808080"));
  f.setBackgroundColor(literalExpression("#808080"));
  f.setOpacity(literalExpression(1.0));
  return f;
}

代码示例来源:origin: org.geotools/gt2-main

/**
 * create a default fill 50% gray
 *
 * @return the fill created
 */
public Fill createFill() {
  Fill f = sf.getDefaultFill();
  f.setColor(literalExpression("#808080"));
  f.setBackgroundColor(literalExpression("#808080"));
  f.setOpacity(literalExpression(1.0));
  return f;
}

代码示例来源:origin: org.geotools/gt2-main

public Fill createFill(Expression color, Expression backgroundColor,
  Expression opacity, Graphic graphicFill) {
  Fill fill = new FillImpl();
  if (color == null) {
    color = Fill.DEFAULT.getColor();
  }
  fill.setColor(color);
  if (backgroundColor == null) {
    backgroundColor = Fill.DEFAULT.getBackgroundColor();
  }
  fill.setBackgroundColor(backgroundColor);
  if (opacity == null) {
    opacity = Fill.DEFAULT.getOpacity();
  }
  // would be nice to check if this was within bounds but we have to wait until use since it may depend on an attribute
  fill.setOpacity(opacity);
  fill.setGraphicFill(graphicFill);
  return fill;
}

代码示例来源:origin: org.geotools/gt-main

public Fill createFill(Expression color, Expression backgroundColor,
  Expression opacity, Graphic graphicFill) {
  Fill fill = new FillImpl(filterFactory);
  if (color == null) {
    color = Fill.DEFAULT.getColor();
  }
  fill.setColor(color);
  if (backgroundColor == null) {
    backgroundColor = Fill.DEFAULT.getBackgroundColor();
  }
  fill.setBackgroundColor(backgroundColor);
  if (opacity == null) {
    opacity = Fill.DEFAULT.getOpacity();
  }
  // would be nice to check if this was within bounds but we have to wait until use since it may depend on an attribute
  fill.setOpacity(opacity);
  fill.setGraphicFill(graphicFill);
  return fill;
}

相关文章