/** * @param text to use for the menu, if it's enclosed between '$' then it's interpreted as a LaTeX * string, in this case the setIcon method of this object is used. */ public void setText(String text) { this.text = text; if (ScilabSpecialTextUtilities.setText(this, text)) { super.setText(""); } else { super.setText(text); } }
/** * Sets the text of a Text Widget * * @param newText the text to set to the Text Widget */ public void setText(String newText) { Document doc = getDocument(); try { doc.remove(0, doc.getLength()); } catch (BadLocationException e) { System.err.println(e); } if (ScilabSpecialTextUtilities.setText(this, newText)) { expression = newText; } else { super.setText(newText); } }
/** @param font to use in this textPane */ public void setFont(Font font) { super.setFont(font); descent = getDescent(font); if (font.getSize() != fontSize && expression != null) { try { // If we have an icon, it is considered as one char getDocument().remove(0, 1); } catch (BadLocationException e) { } ScilabSpecialTextUtilities.setText(this, expression); fontSize = font.getSize(); } }