/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ /* * HtmlRenderer.java * * Created on January 2, 2004, 12:49 AM */ package org.openide.awt; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.KeyboardFocusManager; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.font.LineMetrics; import java.awt.geom.Area; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.lang.ref.Reference; import java.lang.ref.SoftReference; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.StringTokenizer; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JTable; import javax.swing.JTree; import javax.swing.ListCellRenderer; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.border.Border; import javax.swing.table.TableCellRenderer; import javax.swing.tree.TreeCellRenderer; import org.openide.ErrorManager; /** A generic cell renderer class which implements * a lightweight html renderer supporting a minimal subset of HTML used for * markup purposes only - basic font styles, colors, etc. Also supports * named logical colors specified by a preceding ! character for specifying * up colors that should be looked up in the current look and feel's UIDefaults * (e.g. <font color=&!textText&>). *

* If you only need to paint some HTML quickly, use the static methods for * painting - renderString, renderPlainString or * renderHtml. These methods differ as follows: *