VDBFieldData fld = getField("VAL");
VDBFieldData fld = getField(VAL_FIELD);
protected void validate() {  double scale = getRscale();  int rwidth = (int)(getWidth()*scale);  int rheight = (int)(Constants.RECORD_HEIGHT*scale);  setRheight(rheight);  setRwidth(rwidth);  // set appropriate font size  int x0 = (int)(8*scale);		// insets  int y0 = (int)(4*scale);  Font font;  setLabel(recordData.getName());  if (rwidth<(2*x0)) font = null;  else	  font = FontMetricsBuffer.getInstance().getAppropriateFont(		  			Constants.DEFAULT_FONT, Font.PLAIN, 	 	 			getLabel(), rwidth-x0, (rheight-y0)/2);  if (font!=null) {	  FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(font);	  setRlabelX((rwidth-fm.stringWidth(getLabel()))/2); 	  setRlabelY(rheight/2+(rheight/2-fm.getHeight())/2+fm.getAscent());  }  setFont(font);    label2 = recordData.getType();  if (rwidth<(2*x0)) typeFont = null;  else	  typeFont = FontMetricsBuffer.getInstance().getAppropriateFont(		  			 Constants.DEFAULT_FONT, Font.PLAIN, 	 	 			 label2, rwidth-x0, (rheight-y0)/2);  if (typeFont!=null) {	  FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(typeFont);	  rtypeLabelX = (rwidth-fm.stringWidth(label2))/2; 	  rtypeLabelY = (rheight/2-fm.getHeight())/2+fm.getAscent();  } // !!! optimize - static   rfieldRowHeight = (rheight-2*y0)*0.375;  // increase record size for VAL value and timestamp  if (PluginDebugManager.isDebugState())  {	VDBFieldData fld = getField("VAL");	if (fld != null)	{		// TODO for timestamp this could be optimized		timestamp = fld.getDebugValueTimeStamp();		timestampFont = FontMetricsBuffer.getInstance().getAppropriateFont(					    Constants.DEFAULT_FONT, Font.PLAIN, 						timestamp, rwidth-x0, (rheight-y0)/2-y0);		if (timestampFont!=null) {			FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(timestampFont);			timestampX = (rwidth-fm.stringWidth(timestamp))/2;			timestampY = rheight/2+(rheight/2-fm.getHeight())/2+fm.getAscent();		}		value = fld.getValue();		valueFont = FontMetricsBuffer.getInstance().getAppropriateFont(						Constants.DEFAULT_FONT, Font.PLAIN, 						value, rwidth-x0, rheight/2+y0);		if (valueFont!=null) {			FontMetrics fm = FontMetricsBuffer.getInstance().getFontMetrics(valueFont);			valueX = (rwidth-fm.stringWidth(value))/2;			valueY = (rheight/2-fm.getHeight())/2+fm.getAscent();		}		inDebugMode = true;		rheight *= 2;	}	else		inDebugMode = false;  }  else	inDebugMode = false;	  if (rwidth<(2*x0)) 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 = x0; 	  rfieldLabelY = rheight+2*fm.getAscent();	  //rfieldRowHeight = fm.getHeight();	  ascent = fm.getAscent();  }  rheight += y0+rfieldRowHeight*changedFields.size()+ascent;  setHeight((int)(rheight/scale));  // round fix  rheight = (int)((getY()+getHeight())*scale)-(int)(getY()*scale);  setRheight(rheight);  // sub-components  revalidatePosition();		// rec's height can be different  validateFields(); }