|
From: Hirzel P. <ph...@us...> - 2005-12-28 11:52:39
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16853/src/org/tcotool/model Modified Files: CostType.java Cost.java Added Files: CostCause.java Log Message: Refactoring: CostType replaced CostCause --- NEW FILE: CostCause.java --- package org.tcotool.model; import org.tcotool.application.CostCauseDetailView; import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.descriptor.DbDescriptor; import ch.softenvironment.jomm.descriptor.DbFieldTypeDescriptor; import ch.softenvironment.jomm.descriptor.DbMultiplicityRange; import ch.softenvironment.jomm.descriptor.DbTextFieldDescriptor; import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.util.DeveloperException; /** * @author generated by the umleditor */ public class CostCause extends DbCode { // standard CodeCause's for the most TCO-Configuration public static final String INSTALLATION="Installation"; public static final String SERVICE="Service"; public static final String INFRASTRUCTURE="Infrastructure"; public static final String EDUCATION="Education"; public static final String OPERATION="Operation"; public static final String OPERATIONHARDWARE="OperationHardware"; public static final String OPERATIONSOFTWARE="OperationSoftware"; public static final String INTEGRATION="Integration"; public static final String SOFTWARE="Software"; public static final String HARDWARE="Hardware"; public static final String STORAGE="Storage"; public CostCause(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); } public static DbDescriptor createDescriptor(Class dbCode) { DbDescriptor descriptor = DbCode.createDescriptor(dbCode); descriptor.add(DbCodeType.PROPERTY_ILICODE, DbCode.ATTRIBUTE_ILICODE, new DbTextFieldDescriptor(DbCode.ILI_CODE_LENGTH), new DbMultiplicityRange(0, 1)); descriptor.add("direct","direct",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(0,1)); return descriptor; } private String fieldIliCode; /** * Overwrites. */ public final String getIliCode() { return fieldIliCode; } /** * Makes sense here because morphed from CostType-DbEnumeration. * @param iliCode */ public final void setIliCode(String iliCode) { if (getIliCode() != null) { throw new DeveloperException(this, "setIliCode()", "IliCode must not be changed!"); } String oldValue = fieldIliCode; fieldIliCode = iliCode; firePropertyChange("iliCode", oldValue, iliCode); } private Boolean fieldDirect; /** * */ public final Boolean getDirect() { return fieldDirect; } /** * According to Gartner costs may be "direct" or "indirect". * */ public void setDirect(Boolean direct) { Boolean oldValue = fieldDirect; fieldDirect = direct; firePropertyChange("direct", oldValue, direct); } /** * Overwrites */ public String getNameString() { String text = ""; // return getNameString(java.util.Locale.getDefault()); if (getName() != null) { text = getName().getValue(); if (getDirect().booleanValue()) { text = text + " [" + ResourceManager.getResource(CostCauseDetailView.class, "LblDirect_text", false) + "]"; } else { text = text + " [" + ResourceManager.getResource(CostCauseDetailView.class, "LblIndirect_text", false) + "]"; } } return text; } } Index: Cost.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/Cost.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Cost.java 29 Aug 2005 09:41:06 -0000 1.1.1.1 --- Cost.java 28 Dec 2005 11:52:30 -0000 1.2 *************** *** 5,9 **** import ch.softenvironment.jomm.descriptor.DbNumericFieldDescriptor; /** ! * Effectice calcuable Cost-Parameters. * @author generated by the umleditor */ --- 5,9 ---- import ch.softenvironment.jomm.descriptor.DbNumericFieldDescriptor; /** ! * Effective calcuable Cost-Parameters. * @author generated by the umleditor */ *************** *** 56,70 **** firePropertyChange("repeatable", oldValue, fieldRepeatable); } ! ! private org.tcotool.model.CostType fieldType; ! public org.tcotool.model.CostType getType() { refresh(false); // read lazy initialized objects ! return fieldType; } ! public void setType(org.tcotool.model.CostType type){ org.tcotool.model.CostType oldValue=fieldType; fieldType=type; firePropertyChange("type", oldValue, fieldType); ! } private java.lang.Long fieldDriverId; --- 56,85 ---- firePropertyChange("repeatable", oldValue, fieldRepeatable); } ! private org.tcotool.model.CostCause fieldCause; ! public org.tcotool.model.CostCause getCause() { refresh(false); // read lazy initialized objects ! return fieldCause; } ! public void setCause(CostCause cause){ ! CostCause oldValue=fieldCause; ! fieldCause=cause; ! firePropertyChange("cause", oldValue, fieldCause); ! } ! private org.tcotool.model.CostType fieldType; ! /** ! * @deprecated (replaced by CostCause ! */ ! public org.tcotool.model.CostType getType() { ! refresh(false); // read lazy initialized objects ! return fieldType; ! } ! /** ! * @deprecated (replaced by CostCause ! */ ! public void setType(org.tcotool.model.CostType type){ org.tcotool.model.CostType oldValue=fieldType; fieldType=type; firePropertyChange("type", oldValue, fieldType); ! } private java.lang.Long fieldDriverId; *************** *** 84,88 **** descriptor.add("estimated","estimated",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); descriptor.add("repeatable","repeatable",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); ! descriptor.addCode("type", "type", new DbMultiplicityRange(0,1)); descriptor.addManyToOneReferenceId(DbDescriptor.ASSOCIATION, "driverId", "T_Id_driver", new DbMultiplicityRange(1,1)); return descriptor; --- 99,105 ---- descriptor.add("estimated","estimated",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); descriptor.add("repeatable","repeatable",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); ! descriptor.addCode("cause", "cause", new DbMultiplicityRange(0,1)); ! //TODO @deprecated CostType ! descriptor.addCode("type", "type", new DbMultiplicityRange(0,1)); descriptor.addManyToOneReferenceId(DbDescriptor.ASSOCIATION, "driverId", "T_Id_driver", new DbMultiplicityRange(1,1)); return descriptor; Index: CostType.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/CostType.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CostType.java 29 Aug 2005 09:41:05 -0000 1.1.1.1 --- CostType.java 28 Dec 2005 11:52:30 -0000 1.2 *************** *** 3,19 **** import ch.softenvironment.jomm.descriptor.DbDescriptor; import ch.softenvironment.jomm.mvc.model.DbEnumeration; public class CostType extends DbEnumeration { ! public static final String INSTALLATION="Installation"; ! public static final String SERVICE="Service"; ! public static final String INFRASTRUCTURE="Infrastructure"; ! public static final String EDUCATION="Education"; ! public static final String OPERATION="Operation"; ! public static final String OPERATIONHARDWARE="OperationHardware"; ! public static final String OPERATIONSOFTWARE="OperationSoftware"; ! public static final String INTEGRATION="Integration"; ! public static final String SOFTWARE="Software"; ! public static final String HARDWARE="Hardware"; ! public static final String STORAGE="Storage"; ! public CostType(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); } --- 3,12 ---- import ch.softenvironment.jomm.descriptor.DbDescriptor; import ch.softenvironment.jomm.mvc.model.DbEnumeration; + /** + * @author Peter Hirzel <i>soft</i>Environment + * @deprecated (replaced by CostCause) + */ public class CostType extends DbEnumeration { ! public CostType(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); } |