/* * [ImportantKeyword.java] * * Summary: Describes one important keyword for display. * * Copyright: (c) 2004-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 2.0 2009-04-19 tidy comments, more accurate colour names */ package com.mindprod.jtokens; import java.awt.Color; import java.awt.Font; import static com.mindprod.jtokens.TokenColourScheme.COMMON_FOREGROUND_FOR_IMPORTANT_KEYWORD; import static com.mindprod.jtokens.TokenFonts.IMPORTANT_KEYWORD_FONT_SIZE_IN_POINTS; import static com.mindprod.jtokens.TokenFonts.KEYWORD_FONTS; import static java.lang.System.*; /** * Describes one important keyword for display. * * @author Roedy Green, Canadian Mind Products * @version 2.0 2009-04-19 tidy comments, more accurate colour names * @since 2004-04-24 */ public final class ImportantKeyword extends Keyword { // used for: // "break", // "class", // "continue", // "for", // "interface", // "package", // "return", // "while" /** * version number for this class */ static final long serialVersionUID = 2L; /** * the font to use for important keywords. I different font may be selected on the computer that generated the *.ser * files and that renders them. */ @SuppressWarnings( { "ConstantNamingConvention" } ) private static final Font importantKeywordFont = bestFont( KEYWORD_FONTS, Font.BOLD, IMPORTANT_KEYWORD_FONT_SIZE_IN_POINTS ); static { if ( DEBUGGING ) { out.println( "importantKeyword font:" + importantKeywordFont ); } } /** * Constructor * * @param keyword e.g. if else do */ public ImportantKeyword( String keyword ) { super( keyword ); } /** * font to render this object. * * @return Font, in the correct size. */ public Font getFont() { return importantKeywordFont; } /** * foreground colour to render this token. * * @return Color object. */ public Color getForeground() { return COMMON_FOREGROUND_FOR_IMPORTANT_KEYWORD; } /** * get the text surrounded by CSS html * * @return decorated HTML in a " + getRawHTML() + ""; } }