Example #1
0
 @Override
 public Dimension getMinimumSize(int cols) {
   Font f = xtext.getFont();
   FontMetrics fm = xtext.getFontMetrics(f);
   return new Dimension(
       fm.charWidth('0') * cols + 10, fm.getMaxDescent() + fm.getMaxAscent() + PADDING);
 }
Example #2
0
 @Override
 public void setFont(Font f) {
   synchronized (getStateLock()) {
     font = f;
     if (xtext != null && xtext.getFont() != f) {
       xtext.setFont(font);
     }
   }
   xtext.validate();
 }