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

x33g5p2x  于2022-01-20 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(140)

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

Halo.getRadius介绍

[英]Expression that represents the the distance the halo extends from the text
[中]表示光晕从文字延伸的距离的表达式

代码示例

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

/**
 * Retrieves the halo width from a TextSymbolizer.
 *
 * @param symbolizer Text symbolizer information.
 * @return the halo's width, or 0 if unavailable.
 */
public static int textHaloWidth(TextSymbolizer symbolizer) {
  Halo halo = symbolizer.getHalo();
  if (halo == null) {
    return 0;
  }
  Expression exp = halo.getRadius();
  if (exp == null) {
    return 0;
  }
  int width = (int) Float.parseFloat(exp.toString());
  if (width != 0) {
    return width;
  }
  return 0;
}

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

/** @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Halo) */
public void visit(Halo halo) {
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  if (halo.getRadius() != null) {
    halo.getRadius().accept(this, null);
  }
}

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

public void visit(Halo halo) {
  Fill fill = copy(halo.getFill());
  Expression radius = copy(halo.getRadius());
  Halo copy = sf.createHalo(fill, radius);
  if (STRICT && !copy.equals(halo)) {
    throw new IllegalStateException("Was unable to duplicate provided raster:" + halo);
  }
  pages.push(copy);
}

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

public void visit(Halo halo) {
  start("Halo");
  if (halo.getRadius() != null) {
    encodeValue("Radius", null, halo.getRadius(), null);
  }
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  end("Halo");
}

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

@Override
  protected void encode(Halo h) {
    push("halo");
    inline(new FillEncoder(h.getFill()));
    put("radius", h.getRadius());
  }
}

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

ts2d.setHaloFill(getPaint(halo.getFill(), feature, symbolizer));
ts2d.setHaloComposite(getComposite(halo.getFill(), feature));
ts2d.setHaloRadius(evalToFloat(halo.getRadius(), feature, 1));

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

/**
 * Retrieves the halo width from a TextSymbolizer.
 *
 * @param symbolizer Text symbolizer information.
 *
 * @return the halo's width, or 0 if unavailable.
 */
public static int textHaloWidth(TextSymbolizer symbolizer) {
  Halo halo = symbolizer.getHalo();
  if (halo == null) {
    return 0;
  }
  Expression exp = halo.getRadius();
  if (exp == null) {
    return 0;
  }
  int width = (int) Float.parseFloat(exp.toString());
  if (width != 0) {
    return width;
  }
  return 0;
}

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

/**
 * Grabs the halo width from the first TextSymbolizer.
 * 
 * <p>
 * If you are using something fun like symbols you  will need to do your
 * own thing.
 * </p>
 *
 * @param symbolizer Text symbolizer information.
 *
 * @return float of the halo's width, or null if unavailable.
 */
public static int textHaloWidth(TextSymbolizer symbolizer) {
  Halo halo = symbolizer.getHalo();
  if (halo == null) {
    return 0;
  }
  Expression exp = halo.getRadius();
  if (exp == null) {
    return 0;
  }
  int width = (int) Float.parseFloat(exp.toString());
  if (width != 0) {
    return width;
  }
  return 0;
}

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

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Halo)
 */
public void visit(Halo halo) {
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  if (halo.getRadius() != null) {
    halo.getRadius().accept(this,null);
  }
}

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

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Halo)
 */
public void visit(Halo halo) {
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  if (halo.getRadius() != null) {
    halo.getRadius().accept(this,null);
  }
}

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

public void visit(Halo halo) {
  Fill fill = copy(halo.getFill());
  Expression radius = copy(halo.getRadius());
  Halo copy = sf.createHalo(fill, radius);
  if (STRICT && !copy.equals(halo)) {
    throw new IllegalStateException("Was unable to duplicate provided raster:" + halo);
  }
  pages.push(copy);
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

public void setEdited(Halo halo) {
  this.halo = halo;
  if (halo != null) {
    guiFill.setEdited(halo.getFill());
    guiRadius.setExpression(halo.getRadius());
  }
}

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

@Override
public void visit(Halo halo) {
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  if (halo.getRadius() != null) {
    //halo.getRadius().accept(visitor, extraData)
  }
}

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

public void visit(Halo halo) {
  start("Halo");
  if (halo.getRadius() != null) {
    encodeValue("Radius", null, halo.getRadius(), null);
  }
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  end("Halo");
}

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

copy.getHalo().setRadius(rescale(copy.getHalo().getRadius()));

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

copy.getHalo().setRadius(rescale(copy.getHalo().getRadius(), uom));

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

public void visit(Halo halo) {
  start("Halo");
  if (halo.getRadius() != null) {
    start("Radius");
    filterTranslator.encode(halo.getRadius());
    end("Radius");
  }
  if (halo.getFill() != null) {
    halo.getFill().accept(this);
  }
  end("Halo");
}

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

@Override
  protected void encode(Halo h) {
    push("halo");
    inline(new FillEncoder(h.getFill()));
    put("radius", h.getRadius());
  }
}

代码示例来源:origin: robward-scisys/sldeditor

/** @param textSymbolizer */
private void populateHalo(TextSymbolizer textSymbolizer) {
  GroupConfigInterface group;
  Halo halo = textSymbolizer.getHalo();
  group = getGroup(GroupIdEnum.HALO);
  group.enable(halo != null);
  if (halo != null) {
    Fill haloFill = halo.getFill();
    fieldConfigVisitor.populateField(FieldIdEnum.HALO_COLOUR, haloFill.getColor());
    fieldConfigVisitor.populateField(FieldIdEnum.HALO_RADIUS, halo.getRadius());
  } else {
    fieldConfigVisitor.populateField(FieldIdEnum.HALO_COLOUR, (Expression) null);
    fieldConfigVisitor.populateField(FieldIdEnum.HALO_RADIUS, (Expression) null);
  }
}

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

copy.getHalo().setRadius(rescale(copy.getHalo().getRadius()));

相关文章