示例#1
0
  {
    fontName = new StringChoiceInput("FontName", "Key Inputs", defFont);
    fontName.setChoices(validFontNames);
    this.addInput(fontName, true);

    fontColor = new ColourInput("FontColour", "Key Inputs", ColourInput.BLACK);
    this.addInput(fontColor, true, "FontColor");

    fontStyle = new StringListInput("FontStyle", "Key Inputs", new StringVector());
    fontStyle.setValidOptions(validStyles);
    fontStyle.setCaseSensitive(false);
    this.addInput(fontStyle, true);

    dropShadow = new BooleanInput("DropShadow", "Key Inputs", false);
    this.addInput(dropShadow, true);

    dropShadowColor = new ColourInput("DropShadowColour", "Key Inputs", ColourInput.BLACK);
    this.addInput(dropShadowColor, true, "DropShadowColor");

    dropShadowOffset =
        new Vec3dInput("DropShadowOffset", "Key Inputs", new Vec3d(-0.1d, -0.1d, -0.001d));
    this.addInput(dropShadowOffset, true);

    style = Font.PLAIN;
  }
示例#2
0
  @Override
  public void updateForInput(Input<?> in) {
    super.updateForInput(in);

    if (in == fontStyle) {
      style = Font.PLAIN;
      for (String each : fontStyle.getValue()) {
        if (each.equalsIgnoreCase("Bold")) {
          style += Font.BOLD;
        } else if (each.equalsIgnoreCase("Italic")) {
          style += Font.ITALIC;
        }
      }
    }
  }