Class ACLSytntaxStyle


  • public class ACLSytntaxStyle
    extends Object
    A simple text style class. It can specify the color, italic flag, and bold flag of a run of text. The original file is written by Slava Pestov (www.gjt.org) and altered to fit ACL/SL.
    Author:
    Chris van Aart - Acklin B.V., the Netherlands & Slava Pestov
    • Constructor Detail

      • ACLSytntaxStyle

        public ACLSytntaxStyle​(Color color,
                               boolean italics,
                               boolean bold,
                               JComponent theComp)
    • Method Detail

      • getColor

        public Color getColor()
        Returns the color specified in this style.
        Returns:
        The Color value
      • isItalics

        public boolean isItalics()
        Returns true if italics is enabled for this style.
        Returns:
        The Italics value
      • isBold

        public boolean isBold()
        Returns true if boldface is enabled for this style.
        Returns:
        The Bold value
      • getStyledFont

        public Font getStyledFont​(Font font)
        Returns the specified font, but with the style's bold and italic flags applied.
        Parameters:
        font - Description of Parameter
        Returns:
        The StyledFont value
      • getFontMetrics

        public FontMetrics getFontMetrics​(Font font)
        Returns the font metrics for the styled font.
        Parameters:
        font - Description of Parameter
        Returns:
        The FontMetrics value
      • setGraphicsFlags

        public void setGraphicsFlags​(Graphics gfx,
                                     Font font)
        Sets the foreground color and font of the specified graphics context to that specified in this style.
        Parameters:
        gfx - The graphics context
        font - The font to add the styles to
      • toString

        public String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        Description of the Returned Value