예제 #1
0
 /**
  * @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);
   }
 }
예제 #2
0
 /**
  * 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);
   }
 }
예제 #3
0
 /** @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();
   }
 }