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

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

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

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

/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill) */
public void visit(Fill fill) {
  if (fill.getBackgroundColor() != null) {
    fill.getBackgroundColor().accept(this, null);
  }
  if (fill.getColor() != null) {
    fill.getColor().accept(this, null);
  }
  if (fill.getGraphicFill() != null) {
    fill.getGraphicFill().accept(this);
  }
  if (fill.getOpacity() != null) {
    fill.getOpacity().accept(this, null);
  }
}

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

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill)
 */
public void visit(Fill fill) {
  if (fill.getBackgroundColor() != null) {
    fill.getBackgroundColor().accept((ExpressionVisitor) this, null);
  }
  if (fill.getColor() != null) {
    fill.getColor().accept(this, null );
  }
  if (fill.getGraphicFill() != null) {
    fill.getGraphicFill().accept(this);
  }
  if (fill.getOpacity() != null) {
    fill.getOpacity().accept(this, null );
  }
}

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

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Fill)
 */
public void visit(Fill fill) {
  if (fill.getBackgroundColor() != null) {
    fill.getBackgroundColor().accept((ExpressionVisitor) this, null);
  }
  if (fill.getColor() != null) {
    fill.getColor().accept(this, null );
  }
  if (fill.getGraphicFill() != null) {
    fill.getGraphicFill().accept(this);
  }
  if (fill.getOpacity() != null) {
    fill.getOpacity().accept(this, null );
  }
}

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

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

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

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

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

相关文章