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

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

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

Fill.getBackgroundColor介绍

[英]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). The default color is defined to be transparent.
[中]此参数提供将用作填充背景的纯色。
颜色值是使用每个原色分量的两个十六进制数字进行RGB编码的,顺序为红色、绿色、蓝色,前缀为哈希(#)符号。A和F之间的十六进制数字可以是大写或小写。例如,全红色编码为“#ff0000”(不带引号)。默认颜色定义为透明。

代码示例

代码示例来源: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. /** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill) */
  2. public void visit(Fill fill) {
  3. if (fill.getBackgroundColor() != null) {
  4. fill.getBackgroundColor().accept(this, null);
  5. }
  6. if (fill.getColor() != null) {
  7. fill.getColor().accept(this, null);
  8. }
  9. if (fill.getGraphicFill() != null) {
  10. fill.getGraphicFill().accept(this);
  11. }
  12. if (fill.getOpacity() != null) {
  13. fill.getOpacity().accept(this, null);
  14. }
  15. }

代码示例来源: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 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-render

  1. /**
  2. * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill)
  3. */
  4. public void visit(Fill fill) {
  5. if (fill.getBackgroundColor() != null) {
  6. fill.getBackgroundColor().accept((ExpressionVisitor) this, null);
  7. }
  8. if (fill.getColor() != null) {
  9. fill.getColor().accept(this, null );
  10. }
  11. if (fill.getGraphicFill() != null) {
  12. fill.getGraphicFill().accept(this);
  13. }
  14. if (fill.getOpacity() != null) {
  15. fill.getOpacity().accept(this, null );
  16. }
  17. }

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

  1. /**
  2. * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill)
  3. */
  4. public void visit(Fill fill) {
  5. if (fill.getBackgroundColor() != null) {
  6. fill.getBackgroundColor().accept((ExpressionVisitor) this, null);
  7. }
  8. if (fill.getColor() != null) {
  9. fill.getColor().accept(this, null );
  10. }
  11. if (fill.getGraphicFill() != null) {
  12. fill.getGraphicFill().accept(this);
  13. }
  14. if (fill.getOpacity() != null) {
  15. fill.getOpacity().accept(this, null );
  16. }
  17. }

代码示例来源:origin: org.geoserver/wms

  1. /**
  2. * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill)
  3. */
  4. public void visit(Fill fill) {
  5. handleColor(fill.getBackgroundColor());
  6. handleColor(fill.getColor());
  7. if(fill.getGraphicFill() != null)
  8. fill.getGraphicFill().accept(this);
  9. handleOpacity(fill.getOpacity());
  10. }

代码示例来源:origin: org.geoserver/gs-wms

  1. /** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill) */
  2. public void visit(Fill fill) {
  3. handleColor(fill.getBackgroundColor());
  4. handleColor(fill.getColor());
  5. if (fill.getGraphicFill() != null) fill.getGraphicFill().accept(this);
  6. handleOpacity(fill.getOpacity());
  7. }

代码示例来源: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. }

相关文章