示例#1
0
 @Override
 public void draw(java.awt.Graphics g) {
   ((java.awt.Graphics2D) g)
       .setRenderingHint(
           java.awt.RenderingHints.KEY_ANTIALIASING, java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
   super.draw(g);
   if (converter != null) {
     java.awt.Color oldColor = g.getColor();
     if (!converter.isComplete()) {
       g.setColor(java.awt.Color.RED);
     }
     String name = converter.getName();
     if (name.length() == 0) {
       name = "?";
     }
     Utils.drawStringInBox(
         g, name, displayBox().x + 14, displayBox().y + 1 + displayBox().height / 2);
     g.setColor(oldColor);
   }
 }
示例#2
0
 @Override
 protected java.awt.Rectangle invalidateRectangle(java.awt.Rectangle r) {
   java.awt.Rectangle box = super.invalidateRectangle(r);
   box.grow(converter.getName().length() * 10, converter.getName().length() * 10);
   return box;
 }
示例#3
0
 public String expressionWrapper() {
   return converter.getExpression();
 }
示例#4
0
 public void expressionWrapper(String expression) {
   dirty = dirty || !converter.getExpression().equals(expression);
   converter.setExpression(expression);
 }
示例#5
0
 public String nameWrapper() {
   return converter.getName();
 }
示例#6
0
 public void nameWrapper(String name) {
   dirty = dirty || !converter.getName().equals(name);
   converter.setName(name);
 }