package mage.client.components; import java.awt.Color; import javax.swing.JEditorPane; import javax.swing.SwingUtilities; import mage.client.util.GUISizeHelper; import org.mage.card.arcane.ManaSymbols; import org.mage.card.arcane.UI; /** * GUI: component for displaying text in feedback panel. Support html, mana symbols and popups. * * @author nantuko */ public class MageTextArea extends MageEditorPane { private String currentText; private int currentPanelWidth; public MageTextArea() { super(); setEditable(false); setBackground(new Color(0, 0, 0, 0)); // transparent background setFocusable(false); enableHyperlinksAndCardPopups(); } @Override public void setText(String text) { setText(text, 0); } public void setText(String text, final int panelWidth) { if (text == null) { return; } if (text.equals(currentText) && panelWidth == currentPanelWidth) { return; } currentText = text; currentPanelWidth = panelWidth; // prepare text format as header and details texts final StringBuilder buffer = new StringBuilder(512); // Dialog is a java logical font family, so it should work on all systems buffer.append("