public synchronized void setHighlighting(
      final int position, final int length, final int level, final Color color) {
    Preconditions.checkNotNull(color, "Error: color argument can not be null");

    if (!isEmpty()) {
      final int realLength = calculateRealLength(position, length);

      validatePartialLineArguments(position, realLength);

      if (hasHighlighting(level)) {
        clearHighlighting(level);
      }

      m_highlighting.add(
          new CHighlighting(level, position * m_charWidth, realLength * m_charWidth, color));

      Collections.sort(m_highlighting);
    }
  }
Changes the highlighting for a part of the line.

@param position The index of the first character that is highlighted.
@param length Number of characters that are highlighted.
@param level The highlighting level.
@param color The highlighting color.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/realizers/ZyLineContent.java