public void paint(java.awt.Graphics g) {
RuleModel rule = (RuleModel) model;
if (rule.getLeftShape() != null) {
int iconSize = getWidth() < getHeight() ? getWidth() : getHeight();
ControllerBase ctr = null;
try {
ctr = ControllerFactory.CreateController(rule);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//ShapeModel sh = rule.getLeftShape().getShape();
// now draw this control
GeneralPath shape = (GeneralPath) ctr.getShape();
Rectangle2D bounds = shape.getBounds();
// get the resize ratio
double resize = (iconSize - 9)
/ (bounds.getWidth() > bounds.getHeight() ? bounds
.getWidth() : bounds.getHeight()) ;