/* * [CDATATag.java] * * Summary: Describes one start or end marker. * * 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: * 1.0 2010-02-08 initial version */ package com.mindprod.jtokens.html; import java.awt.Color; import java.awt.Font; import static com.mindprod.jtokens.TokenColourScheme.HTML_FOREGROUND_FOR_CDATA_TAG; import static com.mindprod.jtokens.TokenFonts.MONO_FONTS; import static com.mindprod.jtokens.TokenFonts.NORMAL_FONT_SIZE_IN_POINTS; /** * Describes one start or end marker. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2010-02-08 initial version * @since 2010-02-08 */ public final class CDATATag extends HTMLText { /** * version number for the class */ static final long serialVersionUID = 1L; /** * Font to render this token */ @SuppressWarnings( { "ConstantNamingConvention" } ) private static final Font cdataTagFont = bestFont( MONO_FONTS, Font.PLAIN, NORMAL_FONT_SIZE_IN_POINTS - 1 ); /** * Constructor * * @param tag literal text including <xxxx> */ public CDATATag( String tag ) { super( tag ); } /** * @inheritDoc */ public Font getFont() { return cdataTagFont; } /** * foreground colour to render this token. * * @return Color object. */ public Color getForeground() { return HTML_FOREGROUND_FOR_CDATA_TAG; } /** * @inheritDoc */ public String getHTML() { return "" + getRawHTML() + ""; } }