System.out.println(">"+ofield+" "+ofield.getFieldData()+" "+ofield.getFieldData().getValue());
public VisibleObject morph(java.lang.String newType) {	//System.out.println("Morphing "+getName()+" from "+getType()+" to "+newType);		// copies VDBData when the record is still untouched	VDBRecordData recordData = VDBData.morphVDBRecordData(				DataProvider.getInstance().getDbdDB(), getRecordData(), newType, getName());					if (recordData==null) {		Console.getInstance().println("o) Interal error: failed to morph record "+getName()+" ("+getType()+")!");		return null;	}					   		//	here are stored field values that point to us	Vector fieldData = new Vector();		Vector values = new Vector();		// destroys object and stores field values that point to us	//	*****************  destroy object ***********************	if (!isDestroyed()) {		super.destroy();				// ***************** destroy fields ************************		{			Object[] objs = new Object[subObjectsV.size()];					subObjectsV.copyInto(objs);			for (int i=0; i < objs.length; i++) {								if (objs[i] instanceof Field) {					Field field = (Field)objs[i];					fieldData.add(field.getFieldData());					values.add(field.getFieldData().getValue());								Vector startpoints = null;					if (objs[i] instanceof EPICSLinkOutIn) 						 startpoints = ((EPICSLinkOutIn)objs[i]).getStartPoints();					if (objs[i] instanceof EPICSVarLink)						startpoints = ((EPICSVarLink)objs[i]).getStartPoints();					if (startpoints != null) {						for (int j=0; j<startpoints.size(); j++) { 						 							Object obj = startpoints.elementAt(j);							if (obj instanceof Port) {								Port port = (Port)obj;								fieldData.add(port.getData());								values.add(port.getData().getValue());							} else if (obj instanceof Field) {								Field ofield = (Field)obj;								System.out.println(">"+ofield+" "+ofield.getFieldData()+" "+ofield.getFieldData().getValue());								fieldData.add(ofield.getFieldData());								values.add(ofield.getFieldData().getValue());							}						} 					}				} // end of copying field values											((VisibleObject)objs[i]).destroy();			}		}		// ****************************************** end of destroyFields()				//		disconnected=true;				if (outlinks.size()>0) {			Object[] objs = new Object[outlinks.size()];			outlinks.copyInto(objs);			for(int i=0; i<objs.length; i++) {				OutLink outlink = (OutLink)objs[i];				OutLink start = EPICSLinkOut.getStartPoint(outlink);								String value = null;				if (start instanceof Field) {					Field field = (Field)start;					fieldData.add(field.getFieldData());					values.add(field.getFieldData().getValue());				}								if(start instanceof EPICSLinkOut) {					((EPICSLinkOut)start).destroy();									} else if (start!=null) 					start.disconnect(this);				else 					outlink.disconnect(this);			}			outlinks.clear();		}				clear();						getParent().removeObject(Group.substractObjectName(getName()));		UndoManager.getInstance().addAction(new DeleteAction(this));	}	// end if !isDestroyed()	// ************************** end of destroy()		//creates new record	Record record = new Record(null, recordData, getX(), getY());	Group.getRoot().addSubObject(getName(), record, true);	UndoManager.getInstance().addAction(new CreateAction(record));		// sets stored field values	for (int j=0; j<fieldData.size(); j++) {		String value = (String)values.elementAt(j);		LinkSource source = (LinkSource)fieldData.elementAt(j);				//test		String oldValue = source.getValue();		source.setValueSilently(value);		LinkProperties properties = new LinkProperties(source);		InLink varlink = EPICSLinkOut.getTarget(properties);		source.setValueSilently(oldValue);				if (varlink!=null) source.setValue(value);	}	return record;}