/*
   * (non-Javadoc)
   *
   * @see henshineditor.figure.condition.FormulaFigure#refreshLabel()
   */
  @Override
  protected void refreshLabel() {
    if (getFormula().getChild() == null) {
      label.setBounds(new Rectangle(getLocation().x, getLocation().y, width, height));
    } else {
      label.setBounds(new Rectangle(getLocation().x, getLocation().y, width, HEIGHT_DEFAULT));
    }

    label.setForegroundColor(SWTResourceManager.getColor(0, 0, 0));
    if (!FormulaUtil.isValid(getFormula())) {
      label.setForegroundColor(SWTResourceManager.getColor(255, 0, 0));
    }
  }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
   */
  @Override
  protected IFigure createFigure() {
    RectangleFigure fig = new RectangleFigure();

    counterLabel = new Label(Integer.toString(getCastedModel().getCounter()));

    fig.setLayoutManager(new XYLayout());

    fig.setFont(SWTResourceManager.getFont("Sans", 13, SWT.BOLD));
    fig.setBackgroundColor(ColorConstants.lightGray);
    fig.setOpaque(true);
    fig.setOutline(false);

    fig.add(counterLabel, new Rectangle(17, 10, 30, 30));
    fig.add(new Label("x"), new Rectangle(0, 9, 30, 30));

    return fig;
  }