rfieldRowHeight = (frheight-2*y0)*0.092;
rfieldRowHeight = (irheight-2*y0)*0.175;
	protected void validate()	{		  revalidatePosition();		  double scale = getRscale();		  int rwidth = (int)(getWidth()*scale);		  int height = Constants.TEMPLATE_INITIAL_HEIGHT;		  initY = height;		  int irheight = (int)(scale*height);		  // set appropriate font size		  int x0 = (int)(24*scale);		// insets		  int y0 = (int)(12*scale);		  // fields//int fieldRows = Math.max(templateData.getInputs().size(), templateData.getOutputs().size());		 int fieldRows = templateData.getTemplate().getPorts().size();		  height += fieldRows * Constants.FIELD_HEIGHT;		 // height = Math.max(height, Constants.TEMPLATE_MIN_HEIGHT);		  int frheight = (int)(scale*height);		  rlinkY = frheight;		  		  // properties		  int xx0 = (int)(14*scale);		// insets		  int yy0 = (int)(8*scale);  		 // !!! optimize - static 		  rfieldRowHeight = (frheight-2*y0)*0.092;		  if (rwidth<(2*xx0)) fieldFont = null;		  else			  fieldFont = FontMetricsBuffer.getInstance().getAppropriateFont(				  			 Constants.DEFAULT_FONT, Font.PLAIN, 			 	 			 fieldMaxStr, rwidth-x0, (int)rfieldRowHeight);		  int ascent = 0;		  //rfieldRowHeight = 0;		  if (fieldFont!=null)		  {			  FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(fieldFont);			  rfieldLabelX = xx0;		 	  rfieldLabelY = frheight+2*fm.getAscent();			  //rfieldRowHeight = fm.getHeight();			  ascent = fm.getAscent();		  }		  int rheight = frheight + yy0 + (int)(rfieldRowHeight*templateData.getProperties().size())+ascent;		  setHeight((int)(rheight/scale));		  setRwidth(rwidth);		  setRheight(rheight);				  // description		  int idLabelHeight = (int)(Constants.FIELD_HEIGHT*scale);		  		  setLabel(getDescription());				  Font font;		  font = FontMetricsBuffer.getInstance().getAppropriateFont(			  			Constants.DEFAULT_FONT, Font.PLAIN, 			  			getLabel(), rwidth-x0, irheight-y0/*-idLabelHeight*/);				  if (rwidth<(2*x0)) font = null;		  else		  if (font!=null) {			  FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(font);			  setRlabelX((rwidth-fm.stringWidth(getLabel()))/2);		 	  setRlabelY((irheight-fm.getHeight()/*+idLabelHeight*/)/2+fm.getAscent());		  }		  setFont(font);		  // id label		  		  // idlabel = templateData.getTemplate().getId();		  idlabel = templateData.getName();		  if (rwidth<(2*x0)) idFont = null;		  else			  idFont = FontMetricsBuffer.getInstance().getAppropriateFont(				  			 Constants.DEFAULT_FONT, Font.PLAIN, 			 	 			 idlabel, rwidth-x0, idLabelHeight);				  if (idFont!=null) {			  FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(idFont);			  ridLabelX = (rwidth-fm.stringWidth(idlabel))/2;		 	  ridLabelY = (idLabelHeight-fm.getHeight())/2+fm.getAscent();		  }		  	      // sub-components		  revalidatePosition();		  validateFields();	}