Package editor

Class GosuStyleContext

All Implemented Interfaces:
Serializable, AbstractDocument.AttributeContext, ViewFactory

public class GosuStyleContext extends StyleContext implements ViewFactory
A collection of styles used to render gosu source.
See Also:
  • Field Details

  • Constructor Details

    • GosuStyleContext

      public GosuStyleContext()
      Constructs a set of styles to represent gosu lexical tokens.
  • Method Details

    • setForeground

      public void setForeground(Style style, Color colorFore)
    • setBackground

      public void setBackground(Style style, Color colorBack)
    • setBold

      public void setBold(Style style, boolean bBold)
    • setItalic

      public void setItalic(Style style, boolean bItalic)
    • setUnderline

      public void setUnderline(Style style, boolean bUnderline)
    • setStrikeThrough

      public void setStrikeThrough(Style style, boolean bStrikeThrough)
    • setAttribute

      public void setAttribute(Style style, Object attr, Object value)
    • setDefaultStyles

      public void setDefaultStyles()
    • setDefaultFontFamily

      public static void setDefaultFontFamily(String defFontFamily)
    • getDefaultFontFamily

      public static String getDefaultFontFamily()
    • setDefaultFontSize

      public static void setDefaultFontSize(int defFontSize)
    • getDefaultFontSize

      public static int getDefaultFontSize()
    • getForeground

      public Color getForeground(int code)
      Fetch the foreground color to use for a lexical token with the given value.
    • getBackground

      public Color getBackground(int code)
    • getFont

      public Font getFont(int code)
      Fetch the font to use for a lexical token with the given scan value.
    • getStyleForScanValue

      public Style getStyleForScanValue(int code)
      Fetches the attribute set to use for the given scan code. The set is stored in a table to facilitate relatively fast access to use in conjunction with the scanner.
    • getFont

      public Font getFont(AttributeSet attr)
      Fetch the font to use for a given attribute set.
      Overrides:
      getFont in class StyleContext
    • getFont

      private Font getFont(AttributeSet attr, String strFamily)
    • getFontFamily

      public String getFontFamily(AttributeSet a)
    • getFontFamily

      public String getFontFamily()
    • setFontFamily

      public void setFontFamily(String strFamily)
    • getFontSize

      public int getFontSize()
    • setFontSize

      public void setFontSize(int iSize)
    • create

      public View create(Element elem)
      Specified by:
      create in interface ViewFactory
    • getStyles

      public List<Style> getStyles()
    • areStylesEquivalent

      public boolean areStylesEquivalent(String styleName1, String styleName2)