Class Styles

java.lang.Object
org.omegat.util.gui.Styles

public final class Styles extends Object
Static attributes for text.
  • Method Details

    • createAttributeSet

      public static AttributeSet createAttributeSet(@Nullable Color foregroundColor, @Nullable Color backgroundColor, @Nullable Boolean bold, @Nullable Boolean italic)
      Construct required attributes set.

      Since we need many attributes combinations, it's not a good idea to have variable to each attribute set. There is no sense to store created attributes in the cache, because calculate hash for cache requires about 2-3 time more than create attributes set from scratch.

      1000000 attributes creation requires about 305 ms - it's enough fast.

    • createAttributeSet

      public static AttributeSet createAttributeSet(@Nullable Color foregroundColor, @Nullable Color backgroundColor, @Nullable Boolean bold, @Nullable Boolean italic, @Nullable Boolean strikethrough, @Nullable Boolean underline)