Exemplo n.º 1
0
 void setExtendedRst(ExtRst ext_rst) {
   if (ext_rst != null) {
     field_2_optionflags = extBit.setByte(field_2_optionflags);
   } else {
     field_2_optionflags = extBit.clearByte(field_2_optionflags);
   }
   this.field_5_ext_rst = ext_rst;
 }
Exemplo n.º 2
0
  /**
   * Adds a font run to the formatted string.
   *
   * <p>If a font run exists at the current charcter location, then it is replaced with the font run
   * to be added.
   */
  public void addFormatRun(FormatRun r) {
    if (field_4_format_runs == null) {
      field_4_format_runs = new ArrayList<FormatRun>();
    }

    int index = findFormatRunAt(r._character);
    if (index != -1) field_4_format_runs.remove(index);

    field_4_format_runs.add(r);
    // Need to sort the font runs to ensure that the font runs appear in
    // character order
    Collections.sort(field_4_format_runs);

    // Make sure that we now say that we are a rich string
    field_2_optionflags = richText.setByte(field_2_optionflags);
  }
Exemplo n.º 3
0
  /**
   * set the actual string this contains
   *
   * @param string the text
   */
  public void setString(String string) {
    field_3_string = string;
    setCharCount((short) field_3_string.length());
    // scan for characters greater than 255 ... if any are
    // present, we have to use 16-bit encoding. Otherwise, we
    // can use 8-bit encoding
    boolean useUTF16 = false;
    int strlen = string.length();

    for (int j = 0; j < strlen; j++) {
      if (string.charAt(j) > 255) {
        useUTF16 = true;
        break;
      }
    }
    if (useUTF16)
      // Set the uncompressed bit
      field_2_optionflags = highByte.setByte(field_2_optionflags);
    else field_2_optionflags = highByte.clearByte(field_2_optionflags);
  }