gpt4 book ai didi

org.apache.sis.internal.util.X364.forColorName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 13:26:40 26 4
gpt4 key购买 nike

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

X364.forColorName介绍

[英]Returns the enumeration value for the given color name. The search is case-insensitive.
[中]返回给定颜色名称的枚举值。搜索不区分大小写。

代码示例

代码示例来源:origin: org.apache.sis.core/sis-referencing

/**
 * Writes the color for the given type if {@code colors} is non-null.
 */
private static void writeColor(final Appendable out, final Colors colors, final ElementKind type)
    throws IOException
{
  if (colors != null) {
    final String name = colors.getName(type);
    if (name != null) {
      out.append(X364.forColorName(name).sequence());
    }
  }
}

代码示例来源:origin: apache/sis

/**
 * Writes the color for the given type if {@code colors} is non-null.
 */
private static void writeColor(final Appendable out, final Colors colors, final ElementKind type)
    throws IOException
{
  if (colors != null) {
    final String name = colors.getName(type);
    if (name != null) {
      out.append(X364.forColorName(name).sequence());
    }
  }
}

代码示例来源:origin: org.apache.sis.core/sis-metadata

/**
 * Sets the color of the given syntactic element from a color name.
 * The color names supported in the current implementation are
 * {@code "red"}, {@code "green"}, {@code "yellow"}, {@code "blue"}, {@code "magenta"}, {@code "cyan"}
 * and {@code "gray"}, case-insensitive.
 *
 * @param  key    the syntactic element for which to set the color.
 * @param  color  the color to give to the specified element, or {@code null} if none.
 * @throws IllegalArgumentException if the given color name is not recognized.
 */
public void setName(final ElementKind key, final String color) throws IllegalArgumentException {
  if (isImmutable) {
    throw new UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1, "Colors"));
  }
  if (color == null) {
    map.remove(key);
  } else {
    map.put(key, X364.forColorName(color));
  }
}

代码示例来源:origin: apache/sis

/**
 * Sets the color of the given syntactic element from a color name.
 * The color names supported in the current implementation are
 * {@code "red"}, {@code "green"}, {@code "yellow"}, {@code "blue"}, {@code "magenta"}, {@code "cyan"}
 * and {@code "gray"}, case-insensitive.
 *
 * @param  key    the syntactic element for which to set the color.
 * @param  color  the color to give to the specified element, or {@code null} if none.
 * @throws IllegalArgumentException if the given color name is not recognized.
 */
public void setName(final ElementKind key, final String color) throws IllegalArgumentException {
  if (isImmutable) {
    throw new UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1, "Colors"));
  }
  if (color == null) {
    map.remove(key);
  } else {
    map.put(key, X364.forColorName(color));
  }
}

代码示例来源:origin: org.apache.sis.core/sis-utility

synchronized (buffer) {
  if (color != null) {
    final X364 code = X364.forColorName(color).background();
    changed = (colors().put(level, code) != code);
  } else if (colors != null) {

代码示例来源:origin: apache/sis

synchronized (buffer) {
  if (color != null) {
    final X364 code = X364.forColorName(color).background();
    changed = (colors().put(level, code) != code);
  } else if (colors != null) {

代码示例来源:origin: apache/sis

/**
 * Tests {@link X364#forColorName(String)}.
 */
@Test
public void testForColorName() {
  for (final X364 value : X364.values()) {
    if (value.color != null) {
      assertSame(value.color, value.foreground(), X364.forColorName(value.color));
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com