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

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

本文整理了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

  1. public Fill getDefaultFill() {
  2. Fill fill = new FillImpl(filterFactory);
  3. try {
  4. fill.setColor(filterFactory.literal("#808080"));
  5. fill.setOpacity(filterFactory.literal(new Double(1.0)));
  6. fill.setBackgroundColor(filterFactory.literal("#FFFFFF"));
  7. } catch (org.geotools.filter.IllegalFilterException ife) {
  8. throw new RuntimeException("Error creating fill", ife);
  9. }
  10. return fill;
  11. }

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

  1. public void visit(Fill fill) {
  2. Fill copy = sf.getDefaultFill();
  3. copy.setBackgroundColor(copy(fill.getBackgroundColor()));
  4. copy.setColor(copy(fill.getColor()));
  5. copy.setGraphicFill(copy(fill.getGraphicFill()));
  6. copy.setOpacity(copy(fill.getOpacity()));
  7. if (STRICT && !copy.equals(fill)) {
  8. throw new IllegalStateException("Was unable to duplicate provided Fill:" + fill);
  9. }
  10. pages.push(copy);
  11. }

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

  1. /**
  2. * create a default fill 50% gray
  3. *
  4. * @return the fill created
  5. */
  6. public Fill createFill() {
  7. Fill f = sf.getDefaultFill();
  8. f.setColor(literalExpression("#808080"));
  9. f.setBackgroundColor(literalExpression("#808080"));
  10. f.setOpacity(literalExpression(1.0));
  11. return f;
  12. }

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

  1. public Fill createFill(
  2. Expression color, Expression backgroundColor, Expression opacity, Graphic graphicFill) {
  3. Fill fill = new FillImpl(filterFactory);
  4. if (color == null) {
  5. color = Fill.DEFAULT.getColor();
  6. }
  7. fill.setColor(color);
  8. if (backgroundColor == null) {
  9. backgroundColor = Fill.DEFAULT.getBackgroundColor();
  10. }
  11. fill.setBackgroundColor(backgroundColor);
  12. if (opacity == null) {
  13. opacity = Fill.DEFAULT.getOpacity();
  14. }
  15. // would be nice to check if this was within bounds but we have to wait until use since it
  16. // may depend on an attribute
  17. fill.setOpacity(opacity);
  18. fill.setGraphicFill(graphicFill);
  19. return fill;
  20. }

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

  1. public Fill getDefaultFill() {
  2. Fill fill = new FillImpl(filterFactory);
  3. try {
  4. fill.setColor(filterFactory.literal("#808080"));
  5. fill.setOpacity(filterFactory.literal(
  6. new Double(1.0)));
  7. fill.setBackgroundColor(filterFactory.literal("#FFFFFF"));
  8. } catch (org.geotools.filter.IllegalFilterException ife) {
  9. throw new RuntimeException("Error creating fill", ife);
  10. }
  11. return fill;
  12. }

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

  1. public void visit(Fill fill) {
  2. Fill copy = sf.getDefaultFill();
  3. copy.setBackgroundColor( copy( fill.getBackgroundColor()) );
  4. copy.setColor(copy( fill.getColor()));
  5. copy.setGraphicFill( copy(fill.getGraphicFill()));
  6. copy.setOpacity( copy(fill.getOpacity()));
  7. if( STRICT && !copy.equals( fill )){
  8. throw new IllegalStateException("Was unable to duplicate provided Fill:"+fill );
  9. }
  10. pages.push(copy);
  11. }

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

  1. /**
  2. * create a default fill 50% gray
  3. *
  4. * @return the fill created
  5. */
  6. public Fill createFill() {
  7. Fill f = sf.getDefaultFill();
  8. f.setColor(literalExpression("#808080"));
  9. f.setBackgroundColor(literalExpression("#808080"));
  10. f.setOpacity(literalExpression(1.0));
  11. return f;
  12. }

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

  1. /**
  2. * create a default fill 50% gray
  3. *
  4. * @return the fill created
  5. */
  6. public Fill createFill() {
  7. Fill f = sf.getDefaultFill();
  8. f.setColor(literalExpression("#808080"));
  9. f.setBackgroundColor(literalExpression("#808080"));
  10. f.setOpacity(literalExpression(1.0));
  11. return f;
  12. }

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

  1. public Fill createFill(Expression color, Expression backgroundColor,
  2. Expression opacity, Graphic graphicFill) {
  3. Fill fill = new FillImpl();
  4. if (color == null) {
  5. color = Fill.DEFAULT.getColor();
  6. }
  7. fill.setColor(color);
  8. if (backgroundColor == null) {
  9. backgroundColor = Fill.DEFAULT.getBackgroundColor();
  10. }
  11. fill.setBackgroundColor(backgroundColor);
  12. if (opacity == null) {
  13. opacity = Fill.DEFAULT.getOpacity();
  14. }
  15. // would be nice to check if this was within bounds but we have to wait until use since it may depend on an attribute
  16. fill.setOpacity(opacity);
  17. fill.setGraphicFill(graphicFill);
  18. return fill;
  19. }

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

  1. public Fill createFill(Expression color, Expression backgroundColor,
  2. Expression opacity, Graphic graphicFill) {
  3. Fill fill = new FillImpl(filterFactory);
  4. if (color == null) {
  5. color = Fill.DEFAULT.getColor();
  6. }
  7. fill.setColor(color);
  8. if (backgroundColor == null) {
  9. backgroundColor = Fill.DEFAULT.getBackgroundColor();
  10. }
  11. fill.setBackgroundColor(backgroundColor);
  12. if (opacity == null) {
  13. opacity = Fill.DEFAULT.getOpacity();
  14. }
  15. // would be nice to check if this was within bounds but we have to wait until use since it may depend on an attribute
  16. fill.setOpacity(opacity);
  17. fill.setGraphicFill(graphicFill);
  18. return fill;
  19. }

相关文章