You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(20) |
Oct
(2) |
Nov
(22) |
Dec
(38) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(12) |
Feb
|
Mar
(7) |
Apr
|
May
(18) |
Jun
(7) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(34) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(24) |
Jun
(45) |
Jul
(4) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Hirzel P. <ph...@us...> - 2006-05-17 07:44:31
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8726/src/org/tcotool/standard/charts Removed Files: CostTypeBarChart.java CostTypePieChart.java Log Message: Refactoring: remove obsolete classes --- CostTypePieChart.java DELETED --- --- CostTypeBarChart.java DELETED --- |
|
From: Hirzel P. <ph...@us...> - 2006-05-09 01:19:06
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21118/src/org/tcotool/application/resources Modified Files: CostDriverDetailView_de.properties LauncherView_de.properties LauncherView.properties CatalogueDetailView_de.properties HTMLReportFrame_de.properties CatalogueDetailView.properties HTMLReportFrame.properties Added Files: CostCauseDetailView_de.properties CostCauseDetailView.properties Log Message: NLS translations enhanced Index: CatalogueDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CatalogueDetailView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CatalogueDetailView.properties 11 Jan 2006 15:01:50 -0000 1.2 --- CatalogueDetailView.properties 7 May 2006 14:25:34 -0000 1.3 *************** *** 5,7 **** ChxExpendable_toolTipText = Yes=>set usage-/depreciation-Duration to one year CTUpdateReference = Update name-reference ! CQUpdateReference = Would you like to replace the given Catalogue-name in all Factcost assignments? \ No newline at end of file --- 5,7 ---- ChxExpendable_toolTipText = Yes=>set usage-/depreciation-Duration to one year CTUpdateReference = Update name-reference ! CQUpdateReference = Would you like to replace the given <{0}-name> in all Cost assignments? \ No newline at end of file Index: HTMLReportFrame_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/HTMLReportFrame_de.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** HTMLReportFrame_de.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- HTMLReportFrame_de.properties 7 May 2006 14:25:34 -0000 1.2 *************** *** 1,2 **** CTObjectRemoved = Objekt gelöscht ! CIObjectRemoved = Das Objekt wurde in der Zwischenzeit gelöscht und kann im Navigationsbaum deshalb nicht selektiert werden. \ No newline at end of file --- 1,4 ---- CTObjectRemoved = Objekt gelöscht ! CIObjectRemoved = Das Objekt wurde in der Zwischenzeit gelöscht und kann im Navigationsbaum deshalb nicht selektiert werden. ! CTSaveWarning = Generierungsfehler ! CISaveWarning = Ihre Datei <{0}> konnte nicht richtig generiert oder gespeichert werden! \ No newline at end of file Index: HTMLReportFrame.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/HTMLReportFrame.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** HTMLReportFrame.properties 29 Aug 2005 09:41:03 -0000 1.1.1.1 --- HTMLReportFrame.properties 7 May 2006 14:25:34 -0000 1.2 *************** *** 1,2 **** CTObjectRemoved = Object removed ! CIObjectRemoved = The object has been deleted inbetween, and cannot be selected any more. \ No newline at end of file --- 1,4 ---- CTObjectRemoved = Object removed ! CIObjectRemoved = The object has been deleted inbetween, and cannot be selected any more. ! CTSaveWarning = Generation error ! CISaveWarning = A converting or saving error happened with your file <{0}>. \ No newline at end of file Index: LauncherView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/LauncherView_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LauncherView_de.properties 25 Nov 2005 18:07:53 -0000 1.2 --- LauncherView_de.properties 7 May 2006 14:25:34 -0000 1.3 *************** *** 1,12 **** FrmWindow_text = TCO-Tool ! MinCodes_text = Geschäftsobjekte (Codes)... MniDependencyGraph_text = Abhängigkeits-Graph MniFileNewDefault_text = Default-Konfiguration MniReportComplete_text = Bericht (komplett) MniReportInvestment_text = Investitionskosten ! MniReportTotalTcoCost_text = TCO-Kostenblock (gesamt) ! MniTcoChart_text = TCO-Gesamtkosten (Balkendiagramm) ! MniTcoCostTypeChart_text = TCO-Kostenarten (Balkendiagramm) ! MniTcoCostTypePieChart_text = TCO-Kostenarten (Kuchendiagramm) MnuFont_text = Schrift MnuReportGeneral_text = Konfiguration --- 1,10 ---- FrmWindow_text = TCO-Tool ! MinCodes_text = Geschäftsobjekte (Codes) MniDependencyGraph_text = Abhängigkeits-Graph MniFileNewDefault_text = Default-Konfiguration MniReportComplete_text = Bericht (komplett) MniReportInvestment_text = Investitionskosten ! MniReportTotalTcoCost_text = Kostenblock (gesamt) ! MniTcoChart_text = Sach-/Personalkosten (gesamt) MnuFont_text = Schrift MnuReportGeneral_text = Konfiguration *************** *** 24,26 **** CIAutoLayout = Automatisch anordnen... CEConfigFault = Konfigurations-Fehler ! CIConfigFault = Die gewünschte TCO-Konfiguration konnte nicht geöffnet werden, evtl. ist etwas am XML-Format korrupt? \ No newline at end of file --- 22,26 ---- CIAutoLayout = Automatisch anordnen... CEConfigFault = Konfigurations-Fehler ! CIConfigFault = Die gewünschte TCO-Konfiguration konnte nicht geöffnet werden, evtl. ist etwas am XML-Format korrupt? ! MniSubordinateCodes_text = Untergeordnete {0} ! MniSubordinateCodesWithin_text = <{0}> nach <{1}> \ No newline at end of file Index: LauncherView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/LauncherView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LauncherView.properties 25 Nov 2005 18:07:53 -0000 1.2 --- LauncherView.properties 7 May 2006 14:25:34 -0000 1.3 *************** *** 1,12 **** FrmWindow_text = TCO-Tool ! MinCodes_text = Business Objects (Codes)... MniDependencyGraph_text = Dependency-Graph MniFileNewDefault_text = Default-Configuration MniReportComplete_text = Report (complete) MniReportInvestment_text = Investment ! MniReportTotalTcoCost_text = TCO-Costblock (over all) ! MniTcoChart_text = TCO-Over all costs (bar chart) ! MniTcoCostTypeChart_text = TCO-Cost types (bar chart) ! MniTcoCostTypePieChart_text = TCO-Cost types (pie chart) MnuFont_text = Font MnuReportGeneral_text = Configuration --- 1,10 ---- FrmWindow_text = TCO-Tool ! MinCodes_text = Business Objects (Codes) MniDependencyGraph_text = Dependency-Graph MniFileNewDefault_text = Default-Configuration MniReportComplete_text = Report (complete) MniReportInvestment_text = Investment ! MniReportTotalTcoCost_text = Costblock (over all) ! MniTcoChart_text = Personal-/Factcosts (over all) MnuFont_text = Font MnuReportGeneral_text = Configuration *************** *** 24,26 **** CIAutoLayout = Layout automatically... CEConfigFault = Configurations-fault ! CIConfigFault = Unfortunately the desired TCO-configuration could not be opened, evtl. the XML-Format might be corrupt? \ No newline at end of file --- 22,26 ---- CIAutoLayout = Layout automatically... CEConfigFault = Configurations-fault ! CIConfigFault = Unfortunately the desired TCO-configuration could not be opened, evtl. the XML-Format might be corrupt? ! MniSubordinateCodes_text = Subordinate {0} ! MniSubordinateCodesWithin_text = <{0}> by <{1}> \ No newline at end of file Index: CostDriverDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CostDriverDetailView_de.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CostDriverDetailView_de.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- CostDriverDetailView_de.properties 7 May 2006 14:25:34 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- TbcType_text = Art TbcCosttype_text = Kostenart + TbcCosttype_toolTipText = Verursachungsgrund/-kategorie der Kosten CTFactCostName = *SK* CTPersonalCostName = *PK* Index: CatalogueDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CatalogueDetailView_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CatalogueDetailView_de.properties 11 Jan 2006 15:01:50 -0000 1.2 --- CatalogueDetailView_de.properties 7 May 2006 14:25:34 -0000 1.3 *************** *** 5,7 **** ChxExpendable_toolTipText = Ja=>setzt Nutzungs-/Abschreibungsdauer auf 1 Jahr CTUpdateReference = Namens-Referenzen ! CQUpdateReference = Möchten sie den gegebenen Katalog-Namen in allen betroffenen Sachkosten nachführen? \ No newline at end of file --- 5,7 ---- ChxExpendable_toolTipText = Ja=>setzt Nutzungs-/Abschreibungsdauer auf 1 Jahr CTUpdateReference = Namens-Referenzen ! CQUpdateReference = Möchten sie den gegebenen <{0}-Namen> in allen betroffenen Kosten nachführen? \ No newline at end of file --- NEW FILE: CostCauseDetailView_de.properties --- LblDirect_text = Direkt: LblIndirect_text = Indirekt: LblDirect_toolTipText = Ja->Direkte Kosten; Nein->Indirekte Kosten; --- NEW FILE: CostCauseDetailView.properties --- LblDirect_text = Direct: LblIndirect_text = Indirect: LblDirect_toolTipText = Yes->Direct costs; No->Indirect costs; |
|
From: Hirzel P. <ph...@us...> - 2006-05-09 01:16:25
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21283/src/org/tcotool/application/resources Modified Files: CostDriverDetailView.properties Log Message: NLS translations enhanced Index: CostDriverDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CostDriverDetailView.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CostDriverDetailView.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- CostDriverDetailView.properties 7 May 2006 14:26:01 -0000 1.2 *************** *** 11,15 **** PnlRisk_text = Risk TbcType_text = Type ! TbcCosttype_text = Costtype CTFactCostName = *FC* CTPersonalCostName = *PC* --- 11,16 ---- PnlRisk_text = Risk TbcType_text = Type ! TbcCosttype_text = Cost type ! TbcCosttype_toolTipText = Cost causer CTFactCostName = *FC* CTPersonalCostName = *PC* |
|
From: Hirzel P. <ph...@us...> - 2006-05-09 01:16:16
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20616/src/org/tcotool/application/resources Added Files: CourseDetailView_de.properties CourseDetailView.properties Log Message: New --- NEW FILE: CourseDetailView_de.properties --- (This appears to be a binary file; contents omitted.) --- NEW FILE: CourseDetailView.properties --- FrmWindow_text = Currencies LblSource_text = Source-Currency: LblSource_toolTipText = Default Currency according to <{0}> LblTarget_text = Target-Currency: LblFactor_text = Factor: LblFactor_toolTipText = Target = Source * Factor PnlDetails_text = Details |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 23:43:36
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5337/src/org/tcotool/tools Modified Files: ModelUtility.java Log Message: Major changes Index: ModelUtility.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/ModelUtility.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ModelUtility.java 22 Dec 2005 12:34:40 -0000 1.8 --- ModelUtility.java 7 May 2006 14:57:27 -0000 1.9 *************** *** 16,25 **** --- 16,32 ---- */ + import java.net.URL; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; + import java.util.List; + import java.util.Locale; + import java.util.Map; import java.util.Set; import ch.softenvironment.jomm.DbObjectServer; import ch.softenvironment.jomm.mvc.model.DbChangeableBean; + import ch.softenvironment.jomm.mvc.model.DbEnumeration; + import ch.softenvironment.jomm.target.xml.XmlObjectServer; import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.StringUtils; *************** *** 36,39 **** --- 43,47 ---- import javax.swing.Icon; + import javax.swing.ImageIcon; /** * Utility Class that knows how to <b>deal with Model (and TreeNode's)</b>. *************** *** 43,49 **** --- 51,59 ---- */ public class ModelUtility implements ch.softenvironment.view.tree.TreeNodeUtility { + public static final Long EXPENDABLE_DURATION = new Long(12); // 12 month private TcoModel model = null; private String file = null; private Diagram dependencyDiagram = null; + private Map iconMap = new HashMap(); /** *************** *** 71,75 **** this.model = model; this.file = file; ! fixModel(model); } /** --- 81,100 ---- this.model = model; this.file = file; ! ! //TODO remove obsolete code: fix older configuration XSD-Schema ! List causes = model.getObjectServer().retrieveCodes(CostCause.class); ! if (causes.size() == 0) { ! // assume CodeType's not yet transformed at least once => ignore BUG: recreation if user removes all these Code's ! createDefaultCostCauses((XmlObjectServer)model.getObjectServer(), getCodeTypeLocale()); ! } /*else { ! Iterator it = causes.iterator(); ! while (it.hasNext()) { ! CostCause cause = (CostCause)it.next(); ! if (cause.getDirect() == null) { ! cause.setDirect(Boolean.FALSE); ! } ! } ! }*/ ! fixModel(model); } /** *************** *** 125,129 **** // reverse link: element to owner ((Occurance)element).setDriverId(((CostDriver)owner).getId()); ! } else { // sub-package java.util.List ownedElement = new java.util.ArrayList(((TcoPackage)owner).getOwnedElement()); --- 150,161 ---- // reverse link: element to owner ((Occurance)element).setDriverId(((CostDriver)owner).getId()); ! } else if (element instanceof Course) { ! java.util.List course = new java.util.ArrayList(((SystemParameter)owner).getCourse()); ! course.add(element); ! ((SystemParameter)owner).setCourse(course); ! ! // reverse link: element to owner ! ((Course)element).setSystemParameterId(((SystemParameter)owner).getId()); ! } else { // sub-package java.util.List ownedElement = new java.util.ArrayList(((TcoPackage)owner).getOwnedElement()); *************** *** 191,194 **** --- 223,232 ---- return object; } + /** + * Initialize a NEW role with default values. + * @param role + * @param systemParameter + * @throws Throwable + */ public static void initializeRole(Role role, SystemParameter systemParameter) throws Throwable { role.setInternal(Boolean.TRUE); *************** *** 198,202 **** role.setYearlyHours(systemParameter.getManYearHoursInternal()); if ((role.getFullTimeEquivalent() != null) && (role.getYearlyHours() != null)) { ! role.setHourlyRate(new Double(AmountFormat.round(role.getFullTimeEquivalent().doubleValue() / role.getYearlyHours().doubleValue()))); } } --- 236,240 ---- role.setYearlyHours(systemParameter.getManYearHoursInternal()); if ((role.getFullTimeEquivalent() != null) && (role.getYearlyHours() != null)) { ! role.setHourlyRate(new Double(Calculator.calcHourlyRate(role))); } } *************** *** 243,247 **** --- 281,337 ---- group.setName(ResourceManager.getResource(ModelUtility.class, "CIItPlattform")); } + /** + * CostCause are the most important code in a TCO-Configuration + * because they allow to classify each Cost-factor. + * @param server + * @param locale + * @throws Throwable + * @deprecated (necessary for version <1.4.0) + */ + private static void createDefaultCostCauses(XmlObjectServer server, Locale locale) throws Throwable { + morphEnumeration(server.getIliCode(CostType.class, CostCause.HARDWARE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.SOFTWARE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.INSTALLATION)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.INTEGRATION)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.OPERATION)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.OPERATIONHARDWARE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.OPERATIONSOFTWARE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.INFRASTRUCTURE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.SERVICE)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.EDUCATION)); + morphEnumeration(server.getIliCode(CostType.class, CostCause.STORAGE)); + /* + String nlsText[] = new String[]{ ResourceManager.getResource(CostType.class, "CIHardware"), + ResourceManager.getResource(CostCause.class, "CISoftware"), + ResourceManager.getResource(CostCause.class, "CIInstallation"), + ResourceManager.getResource(CostCause.class, "CIIntegration"), + ResourceManager.getResource(CostCause.class, "CIOperaion"), + ResourceManager.getResource(CostCause.class, "CIOperationHardware"), + ResourceManager.getResource(CostCause.class, "CIOperationSoftware"), + ResourceManager.getResource(CostCause.class, "CIInfrastructure"), + ResourceManager.getResource(CostCause.class, "CIService"), + ResourceManager.getResource(CostCause.class, "CIEducation"), + ResourceManager.getResource(CostCause.class, "CIStorage") + }; + server.mapCodes(CostCause.class, nlsText, locale); + */ + } + /** + * Morph given enumeration into a new instance of dbCode. + * @param enumeration + * @param dbCode + * @return + * @deprecated (see #fixModel()) + */ + private static CostCause morphEnumeration(DbEnumeration enumeration) throws Throwable { + CostCause cause = (CostCause)enumeration.getObjectServer().createInstance(CostCause.class); + cause.setName(enumeration.getName()); + cause.setIliCode(enumeration.getIliCode()); + cause.setDirect(Boolean.FALSE); + cause.save(); + enumeration.getObjectServer().cacheCode(cause); + return cause; + } /** * Return the client of a Dependency. *************** *** 429,434 **** */ public void fixModel(TcoObject owner) throws Throwable { if (owner instanceof TcoPackage) { ! java.util.Iterator it = ((TcoPackage)owner).getOwnedElement().iterator(); while (it.hasNext()) { TcoPackage ownedElement = (TcoPackage)it.next(); --- 519,546 ---- */ public void fixModel(TcoObject owner) throws Throwable { + List causes = owner.getObjectServer().retrieveCodes(CostCause.class); + Iterator it = causes.iterator(); + while (it.hasNext()) { + CostCause cause = (CostCause)it.next(); + if (cause.getDirect() == null) { + cause.setDirect(Boolean.FALSE); + } + } + it = owner.getObjectServer().retrieveCodes(Catalogue.class).iterator(); + while (it.hasNext()) { + Catalogue catalogue = (Catalogue)it.next(); + if (catalogue.getExpendable() == null) { + catalogue.setExpendable(Boolean.FALSE); + } + if (catalogue.getUsageDuration() == null) { + catalogue.setUsageDuration(new Long(ReportTool.getUsageDuration())); + } + if (catalogue.getDepreciationDuration() == null) { + catalogue.setDepreciationDuration(new Long(ReportTool.getDepreciationDuration())); + } + } + if (owner instanceof TcoPackage) { ! it = ((TcoPackage)owner).getOwnedElement().iterator(); while (it.hasNext()) { TcoPackage ownedElement = (TcoPackage)it.next(); *************** *** 441,445 **** } } else if (owner instanceof Service) { ! java.util.Iterator it = ((Service)owner).getDriver().iterator(); while (it.hasNext()) { CostDriver driver = (CostDriver)it.next(); --- 553,557 ---- } } else if (owner instanceof Service) { ! it = ((Service)owner).getDriver().iterator(); while (it.hasNext()) { CostDriver driver = (CostDriver)it.next(); *************** *** 450,453 **** --- 562,579 ---- cost.setEstimated(Boolean.FALSE); } + if (cost.getType() != null) { + // <= V1.4.0 instances => morph CostType into CostCause + String iliCode = cost.getType().getIliCode(); + Iterator itCauses = causes.iterator(); + while (itCauses.hasNext()) { + CostCause code = (CostCause)itCauses.next(); + if (iliCode.equals(code.getIliCode())) { + Tracer.getInstance().debug(this, "fixModel()", "Morph enum: " + cost.getType().getNameString() + " => code: " + code.getNameString()); + cost.setCause(code); + cost.setType(null); + break; + } + } + } if (cost instanceof PersonalCost) { PersonalCost pCost = (PersonalCost)cost; *************** *** 517,522 **** * if its Role changed. * @param cost */ ! public static void updateRole(PersonalCost cost) { if (cost.getRole() != null) { Role role = cost.getRole(); --- 643,649 ---- * if its Role changed. * @param cost + * @return boolean (true->FTE manYear relevant; false->otherwise) */ ! public static boolean updateRole(PersonalCost cost) { if (cost.getRole() != null) { Role role = cost.getRole(); *************** *** 525,540 **** cost.setInternal(role.getInternal()); if ((cost.getHourlyRate() != null) && (cost.getHours() != null)) { ! // calc cost.setAmount(new Double(AmountFormat.round(cost.getHourlyRate().doubleValue() * cost.getHours().doubleValue()))); } else { ! // use FTE because whole salary is assumed cost.setAmount(role.getFullTimeEquivalent()); } } } public static void updateCatalogue(FactCost cost) { if (cost.getCatalogue() != null) { cost.setAmount(cost.getCatalogue().getPrice()); cost.setCurrency(cost.getCatalogue().getCurrency()); } } --- 652,677 ---- cost.setInternal(role.getInternal()); if ((cost.getHourlyRate() != null) && (cost.getHours() != null)) { ! // calc hourlyRate*hours cost.setAmount(new Double(AmountFormat.round(cost.getHourlyRate().doubleValue() * cost.getHours().doubleValue()))); } else { ! // use FTE because whole salary is assumed cost.setAmount(role.getFullTimeEquivalent()); + return true; } } + return false; } + /** + * Reuse price and duration of Catalogue. + * @param cost + */ public static void updateCatalogue(FactCost cost) { if (cost.getCatalogue() != null) { cost.setAmount(cost.getCatalogue().getPrice()); cost.setCurrency(cost.getCatalogue().getCurrency()); + cost.setUsageDuration(cost.getCatalogue().getUsageDuration()); + cost.setDepreciationDuration(cost.getCatalogue().getDepreciationDuration()); + // by default Catalogue parts are known in price exactly + cost.setEstimated(Boolean.FALSE); } } *************** *** 542,577 **** * Returns the appropriate icon for node Element. */ ! public Icon getIcon(Object node, boolean expanded) { ! String fileName = null; ! boolean imported = //(((TcoObject) node).getReference() == null) ! !((TcoObject)node).getObjectServer().equals(((TcoModel)getRoot()).getObjectServer()); ! ! if (node instanceof TcoPackage) { ! if (imported) { ! if (expanded) { ! fileName = "package_imported_opened.png"; ! } else { ! fileName = "package_imported_closed.png"; ! } ! } // else null for default Tree package-symbol ! } else if (node instanceof org.tcotool.model.Service) { ! if (imported) { ! fileName = "service_imported.png"; ! } else { ! fileName = "Service.png"; } - } else { - fileName = StringUtils.getPureClassName(node) + ".png"; } ! try { ! if (fileName != null) { ! return ch.ehi.basics.i18n.ResourceBundle.getImageIcon(ModelUtility.class, fileName); ! } ! } catch (NullPointerException e) { ! ch.softenvironment.util.Tracer.getInstance().developerError(this, "getIcon(..)", "image not found for =>" + node.toString()); } - // => default for e.g. javax.swing.UIManager.getIcon("Tree.closedIcon"); - return null; } /** --- 679,719 ---- * Returns the appropriate icon for node Element. */ ! public Icon getIcon(Class type, boolean expanded) { ! URL url = getImageURL(type); ! if (url != null) { ! try { ! return new ImageIcon(url); ! } catch (Exception e) { ! ch.softenvironment.util.Tracer.getInstance().developerError(this, "getIcon(..)", "image not found for =>" + type); } } ! return null; ! } ! public void setImageURL(Class key, URL url) { ! iconMap.put(key, url); ! } ! public URL getImageURL(Class key) { try { ! if (iconMap.containsKey(key)) { ! return (URL)iconMap.get(key); ! } else { ! if (key.equals(TcoPackage.class) || key.equals(TcoModel.class)) { ! return null; // leave it to default Tree behaviour ! } else { ! String fileName = StringUtils.getPureClassName(key); ! //TODO IMPORT ! /* ! if (!((TcoObject)node).getObjectServer().equals(((TcoModel)getRoot()).getObjectServer())) { ! fileName = fileName + "_imported"; ! } ! */ ! setImageURL(key, ch.ehi.basics.i18n.ResourceBundle.getURL(ModelUtility.class, fileName + ".png")); ! return (URL)iconMap.get(key); ! } ! } ! } catch(Exception e) { ! ch.softenvironment.util.Tracer.getInstance().developerError(this, "getImageURL(..)", "image not found for =>" + key); ! return null; } } /** *************** *** 644,651 **** return ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"); // DbEnumeration's ! } else if (type.equals(CostType.class)) { return ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", false); // DbCode's } else if (type.equals(ServiceCategory.class)) { return ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text", false); } else if (type.equals(Responsibility.class)) { --- 786,795 ---- return ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"); // DbEnumeration's ! } else if (type.equals(CostCause.class)) { return ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", false); // DbCode's } else if (type.equals(ServiceCategory.class)) { + //TODO HACK + //return "Clinical Symptom"; return ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text", false); } else if (type.equals(Responsibility.class)) { *************** *** 657,660 **** --- 801,806 ---- } else if (type.equals(ProjectPhase.class)) { return ResourceManager.getResource(CostDriverDetailView.class, "LblPhase_text", false); + } else if (type.equals(LifeCycle.class)) { + return ResourceManager.getResource(CostDriverDetailView.class, "LblCycle_text", false); } else if (type.equals(Site.class)) { return ResourceManager.getResource(CostDriverDetailView.class, "LblSite_text", false); *************** *** 775,785 **** } /** ! * Register the default DbCode's. * @throws Throwable */ private static void mapDefaultCodes(ch.softenvironment.jomm.target.xml.XmlObjectServer server, SystemParameter sysPar) throws Throwable { //TODO NLS-translations ! java.util.Locale locale = java.util.Locale.GERMAN; String nlsText[] = new String[]{ "System-Service", "Security-Service", --- 921,941 ---- } /** ! * Return the Locale for NLS-Codes. ! * @deprecated (JOMM does not suppert multiple NLS-Settings yet!) ! */ ! private static Locale getCodeTypeLocale() { ! //TODO replace by proper JOMM-Mechanism ! return java.util.Locale.GERMAN; ! } ! /** ! * Register the default DbCode's for new Configurations. * @throws Throwable */ private static void mapDefaultCodes(ch.softenvironment.jomm.target.xml.XmlObjectServer server, SystemParameter sysPar) throws Throwable { //TODO NLS-translations ! java.util.Locale locale = getCodeTypeLocale(); + createDefaultCostCauses(server, locale); + String nlsText[] = new String[]{ "System-Service", "Security-Service", *************** *** 869,904 **** } /** ! * Register the default DbEnumeration's. */ public static void mapEnumerations(ch.softenvironment.jomm.target.xml.XmlObjectServer server) { ! // define default DbEnumertion's ! java.util.Locale locale = java.util.Locale.GERMAN; - //TODO morph DbEnumeration CostType into a DbCode - server.createEnumeration(CostType.class, CostType.HARDWARE, locale, ResourceManager.getResource(CostType.class, "CIHardware")); - server.createEnumeration(CostType.class, CostType.SOFTWARE, locale, ResourceManager.getResource(CostType.class, "CISoftware")); - server.createEnumeration(CostType.class, CostType.INSTALLATION, locale, ResourceManager.getResource(CostType.class, "CIInstallation")); - server.createEnumeration(CostType.class, CostType.INTEGRATION, locale, ResourceManager.getResource(CostType.class, "CIIntegration")); - server.createEnumeration(CostType.class, CostType.OPERATION, locale, ResourceManager.getResource(CostType.class, "CIOperaion")); - server.createEnumeration(CostType.class, CostType.OPERATIONHARDWARE, locale, ResourceManager.getResource(CostType.class, "CIOperationHardware")); - server.createEnumeration(CostType.class, CostType.OPERATIONSOFTWARE, locale, ResourceManager.getResource(CostType.class, "CIOperationSoftware")); - server.createEnumeration(CostType.class, CostType.INFRASTRUCTURE, locale, ResourceManager.getResource(CostType.class, "CIInfrastructure")); - server.createEnumeration(CostType.class, CostType.SERVICE, locale, ResourceManager.getResource(CostType.class, "CIService")); - server.createEnumeration(CostType.class, CostType.EDUCATION, locale, ResourceManager.getResource(CostType.class, "CIEducation")); - server.createEnumeration(CostType.class, CostType.STORAGE, locale, ResourceManager.getResource(CostType.class, "CIStorage")); - /* - // Buruli-Configuration only ! - server.createEnumeration(CostType.class, "DC_Bandage", locale, "DC:Bandage"); - server.createEnumeration(CostType.class, "DC_Surgery", locale, "DC:Surgery"); - server.createEnumeration(CostType.class, "DC_Physiotherapie", locale, "DC:Physiotherapie"); - server.createEnumeration(CostType.class, "DC_SkinTransplantation", locale, "DC:Skin Transplantation"); - server.createEnumeration(CostType.class, "DC_Nutrition", locale, "DC:Nutrition"); - server.createEnumeration(CostType.class, "DC_Cleaning", locale, "DC:Cleaning"); - server.createEnumeration(CostType.class, "IC_Wages", locale, "IC:Wages"); - server.createEnumeration(CostType.class, "IC_ExpensesAlesForAyos", locale, "IC:Expenses (ALES for Ayos)"); - server.createEnumeration(CostType.class, "IC_Energy", locale, "IC:Energy"); - server.createEnumeration(CostType.class, "IC_AdministrationAles", locale, "IC:Administration ALES"); - server.createEnumeration(CostType.class, "IC_Depreciation", locale, "IC:Depreciation"); - */ server.createEnumeration(Branch.class, Branch.GOVERNMENT, locale, ResourceManager.getResource(Branch.class, "EnumGOVERNMENT")); server.createEnumeration(Branch.class, Branch.BANKINSURANCE, locale, ResourceManager.getResource(Branch.class, "EnumBANKINSURANCE")); --- 1025,1049 ---- } /** ! * Register the default DbEnumeration's which are the same ! * for all Configuration. */ public static void mapEnumerations(ch.softenvironment.jomm.target.xml.XmlObjectServer server) { ! // define default DbEnumeration's ! //TODO implement DbEnumeration according to proper NLS-Language ! java.util.Locale locale = getCodeTypeLocale(); ! ! //TODO OBSOLETE DbEnumeration CostType ! server.createEnumeration(CostType.class, CostCause.HARDWARE, locale, ResourceManager.getResource(CostCause.class, "CIHardware")); ! server.createEnumeration(CostType.class, CostCause.SOFTWARE, locale, ResourceManager.getResource(CostCause.class, "CISoftware")); ! server.createEnumeration(CostType.class, CostCause.INSTALLATION, locale, ResourceManager.getResource(CostCause.class, "CIInstallation")); ! server.createEnumeration(CostType.class, CostCause.INTEGRATION, locale, ResourceManager.getResource(CostCause.class, "CIIntegration")); ! server.createEnumeration(CostType.class, CostCause.OPERATION, locale, ResourceManager.getResource(CostCause.class, "CIOperaion")); ! server.createEnumeration(CostType.class, CostCause.OPERATIONHARDWARE, locale, ResourceManager.getResource(CostCause.class, "CIOperationHardware")); ! server.createEnumeration(CostType.class, CostCause.OPERATIONSOFTWARE, locale, ResourceManager.getResource(CostCause.class, "CIOperationSoftware")); ! server.createEnumeration(CostType.class, CostCause.INFRASTRUCTURE, locale, ResourceManager.getResource(CostCause.class, "CIInfrastructure")); ! server.createEnumeration(CostType.class, CostCause.SERVICE, locale, ResourceManager.getResource(CostCause.class, "CIService")); ! server.createEnumeration(CostType.class, CostCause.EDUCATION, locale, ResourceManager.getResource(CostCause.class, "CIEducation")); ! server.createEnumeration(CostType.class, CostCause.STORAGE, locale, ResourceManager.getResource(CostCause.class, "CIStorage")); server.createEnumeration(Branch.class, Branch.GOVERNMENT, locale, ResourceManager.getResource(Branch.class, "EnumGOVERNMENT")); server.createEnumeration(Branch.class, Branch.BANKINSURANCE, locale, ResourceManager.getResource(Branch.class, "EnumBANKINSURANCE")); *************** *** 914,917 **** --- 1059,1063 ---- server.createEnumeration(Currency.class, Currency.JPY, locale, "JPY"); server.createEnumeration(Currency.class, Currency.CFA, locale, "CFA"); + server.createEnumeration(Currency.class, Currency.INR, locale, "INR"); server.createEnumeration(CostExponent.class, CostExponent.ASIS, locale, ResourceManager.getResource(CostExponent.class, "CIAsIs")); *************** *** 930,934 **** } /** ! * Move an object from its "owner" to target. * @param object to be moved * @param target new owner --- 1076,1080 ---- } /** ! * Move an object from its "owner" to given target. * @param object to be moved * @param target new owner *************** *** 1050,1054 **** dependency.getObjectServer().deletePersistent(dependency); ! TcoObject supplier = object; //findSupplier(dependency); TcoObject client = findClient(dependency); --- 1196,1200 ---- dependency.getObjectServer().deletePersistent(dependency); ! // TcoObject supplier = object; //findSupplier(dependency); TcoObject client = findClient(dependency); *************** *** 1128,1131 **** --- 1274,1292 ---- } } + public void removeCourse(List courses) throws Throwable { + // 1) unlink owner from element + Iterator it = courses.iterator(); + while (it.hasNext()) { + ((Course)it.next()).setSystemParameterId(null); + } + + // 2) unlink element + java.util.List copy = new java.util.ArrayList(getSystemParameter().getCourse()); + copy.removeAll(courses); + getSystemParameter().setCourse(copy); // triggers node structure + + // 3) remove persistently + ((TcoModel)getRoot()).getObjectServer().deletePersistentAll(courses); + } /** * Return InterestRate according to SystemParameter settings. |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 23:43:35
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5337/src/org/tcotool/tools/resources Modified Files: ModelUtility_de.properties Log Message: Major changes Index: ModelUtility_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/resources/ModelUtility_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModelUtility_de.properties 13 Dec 2005 13:57:46 -0000 1.2 --- ModelUtility_de.properties 7 May 2006 14:57:27 -0000 1.3 *************** *** 9,13 **** CWMoveSubtree = Ein Objekt kann nicht in seinen \"Unterbaum\" verschoben werden, da sonst alles unterhalb des Objektes weggelöscht würde! CWAddOwnedElement = Das selektierte Element darf dem Zielobjekt nicht zugeordnet werden! ! CWAlreadyOwned = Das selektierte Elementist bereits dem Zielobjekt zugeordnet! CWUnknownSourceTarget = Quell- und/oder Zielobjekt ist nicht klar definiert! CWSelfDrop = Quellobjekt darf nicht in sich selber verschoben werden! --- 9,13 ---- CWMoveSubtree = Ein Objekt kann nicht in seinen \"Unterbaum\" verschoben werden, da sonst alles unterhalb des Objektes weggelöscht würde! CWAddOwnedElement = Das selektierte Element darf dem Zielobjekt nicht zugeordnet werden! ! CWAlreadyOwned = Das selektierte Element ist bereits dem Zielobjekt zugeordnet! CWUnknownSourceTarget = Quell- und/oder Zielobjekt ist nicht klar definiert! CWSelfDrop = Quellobjekt darf nicht in sich selber verschoben werden! |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 23:42:41
|
Update of /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6652/test/org/tcotool/tools/test Modified Files: ModelUtilityTestCase.java TestModel.java CalculatorTestCase.java Log Message: TestCases enhanced Index: ModelUtilityTestCase.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test/ModelUtilityTestCase.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ModelUtilityTestCase.java 29 Aug 2005 09:41:17 -0000 1.1.1.1 --- ModelUtilityTestCase.java 7 May 2006 14:59:35 -0000 1.2 *************** *** 57,60 **** --- 57,63 ---- assertNotNull("Default Usage", m.utility.getSystemParameter().getDefaultUsageDuration()); assertNotNull("Default Depreciation", m.utility.getSystemParameter().getDefaultDepreciationDuration()); + + m.utility.getSystemParameter().setDepreciationInterestRate(new Double(5.6)); + assertTrue(m.utility.getSystemParameter().getDepreciationInterestRate().doubleValue() == 5.6); } catch(Throwable e) { fail(e.getLocalizedMessage()); Index: TestModel.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test/TestModel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestModel.java 20 Nov 2005 15:55:42 -0000 1.2 --- TestModel.java 7 May 2006 14:59:35 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- import ch.softenvironment.jomm.DbObjectServer; + import ch.softenvironment.util.DeveloperException; /* *************** *** 32,48 **** * @version $Revision$ $Date$ */ ! class TestModel { ! protected DbObjectServer server = null; ! protected ModelUtility utility = null; ! protected TcoModel model = null; ! protected TcoPackage group = null; ! protected Service service = null; ! protected CostDriver driver = null; ! protected Role role = null; ! protected double driverFactor = 2.0 * 3.0 * 4.0 * 5.0; private DbObjectServer initializeDatabase() { ! org.tcotool.TcotoolUtility.registerClasses(); ! javax.jdo.PersistenceManagerFactory pmFactory = new ch.softenvironment.jomm.target.xml.XmlObjectServerFactory(); pmFactory.setConnectionURL("tcotool.model"); --- 33,53 ---- * @version $Revision$ $Date$ */ ! public class TestModel { ! public DbObjectServer server = null; ! public ModelUtility utility = null; ! public TcoModel model = null; ! public TcoPackage group = null; ! public Service service = null; ! public CostDriver driver = null; ! public Role role = null; ! public double driverFactor = 2.0 * 3.0 * 4.0 * 5.0; private DbObjectServer initializeDatabase() { ! try { ! org.tcotool.TcotoolUtility.registerClasses(); ! } catch(DeveloperException e) { ! //TODO hack against static re-evalution => use JUnit TestSetup instead ! // ignore: re-Registering caused by TestCase#setUp() ! } javax.jdo.PersistenceManagerFactory pmFactory = new ch.softenvironment.jomm.target.xml.XmlObjectServerFactory(); pmFactory.setConnectionURL("tcotool.model"); *************** *** 52,60 **** return (DbObjectServer)pmFactory.getPersistenceManager(System.getProperty("user.name"), null); } ! protected TestModel() throws Throwable { // connection & Utility init server = initializeDatabase(); utility = ModelUtility.createDefaultConfiguration(server); //new ModelUtility(server); ! // add own codes role = (Role)server.createInstance(Role.class); --- 57,65 ---- return (DbObjectServer)pmFactory.getPersistenceManager(System.getProperty("user.name"), null); } ! public TestModel() throws Throwable { // connection & Utility init server = initializeDatabase(); utility = ModelUtility.createDefaultConfiguration(server); //new ModelUtility(server); ! // add own codes role = (Role)server.createInstance(Role.class); *************** *** 78,82 **** utility.addOwnedElement(service, driver); } ! protected PersonalCost addPersonalCost() throws Throwable { PersonalCost pcost = (PersonalCost)utility.createTcoObject(server, PersonalCost.class); utility.addOwnedElement(driver, pcost); --- 83,87 ---- utility.addOwnedElement(service, driver); } ! public PersonalCost addPersonalCost() throws Throwable { PersonalCost pcost = (PersonalCost)utility.createTcoObject(server, PersonalCost.class); utility.addOwnedElement(driver, pcost); Index: CalculatorTestCase.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test/CalculatorTestCase.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CalculatorTestCase.java 29 Aug 2005 09:41:17 -0000 1.1.1.1 --- CalculatorTestCase.java 7 May 2006 14:59:35 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- */ + import org.tcotool.model.FactCost; import org.tcotool.model.PersonalCost; import org.tcotool.model.TcoObject; *************** *** 21,24 **** --- 22,27 ---- import org.tcotool.tools.ModelUtility; + import ch.softenvironment.math.MathUtils; + import junit.framework.TestCase; |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 18:00:24
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20160/src/org/tcotool/application Modified Files: FindDialog.java Log Message: Feature: Find DbCodeType's as well Index: FindDialog.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/FindDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FindDialog.java 28 Dec 2005 11:51:42 -0000 1.5 --- FindDialog.java 7 May 2006 14:24:02 -0000 1.6 *************** *** 1,3 **** --- 1,19 ---- package org.tcotool.application; + + /* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ import java.util.ArrayList; import java.util.EventObject; *************** *** 31,34 **** --- 47,51 ---- import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.mvc.model.DbCodeType; + import ch.softenvironment.jomm.serialize.HtmlSerializer; import ch.softenvironment.util.StringUtils; import ch.softenvironment.util.Tracer; *************** *** 45,48 **** --- 62,66 ---- private List searchList = null; private String expression = null; + private DbCodeType code = null; private javax.swing.JPanel ivjBaseDialogContentPane = null; private javax.swing.JButton ivjBtnCancel = null; *************** *** 82,85 **** --- 100,104 ---- public FindDialog(java.awt.Component owner, ViewOptions viewOptions, boolean modal) { super(owner, modal, viewOptions); + this.code = null; initialize(); } *************** *** 89,92 **** --- 108,112 ---- public FindDialog(java.awt.Component owner, ViewOptions viewOptions, DbCodeType code) { super(owner, false, viewOptions); + this.code = code; initialize(); //TODO allow research *************** *** 102,105 **** --- 122,126 ---- public FindDialog(java.awt.Component owner, ViewOptions viewOptions, final String id) { super(owner, false, viewOptions); + this.code = null; initialize(); //TODO allow research *************** *** 133,137 **** Iterator it = searchList.iterator(); while (it.hasNext()) { ! buffer.append("<li>" + it.next() + "</li>"); } buffer.append("</ul>"); --- 154,160 ---- Iterator it = searchList.iterator(); while (it.hasNext()) { ! buffer.append("<li>"); ! buffer.append(it.next()); ! buffer.append("</li>"); } buffer.append("</ul>"); *************** *** 199,206 **** } private void addHit(TcoObject object) { ! String text = ReportTool.getTcoObjectImage(object.getClass()) + ! " <a href=\"" + object.getId() + "\"> " + object.getName() + "</a>"; ! searchList.add(text); } /** --- 222,241 ---- } private void addHit(TcoObject object) { ! StringBuffer buffer = new StringBuffer(); ! buffer.append(ReportTool.getTcoObjectImage(object.getClass())); ! buffer.append(" <a href=\""); ! buffer.append(object.getId()); ! buffer.append("\"> "); ! buffer.append(object.getName()); ! buffer.append("</a>"); ! if (code != null){ ! if ((code instanceof Role) && (object instanceof PersonalCost)) { ! buffer.append(" " + Calculator.calcHours(((PersonalCost)object)) * LauncherView.getInstance().getUtility().getMultitudeFactor((PersonalCost)object, true) + " / " + Calculator.calcAvailableHours((Role)code) + " [h]"); ! } else if ((code instanceof CostCause) && (object instanceof Cost)) { ! buffer.append(" " + Calculator.calc((Cost)object) + " " + ((Cost)object).getCurrency().getNameString()); ! } ! } ! searchList.add(buffer.toString()); } /** *************** *** 828,832 **** } // user code begin {2} ! setSize(424, 500); setTitle(getResourceString("FrmWindow_text")); --- 863,867 ---- } // user code begin {2} ! setSize(475, 520); setTitle(getResourceString("FrmWindow_text")); |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:59:25
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4183/src/org/tcotool/tools Added Files: CourseUtils.java Log Message: New --- NEW FILE: CourseUtils.java --- package org.tcotool.tools; /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ import java.util.ArrayList; import org.tcotool.application.LauncherView; import org.tcotool.model.Course; import org.tcotool.model.Currency; import ch.softenvironment.util.UserException; /** * @author Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1 $ $Date: 2006/05/07 14:55:32 $ */ public class CourseUtils { /** * Return the targetAmount, which is: * targetAmount = sourceAmount * factor * @see #getCourse(Currency, Currency) */ public static double getAmount(double sourceAmount, Currency source, Currency target) throws UserException { return sourceAmount * getCourse(source, target); } /** * Return a course between source- and target-Currency. * @param source * @param target * @return * @throws UserException */ public static double getCourse(Currency source, Currency target) throws UserException { //TODO NLS if ((source == null) || (target == null)) { throw new IllegalArgumentException("source AND target must not be null"); } if (source.equals(target)) { // no transformation at all return 1.0; } java.util.List list = null; try { list = LauncherView.getInstance().getUtility().getSystemParameter().getCourse(); } catch(Throwable e) { LauncherView.getInstance().handleException(e); list = new ArrayList(); } java.util.Iterator it = list.iterator(); while (it.hasNext()) { Course course = (Course)it.next(); if (source.equals(course.getSource()) && target.equals(course.getTarget())) { // straight return course.getFactor().doubleValue(); } if (source.equals(course.getTarget()) && target.equals(course.getSource())) { // 1/x return 1.0 / course.getFactor().doubleValue(); } } throw new UserException(CourseUtils.class, "getCourse()", "No course defined for <" + source.getNameString() + "> to <" + target.getNameString() + ">"); } } |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:57:56
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28131/src/org/tcotool/model Modified Files: Currency.java Log Message: Some important currencies added Index: Currency.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/Currency.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Currency.java 20 Nov 2005 15:53:40 -0000 1.2 --- Currency.java 7 May 2006 14:39:03 -0000 1.3 *************** *** 2,5 **** --- 2,9 ---- import ch.softenvironment.jomm.mvc.model.DbEnumeration; + /** + * Currency Enumeration according to ISO 4217. + * @author Peter Hirzel <i>soft</i>Environment + */ public class Currency extends DbEnumeration { public final static String CHF = "CHF"; *************** *** 8,11 **** --- 12,19 ---- public final static String JPY = "JPY"; public final static String CFA = "CFA"; + public final static String INR = "INR"; + public final static String AUD = "AUD"; + public final static String CAD = "CAD"; + public final static String XAF = "XAF"; public Currency(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:54:33
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29450/src/org/tcotool/application Modified Files: HTMLReportFrame.java Formatter.java Log Message: Refactoring: for easier usage Index: HTMLReportFrame.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/HTMLReportFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HTMLReportFrame.java 28 Dec 2005 11:51:00 -0000 1.5 --- HTMLReportFrame.java 7 May 2006 14:41:14 -0000 1.6 *************** *** 21,25 **** --- 21,28 ---- import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.target.xml.XmlObjectServer; + import ch.softenvironment.util.NlsUtils; import ch.softenvironment.util.StringUtils; + import ch.softenvironment.view.BaseDialog; + import org.tcotool.standard.report.ReportTool; import java.io.*; *************** *** 178,182 **** } } catch(NumberFormatException nfe) { ! // try "free" id, because not a TID JDialog dialog = new FindDialog(this, viewOptions, id); dialog.setVisible(true); --- 181,185 ---- } } catch(NumberFormatException nfe) { ! // try "free" id, because not a TID of a TcoObject JDialog dialog = new FindDialog(this, viewOptions, id); dialog.setVisible(true); *************** *** 228,232 **** } /** ! * Save HTML-Report into MyFile.html. */ private void saveObject() { --- 231,235 ---- } /** ! * Save HTML-Report into MyFile.csv/html. */ private void saveObject() { *************** *** 242,263 **** if (saveDialog.showSaveDialog(this) == javax.swing.JFileChooser.APPROVE_OPTION) { String filename = saveDialog.getSelectedFile().getAbsolutePath(); if (filename.toUpperCase().endsWith(".CSV")) { ! FileOutputStream out = new FileOutputStream(saveDialog.getSelectedFile()); //saveDialog.getSelectedFile().getName()); ! PrintStream stream = new PrintStream(out); ! stream.print(tool.getCsvContents()); ! ! stream.flush(); ! out.close(); ! ch.ehi.basics.view.BrowserControl.displayURL("file://" + saveDialog.getSelectedFile().getAbsolutePath()); ! } else /*if (filename.toUpperCase().endsWith(".HTML"))*/ { ! String tmp = StringUtils.tryAppendSuffix(saveDialog.getSelectedFile().getAbsolutePath(), ".html"); ! FileOutputStream out = new FileOutputStream(tmp); ! PrintStream stream = new PrintStream(out); ! stream.print(tool.getHTMLContents()); ! ! stream.flush(); ! out.close(); ! ch.ehi.basics.view.BrowserControl.displayURL("file://" + saveDialog.getSelectedFile().getAbsolutePath()); ! } } // } catch(FileNotFoundException fne) { --- 245,274 ---- if (saveDialog.showSaveDialog(this) == javax.swing.JFileChooser.APPROVE_OPTION) { String filename = saveDialog.getSelectedFile().getAbsolutePath(); + String contents = null; if (filename.toUpperCase().endsWith(".CSV")) { ! contents = tool.getCsvContents(); ! } else /*if (filename.toUpperCase().endsWith(".HTML"))*/ { ! filename = StringUtils.tryAppendSuffix(filename, ".html"); ! contents = tool.getHTMLContents(); ! } ! FileOutputStream out = null; ! try { ! out = new FileOutputStream(filename); //saveDialog.getSelectedFile().getName()); ! PrintStream stream = new PrintStream(out); ! stream.print(contents); ! stream.flush(); ! } catch(Throwable fe) { ! BaseDialog.showWarning(LauncherView.getInstance(), ! ResourceManager.getResource(HTMLReportFrame.class, "CTSaveWarning"), ! NlsUtils.formatMessage(ResourceManager.getResource(HTMLReportFrame.class, "CISaveWarning"), filename)); ! filename = null; ! } finally { ! if (out != null) { ! out.close(); ! if (fileName != null) { ! ch.ehi.basics.view.BrowserControl.displayURL("file://" + filename); ! } ! } ! } } // } catch(FileNotFoundException fne) { Index: Formatter.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/Formatter.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Formatter.java 29 Aug 2005 09:40:30 -0000 1.1.1.1 --- Formatter.java 7 May 2006 14:41:14 -0000 1.2 *************** *** 1,19 **** package org.tcotool.application; - /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ import ch.softenvironment.client.ResourceManager; import org.tcotool.model.*; import org.tcotool.standard.report.ReportTool; --- 1,6 ---- package org.tcotool.application; import ch.softenvironment.client.ResourceManager; + import ch.softenvironment.math.MathUtils; + import org.tcotool.model.*; import org.tcotool.standard.report.ReportTool; *************** *** 80,84 **** } catch(Throwable e) { ch.softenvironment.util.Tracer.getInstance().developerError(this, "format()", "IGNORE: SystemParameters.defaultCurrency reference"); ! return "<" + ResourceManager.getInstance().getResource(FactCostDetailView.class, "LblCurrency_text") + ">"; } } else if (property.equals(COSTDRIVER_PERCENTAGE)) { --- 67,71 ---- } catch(Throwable e) { ch.softenvironment.util.Tracer.getInstance().developerError(this, "format()", "IGNORE: SystemParameters.defaultCurrency reference"); ! return "<" + ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text") + ">"; } } else if (property.equals(COSTDRIVER_PERCENTAGE)) { *************** *** 86,90 **** return NOT_AVAILABLE; } else { ! return ReportTool.fix1(100.0 / totalCostDriver * total); } } --- 73,77 ---- return NOT_AVAILABLE; } else { ! return new Double(MathUtils.fix(100.0 / totalCostDriver * total, 1)); } } *************** *** 96,102 **** } else if (property.equals(COST_TYPE)) { if (cost instanceof FactCost) { ! return ResourceManager.getInstance().getResource(Formatter.class, "CIFactCostAbbreviation"); } else { ! return ResourceManager.getInstance().getResource(Formatter.class, "CIPersonalCostAbbreviation"); } } else if (property.equals(COST_PERCENTAGE)) { --- 83,89 ---- } else if (property.equals(COST_TYPE)) { if (cost instanceof FactCost) { ! return ResourceManager.getResource(Formatter.class, "CIFactCostAbbreviation"); } else { ! return ResourceManager.getResource(Formatter.class, "CIPersonalCostAbbreviation"); } } else if (property.equals(COST_PERCENTAGE)) { *************** *** 107,111 **** return NOT_AVAILABLE; } else { ! return ReportTool.fix1(100.0 / (totalCost / costDriverMultitude.doubleValue()) * (total * ModelUtility.getMultitudeFactor(cost))); } } --- 94,98 ---- return NOT_AVAILABLE; } else { ! return new Double(MathUtils.fix(100.0 / (totalCost / costDriverMultitude.doubleValue()) * (total * ModelUtility.getMultitudeFactor(cost)), 1)); } } *************** *** 114,120 **** // @see ServiceDetailView#initializeView() TcoObject supplier = LauncherView.getInstance().getUtility().findSupplier((Dependency)owner); ! TcoObject client = LauncherView.getInstance().getUtility().findClient((Dependency)owner); if (supplier == null) { ! return ResourceManager.getInstance().getResource(Formatter.class, "CWDependencyFault"); } if (property.equals(SUPPLIER_NAME)) { --- 101,107 ---- // @see ServiceDetailView#initializeView() TcoObject supplier = LauncherView.getInstance().getUtility().findSupplier((Dependency)owner); ! // TcoObject client = LauncherView.getInstance().getUtility().findClient((Dependency)owner); if (supplier == null) { ! return ResourceManager.getResource(Formatter.class, "CWDependencyFault"); } if (property.equals(SUPPLIER_NAME)) { *************** *** 128,132 **** org.tcotool.tools.Calculator calculator = new org.tcotool.tools.Calculator(LauncherView.getInstance().getUtility()); double cost = calculator.calcTcoOverall(supplier); ! return ReportTool.fix1(cost / 100.0 * ((Dependency)owner).getDistribution().doubleValue()); } } --- 115,119 ---- org.tcotool.tools.Calculator calculator = new org.tcotool.tools.Calculator(LauncherView.getInstance().getUtility()); double cost = calculator.calcTcoOverall(supplier); ! return new Double(MathUtils.fix(cost / 100.0 * ((Dependency)owner).getDistribution().doubleValue(), 1)); } } |
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16033/src/org/tcotool/application Modified Files: FactCostDetailView.java SystemParameterDetailView.java RoleDetailView.java DependencyDetailView.java ModelDetailView.java SiteDetailView.java ServiceDetailView.java PersonalCostDetailView.java OccuranceDetailView.java PackageDetailView.java CostCauseDetailView.java CostDriverDetailView.java CodeDetailView.java NavigationView.java CatalogueDetailView.java ApplicationOptions.java Added Files: CourseDetailView.java Log Message: Feature: UserActionRights implemented Index: CostDriverDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CostDriverDetailView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CostDriverDetailView.java 13 Jan 2006 17:38:47 -0000 1.3 --- CostDriverDetailView.java 7 May 2006 14:17:08 -0000 1.4 *************** *** 1,4 **** package org.tcotool.application; - import java.text.NumberFormat; import java.util.EventObject; --- 1,3 ---- *************** *** 22,25 **** --- 21,25 ---- */ import ch.softenvironment.client.ResourceManager; + import ch.softenvironment.client.UserActionRights; import ch.softenvironment.jomm.*; import ch.softenvironment.jomm.mvc.controller.*; *************** *** 1264,1268 **** java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 93; --- 1264,1268 ---- java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 0; constraintsLblName.gridy = 0; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 93; *************** *** 1271,1284 **** java.awt.GridBagConstraints constraintsTxtName = new java.awt.GridBagConstraints(); ! constraintsTxtName.gridx = 2; constraintsTxtName.gridy = 1; constraintsTxtName.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsTxtName.weightx = 1.0; constraintsTxtName.ipadx = 347; ! constraintsTxtName.insets = new java.awt.Insets(15, 7, 2, 141); getJPanel1().add(getTxtName(), constraintsTxtName); java.awt.GridBagConstraints constraintsTbpGeneral = new java.awt.GridBagConstraints(); ! constraintsTbpGeneral.gridx = 1; constraintsTbpGeneral.gridy = 4; constraintsTbpGeneral.gridwidth = 2; constraintsTbpGeneral.fill = java.awt.GridBagConstraints.BOTH; --- 1271,1284 ---- java.awt.GridBagConstraints constraintsTxtName = new java.awt.GridBagConstraints(); ! constraintsTxtName.gridx = 1; constraintsTxtName.gridy = 0; constraintsTxtName.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsTxtName.weightx = 1.0; constraintsTxtName.ipadx = 347; ! constraintsTxtName.insets = new java.awt.Insets(15, 7, 2, 30); getJPanel1().add(getTxtName(), constraintsTxtName); java.awt.GridBagConstraints constraintsTbpGeneral = new java.awt.GridBagConstraints(); ! constraintsTbpGeneral.gridx = 0; constraintsTbpGeneral.gridy = 3; constraintsTbpGeneral.gridwidth = 2; constraintsTbpGeneral.fill = java.awt.GridBagConstraints.BOTH; *************** *** 1292,1296 **** java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 1; constraintsLblMultitude.gridy = 2; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 128; --- 1292,1296 ---- java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 0; constraintsLblMultitude.gridy = 1; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 128; *************** *** 1299,1303 **** java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); ! constraintsLblBaseDate.gridx = 1; constraintsLblBaseDate.gridy = 3; constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblBaseDate.ipadx = 88; --- 1299,1303 ---- java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); ! constraintsLblBaseDate.gridx = 0; constraintsLblBaseDate.gridy = 2; constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblBaseDate.ipadx = 88; *************** *** 1306,1310 **** java.awt.GridBagConstraints constraintsTxtBaseDate = new java.awt.GridBagConstraints(); ! constraintsTxtBaseDate.gridx = 2; constraintsTxtBaseDate.gridy = 3; constraintsTxtBaseDate.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; --- 1306,1310 ---- java.awt.GridBagConstraints constraintsTxtBaseDate = new java.awt.GridBagConstraints(); ! constraintsTxtBaseDate.gridx = 1; constraintsTxtBaseDate.gridy = 2; constraintsTxtBaseDate.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; *************** *** 1315,1319 **** java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); ! constraintsTxtMultitude.gridx = 2; constraintsTxtMultitude.gridy = 2; constraintsTxtMultitude.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; --- 1315,1319 ---- java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); ! constraintsTxtMultitude.gridx = 1; constraintsTxtMultitude.gridy = 1; constraintsTxtMultitude.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; *************** *** 1332,1335 **** --- 1332,1336 ---- return ivjJPanel1; } + /** * Return the JSeparator11 property value. *************** *** 1539,1543 **** ivjLblTotal.setToolTipText("Total der Kostentreiber nach Menge"); ivjLblTotal.setText("Total:"); ! ivjLblTotal.setBounds(8, 66, 244, 14); ivjLblTotal.setForeground(java.awt.Color.red); // user code begin {1} --- 1540,1544 ---- ivjLblTotal.setToolTipText("Total der Kostentreiber nach Menge"); ivjLblTotal.setText("Total:"); ! ivjLblTotal.setBounds(8, 66, 308, 14); ivjLblTotal.setForeground(java.awt.Color.red); // user code begin {1} *************** *** 1553,1556 **** --- 1554,1558 ---- return ivjLblTotal; } + /** * Return the JLabel322 property value. *************** *** 1565,1569 **** ivjLblTotalFactCost.setToolTipText("Summe Sachkosten nach Menge"); ivjLblTotalFactCost.setText("Total Sachkosten:"); ! ivjLblTotalFactCost.setBounds(8, 12, 244, 14); // user code begin {1} ivjLblTotalFactCost.setToolTipText(getResourceString(ServiceDetailView.class, "LblTotalFactCost_toolTipText")); --- 1567,1571 ---- ivjLblTotalFactCost.setToolTipText("Summe Sachkosten nach Menge"); ivjLblTotalFactCost.setText("Total Sachkosten:"); ! ivjLblTotalFactCost.setBounds(8, 12, 308, 14); // user code begin {1} ivjLblTotalFactCost.setToolTipText(getResourceString(ServiceDetailView.class, "LblTotalFactCost_toolTipText")); *************** *** 1578,1581 **** --- 1580,1584 ---- return ivjLblTotalFactCost; } + /** * Return the LblSumOccurance property value. *************** *** 1614,1618 **** ivjLblTotalPersonalCost.setToolTipText("Summe des Personalaufwandes nach Menge"); ivjLblTotalPersonalCost.setText("Total Personalkosten:"); ! ivjLblTotalPersonalCost.setBounds(8, 39, 244, 14); // user code begin {1} ivjLblTotalPersonalCost.setToolTipText(getResourceString(ServiceDetailView.class, "LblTotalPersonalCost_toolTipText")); --- 1617,1621 ---- ivjLblTotalPersonalCost.setToolTipText("Summe des Personalaufwandes nach Menge"); ivjLblTotalPersonalCost.setText("Total Personalkosten:"); ! ivjLblTotalPersonalCost.setBounds(8, 39, 308, 14); // user code begin {1} ivjLblTotalPersonalCost.setToolTipText(getResourceString(ServiceDetailView.class, "LblTotalPersonalCost_toolTipText")); *************** *** 1627,1630 **** --- 1630,1634 ---- return ivjLblTotalPersonalCost; } + /** * Return the MniChangeDriver property value. *************** *** 1950,1954 **** constraintsCbxProjectPhase.weightx = 1.0; constraintsCbxProjectPhase.ipadx = 168; ! constraintsCbxProjectPhase.insets = new java.awt.Insets(2, 6, 2, 173); getPnlDetail().add(getCbxProjectPhase(), constraintsCbxProjectPhase); --- 1954,1958 ---- constraintsCbxProjectPhase.weightx = 1.0; constraintsCbxProjectPhase.ipadx = 168; ! constraintsCbxProjectPhase.insets = new java.awt.Insets(2, 6, 2, 30); getPnlDetail().add(getCbxProjectPhase(), constraintsCbxProjectPhase); *************** *** 1966,1970 **** constraintsCbxLifeCycle.weightx = 1.0; constraintsCbxLifeCycle.ipadx = 168; ! constraintsCbxLifeCycle.insets = new java.awt.Insets(3, 6, 4, 173); getPnlDetail().add(getCbxLifeCycle(), constraintsCbxLifeCycle); --- 1970,1974 ---- constraintsCbxLifeCycle.weightx = 1.0; constraintsCbxLifeCycle.ipadx = 168; ! constraintsCbxLifeCycle.insets = new java.awt.Insets(3, 6, 4, 30); getPnlDetail().add(getCbxLifeCycle(), constraintsCbxLifeCycle); *************** *** 1982,1986 **** constraintsCbxProcess.weightx = 1.0; constraintsCbxProcess.ipadx = 168; ! constraintsCbxProcess.insets = new java.awt.Insets(10, 6, 2, 173); getPnlDetail().add(getCbxProcess(), constraintsCbxProcess); --- 1986,1990 ---- constraintsCbxProcess.weightx = 1.0; constraintsCbxProcess.ipadx = 168; ! constraintsCbxProcess.insets = new java.awt.Insets(10, 6, 2, 30); getPnlDetail().add(getCbxProcess(), constraintsCbxProcess); *************** *** 2004,2007 **** --- 2008,2012 ---- return ivjPnlDetail; } + /** * Return the SimpleEditorPanel1 property value. *************** *** 2409,2413 **** ivjTxtSumTotal = new javax.swing.JTextField(); ivjTxtSumTotal.setName("TxtSumTotal"); ! ivjTxtSumTotal.setBounds(324, 61, 143, 20); ivjTxtSumTotal.setEditable(false); // user code begin {1} --- 2414,2418 ---- ivjTxtSumTotal = new javax.swing.JTextField(); ivjTxtSumTotal.setName("TxtSumTotal"); ! ivjTxtSumTotal.setBounds(324, 63, 143, 20); ivjTxtSumTotal.setEditable(false); // user code begin {1} *************** *** 2422,2425 **** --- 2427,2431 ---- return ivjTxtSumTotal; } + /** * Called whenever the part throws an exception. *************** *** 2464,2473 **** connPtoP57SetTarget(); connPtoP58SetTarget(); - connPtoP3SetTarget(); - connPtoP5SetTarget(); connPtoP7SetTarget(); connPtoP9SetTarget(); connPtoP4SetTarget(); } /** * Initialize the class. --- 2470,2478 ---- connPtoP57SetTarget(); connPtoP58SetTarget(); connPtoP7SetTarget(); connPtoP9SetTarget(); connPtoP4SetTarget(); } + /** * Initialize the class. *************** *** 2487,2491 **** } // user code begin {2} ! setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "CostDriver.png").getImage()); setTitle(getResourceString("FrmWindow_text")); //ReportTool.getTypeString(object.getClass())); /* --- 2492,2496 ---- } // user code begin {2} ! setIconImage((new javax.swing.ImageIcon(LauncherView.getInstance().getUtility().getImageURL(CostDriver.class))).getImage()); //setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "CostDriver.png").getImage()); setTitle(getResourceString("FrmWindow_text")); //ReportTool.getTypeString(object.getClass())); /* *************** *** 2496,2501 **** */ setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().setObjects(getObjects()); ! if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { getLblBaseDate().setVisible(false); --- 2501,2516 ---- */ setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostDriver.class)); getPnlStandardToolbar().setObjects(getObjects()); ! UserActionRights rights = getViewOptions().getViewManager().getRights(ProjectPhase.class); ! if (!rights.isSaveObjectAllowed()) { ! getLblPhase().setVisible(false); ! getCbxProjectPhase().setVisible(false); ! } ! rights = getViewOptions().getViewManager().getRights(LifeCycle.class); ! if (!rights.isSaveObjectAllowed()) { ! getLblCycle().setVisible(false); ! getCbxLifeCycle().setVisible(false); ! } if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { getLblBaseDate().setVisible(false); *************** *** 2508,2512 **** tm.addColumnEvaluated(getResourceString("TbcType_text"), Formatter.COST_TYPE, 40, null, evaluator); tm.addColumn(ch.softenvironment.client.ResourceManager.getResource(ServiceDetailView.class, "LblName_text", false), "name", 100);//$NON-NLS-1$ ! tm.addColumn(getResourceString("TbcCosttype_text"), "type", 100);//$NON-NLS-1$ // tm.addColumn("Rolle", "role", 100); // tm.addColumn("Aktivität", "activity", 100); --- 2523,2527 ---- tm.addColumnEvaluated(getResourceString("TbcType_text"), Formatter.COST_TYPE, 40, null, evaluator); tm.addColumn(ch.softenvironment.client.ResourceManager.getResource(ServiceDetailView.class, "LblName_text", false), "name", 100);//$NON-NLS-1$ ! tm.addColumn(getResourceString("TbcCosttype_text"), "cause", 100);//$NON-NLS-1$ // tm.addColumn("Rolle", "role", 100); // tm.addColumn("Aktivität", "activity", 100); *************** *** 2605,2608 **** --- 2620,2628 ---- */ protected void refreshCost() throws Throwable { + Currency currency = LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency(); + getCbxCurrencyFact().setSelectedItem(currency); + getCbxCurrencyPersonal().setSelectedItem(currency); + getCbxCurrencyTotal().setSelectedItem(currency); + double sums[] = org.tcotool.tools.Calculator.calc(getObject()); double total = sums[0] + sums[1]; *************** *** 2625,2630 **** */ protected void refreshOccurance() throws Throwable { - java.util.Iterator iterator = ((org.tcotool.model.CostDriver)getObject()).getOccurrance().iterator(); - ((DbTableModel)getTblOccurance().getModel()).setAll(((org.tcotool.model.CostDriver)getObject()).getOccurrance()); getTxtSumOccurance().setText("" + org.tcotool.tools.Calculator.calcOccuranceTotal(getObject())); --- 2645,2648 ---- Index: CostCauseDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CostCauseDetailView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CostCauseDetailView.java 13 Jan 2006 17:38:47 -0000 1.2 --- CostCauseDetailView.java 7 May 2006 14:17:08 -0000 1.3 *************** *** 755,758 **** --- 755,759 ---- setTitle(ModelUtility.getTypeString(CostCause.class)); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostCause.class)); getPnlStandardToolbar().setObjects(getObjects()); // user code end Index: NavigationView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/NavigationView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NavigationView.java 22 Dec 2005 12:27:15 -0000 1.6 --- NavigationView.java 7 May 2006 14:17:08 -0000 1.7 *************** *** 40,43 **** --- 40,45 ---- import ch.softenvironment.view.ToolBar; import ch.softenvironment.view.tree.*; + import ch.softenvironment.client.UserActionRights; + import ch.softenvironment.client.ViewManager; import ch.softenvironment.jomm.mvc.model.DbObject; import org.tcotool.model.*; *************** *** 145,155 **** // ModelUtility utility = (ModelUtility)((NavigationTreeModel)modelAdapter.getUtility(); Object node = getSelectedNode(); ! boolean selected = (node != null); ! boolean isPackage = selected && (node instanceof TcoPackage); ! boolean isService = selected && (node instanceof Service); ! getMnuFileNew().setEnabled(false); ! if (selected) { ! if (node instanceof TcoPackage) { getMnuFileNew().setEnabled(true); getMniGroup().setVisible(true); --- 147,171 ---- // ModelUtility utility = (ModelUtility)((NavigationTreeModel)modelAdapter.getUtility(); Object node = getSelectedNode(); ! if (node == null) { ! getMnuFileNew().setEnabled(false); ! getMniEditCopy().setEnabled(false); ! getMniEditChangeWindow().setEnabled(false); ! getMniEditRemove().setEnabled(false); ! getMniEditRename().setEnabled(false); ! ! getMniMove().setEnabled(false); ! getMniMorphToService().setEnabled(false); ! getMniImportConfiguration().setEnabled(false); ! getMniExportConfiguration().setEnabled(false); ! return; ! } else { ! boolean isPackage = node instanceof TcoPackage; ! boolean isService = node instanceof Service; ! UserActionRights rights = viewOptions.getViewManager().getRights(node.getClass()); ! ViewManager mgr = viewOptions.getViewManager(); ! ! getMnuFileNew().setEnabled(false); ! if (isPackage) { getMnuFileNew().setEnabled(true); getMniGroup().setVisible(true); *************** *** 158,168 **** getMniPersonalCost().setVisible(false); getMniFactCost().setVisible(false); ! } else if (node instanceof Service) { getMnuFileNew().setEnabled(true); getMniGroup().setVisible(false); getMniService().setVisible(false); getMniCostDriver().setVisible(true); getMniPersonalCost().setVisible(false); getMniFactCost().setVisible(false); } else if (node instanceof CostDriver) { getMnuFileNew().setEnabled(true); --- 174,189 ---- getMniPersonalCost().setVisible(false); getMniFactCost().setVisible(false); ! getMniService().setIcon(LauncherView.getInstance().getUtility().getIcon(Service.class, false)); ! getMniGroup().setEnabled(rights.isNewObjectAllowed()); ! getMniService().setEnabled((!node.equals(modelAdapter.getUtility().getRoot())) && mgr.getRights(Service.class).isNewObjectAllowed()); ! } else if (isService) { getMnuFileNew().setEnabled(true); getMniGroup().setVisible(false); getMniService().setVisible(false); getMniCostDriver().setVisible(true); + getMniCostDriver().setIcon(LauncherView.getInstance().getUtility().getIcon(CostDriver.class, false)); getMniPersonalCost().setVisible(false); getMniFactCost().setVisible(false); + getMniCostDriver().setEnabled(mgr.getRights(CostDriver.class).isNewObjectAllowed()); } else if (node instanceof CostDriver) { getMnuFileNew().setEnabled(true); *************** *** 171,199 **** getMniCostDriver().setVisible(false); getMniPersonalCost().setVisible(true); getMniFactCost().setVisible(true); } ! } ! getMniService().setEnabled(isPackage && (!node.equals(modelAdapter.getUtility().getRoot()))); ! ! // treat "Main-Menu" ! getMniEditCopy().setEnabled(selected && ! ((node instanceof Service) || (node instanceof CostDriver) || (node instanceof Cost))); ! getMniEditChangeWindow().setEnabled(selected); ! getMniEditRemove().setEnabled(selected && modelAdapter.getUtility().isNodeRemovable(node)); ! getMniEditRename().setEnabled(selected && modelAdapter.getUtility().isNodeEditable(node)); ! ! getMniMove().setEnabled(selected && modelAdapter.getUtility().isNodeMovable(node)); ! getMniMorphToService().setEnabled(isPackage && (!node.equals(modelAdapter.getUtility().getRoot()))); ! ! getMniImportConfiguration().setEnabled(isPackage); ! getMniExportConfiguration().setEnabled(isPackage && (!modelAdapter.getUtility().getRoot().equals(node))); ! ! adaptReports(getMnuReportTco().getMenuComponents(), isService, isPackage); ! adaptReports(getMnuReportFinance().getMenuComponents(), isService, isPackage); ! // getMniReportBlockTcoTotal().setEnabled(isPackage); ! // getMniReportBlockTcoDetailed().setEnabled(isService || isPackage); ! // getMniReportInvestment().setEnabled(isPackage); ! ! // LauncherView.getInstance().adaptSelection(node); } /** --- 192,222 ---- getMniCostDriver().setVisible(false); getMniPersonalCost().setVisible(true); + getMniPersonalCost().setIcon(LauncherView.getInstance().getUtility().getIcon(PersonalCost.class, false)); + getMniPersonalCost().setEnabled(mgr.getRights(PersonalCost.class).isNewObjectAllowed()); getMniFactCost().setVisible(true); + getMniFactCost().setIcon(LauncherView.getInstance().getUtility().getIcon(FactCost.class, false)); + getMniFactCost().setEnabled(mgr.getRights(FactCost.class).isNewObjectAllowed()); } ! ! // treat "Main-Menu" ! getMniEditCopy().setEnabled((isService || (node instanceof CostDriver) || (node instanceof Cost)) && rights.isSaveObjectAllowed()); ! getMniEditChangeWindow().setEnabled(rights.isChangeObjectAllowed()); ! getMniEditRemove().setEnabled(modelAdapter.getUtility().isNodeRemovable(node) && rights.isRemoveObjectsAllowed()); ! getMniEditRename().setEnabled(modelAdapter.getUtility().isNodeEditable(node) && rights.isSaveObjectAllowed()); ! ! getMniMove().setEnabled(modelAdapter.getUtility().isNodeMovable(node) && rights.isSaveObjectAllowed()); ! getMniMorphToService().setEnabled(isPackage && (!node.equals(modelAdapter.getUtility().getRoot())) && rights.isSaveObjectAllowed()); ! ! getMniImportConfiguration().setEnabled(isPackage && rights.isSaveObjectAllowed()); ! getMniExportConfiguration().setEnabled(isPackage && (!modelAdapter.getUtility().getRoot().equals(node)) && rights.isSaveObjectAllowed()); ! ! adaptReports(getMnuReportTco().getMenuComponents(), isService, isPackage); ! adaptReports(getMnuReportFinance().getMenuComponents(), isService, isPackage); ! // getMniReportBlockTcoTotal().setEnabled(isPackage); ! // getMniReportBlockTcoDetailed().setEnabled(isService || isPackage); ! // getMniReportInvestment().setEnabled(isPackage); ! ! // LauncherView.getInstance().adaptSelection(node); ! } } /** *************** *** 755,759 **** // user code begin {1} ivjMniCostDriver.setText(getResourceString(CostDriverDetailView.class, "FrmWindow_text") + "..."); - ivjMniCostDriver.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "CostDriver.png")); // user code end } catch (java.lang.Throwable ivjExc) { --- 778,781 ---- *************** *** 897,901 **** // user code begin {1} ivjMniFactCost.setText(getResourceString(FactCostDetailView.class, "FrmWindow_text")); - ivjMniFactCost.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "FactCost.png")); // user code end } catch (java.lang.Throwable ivjExc) { --- 919,922 ---- *************** *** 920,924 **** // user code begin {1} ivjMniGroup.setText(getResourceString(PackageDetailView.class, "FrmWindow_text") + "..."); ! ivjMniGroup.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "TcoPackage.png")); // user code end } catch (java.lang.Throwable ivjExc) { --- 941,945 ---- // user code begin {1} ivjMniGroup.setText(getResourceString(PackageDetailView.class, "FrmWindow_text") + "..."); ! ivjMniGroup.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "TcoPackage.png")); // special case in ModelUtility.getIcon() // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 1011,1015 **** // user code begin {1} ivjMniPersonalCost.setText(getResourceString(PersonalCostDetailView.class, "FrmWindow_text") + "..."); - ivjMniPersonalCost.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "PersonalCost.png")); // user code end } catch (java.lang.Throwable ivjExc) { --- 1032,1035 ---- *************** *** 1098,1102 **** // user code begin {1} ivjMniService.setText(getResourceString(ServiceDetailView.class, "FrmWindow_text") + "..."); - ivjMniService.setIcon(ResourceBundle.getImageIcon(ModelUtility.class, "Service.png")); // user code end } catch (java.lang.Throwable ivjExc) { --- 1118,1121 ---- *************** *** 1182,1185 **** --- 1201,1205 ---- ivjMnuReportFinance.setText("Finanzen"); // user code begin {1} + ivjMnuReportFinance.setText(getResourceString(LauncherView.class, "MnuReportFinance_text")); // user code end } catch (java.lang.Throwable ivjExc) { Index: ModelDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/ModelDetailView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ModelDetailView.java 13 Jan 2006 17:38:47 -0000 1.3 --- ModelDetailView.java 7 May 2006 14:17:08 -0000 1.4 *************** *** 16,19 **** --- 16,22 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + import org.tcotool.model.Catalogue; + import org.tcotool.model.TcoModel; + import ch.softenvironment.jomm.mvc.controller.*; /** *************** *** 1132,1135 **** --- 1135,1139 ---- setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(TcoModel.class)); getPnlStandardToolbar().setObjects(getObjects()); Index: CodeDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CodeDetailView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CodeDetailView.java 13 Jan 2006 17:38:47 -0000 1.5 --- CodeDetailView.java 7 May 2006 14:17:08 -0000 1.6 *************** *** 27,30 **** --- 27,31 ---- import org.tcotool.model.CostCause; import org.tcotool.model.CostCentre; + import org.tcotool.model.LifeCycle; import org.tcotool.model.ProjectPhase; import org.tcotool.model.Responsibility; *************** *** 37,41 **** import ch.ehi.basics.view.GenericFileFilter; import ch.softenvironment.client.ResourceManager; ! import ch.softenvironment.demoapp.model.Role; import ch.softenvironment.jomm.DbUserTransactionBlock; import ch.softenvironment.jomm.mvc.model.DbCode; --- 38,44 ---- import ch.ehi.basics.view.GenericFileFilter; import ch.softenvironment.client.ResourceManager; ! import ch.softenvironment.client.UserActionRights; ! ! import org.tcotool.model.Role; import ch.softenvironment.jomm.DbUserTransactionBlock; import ch.softenvironment.jomm.mvc.model.DbCode; *************** *** 991,996 **** // user code begin {2} setTitle(getResourceString("FrmWindow_text")); //TODO Patch: allow saving of DbChangeableCodeView changes ! getTlbToolbar().setTbbSaveEnabled(true); // user code end } --- 994,1005 ---- // user code begin {2} setTitle(getResourceString("FrmWindow_text")); + UserActionRights rights = getViewOptions().getViewManager().getRights(ProjectPhase.class); + if (!rights.isSaveObjectAllowed()) { + getLblPhase().setVisible(false); + getPnlPhase().setVisible(false); + } //TODO Patch: allow saving of DbChangeableCodeView changes ! rights = getViewOptions().getViewManager().getRights(TcoModel.class); ! getTlbToolbar().setTbbSaveEnabled(rights.isSaveObjectAllowed()); // user code end } *************** *** 1001,1016 **** } private void refreshCodes() throws Throwable { ! getPnlCategory().setCode(server, org.tcotool.model.ServiceCategory.class, ModelUtility.getTypeString(ServiceCategory.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text", false)*/, DbObject.PROPERTY_NAME, null); ! getPnlResponsibility().setCode(server, org.tcotool.model.Responsibility.class, ModelUtility.getTypeString(Responsibility.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblResponsibility_text", false)*/, DbObject.PROPERTY_NAME, null); ! getPnlCostCentre().setCode(server, org.tcotool.model.CostCentre.class, ModelUtility.getTypeString(CostCentre.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblCostCentre_text", false)*/, DbObject.PROPERTY_NAME, null); ! getPnlPhase().setCode(server, ProjectPhase.class, ModelUtility.getTypeString(ProjectPhase.class) /*ResourceManager.getResource(CostDriverDetailView.class, "LblPhase_text", false)*/, DbObject.PROPERTY_NAME, null); ! getPnlSite().setCode(server, Site.class, ModelUtility.getTypeString(Site.class) /*ResourceManager.getResource(CostDriverDetailView.class, "LblSite_text", false)*/, DbObject.PROPERTY_NAME, SiteDetailView.class); ! getPnlProcess().setCode(server, org.tcotool.model.Process.class, ResourceManager.getResource(CostDriverDetailView.class, "LblProcess_text", false), DbObject.PROPERTY_NAME, null); ! getPnlCostCause().setCode(server, org.tcotool.model.CostCause.class, ModelUtility.getTypeString(CostCause.class) /*ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", false)*/, DbObject.PROPERTY_NAME, CostCauseDetailView.class); ! getPnlCatalogue().setCode(server, org.tcotool.model.Catalogue.class, ModelUtility.getTypeString(Catalogue.class) /*ResourceManager.getResource(CatalogueDetailView.class, "FrmWindow_text", false)*/, DbObject.PROPERTY_NAME, CatalogueDetailView.class); ! getPnlRole().setCode(server, org.tcotool.model.Role.class, ModelUtility.getTypeString(Role.class) /*ResourceManager.getResource(RoleDetailView.class, "FrmWindow_text", false)*/, DbObject.PROPERTY_NAME, RoleDetailView.class); ! getPnlActivity().setCode(server, org.tcotool.model.Activity.class, ModelUtility.getTypeString(Activity.class) /*ResourceManager.getResource(PersonalCostDetailView.class, "LblActivity_text", false)*/, DbObject.PROPERTY_NAME, null); } /* (non-Javadoc) --- 1010,1025 ---- } private void refreshCodes() throws Throwable { ! getPnlCategory().setCode(server, org.tcotool.model.ServiceCategory.class, ModelUtility.getTypeString(ServiceCategory.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlResponsibility().setCode(server, org.tcotool.model.Responsibility.class, ModelUtility.getTypeString(Responsibility.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblResponsibility_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlCostCentre().setCode(server, org.tcotool.model.CostCentre.class, ModelUtility.getTypeString(CostCentre.class) /*ResourceManager.getResource(ServiceDetailView.class, "LblCostCentre_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlPhase().setCode(server, ProjectPhase.class, ModelUtility.getTypeString(ProjectPhase.class) /*ResourceManager.getResource(CostDriverDetailView.class, "LblPhase_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlSite().setCode(server, Site.class, ModelUtility.getTypeString(Site.class) /*ResourceManager.getResource(CostDriverDetailView.class, "LblSite_text", false)*/, DbObject.PROPERTY_NAME, SiteDetailView.class, getViewOptions()); ! getPnlProcess().setCode(server, org.tcotool.model.Process.class, ResourceManager.getResource(CostDriverDetailView.class, "LblProcess_text", false), DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlCostCause().setCode(server, org.tcotool.model.CostCause.class, ModelUtility.getTypeString(CostCause.class) /*ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", false)*/, DbObject.PROPERTY_NAME, CostCauseDetailView.class, getViewOptions()); ! getPnlCatalogue().setCode(server, org.tcotool.model.Catalogue.class, ModelUtility.getTypeString(Catalogue.class) /*ResourceManager.getResource(CatalogueDetailView.class, "FrmWindow_text", false)*/, DbObject.PROPERTY_NAME, CatalogueDetailView.class, getViewOptions()); ! getPnlRole().setCode(server, org.tcotool.model.Role.class, ModelUtility.getTypeString(Role.class) /*ResourceManager.getResource(RoleDetailView.class, "FrmWindow_text", false)*/, DbObject.PROPERTY_NAME, RoleDetailView.class, getViewOptions()); ! getPnlActivity().setCode(server, org.tcotool.model.Activity.class, ModelUtility.getTypeString(Activity.class) /*ResourceManager.getResource(PersonalCostDetailView.class, "LblActivity_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); } /* (non-Javadoc) Index: ApplicationOptions.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/ApplicationOptions.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ApplicationOptions.java 29 Aug 2005 09:40:49 -0000 1.1.1.1 --- ApplicationOptions.java 7 May 2006 14:17:08 -0000 1.2 *************** *** 1,6 **** package org.tcotool.application; - import java.awt.Color; - /* * This library is free software; you can redistribute it and/or --- 1,4 ---- *************** *** 19,22 **** --- 17,21 ---- */ + import java.awt.Color; /** * Keep Settings in a <user.home>/.tcoTool file. *************** *** 60,62 **** --- 59,68 ---- setProperty(CHART_RANGEGRIDLINE, (new Integer(color.getRGB())).toString()); } + /** + * Display mode. + * @return + */ + public boolean isModeAdvanced() { + return false; + } } Index: PackageDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/PackageDetailView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PackageDetailView.java 13 Jan 2006 17:38:47 -0000 1.3 --- PackageDetailView.java 7 May 2006 14:17:08 -0000 1.4 *************** *** 16,19 **** --- 16,22 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + import org.tcotool.model.Catalogue; + import org.tcotool.model.TcoPackage; + import ch.softenvironment.jomm.mvc.controller.*; /** *************** *** 920,923 **** --- 923,927 ---- setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(TcoPackage.class)); getPnlStandardToolbar().setObjects(getObjects()); Index: OccuranceDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/OccuranceDetailView.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OccuranceDetailView.java 29 Aug 2005 09:40:58 -0000 1.1.1.1 --- OccuranceDetailView.java 7 May 2006 14:17:08 -0000 1.2 *************** *** 17,20 **** --- 17,23 ---- import java.beans.PropertyChangeEvent; + import org.tcotool.model.Catalogue; + import org.tcotool.model.Occurance; + import ch.softenvironment.jomm.mvc.controller.*; import ch.softenvironment.view.DetailView; *************** *** 725,728 **** --- 728,732 ---- setTitle(getResourceString("FrmWindow_title")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(Occurance.class)); getPnlStandardToolbar().setObjects(getObjects()); // user code end Index: FactCostDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/FactCostDetailView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FactCostDetailView.java 13 Jan 2006 17:38:47 -0000 1.4 --- FactCostDetailView.java 7 May 2006 14:17:08 -0000 1.5 *************** *** 19,23 **** import ch.ehi.basics.i18n.ResourceBundle; - import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.*; import ch.softenvironment.jomm.mvc.controller.*; --- 19,22 ---- *************** *** 1535,1538 **** --- 1534,1538 ---- // user code begin {1} ivjLblCause.setText(ModelUtility.getTypeString(CostCause.class) + ":" /*ch.softenvironment.client.ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", true)*/); + ivjLblCause.setToolTipText(ch.softenvironment.client.ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_toolTipText")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 2308,2314 **** } // user code begin {2} ! setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "FactCost.png").getImage()); setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().setObjects(getObjects()); --- 2308,2315 ---- } // user code begin {2} ! setIconImage((new javax.swing.ImageIcon(LauncherView.getInstance().getUtility().getImageURL(FactCost.class))).getImage()); //setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "FactCost.png").getImage()); setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(FactCost.class)); getPnlStandardToolbar().setObjects(getObjects()); *************** *** 2445,2449 **** setObject((org.tcotool.model.FactCost)object); ! refreshTotal(); --- 2446,2458 ---- setObject((org.tcotool.model.FactCost)object); ! //TODO @deprecated properties => remove Tabbed Pane definitively ! if ((getObject().getPortsISL() == null) && ! (getObject().getPortsServer() == null) && ! (getObject().getPortsUseable() == null) && ! (getObject().getSerialNumber() == null)) { ! // only show if data available from older configurations ! ivjJTabbedPane1.remove(1); ! } ! refreshTotal(); Index: PersonalCostDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/PersonalCostDetailView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PersonalCostDetailView.java 13 Jan 2006 17:38:47 -0000 1.4 --- PersonalCostDetailView.java 7 May 2006 14:17:08 -0000 1.5 *************** *** 1,23 **** package org.tcotool.application; - /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ import java.awt.Color; import java.beans.PropertyChangeEvent; import ch.ehi.basics.i18n.ResourceBundle; import ch.softenvironment.jomm.*; import ch.softenvironment.jomm.mvc.controller.*; --- 1,9 ---- package org.tcotool.application; import java.awt.Color; import java.beans.PropertyChangeEvent; import ch.ehi.basics.i18n.ResourceBundle; + import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.*; import ch.softenvironment.jomm.mvc.controller.*; *************** *** 91,94 **** --- 77,81 ---- private javax.swing.JLabel ivjLblHoursUnit = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtAvailableHours = null; + private javax.swing.JLabel ivjLblCause = null; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { *************** *** 186,190 **** }; }; - private javax.swing.JLabel ivjLblCause = null; /** * Constructor --- 173,176 ---- *************** *** 1135,1139 **** ivjCbxActivity = new javax.swing.JComboBox(); ivjCbxActivity.setName("CbxActivity"); ! ivjCbxActivity.setBounds(166, 34, 167, 23); // user code begin {1} // user code end --- 1121,1125 ---- ivjCbxActivity = new javax.swing.JComboBox(); ivjCbxActivity.setName("CbxActivity"); ! ivjCbxActivity.setBounds(166, 34, 398, 23); // user code begin {1} // user code end *************** *** 1156,1160 **** ivjCbxCostType = new javax.swing.JComboBox(); ivjCbxCostType.setName("CbxCostType"); ! ivjCbxCostType.setBounds(166, 6, 260, 23); // user code begin {1} // user code end --- 1142,1146 ---- ivjCbxCostType = new javax.swing.JComboBox(); ivjCbxCostType.setName("CbxCostType"); ! ivjCbxCostType.setBounds(166, 6, 398, 23); // user code begin {1} // user code end *************** *** 1243,1247 **** ivjCbxRole = new javax.swing.JComboBox(); ivjCbxRole.setName("CbxRole"); ! ivjCbxRole.setBounds(159, 23, 205, 23); // user code begin {1} // user code end --- 1229,1233 ---- ivjCbxRole = new javax.swing.JComboBox(); ivjCbxRole.setName("CbxRole"); ! ivjCbxRole.setBounds(159, 23, 394, 23); // user code begin {1} // user code end *************** *** 1290,1294 **** ivjChxInternal.setToolTipText("sonst externe MitarbeiterIn"); ivjChxInternal.setText("MitarbeiterIn intern"); ! ivjChxInternal.setBounds(385, 23, 137, 22); // user code begin {1} ivjChxInternal.setToolTipText(getResourceString("ChxInternal_toolTipText")); --- 1276,1280 ---- ivjChxInternal.setToolTipText("sonst externe MitarbeiterIn"); ivjChxInternal.setText("MitarbeiterIn intern"); ! ivjChxInternal.setBounds(385, 51, 137, 22); // user code begin {1} ivjChxInternal.setToolTipText(getResourceString("ChxInternal_toolTipText")); *************** *** 1474,1478 **** ivjLblAvailableHoursUnit.setName("LblAvailableHoursUnit"); ivjLblAvailableHoursUnit.setText("h"); ! ivjLblAvailableHoursUnit.setBounds(244, 83, 19, 14); // user code begin {1} // user code end --- 1460,1464 ---- ivjLblAvailableHoursUnit.setName("LblAvailableHoursUnit"); ivjLblAvailableHoursUnit.setText("h"); ! ivjLblAvailableHoursUnit.setBounds(339, 82, 19, 14); // user code begin {1} // user code end *************** *** 1522,1525 **** --- 1508,1512 ---- // user code begin {1} ivjLblCause.setText(ModelUtility.getTypeString(CostCause.class) + ":" /*ch.softenvironment.client.ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", true)*/); + ivjLblCause.setToolTipText(ch.softenvironment.client.ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_toolTipText")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 1845,1849 **** ivjTxtAvailableHours = new ch.softenvironment.view.swingext.NumberTextField(); ivjTxtAvailableHours.setName("TxtAvailableHours"); ! ivjTxtAvailableHours.setBounds(159, 79, 73, 20); ivjTxtAvailableHours.setEditable(false); ivjTxtAvailableHours.setEnabled(true); --- 1832,1836 ---- ivjTxtAvailableHours = new ch.softenvironment.view.swingext.NumberTextField(); ivjTxtAvailableHours.setName("TxtAvailableHours"); ! ivjTxtAvailableHours.setBounds(159, 79, 170, 20); ivjTxtAvailableHours.setEditable(false); ivjTxtAvailableHours.setEnabled(true); *************** *** 1998,2002 **** ivjTxtName = new javax.swing.JTextField(); ivjTxtName.setName("TxtName"); ! ivjTxtName.setBounds(180, 12, 328, 20); // user code begin {1} // user code end --- 1985,1989 ---- ivjTxtName = new javax.swing.JTextField(); ivjTxtName.setName("TxtName"); ! ivjTxtName.setBounds(180, 12, 397, 20); // user code begin {1} // user code end *************** *** 2078,2084 **** } // user code begin {2} ! setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "PersonalCost.png").getImage()); setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().setObjects(getObjects()); --- 2065,2072 ---- } // user code begin {2} ! setIconImage((new javax.swing.ImageIcon(LauncherView.getInstance().getUtility().getImageURL(PersonalCost.class))).getImage()); //setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "PersonalCost.png").getImage()); setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(PersonalCost.class)); getPnlStandardToolbar().setObjects(getObjects()); *************** *** 2119,2122 **** --- 2107,2111 ---- */ private void refreshCosts() { + getPnlStatusBar().setStatus(null); if (getObject().getRole() == null) { getTxtHourlyRate().setEditable(true); *************** *** 2143,2147 **** getTxtCost().setEditable(false); double availableHours = Calculator.calcFreeHours(getObject().getRole()); ! getTxtAvailableHours().setText(AmountFormat.toString(availableHours)); if (availableHours < 0.0) { getTxtAvailableHours().setBackground(Color.RED); --- 2132,2136 ---- getTxtCost().setEditable(false); double availableHours = Calculator.calcFreeHours(getObject().getRole()); ! getTxtAvailableHours().setText(AmountFormat.toString(availableHours) + " / " + AmountFormat.toString(Calculator.calcAvailableHours(getObject().getRole()))); if (availableHours < 0.0) { getTxtAvailableHours().setBackground(Color.RED); *************** *** 2150,2154 **** } ! ModelUtility.updateRole(getObject()); } --- 2139,2145 ---- } ! if (ModelUtility.updateRole(getObject())) { ! getPnlStatusBar().setStatus("FTE-" + ResourceManager.getResource(RoleDetailView.class, "LblYearlyHours_text", false) + "=" + getObject().getRole().getYearlyHours() + " [" + getLblHoursUnit().getText() + "]"); ! } } Index: ServiceDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/ServiceDetailView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ServiceDetailView.java 13 Jan 2006 17:38:47 -0000 1.3 --- ServiceDetailView.java 7 May 2006 14:17:08 -0000 1.4 *************** *** 1110,1114 **** ivjCbxCategory = new javax.swing.JComboBox(); ivjCbxCategory.setName("CbxCategory"); ! ivjCbxCategory.setBounds(155, 10, 393, 23); // user code begin {1} // user code end --- 1110,1114 ---- ivjCbxCategory = new javax.swing.JComboBox(); ivjCbxCategory.setName("CbxCategory"); ! ivjCbxCategory.setBounds(155, 10, 471, 23); // user code begin {1} // user code end *************** *** 1121,1124 **** --- 1121,1125 ---- return ivjCbxCategory; } + /** * Return the CbxCostCentre property value. *************** *** 1131,1135 **** ivjCbxCostCentre = new javax.swing.JComboBox(); ivjCbxCostCentre.setName("CbxCostCentre"); ! ivjCbxCostCentre.setBounds(155, 59, 393, 23); // user code begin {1} // user code end --- 1132,1136 ---- ivjCbxCostCentre = new javax.swing.JComboBox(); ivjCbxCostCentre.setName("CbxCostCentre"); ! ivjCbxCostCentre.setBounds(155, 59, 471, 23); // user code begin {1} // user code end *************** *** 1142,1145 **** --- 1143,1147 ---- return ivjCbxCostCentre; } + /** * Return the CbxCurrencyDependency property value. *************** *** 1262,1266 **** ivjCbxResponsibility = new javax.swing.JComboBox(); ivjCbxResponsibility.setName("CbxResponsibility"); ! ivjCbxResponsibility.setBounds(155, 34, 393, 23); // user code begin {1} // user code end --- 1264,1268 ---- ivjCbxResponsibility = new javax.swing.JComboBox(); ivjCbxResponsibility.setName("CbxResponsibility"); ! ivjCbxResponsibility.setBounds(155, 34, 471, 23); // user code begin {1} // user code end *************** *** 1273,1276 **** --- 1275,1279 ---- return ivjCbxResponsibility; } + /** * Return the ConsistencyController property value. *************** *** 1296,1300 **** java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 55; --- 1299,1303 ---- java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 0; constraintsLblName.gridy = 0; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 55; *************** *** 1303,1316 **** java.awt.GridBagConstraints constraintsTxtName = new java.awt.GridBagConstraints(); ! constraintsTxtName.gridx = 2; constraintsTxtName.gridy = 1; constraintsTxtName.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsTxtName.weightx = 1.0; constraintsTxtName.ipadx = 422; ! constraintsTxtName.insets = new java.awt.Insets(13, 10, 2, 85); getJPanel1().add(getTxtName(), constraintsTxtName); java.awt.GridBagConstraints constraintsTbpMain = new java.awt.GridBagConstraints(); ! constraintsTbpMain.gridx = 1; constraintsTbpMain.gridy = 4; constraintsTbpMain.gridwidth = 2; constraintsTbpMain.fill = java.awt.GridBagConstraints.BOTH; --- 1306,1319 ---- java.awt.GridBagConstraints constraintsTxtName = new java.awt.GridBagConstraints(); ! constraintsTxtName.gridx = 1; constraintsTxtName.gridy = 0; constraintsTxtName.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsTxtName.weightx = 1.0; constraintsTxtName.ipadx = 422; ! constraintsTxtName.insets = new java.awt.Insets(13, 10, 2, 30); getJPanel1().add(getTxtName(), constraintsTxtName); java.awt.GridBagConstraints constraintsTbpMain = new java.awt.GridBagConstraints(); ! constraintsTbpMain.gridx = 0; constraintsTbpMain.gridy = 3; constraintsTbpMain.gridwidth = 2; constraintsTbpMain.fill = java.awt.GridBagConstraints.BOTH; *************** *** 1324,1328 **** java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 1; constraintsLblMultitude.gridy = 2; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 90; --- 1327,1331 ---- java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 0; constraintsLblMultitude.gridy = 1; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 90; *************** *** 1331,1335 **** java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); ! constraintsLblBaseDate.gridx = 1; constraintsLblBaseDate.gridy = 3; constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblBaseDate.ipadx = 50; --- 1334,1338 ---- java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); ! constraintsLblBaseDate.gridx = 0; constraintsLblBaseDate.gridy = 2; constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblBaseDate.ipadx = 50; *************** *** 1338,1342 **** java.awt.GridBagConstraints constraintsTxtBaseDate = new java.awt.GridBagConstraints(); ! constraintsTxtBaseDate.gridx = 2; constraintsTxtBaseDate.gridy = 3; constraintsTxtBaseDate.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; --- 1341,1345 ---- java.awt.GridBagConstraints constraintsTxtBaseDate = new java.awt.GridBagConstraints(); ! constraintsTxtBaseDate.gridx = 1; constraintsTxtBaseDate.gridy = 2; constraintsTxtBaseDate.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; *************** *** 1347,1351 **** java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); ! constraintsTxtMultitude.gridx = 2; constraintsTxtMultitude.gridy = 2; constraintsTxtMultitude.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; --- 1350,1354 ---- java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); ! constraintsTxtMultitude.gridx = 1; constraintsTxtMultitude.gridy = 1; constraintsTxtMultitude.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsTxtMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; *************** *** 1364,1367 **** --- 1367,1371 ---- return ivjJPanel1; } + /** * Return the JSeparator1 property value. *************** *** 1578,1582 **** ivjLblTotalFactCost.setToolTipText("Summe der Sachkosten nach Menge"); ivjLblTotalFactCost.setText("Total Sachkosten:"); ! ivjLblTotalFactCost.setBounds(7, 11, 288, 14); // user code begin {1} ivjLblTotalFactCost.setText(getResourceString("LblTotalFactCost_text")); --- 1582,1586 ---- ivjLblTotalFactCost.setToolTipText("Summe der Sachkosten nach Menge"); ivjLblTotalFactCost.setText("Total Sachkosten:"); ! ivjLblTotalFactCost.setBounds(7, 11, 309, 14); // user code begin {1} ivjLblTotalFactCost.setText(getResourceString("LblTotalFactCost_text")); *************** *** 1591,1594 **** --- 1595,1599 ---- return ivjLblTotalFactCost; } + /** * Return the JLabel311 property value. *************** *** 1603,1607 **** ivjLblTotalPersonalCost.setToolTipText("Summe des Personalaufwandes nach Menge"); ivjLblTotalPersonalCost.setText("Total Personalkosten:"); ! ivjLblTotalPersonalCost.setBounds(7, 33, 288, 14); // user code begin {1} ivjLblTotalPersonalCost.setToolTipText(getResourceString("LblTotalPersonalCost_toolTipText")); --- 1608,1612 ---- ivjLblTotalPersonalCost.setToolTipText("Summe des Personalaufwandes nach Menge"); ivjLblTotalPersonalCost.setText("Total Personalkosten:"); ! ivjLblTotalPersonalCost.setBounds(7, 33, 309, 14); // user code begin {1} ivjLblTotalPersonalCost.setToolTipText(getResourceString("LblTotalPersonalCost_toolTipText")); *************** *** 1616,1619 **** --- 1621,1625 ---- return ivjLblTotalPersonalCost; } + /** * Return the JLabel31 property value. *************** *** 1628,1632 **** ivjLblTotalWithDependencyCost.setToolTipText("Summe (lokal) + Dienstabhängigkeitseinfluss"); ivjLblTotalWithDependencyCost.setText("Total (mit Abhängigkeiten):"); ! ivjLblTotalWithDependencyCost.setBounds(8, 40, 298, 14); ivjLblTotalWithDependencyCost.setForeground(java.awt.Color.red); // user code begin {1} --- 1634,1638 ---- ivjLblTotalWithDependencyCost.setToolTipText("Summe (lokal) + Dienstabhängigkeitseinfluss"); ivjLblTotalWithDependencyCost.setText("Total (mit Abhängigkeiten):"); ! ivjLblTotalWithDependencyCost.setBounds(8, 40, 320, 14); ivjLblTotalWithDependencyCost.setForeground(java.awt.Color.red); // user code begin {1} *************** *** 1642,1645 **** --- 1648,1652 ---- return ivjLblTotalWithDependencyCost; } + /** * Return the JLabel3 property value. *************** *** 1654,1658 **** ivjLblTotalWithoutDependencyCost.setToolTipText("Total der Kostentreiber nach Menge ohne Abhängig"); ivjLblTotalWithoutDependencyCost.setText("Total (ohne Abhängigkeiten):"); ! ivjLblTotalWithoutDependencyCost.setBounds(8, 16, 298, 14); ivjLblTotalWithoutDependencyCost.setForeground(java.awt.Color.red); // user code begin {1} --- 1661,1665 ---- ivjLblTotalWithoutDependencyCost.setToolTipText("Total der Kostentreiber nach Menge ohne Abhängig"); ivjLblTotalWithoutDependencyCost.setText("Total (ohne Abhängigkeiten):"); ! ivjLblTotalWithoutDependencyCost.setBounds(8, 16, 320, 14); ivjLblTotalWithoutDependencyCost.setForeground(java.awt.Color.red); // user code begin {1} *************** *** 1668,1671 **** --- 1675,1679 ---- return ivjLblTotalWithoutDependencyCost; } + /** * Return the MniOpen property value. *************** *** 2476,2484 **** connPtoP2SetTarget(); connPtoP7SetTarget(); - connPtoP8SetTarget(); - connPtoP10SetTarget(); - connPtoP11SetTarget(); connPtoP3SetTarget(); - connPtoP12SetTarget(); connPtoP13SetTarget(); connPtoP14SetTarget(); --- 2484,2488 ---- *************** *** 2486,2489 **** --- 2490,2494 ---- connPtoP4SetTarget(); } + /** * Initialize the class. *************** *** 2505,2511 **** } // user code begin {2} ! setIconImage(ResourceBundle.getImageIcon(ModelUtility.class, "Service.png").getImage()); setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().setObjects(getObjects()); --- 2510,2517 ---- } // user code begin {2} ! setIconImage((new javax.swing.ImageIcon(LauncherView.getInstance().getUtility().getImageURL(Service.class))).getImage()); //ResourceBundle.getImageIcon(ModelUtility.class, "Service.png").getImage() setTitle(getResourceString("FrmWindow_text")); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); + getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(Service.class)); getPnlStandardToolbar().setObjects(getObjects()); *************** *** 2609,2612 **** --- 2615,2625 ---- */ protected void refreshCosts() throws Throwable { + Currency currency = LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency(); + getCbxCurrencyAll().setSelectedItem(currency); + getCbxCurrencyDependency().setSelectedItem(currency); + getCbxCurrencyFact().setSelectedItem(currency); + getCbxCurrencyLocal().setSelectedItem(currency); + getCbxCurrencyResources().setSelectedItem(currency); + refreshDr... [truncated message content] |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:32:44
|
Update of /cvsroot/tcotool/TCO-Tool/test/org/tcotool/standard/report/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6652/test/org/tcotool/standard/report/test Modified Files: ReportToolTestCase.java Log Message: TestCases enhanced Index: ReportToolTestCase.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/test/org/tcotool/standard/report/test/ReportToolTestCase.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReportToolTestCase.java 29 Aug 2005 09:41:17 -0000 1.1.1.1 --- ReportToolTestCase.java 7 May 2006 14:59:35 -0000 1.2 *************** *** 17,22 **** - import org.tcotool.standard.report.ReportTool; - import junit.framework.TestCase; --- 17,20 ---- *************** *** 25,32 **** * @author Peter Hirzel <i>soft</i>Environment * @version $Revision$ $Date$ */ public class ReportToolTestCase extends TestCase { public void testPercentage() { ! assertTrue(ReportTool.fix1(12.43).equals(new Double(12.4))); } } --- 23,34 ---- * @author Peter Hirzel <i>soft</i>Environment * @version $Revision$ $Date$ + * @deprecated */ public class ReportToolTestCase extends TestCase { + /** + * @deprecated + */ public void testPercentage() { ! //assertTrue(ReportTool.fix1(12.43).equals(new Double(12.4))); } } |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:16:17
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29450/src/org/tcotool/standard/report Modified Files: ReportTool.java Log Message: Refactoring: for easier usage Index: ReportTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReportTool.java 18 Mar 2006 17:12:56 -0000 1.5 --- ReportTool.java 7 May 2006 14:41:16 -0000 1.6 *************** *** 357,368 **** /** * Return the TcoObject typical Icon as HTML image-Tag. ! * @see ModelUtility#getIcon(Object, boolean) */ public static String getTcoObjectImage(Class tcoObject) { ! String file = StringUtils.getPureClassName(tcoObject) + ".png"; ! if (tcoObject.equals(TcoModel.class)) { ! file = StringUtils.getPureClassName(TcoPackage.class) + ".png"; } ! return "<img src='" + ch.ehi.basics.i18n.ResourceBundle.getURL(ModelUtility.class, file) +"' border='0' alt='" + ModelUtility.getTypeString(tcoObject) + ":'>"; } /** --- 357,368 ---- /** * Return the TcoObject typical Icon as HTML image-Tag. ! * @see ModelUtility#getImageURL() */ public static String getTcoObjectImage(Class tcoObject) { ! URL url = LauncherView.getInstance().getUtility().getImageURL(tcoObject); ! if (tcoObject.equals(TcoPackage.class) || tcoObject.equals(TcoModel.class)) { ! url = ch.ehi.basics.i18n.ResourceBundle.getURL(ModelUtility.class, StringUtils.getPureClassName(TcoPackage.class) + ".png"); } ! return "<img src='" + url +"' border='0' alt='" + ModelUtility.getTypeString(tcoObject) + ":'>"; } /** |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:16:17
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29450/src/org/tcotool/tools Modified Files: CodeRefBuilder.java Calculator.java Log Message: Refactoring: for easier usage Index: CodeRefBuilder.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/CodeRefBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeRefBuilder.java 25 Nov 2005 18:08:52 -0000 1.1 --- CodeRefBuilder.java 7 May 2006 14:41:16 -0000 1.2 *************** *** 73,77 **** public void treatFactCost(FactCost cost) { if (code.equals(cost.getCatalogue()) ! || code.equals(cost.getType())) { hits.add(cost); } --- 73,77 ---- public void treatFactCost(FactCost cost) { if (code.equals(cost.getCatalogue()) ! || code.equals(cost.getCause())) { hits.add(cost); } *************** *** 81,85 **** if (code.equals(cost.getRole()) || code.equals(cost.getActivity()) ! || code.equals(cost.getType())) { hits.add(cost); } --- 81,85 ---- if (code.equals(cost.getRole()) || code.equals(cost.getActivity()) ! || code.equals(cost.getCause())) { hits.add(cost); } Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Calculator.java 28 Dec 2005 11:54:19 -0000 1.3 --- Calculator.java 7 May 2006 14:41:16 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + import java.util.ArrayList; import java.util.HashMap; *************** *** 25,29 **** --- 26,33 ---- import org.tcotool.standard.report.ReportTool; + import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; + import ch.softenvironment.util.AmountFormat; + import ch.softenvironment.util.DeveloperException; import ch.softenvironment.util.Tracer; import ch.softenvironment.util.UserException; *************** *** 44,48 **** public static final String FACT_TCO = "FCTCO_"; public static final String PERSONAL_TCO = "PCTCO_"; - public static final String DEPRECIATION_COSTS = "ACC_"; // undefined Codes --- 48,51 ---- *************** *** 68,74 **** private Map costs = new HashMap(); // map to keep costs per service public static final int INDEX_TOTAL = 0; // overall cost (independent of TCO/Depreciation-years) ! private ModelUtility utility = null; ! private TcoObject rootObject = null; private long maxDuration = 12; // in month /** --- 71,79 ---- private Map costs = new HashMap(); // map to keep costs per service public static final int INDEX_TOTAL = 0; // overall cost (independent of TCO/Depreciation-years) ! protected ModelUtility utility = null; ! protected TcoObject rootObject = null; private long maxDuration = 12; // in month + + private DbCodeType maskCode = null; // if set only TcoObject's containing this code are to be considered in calculation /** *************** *** 149,152 **** --- 154,166 ---- } /** + * FTE/YearlyHours. + * Calculates a rounded(2) value! + * @param role + * @return + */ + public static double calcHourlyRate(Role role) { + return AmountFormat.round(role.getFullTimeEquivalent().doubleValue() / role.getYearlyHours().doubleValue()); + } + /** * Calculate open hours for given role, by means * non-assigned availability of a Role. *************** *** 162,168 **** --- 176,184 ---- PersonalCost cost = (PersonalCost)hits.next(); if (cost.getHours() != null) { + // concrete hours booked double hours = cost.getHours().doubleValue(); sum = sum - hours * LauncherView.getInstance().getUtility().getMultitudeFactor(cost, true); } else { + //FTE => Man-year sum = sum - role.getYearlyHours().doubleValue() * LauncherView.getInstance().getUtility().getMultitudeFactor(cost, true); } *************** *** 283,294 **** } /** ! * Create calculator for a given time period. ! * @param maxDuration in months to calculate costs for */ public Calculator(ModelUtility utility, TcoObject rootObject, long maxDurationMonths) { super(); this.utility = utility; this.maxDuration = maxDurationMonths; this.rootObject = rootObject; walkPackage(rootObject, (long)1); --- 299,328 ---- } /** ! * @see #Calculator(ModelUtility, TcoObject, long, ServiceCategory, Responsibility) */ public Calculator(ModelUtility utility, TcoObject rootObject, long maxDurationMonths) { + this(utility, rootObject, maxDurationMonths, null); + } + /** + * Create calculator for a given time period. + * + * A filter (maskCode) might be set to only calculate TcoObject's + * (Service, CostDriver, Cost) where exactly this filter-maskCode is attached, + * for e.g. if maskCode is a ServiceCatgery-code ("Development"), + * then only Service's attaching this very code are included. + * @see #calc(Service, double) + + * @param utility + * @param rootObject (where to start calculation hierarchically + * @param maxDuration in months to calculate costs for (either Usage- or Depreciation-Duration) + * @param maskCode (only calc TcoObject's where given maskCode is contained in hierarchy (for e.g. service.getCategory()==maskCode) + * @param responsibility (optionally calculate only services of this Responsibility; null for all) + */ + public Calculator(ModelUtility utility, TcoObject rootObject, long maxDurationMonths, DbCodeType maskCode) { super(); this.utility = utility; this.maxDuration = maxDurationMonths; this.rootObject = rootObject; + this.maskCode = maskCode; walkPackage(rootObject, (long)1); *************** *** 297,302 **** * Calculate the costs for all services managed by given object. * Recursive Algorithm. ! * @param object ! * @param multitude */ private void walkPackage(TcoObject object, long multitude) { --- 331,336 ---- * Calculate the costs for all services managed by given object. * Recursive Algorithm. ! * @param object (TcoPackage or Service) ! * @param multitude (of owner of given object) */ private void walkPackage(TcoObject object, long multitude) { *************** *** 317,321 **** } else if (object instanceof Service) { calc((Service)object, multitude); ! } } /** --- 351,357 ---- } else if (object instanceof Service) { calc((Service)object, multitude); ! } else { ! throw new DeveloperException(this, "walkPackage()", "TcoObject kind not implemented!"); ! } } /** *************** *** 325,328 **** --- 361,365 ---- */ private void calc(Service service, double groupFactor) { + // only calc if service-code not given or equal to given one double serviceFactor = ModelUtility.getMultitudeFactor(service); *************** *** 336,348 **** while (costs.hasNext()) { Cost cost = (Cost)costs.next(); ! if (cost.getAmount() == null) { ! Tracer.getInstance().developerWarning(this,"calc(Service)", "Autocorrection: cost#amount set to 0.0"); ! cost.setAmount(new Double(0.0)); ! } ! double costFactor = groupFactor * serviceFactor * driverFactor * ModelUtility.getMultitudeFactor(cost); ! // 1) Financial accounting purpose ! calcDepreciation(service, driver, cost, costFactor); ! // 2) TCO Costs purpose ! calcTco(service, driver, cost, costFactor); } } --- 373,398 ---- while (costs.hasNext()) { Cost cost = (Cost)costs.next(); ! if ((maskCode != null) && ! !(maskCode.equals(service.getCategory()) || ! maskCode.equals(service.getResponsibility()) || ! maskCode.equals(service.getCostCentre()) || ! maskCode.equals(driver.getCycle()) || ! maskCode.equals(driver.getPhase()) || ! maskCode.equals(driver.getProcess()) || ! maskCode.equals(cost.getCause()) || ! ((cost instanceof PersonalCost) && (maskCode.equals(((PersonalCost)cost).getRole()) || maskCode.equals(((PersonalCost)cost).getActivity()))))) { ! // exclude TcoObject's not attached to this filter from calculation ! continue; ! } else { ! if (cost.getAmount() == null) { ! Tracer.getInstance().developerWarning(this,"calc(Service)", "Autocorrection: cost#amount set to 0.0"); ! cost.setAmount(new Double(0.0)); ! } ! double costFactor = groupFactor * serviceFactor * driverFactor * ModelUtility.getMultitudeFactor(cost); ! // 1) Financial accounting purpose ! calcFinances(service, driver, cost, costFactor); ! // 2) TCO Costs purpose ! calcTco(service, driver, cost, costFactor); ! } } } *************** *** 421,509 **** } /** ! * Cummulate the Depreciation-Costs for given cost. ! * ! * @param cost FactCost's only * @param factor (including the given Cost's factor) */ ! private double calcDepreciation(Service service, CostDriver driver, Cost cost, double factor) { ! if (cost instanceof FactCost) { ! FactCost fCost = (FactCost)cost; ! if ((fCost.getDepreciationDuration() != null) && (fCost.getDepreciationDuration().longValue() > 0)) { ! // [0] total FactCost independent of depreciation & interest ! double capital = fCost.getAmount().doubleValue() * factor; ! cummulateCodes(service, driver, cost, DEPRECIATION_COSTS, INDEX_TOTAL, capital); ! ! // [1..fCost.depreciationYears] of first period of FactCost's depreciationDuration ! boolean repeatable = (cost.getRepeatable() != null) && cost.getRepeatable().booleanValue(); ! int year = calcDepreciationPeriod(service, driver, cost, capital, repeatable, fCost.getDepreciationDuration(), INDEX_TOTAL); ! ! // [after fCost.depreciationYears years] repeatable periods ! if (repeatable && (year < getDurationYears())) { ! // repeat the costs until maxDuration ! while (year<getDurationYears()) { ! year = calcDepreciationPeriod(service, driver, cost, capital, true, fCost.getDepreciationDuration(), year); ! } ! } ! } ! } ! ! return cost.getAmount().doubleValue(); ! } ! /** ! * Calc the depreciation over a whole Duration Period of FactCost. ! * @param costCapital ! * @param costDuration ! * @return year of last Cost-entry ! */ ! private int calcDepreciationPeriod(Service service, CostDriver driver, Cost cost, double costCapital, boolean repeatable, Long costDuration, int yearIndex) { ! long completeYears = costDuration.longValue() / 12; ! double duration = costDuration.doubleValue(); ! int year = 0; ! ! if (duration <= 12.0) { ! // add simply the interest of last year ! double yearlyCapital = 0.0; ! if (repeatable) { ! // reinvest capital ! yearlyCapital = costCapital; ! } ! // pluy interest year before which was the same capital ! yearlyCapital += calcInterest(costCapital); ! cummulateCodes(service, driver, cost, DEPRECIATION_COSTS, year + yearIndex + 1, yearlyCapital); ! year++; ! return year + yearIndex; ! } ! ! double capitalYearBefore = costCapital; ! for (; year<completeYears; year++) { ! // depreciation over full year ! double yearlyCapital = costCapital / duration * (duration - ((year + 1.0) * 12.0)); ! // add interest from last Year ! yearlyCapital += calcInterest(capitalYearBefore); ! cummulateCodes(service, driver, cost, DEPRECIATION_COSTS, year + yearIndex + 1, yearlyCapital); ! capitalYearBefore = yearlyCapital; ! } ! long partialMonthInYear = costDuration.longValue() % 12; ! if (partialMonthInYear > 0) { ! // depreciation over fraction part of year should be 0 ! double yearlyCapital = costCapital / duration * (duration - ((year + 1.0) * 12.0) + (double)partialMonthInYear); ! //costCapital / duration * (double)partialMonthInYear; ! // add interest from last Year ! yearlyCapital += calcInterest(capitalYearBefore); ! cummulateCodes(service, driver, cost, DEPRECIATION_COSTS, year + yearIndex + 1, yearlyCapital); ! capitalYearBefore = yearlyCapital; ! year++; ! } ! return year + yearIndex; ! } ! /** ! * Calc interest for given Capital according to the following formula: ! * Interest-Amount = (Capital * InterestRate * Time)/100 ! * where: Time=1 Year ! * @param capital ! * @return interest of capital for a year ! */ ! private double calcInterest(double capital) { ! return capital * utility.getInterestRate() / 100.0; } private Map getServiceMap(Map map, Service key) { --- 471,483 ---- } /** ! * Cummulate costs of financial matters for e.g. Interests, Depreciation and the like ! * for the given cost in driver and service. ! * Overwrite this method. ! * @param service ! * @param cost * @param factor (including the given Cost's factor) */ ! protected void calcFinances(Service service, CostDriver driver, Cost cost, double factor) { ! //TODO implement a default implementation } private Map getServiceMap(Map map, Service key) { *************** *** 518,522 **** * @param amount costs to charge for given year */ ! private void cummulateCodes(Service service, CostDriver driver, Cost cost, final String kind, int year, double amount) { Map serviceMap = getServiceMap(costs, service); // Service codes --- 492,496 ---- * @param amount costs to charge for given year */ ! protected void cummulateCodes(Service service, CostDriver driver, Cost cost, final String kind, int year, double amount) { Map serviceMap = getServiceMap(costs, service); // Service codes *************** *** 703,724 **** * Return cost-list over given object. * @param object null for all services - * @return [FactCosts_Total; Depreciation_Year1;.. TCO_YearN] - */ - public List getDepreciationCostBlock(TcoObject object) { - TcoObject costObject = (object == null ? rootObject : object); - List costs = new ArrayList(); - - List totalFacts = getTotalCosts(costObject, Calculator.DEPRECIATION_COSTS); - costs.add(new Double(Calculator.getValue(totalFacts, Calculator.INDEX_TOTAL))); - for (int i=0; i<getDurationYears(); i++) { - // print Depreciation-Years - int index = i + INDEX_TOTAL + 1; - costs.add(new Double(Calculator.getValue(totalFacts, index))); - } - return costs; - } - /** - * Return cost-list over given object. - * @param object null for all services * @return [PersonalCosts_Total; FactCosts_Total; TCO_Year1(PC + FC);.. TCO_YearN(PC + FC)] */ --- 677,680 ---- |
|
From: Hirzel P. <ph...@us...> - 2006-05-08 17:16:05
|
Update of /cvsroot/tcotool/TCO-Tool/plugins/org.tcotool.core.runtime/source/org/tcotool/core/runtime In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6192/plugins/org.tcotool.core.runtime/source/org/tcotool/core/runtime Modified Files: ApplicationPlugin.java Log Message: Refactoring: Loader access Index: ApplicationPlugin.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/plugins/org.tcotool.core.runtime/source/org/tcotool/core/runtime/ApplicationPlugin.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ApplicationPlugin.java 16 Dec 2005 10:06:38 -0000 1.4 --- ApplicationPlugin.java 7 May 2006 14:58:59 -0000 1.5 *************** *** 176,180 **** node = LauncherView.getInstance().getPnlNavigation().getSelectedNode(); } ! menu.actionPerform(component, node, loader); } /** --- 176,180 ---- node = LauncherView.getInstance().getPnlNavigation().getSelectedNode(); } ! menu.actionPerform(component, node); } /** |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:13:00
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30954/src/org/tcotool/standard/report Modified Files: ReportTool.java ReportTco.java Log Message: Refactoring: API changed; NLS Index: ReportTco.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTco.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReportTco.java 13 Jan 2006 17:43:28 -0000 1.3 --- ReportTco.java 18 Mar 2006 17:12:56 -0000 1.4 *************** *** 23,27 **** import ch.softenvironment.jomm.mvc.controller.DbCodeTypeComparator; - import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; import ch.softenvironment.util.NlsUtils; --- 23,26 ---- Index: ReportTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReportTool.java 13 Jan 2006 17:43:28 -0000 1.4 --- ReportTool.java 18 Mar 2006 17:12:56 -0000 1.5 *************** *** 1,28 **** package org.tcotool.standard.report; - /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ import java.io.IOException; import java.net.URL; import java.util.*; import org.tcotool.model.*; import org.tcotool.tools.Calculator; import org.tcotool.tools.ModelUtility; import org.tcotool.application.*; - import sun.security.action.GetIntegerAction; - import ch.softenvironment.jomm.DbObjectServer; import ch.softenvironment.jomm.mvc.model.DbCodeType; --- 1,12 ---- package org.tcotool.standard.report; import java.io.IOException; import java.net.URL; import java.util.*; import org.tcotool.model.*; + import org.tcotool.model.Process; import org.tcotool.tools.Calculator; import org.tcotool.tools.ModelUtility; import org.tcotool.application.*; import ch.softenvironment.jomm.DbObjectServer; import ch.softenvironment.jomm.mvc.model.DbCodeType; *************** *** 46,49 **** --- 30,34 ---- public static final String PERSONAL_COST_INTERNAL = "PC_INTERN"; public static final String PERSONAL_COST_EXTERNAL = "PC_EXTERN"; + private static final long DEFAULT_DURATION = 48; protected Calculator calculator = null; protected String title = ""; *************** *** 114,118 **** super.breakLine(); ! csvWriter.newline(); } protected URL getHeaderImage() { --- 99,103 ---- super.breakLine(); ! getCsvWriter().newline(); } protected URL getHeaderImage() { *************** *** 165,172 **** try { // in csv costs are always as is ! csvWriter.cell(tmp + LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency() + "]" + currency); } catch(Throwable e) { ch.softenvironment.util.Tracer.getInstance().runtimeError(this, "encodeCostUnit()", "INGORED: SystemParameters FAILURE"); ! csvWriter.cell(tmp + UNKNOWN + "]" + currency); } } --- 150,157 ---- try { // in csv costs are always as is ! getCsvWriter().cell(tmp + LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency() + "]" + currency); } catch(Throwable e) { ch.softenvironment.util.Tracer.getInstance().runtimeError(this, "encodeCostUnit()", "INGORED: SystemParameters FAILURE"); ! getCsvWriter().cell(tmp + UNKNOWN + "]" + currency); } } *************** *** 181,189 **** double estimated = Calculator.getValue(calculator.getTcoCodeTotal(root, Calculator.ESTIMATED), Calculator.INDEX_TOTAL); nativeContent(tmp + amount(estimated) + " : " + amount(known)); ! csvWriter.cell(tmp); ! csvWriter.cell(new Double(estimated)); ! csvWriter.cell(" : "); ! csvWriter.cell(new Double(known)); ! csvWriter.newline(); // Cost->CostCause (most important Enumeration) --- 166,174 ---- double estimated = Calculator.getValue(calculator.getTcoCodeTotal(root, Calculator.ESTIMATED), Calculator.INDEX_TOTAL); nativeContent(tmp + amount(estimated) + " : " + amount(known)); ! getCsvWriter().cell(tmp); ! getCsvWriter().cell(new Double(estimated)); ! getCsvWriter().cell(" : "); ! getCsvWriter().cell(new Double(known)); ! getCsvWriter().newline(); // Cost->CostCause (most important Enumeration) *************** *** 191,195 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COST_CAUSE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); } --- 176,180 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COST_CAUSE_UNDEFINED, ModelUtility.getTypeString(CostCause.class)); endParagraph(); } *************** *** 198,202 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATEGORY_UNDEFINED, ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text", false)); endParagraph(); } --- 183,187 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATEGORY_UNDEFINED, ModelUtility.getTypeString(ServiceCategory.class)); endParagraph(); } *************** *** 204,208 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.RESPONSIBILITY_UNDEFINED, ResourceManager.getResource(ServiceDetailView.class, "LblResponsibility_text", false)); endParagraph(); } --- 189,193 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.RESPONSIBILITY_UNDEFINED, ModelUtility.getTypeString(Responsibility.class)); endParagraph(); } *************** *** 210,214 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COSTCENTRE_UNDEFINED, ResourceManager.getResource(ServiceDetailView.class, "LblCostCentre_text", false)); endParagraph(); } --- 195,199 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COSTCENTRE_UNDEFINED, ModelUtility.getTypeString(CostCentre.class)); endParagraph(); } *************** *** 218,230 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.PROCESS_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "LblProcess_text", false)); endParagraph(); } ! //TODO NYI: ProjectPhase ! //TODO NYI: LifeCycle codes = server.retrieveCodes(org.tcotool.model.Site.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.SITE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "LblSite_text", false)); endParagraph(); } --- 203,215 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.PROCESS_UNDEFINED, ModelUtility.getTypeString(Process.class)); endParagraph(); } ! //TODO NYI: ProjectPhase (only if UserActionRights are available) ! //TODO NYI: LifeCycle (only if UserActionRights are available) codes = server.retrieveCodes(org.tcotool.model.Site.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.SITE_UNDEFINED, ModelUtility.getTypeString(Site.class)); endParagraph(); } *************** *** 234,238 **** if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATALOGUE_UNDEFINED, ResourceManager.getResource(CatalogueDetailView.class, "FrmWindow_text", false)); endParagraph(); } --- 219,223 ---- if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATALOGUE_UNDEFINED, ModelUtility.getTypeString(Catalogue.class)); endParagraph(); } *************** *** 245,249 **** super.endParagraph(); ! csvWriter.newline(); } /** --- 230,234 ---- super.endParagraph(); ! getCsvWriter().newline(); } /** *************** *** 253,257 **** super.endTable(); ! csvWriter.newline(); } /** --- 238,242 ---- super.endTable(); ! getCsvWriter().newline(); } /** *************** *** 262,266 **** super.endTableRow(); ! csvWriter.newline(); } /** --- 247,251 ---- super.endTableRow(); ! getCsvWriter().newline(); } /** *************** *** 322,326 **** */ public String getCsvContents() { ! return csvWriter.getWriter().toString(); } /** --- 307,311 ---- */ public String getCsvContents() { ! return getCsvWriter().getWriter().toString(); } /** *************** *** 329,333 **** */ public static long getDepreciationDuration() { ! Long duration = new Long(48); try { if (LauncherView.getInstance().getUtility().getSystemParameter().getReportDepreciationDuration() == null) { --- 314,318 ---- */ public static long getDepreciationDuration() { ! Long duration = new Long(DEFAULT_DURATION); try { if (LauncherView.getInstance().getUtility().getSystemParameter().getReportDepreciationDuration() == null) { *************** *** 358,362 **** */ public static long getUsageDuration() { ! Long duration = new Long(48); try { if (LauncherView.getInstance().getUtility().getSystemParameter().getReportUsageDuration() == null) { --- 343,347 ---- */ public static long getUsageDuration() { ! Long duration = new Long(DEFAULT_DURATION); try { if (LauncherView.getInstance().getUtility().getSystemParameter().getReportUsageDuration() == null) { *************** *** 393,399 **** nativeContent("<h4>" + text + "</h4>"); } ! csvWriter.newline(); ! csvWriter.cell(level + " - " + text); ! csvWriter.newline(); } /** --- 378,384 ---- nativeContent("<h4>" + text + "</h4>"); } ! getCsvWriter().newline(); ! getCsvWriter().cell(level + " - " + text); ! getCsvWriter().newline(); } /** *************** *** 413,419 **** } ! csvWriter.newline(); ! csvWriter.cell(prefix + " " + ModelUtility.getTypeString(object.getClass()) + ": " + object.getName()); ! csvWriter.newline(); } private String linkObject(TcoObject object, boolean hasRef) { --- 398,404 ---- } ! getCsvWriter().newline(); ! getCsvWriter().cell(prefix + " " + ModelUtility.getTypeString(object.getClass()) + ": " + object.getName()); ! getCsvWriter().newline(); } private String linkObject(TcoObject object, boolean hasRef) { *************** *** 451,455 **** nativeContent("<td>" + (bold ? "<b>" : "") + linkObject(object, true, false) + (bold ? "</b>" : "") + "</td>"); ! csvWriter.cell(object.getName()); } /** --- 436,440 ---- nativeContent("<td>" + (bold ? "<b>" : "") + linkObject(object, true, false) + (bold ? "</b>" : "") + "</td>"); ! getCsvWriter().cell(object.getName()); } /** *************** *** 462,466 **** nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + ((DbObject)object).getId() + "\">" + encodeString(object.getNameString()) + (bold ? "</b>" : "") + "</td>"); ! csvWriter.cell(object.getName()); } /** --- 447,451 ---- nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + ((DbObject)object).getId() + "\">" + encodeString(object.getNameString()) + (bold ? "</b>" : "") + "</td>"); ! getCsvWriter().cell(object.getName()); } /** *************** *** 474,478 **** nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + id + "\">" + encodeString(text) + (bold ? "</b>" : "") + "</td>"); ! csvWriter.cell(text); } /** --- 459,463 ---- nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + id + "\">" + encodeString(text) + (bold ? "</b>" : "") + "</td>"); ! getCsvWriter().cell(text); } /** *************** *** 482,486 **** super.startTable(attrs); ! csvWriter.newline(); } /** --- 467,471 ---- super.startTable(attrs); ! getCsvWriter().newline(); } /** *************** *** 515,519 **** super.tableData(text, attrs); ! csvWriter.cell(text); } protected void tableDataAmount(double value, boolean bold) throws IOException { --- 500,504 ---- super.tableData(text, attrs); ! getCsvWriter().cell(text); } protected void tableDataAmount(double value, boolean bold) throws IOException { *************** *** 524,528 **** if (colspan > 1) { attrs.add("colspan", "" + colspan); ! csvWriter.colSpan(colspan); } --- 509,513 ---- if (colspan > 1) { attrs.add("colspan", "" + colspan); ! getCsvWriter().colSpan(colspan); } *************** *** 539,543 **** nativeContent("</td>"); ! csvWriter.cell(new Double(value)); } /** --- 524,528 ---- nativeContent("</td>"); ! getCsvWriter().cell(new Double(value)); } /** *************** *** 560,564 **** nativeContent("<td><b>" + encodeString(text) + "</b></td>"); ! csvWriter.cell(text); } protected void tableDataHour(Number value, boolean bold) throws IOException { --- 545,549 ---- nativeContent("<td><b>" + encodeString(text) + "</b></td>"); ! getCsvWriter().cell(text); } protected void tableDataHour(Number value, boolean bold) throws IOException { *************** *** 596,600 **** super.tableHeader(text, attrs); ! csvWriter.cell(text); } /** --- 581,585 ---- super.tableHeader(text, attrs); ! getCsvWriter().cell(text); } /** *************** *** 680,689 **** return csvWriter; } - /** - * Fixed(1) decimal value. - */ - public static Double fix1(double value) { - return new Double(((long)(value * 10.0)) / 10.0); - // return new Double((long)value); - } } --- 665,667 ---- |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:11:35
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30492/src/org/tcotool/standard/drawing Modified Files: DependencyView.java DependencyLineConnection.java Log Message: Commenting. Index: DependencyLineConnection.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/DependencyLineConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DependencyLineConnection.java 17 Sep 2005 17:19:44 -0000 1.3 --- DependencyLineConnection.java 18 Mar 2006 17:11:32 -0000 1.4 *************** *** 54,76 **** */ public boolean canConnect(Figure start, Figure end) { ! TcoObject client = null; ! TcoObject supplier = null; try { // only GeneralizableElement's are valid types ! client = (TcoObject)((NodeFigure)start).getModelElement(); ! supplier = (TcoObject)((NodeFigure)end).getModelElement(); } catch(ClassCastException e) { Tracer.getInstance().developerWarning(this, "canConnect()", "Wrong dependency"); return false; } ! /* ! if (!(((client instanceof Classifier) && (supplier instanceof Classifier)) || ! // ((client instanceof TopicDef) && (supplier instanceof TopicDef)) || ! ((client instanceof ch.ehi.uml1_4.modelmanagement.Package) && (supplier instanceof ch.ehi.uml1_4.modelmanagement.Package)))) { ! shouldWarn(resDependencyLineConnection.getString("CWNodesMustBeClassifier")); //$NON-NLS-1$ ! return false; ! } ! */ return true; } --- 54,69 ---- */ public boolean canConnect(Figure start, Figure end) { ! // TcoObject client = null; ! // TcoObject supplier = null; try { // only GeneralizableElement's are valid types ! /*client = (TcoObject)*/ ((NodeFigure)start).getModelElement(); ! /*supplier = (TcoObject)*/ ((NodeFigure)end).getModelElement(); } catch(ClassCastException e) { Tracer.getInstance().developerWarning(this, "canConnect()", "Wrong dependency"); return false; } ! return true; } Index: DependencyView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/drawing/DependencyView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DependencyView.java 20 Sep 2005 19:11:17 -0000 1.4 --- DependencyView.java 18 Mar 2006 17:11:32 -0000 1.5 *************** *** 339,343 **** public Figure remove(Figure figure) { // seems to be tricky in JHotDraw, to get what is wanted ! Figure fig = super.remove(figure); clearSelection(); repaint(); --- 339,343 ---- public Figure remove(Figure figure) { // seems to be tricky in JHotDraw, to get what is wanted ! /*Figure fig =*/ super.remove(figure); clearSelection(); repaint(); |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:10:48
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30164/src/org/tcotool/standard/charts Modified Files: ChartTool.java Log Message: API changed. Index: ChartTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts/ChartTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ChartTool.java 13 Jan 2006 13:07:48 -0000 1.3 --- ChartTool.java 18 Mar 2006 17:10:45 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; + import org.jfree.chart.axis.AxisSpace; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryLabelPositions; *************** *** 49,52 **** --- 50,55 ---- import org.tcotool.tools.ModelUtility; import org.tcotool.model.CostCause; + import org.tcotool.model.Responsibility; + import org.tcotool.model.ServiceCategory; import org.tcotool.model.TcoPackage; *************** *** 64,72 **** protected Calculator calculator = null; protected TcoPackage rootObject = null; ! public ChartTool(TcoPackage rootObject) { super(); this.rootObject = rootObject; ! calculator = new Calculator(LauncherView.getInstance().getUtility(), rootObject, ReportTool.getUsageDuration()); } /** --- 67,87 ---- protected Calculator calculator = null; protected TcoPackage rootObject = null; ! /** ! * @see #ChartTool(TcoPackage, DbCodeType) ! */ public ChartTool(TcoPackage rootObject) { + this(rootObject, null); + } + /** + * Create a ChartTool and calculate Costs for rootObject. + * If maskCode is set, all Service, CostDriver or Cost Objects + * are rejected if the code is not contained in hierarchy. + * @param rootObject + * @param maskCode + */ + public ChartTool(TcoPackage rootObject, DbCodeType maskCode) { super(); this.rootObject = rootObject; ! calculator = new Calculator(LauncherView.getInstance().getUtility(), rootObject, ReportTool.getUsageDuration(), maskCode); } /** *************** *** 133,136 **** --- 148,153 ---- categoryplot.setDomainGridlinesVisible(true); categoryplot.setRangeGridlinePaint(settings.getChartRangeGridLine()); + + //jfreechart.getXYPlot().getDataRange(axis)fetdsetFixedRangeAxisSpace(new AxisSpace()); NumberAxis numberaxis = (NumberAxis)categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); *************** *** 184,188 **** public JPanel createTcoPieChart(Class dbCodeType) throws Throwable { CategoryDataset categorydataset = createTotalCodeDataset(rootObject.getObjectServer().retrieveCodes(dbCodeType)); ! JFreeChart jfreechart = createPieChart(categorydataset); ChartPanel chartpanel = new ChartPanel(jfreechart); --- 201,205 ---- public JPanel createTcoPieChart(Class dbCodeType) throws Throwable { CategoryDataset categorydataset = createTotalCodeDataset(rootObject.getObjectServer().retrieveCodes(dbCodeType)); ! JFreeChart jfreechart = createPieChart(categorydataset, dbCodeType); ChartPanel chartpanel = new ChartPanel(jfreechart); *************** *** 195,200 **** * @return */ ! private JFreeChart createPieChart(CategoryDataset categorydataset) { ! JFreeChart jfreechart = ChartFactory.createMultiplePieChart(NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(CostCause.class)), categorydataset, TableOrder.BY_COLUMN, true, --- 212,217 ---- * @return */ ! private JFreeChart createPieChart(CategoryDataset categorydataset, Class dbCodeType) { ! JFreeChart jfreechart = ChartFactory.createMultiplePieChart(NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(dbCodeType)), categorydataset, TableOrder.BY_COLUMN, true, |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:09:32
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29615/src/org/tcotool/model Modified Files: CostCause.java SystemParameter.java Log Message: Commenting. Index: CostCause.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/CostCause.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CostCause.java 28 Dec 2005 11:52:30 -0000 1.1 --- CostCause.java 18 Mar 2006 17:09:29 -0000 1.2 *************** *** 16,33 **** 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); --- 16,32 ---- 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); *************** *** 36,40 **** 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; } --- 35,39 ---- 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(1,1)); return descriptor; } Index: SystemParameter.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/SystemParameter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SystemParameter.java 2 Oct 2005 11:23:47 -0000 1.2 --- SystemParameter.java 18 Mar 2006 17:09:29 -0000 1.3 *************** *** 20,23 **** --- 20,25 ---- private java.lang.Long fieldReportDepreciationDuration; private java.lang.Long fieldModelId; + private java.util.List fieldCourse=new java.util.ArrayList(); + public SystemParameter(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); *************** *** 35,38 **** --- 37,41 ---- descriptor.add("reportDepreciationDuration","reportDepreciationDurtion",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9.99999999E8,0),new DbMultiplicityRange(0,1)); descriptor.addOneToOneReferenceId(DbDescriptor.ASSOCIATION, "modelId", "T_Id_model", new DbMultiplicityRange(1,1), false); + descriptor.addOneToMany(DbDescriptor.COMPOSITION, "course", "systemParameterId", new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), Course.class, false); return descriptor; } *************** *** 127,129 **** --- 130,141 ---- firePropertyChange("reportUsageDuration", oldValue, fieldReportUsageDuration); } + public java.util.List getCourse() { + refresh(false); // read lazy initialized objects + return fieldCourse; + } + public void setCourse(java.util.List course) { + java.util.List oldValue=fieldCourse; + fieldCourse=course; + firePropertyChange("course", oldValue, fieldCourse); + } } |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:08:36
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29209/src/org/tcotool/model Modified Files: Role.java FactCost.java Log Message: Commenting. Index: FactCost.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/FactCost.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FactCost.java 13 Dec 2005 12:51:41 -0000 1.2 --- FactCost.java 18 Mar 2006 17:08:28 -0000 1.3 *************** *** 23,30 **** descriptor.add("depreciationDuration","depreciationDuration",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(1,1)); descriptor.add("usageDuration","usageDuration",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(1,1)); ! descriptor.add("serialNumber","serialNumber",new DbTextFieldDescriptor(20),new DbMultiplicityRange(0,1)); ! descriptor.add("portsUseable","portsUseable",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); ! descriptor.add("portsISL","portsISL",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); ! descriptor.add("portsServer","portsServer",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); descriptor.addCode("catalogue", "T_Id_catalogue", new DbMultiplicityRange(0,1)); return descriptor; --- 23,30 ---- descriptor.add("depreciationDuration","depreciationDuration",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(1,1)); descriptor.add("usageDuration","usageDuration",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(1,1)); ! descriptor.add("serialNumber","serialNumber",new DbTextFieldDescriptor(20),new DbMultiplicityRange(0,1)); ! descriptor.add("portsUseable","portsUseable",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); ! descriptor.add("portsISL","portsISL",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); ! descriptor.add("portsServer","portsServer",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(0,1)); descriptor.addCode("catalogue", "T_Id_catalogue", new DbMultiplicityRange(0,1)); return descriptor; *************** *** 43,58 **** --- 43,70 ---- return fieldDepreciationDuration; } + /** + * @deprecated (will be redesigned soon) + */ public java.lang.Long getPortsISL() { refresh(false); // read lazy initialized objects return fieldPortsISL; } + /** + * @deprecated (will be redesigned soon) + */ public java.lang.Long getPortsServer() { refresh(false); // read lazy initialized objects return fieldPortsServer; } + /** + * @deprecated (will be redesigned soon) + */ public java.lang.Long getPortsUseable() { refresh(false); // read lazy initialized objects return fieldPortsUseable; } + /** + * @deprecated (will be redesigned soon) + */ public String getSerialNumber() { refresh(false); // read lazy initialized objects *************** *** 78,81 **** --- 90,96 ---- firePropertyChange("depreciationDuration", oldValue, fieldDepreciationDuration); } + /** + * @deprecated (will be redesigned soon) + */ public void setPortsISL(java.lang.Long portsISL){ java.lang.Long oldValue=fieldPortsISL; *************** *** 83,86 **** --- 98,104 ---- firePropertyChange("portsISL", oldValue, fieldPortsISL); } + /** + * @deprecated (will be redesigned soon) + */ public void setPortsServer(java.lang.Long portsServer){ java.lang.Long oldValue=fieldPortsServer; *************** *** 88,91 **** --- 106,112 ---- firePropertyChange("portsServer", oldValue, fieldPortsServer); } + /** + * @deprecated (will be redesigned soon) + */ public void setPortsUseable(java.lang.Long portsUseable){ java.lang.Long oldValue=fieldPortsUseable; *************** *** 93,96 **** --- 114,120 ---- firePropertyChange("portsUseable", oldValue, fieldPortsUseable); } + /** + * @deprecated (will be redesigned soon) + */ public void setSerialNumber(String serialNumber){ String oldValue=fieldSerialNumber; *************** *** 103,105 **** firePropertyChange("usageDuration", oldValue, fieldUsageDuration); } ! } --- 127,129 ---- firePropertyChange("usageDuration", oldValue, fieldUsageDuration); } ! } \ No newline at end of file Index: Role.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/Role.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Role.java 29 Aug 2005 09:41:06 -0000 1.1.1.1 --- Role.java 18 Mar 2006 17:08:28 -0000 1.2 *************** *** 85,88 **** --- 85,94 ---- firePropertyChange("fullTimeEquivalent", oldValue, fieldFullTimeEquivalent); } + /** + * Costs per hour for this role. + * Rounded(2)! + * value = fullTimeEquivalent / yearlyHours + * @param hourlyRate + */ public void setHourlyRate(java.lang.Double hourlyRate){ java.lang.Double oldValue=fieldHourlyRate; |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:06:21
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28267/src/org/tcotool/model Added Files: Course.java Log Message: Feature: new model Class --- NEW FILE: Course.java --- package org.tcotool.model; import ch.softenvironment.jomm.mvc.model.*; import ch.softenvironment.jomm.descriptor.*; /** * Map a course factor between source- and target-Currency where: target = source * factor * @author generated by the umleditor * @version $Revision: 1.1 $ $Date: 2006/03/18 17:06:11 $ */ public class Course extends DbEntityBean { public Course(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); } private org.tcotool.model.Currency fieldSource; // NOT NULL public org.tcotool.model.Currency getSource() { refresh(false); // read lazy initialized objects return fieldSource; } public void setSource(org.tcotool.model.Currency source){ org.tcotool.model.Currency oldValue=fieldSource; fieldSource=source; firePropertyChange("source", oldValue, fieldSource); } private org.tcotool.model.Currency fieldTarget; // NOT NULL public org.tcotool.model.Currency getTarget() { refresh(false); // read lazy initialized objects return fieldTarget; } public void setTarget(org.tcotool.model.Currency target){ org.tcotool.model.Currency oldValue=fieldTarget; fieldTarget=target; firePropertyChange("target", oldValue, fieldTarget); } private java.lang.Double fieldFactor; // NOT NULL public java.lang.Double getFactor() { refresh(false); // read lazy initialized objects return fieldFactor; } public void setFactor(java.lang.Double factor){ java.lang.Double oldValue=fieldFactor; fieldFactor=factor; firePropertyChange("factor", oldValue, fieldFactor); } public java.lang.Long fieldSystemParameterId; public java.lang.Long getSystemParameterId() { refresh(false); // read lazy initialized objects return fieldSystemParameterId; } public void setSystemParameterId(java.lang.Long systemParameter) { java.lang.Long oldValue=fieldSystemParameterId; fieldSystemParameterId=systemParameter; firePropertyChange("systemParameterId", oldValue, fieldSystemParameterId); } public static DbDescriptor createDescriptor() { DbDescriptor descriptor = new DbDescriptor(Course.class); descriptor.addCode("source", "source", new DbMultiplicityRange(1,1)); descriptor.addCode("target", "target", new DbMultiplicityRange(1,1)); descriptor.add("factor","factor",new DbNumericFieldDescriptor(java.lang.Double.class,0.0,99999.0,5),new DbMultiplicityRange(1,1)); descriptor.addManyToOneReferenceId(DbDescriptor.ASSOCIATION, "systemParameterId", "T_Id_systemParameter", new DbMultiplicityRange(1,1)); return descriptor; } } |
|
From: Hirzel P. <ph...@us...> - 2006-03-18 17:06:16
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28267/src/org/tcotool Modified Files: TcotoolUtility.java Log Message: Feature: new model Class Index: TcotoolUtility.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/TcotoolUtility.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TcotoolUtility.java 28 Dec 2005 11:34:12 -0000 1.3 --- TcotoolUtility.java 18 Mar 2006 17:06:11 -0000 1.4 *************** *** 54,57 **** --- 54,58 ---- DbObjectRegistry.registerClass(org.tcotool.model.Occurance.class,"tcotool.model.Occurance"); DbObjectRegistry.registerClass(org.tcotool.model.Branch.class,"tcotool.model.Branch"); + DbObjectRegistry.registerClass(org.tcotool.model.Course.class,"tcotool.model.Course"); // Basket PRESENTATION |
|
From: Hirzel P. <ph...@us...> - 2006-01-20 15:22:13
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/pluginsupport In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12210/src/org/tcotool/pluginsupport Modified Files: PluginUtility.java Menu.java Log Message: Refactoring: API change Index: Menu.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/pluginsupport/Menu.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Menu.java 29 Aug 2005 09:41:11 -0000 1.1.1.1 --- Menu.java 20 Jan 2006 15:22:02 -0000 1.2 *************** *** 33,38 **** * @param item MenuItem triggered * @param object according to plugin.xml Manifest, the selected node in NavigationTree - * @param loader ClassLoader for getting resources (images, *.properties, etc) */ ! void actionPerform(final JComponent item, final Object object, final ClassLoader loader); } --- 33,37 ---- * @param item MenuItem triggered * @param object according to plugin.xml Manifest, the selected node in NavigationTree */ ! void actionPerform(final JComponent item, final Object object); } Index: PluginUtility.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/pluginsupport/PluginUtility.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PluginUtility.java 22 Dec 2005 12:31:16 -0000 1.4 --- PluginUtility.java 20 Jan 2006 15:22:02 -0000 1.5 *************** *** 1,18 **** package org.tcotool.pluginsupport; - /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ import java.io.File; import java.io.FileFilter; --- 1,3 ---- *************** *** 169,171 **** --- 154,159 ---- return buf.toString(); } + public static ClassLoader getClassLoader(Plugin plugin) { + return plugin.getManager().getPluginClassLoader(plugin.getDescriptor()); + } } \ No newline at end of file |
|
From: Hirzel P. <ph...@us...> - 2006-01-13 17:43:37
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24602/src/org/tcotool/standard/report Modified Files: ReportInvestment.java ReportTool.java ReportTco.java ReportStaff.java ReportComplete.java Log Message: Refactoring: API changes Index: ReportInvestment.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportInvestment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReportInvestment.java 25 Nov 2005 18:12:07 -0000 1.2 --- ReportInvestment.java 13 Jan 2006 17:43:28 -0000 1.3 *************** *** 13,17 **** import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.mvc.controller.DbCodeTypeComparator; - import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; --- 13,16 ---- *************** *** 27,31 **** } /** ! * Summarize all Investment-Cost within given object and subpackages. */ public static ReportTool createInvestment(TcoPackage root) throws java.lang.Throwable { --- 26,30 ---- } /** ! * Summarize all Investment-Cost within given root and subpackages. */ public static ReportTool createInvestment(TcoPackage root) throws java.lang.Throwable { *************** *** 121,129 **** startTableRow(); // name of CostType ! if (code instanceof DbCodeType) { ! tableDataLinked((DbCodeType)code, false); ! } else { ! tableData(getCodeName(code)); ! } List factCosts = calculator.getCosts(root, Calculator.FACT_TCO, code); --- 120,124 ---- startTableRow(); // name of CostType ! tableDataCode(code); List factCosts = calculator.getCosts(root, Calculator.FACT_TCO, code); Index: ReportComplete.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportComplete.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReportComplete.java 20 Nov 2005 15:54:26 -0000 1.2 --- ReportComplete.java 13 Jan 2006 17:43:28 -0000 1.3 *************** *** 97,103 **** } } ! header(4, "a) " + ModelUtility.getTypeString(FactCost.class) + ":"); encodeCompleteCosts(FactCost.class, facts); ! header(4, "b) " + ModelUtility.getTypeString(PersonalCost.class) + ":"); encodeCompleteCosts(PersonalCost.class, personal); } --- 97,103 ---- } } ! header(4, "a) " + getTcoObjectImage(FactCost.class) + " " + ModelUtility.getTypeString(FactCost.class) + ":"); encodeCompleteCosts(FactCost.class, facts); ! header(4, "b) " + getTcoObjectImage(PersonalCost.class) + " " + ModelUtility.getTypeString(PersonalCost.class) + ":"); encodeCompleteCosts(PersonalCost.class, personal); } *************** *** 201,205 **** startTableRow(); tableDataLinked(cost, false); // tableData(cost.getName()); ! tableData(encodeString(getCodeName(cost.getType()))); tableData("" + (long)ModelUtility.getMultitudeFactor(cost)); tableDataAmount(cost.getAmount() == null ? 0.0 : cost.getAmount().doubleValue(), false); --- 201,205 ---- startTableRow(); tableDataLinked(cost, false); // tableData(cost.getName()); ! tableData(getCodeName(cost.getCause())); tableData("" + (long)ModelUtility.getMultitudeFactor(cost)); tableDataAmount(cost.getAmount() == null ? 0.0 : cost.getAmount().doubleValue(), false); *************** *** 220,228 **** } } ! private void encodeCompleteEnum(String property, DbCodeType enum) throws IOException { ! if (enum != null) { startTableRow(); tableData(property, abstractCell); ! tableData(enum.getNameString()); endTableRow(); } --- 220,228 ---- } } ! private void encodeCompleteEnum(String property, DbCodeType enumeration) throws IOException { ! if (enumeration != null) { startTableRow(); tableData(property, abstractCell); ! tableData(enumeration.getNameString()); endTableRow(); } *************** *** 241,243 **** endHtml(); } ! } --- 241,243 ---- endHtml(); } ! } \ No newline at end of file Index: ReportTco.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTco.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReportTco.java 25 Nov 2005 18:12:07 -0000 1.2 --- ReportTco.java 13 Jan 2006 17:43:28 -0000 1.3 *************** *** 23,27 **** import ch.softenvironment.jomm.mvc.controller.DbCodeTypeComparator; - import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; --- 23,26 ---- *************** *** 57,61 **** ReportTco tool = new ReportTco(ResourceManager.getResource(NavigationView.class, "MniReportTcoCostDetailed_text")); tool.calculator = new Calculator(LauncherView.getInstance().getUtility(), root, tcoMaxUsage); ! tool.costBlock(root); return tool; } --- 56,60 ---- ReportTco tool = new ReportTco(ResourceManager.getResource(NavigationView.class, "MniReportTcoCostDetailed_text")); tool.calculator = new Calculator(LauncherView.getInstance().getUtility(), root, tcoMaxUsage); ! tool.costBlockCostCause(root); return tool; } *************** *** 169,181 **** */ private void encodeCostBlockColumns(TcoObject root, Object code) throws IOException { ! ch.softenvironment.jomm.serialize.AttributeList attrs = getAlignRight(); startTableRow(); // name of CostType //tableData(getCodeName(code)); ! if (code instanceof DbCodeType) { ! tableDataLinked((DbCodeType)code, false); ! } else { ! tableData(getCodeName(code)); ! } List factCosts = null; --- 168,176 ---- */ private void encodeCostBlockColumns(TcoObject root, Object code) throws IOException { ! // ch.softenvironment.jomm.serialize.AttributeList attrs = getAlignRight(); startTableRow(); // name of CostType //tableData(getCodeName(code)); ! tableDataCode(code); List factCosts = null; Index: ReportTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReportTool.java 7 Dec 2005 10:58:08 -0000 1.3 --- ReportTool.java 13 Jan 2006 17:43:28 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- */ import java.io.IOException; + import java.net.URL; import java.util.*; import org.tcotool.model.*; *************** *** 22,25 **** --- 23,28 ---- import org.tcotool.application.*; + import sun.security.action.GetIntegerAction; + import ch.softenvironment.jomm.DbObjectServer; import ch.softenvironment.jomm.mvc.model.DbCodeType; *************** *** 27,30 **** --- 30,35 ---- import ch.softenvironment.jomm.serialize.AttributeList; import ch.softenvironment.jomm.serialize.CsvSerializer; + import ch.softenvironment.jomm.serialize.HtmlSerializer; + import ch.softenvironment.util.StringUtils; import ch.softenvironment.util.Tracer; import ch.softenvironment.client.ResourceManager; *************** *** 39,42 **** --- 44,49 ---- */ public abstract class ReportTool extends ch.softenvironment.jomm.serialize.HtmlSerializer { + public static final String PERSONAL_COST_INTERNAL = "PC_INTERN"; + public static final String PERSONAL_COST_EXTERNAL = "PC_EXTERN"; protected Calculator calculator = null; protected String title = ""; *************** *** 109,118 **** csvWriter.newline(); } /** * Display Service-Cost's in detail (recursively). * Only consider Services below given root. * @param root (TcoPackage or Service) */ ! protected void costBlock(TcoObject root) throws java.lang.Throwable { printDetails = true; --- 116,129 ---- csvWriter.newline(); } + protected URL getHeaderImage() { + return null; + } /** * Display Service-Cost's in detail (recursively). * Only consider Services below given root. * @param root (TcoPackage or Service) + * @deprecated (will be redesigned soon) */ ! protected void costBlockCostCause(TcoObject root) throws java.lang.Throwable { printDetails = true; *************** *** 126,130 **** // Service header(prefix, 1, root); ! // encodeCostBlock((Service)root, root.getObjectServer().retrieveCodes(CostType.class), Calculator.COST_TYPE_UNDEFINED, "Kostenart"); encodeCodes(root.getObjectServer(), root); } --- 137,141 ---- // Service header(prefix, 1, root); ! encodeCostBlock((Service)root, root.getObjectServer().retrieveCodes(CostCause.class), Calculator.COST_CAUSE_UNDEFINED, ModelUtility.getTypeString(CostCause.class)); encodeCodes(root.getObjectServer(), root); } *************** *** 134,138 **** } /** ! * Encode the costs sorted <b>by CostType</b> in a Block (HTML-Table) * for TCO or Depreciation. * If (printDetails==true) then all Service's (either the given --- 145,149 ---- } /** ! * Encode the costs sorted <b>by CostCause</b> in a Block (HTML-Table) * for TCO or Depreciation. * If (printDetails==true) then all Service's (either the given *************** *** 140,145 **** * will be printed separately in an own such block. * @param root TcoPackage or Service */ ! protected abstract void encodeCostBlock(TcoObject root, List codes, final String codeUndefined, String title) throws IOException; /** * @see #getCostUnit() --- 151,159 ---- * will be printed separately in an own such block. * @param root TcoPackage or Service + * @deprecated (redesign generic approach, cause to much overhead with CostCause-list) */ ! protected void encodeCostBlock(TcoObject root, List codes, final String codeUndefined, String title) throws IOException { ! ! } /** * @see #getCostUnit() *************** *** 158,162 **** } /** ! * Print all meaningful codes for a CostBlock-Report one * after each other. * @param root null for whole configuration --- 172,176 ---- } /** ! * Print all meaningful DbCodeType's for a CostBlock-Report one * after each other. * @param root null for whole configuration *************** *** 173,181 **** csvWriter.newline(); ! // Cost->CostType (most important Enumeration) ! List codes = server.retrieveCodes(CostType.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COST_TYPE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); } --- 187,195 ---- csvWriter.newline(); ! // Cost->CostCause (most important Enumeration) ! List codes = server.retrieveCodes(CostCause.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.COST_CAUSE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); } *************** *** 215,226 **** endParagraph(); } ! // other Cost codes (CostType see above) codes = server.retrieveCodes(Catalogue.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATALOGUE_UNDEFINED, ResourceManager.getResource(CatalogueDetailView.class, "FrmWindow_text", true)); endParagraph(); } } /** --- 229,241 ---- endParagraph(); } ! /* no sense // other Cost codes (CostType see above) codes = server.retrieveCodes(Catalogue.class); if (codes.size() > 0) { startParagraph(); ! encodeCostBlock(root, codes, Calculator.CATALOGUE_UNDEFINED, ResourceManager.getResource(CatalogueDetailView.class, "FrmWindow_text", false)); endParagraph(); } + */ } /** *************** *** 356,359 **** --- 371,385 ---- } /** + * Return the TcoObject typical Icon as HTML image-Tag. + * @see ModelUtility#getIcon(Object, boolean) + */ + public static String getTcoObjectImage(Class tcoObject) { + String file = StringUtils.getPureClassName(tcoObject) + ".png"; + if (tcoObject.equals(TcoModel.class)) { + file = StringUtils.getPureClassName(TcoPackage.class) + ".png"; + } + return "<img src='" + ch.ehi.basics.i18n.ResourceBundle.getURL(ModelUtility.class, file) +"' border='0' alt='" + ModelUtility.getTypeString(tcoObject) + ":'>"; + } + /** * Overwrites. * @param level Chapter level *************** *** 388,392 **** csvWriter.newline(); ! csvWriter.cell(prefix + " " + linkObject(object, false)); csvWriter.newline(); } --- 414,418 ---- csvWriter.newline(); ! csvWriter.cell(prefix + " " + ModelUtility.getTypeString(object.getClass()) + ": " + object.getName()); csvWriter.newline(); } *************** *** 403,407 **** String text = ""; if (includingType) { ! text = ModelUtility.getTypeString(object.getClass()) + ": "; } --- 429,433 ---- String text = ""; if (includingType) { ! text = getTcoObjectImage(object.getClass()) + HtmlSerializer.SPACE; //ModelUtility.getTypeString(object.getClass()) + ": "; } *************** *** 416,419 **** --- 442,451 ---- return text; } + /** + * Add a HTML-Hyperlink within a table-cell to a concrete TcoObject. + * @param object + * @param bold + * @throws IOException + */ protected void tableDataLinked(TcoObject object, boolean bold) throws IOException { nativeContent("<td>" + (bold ? "<b>" : "") + linkObject(object, true, false) + (bold ? "</b>" : "") + "</td>"); *************** *** 421,424 **** --- 453,462 ---- csvWriter.cell(object.getName()); } + /** + * Add a HTML-Hyperlink within a table-cell to a concrete DbCodeType. + * @param object + * @param bold + * @throws IOException + */ protected void tableDataLinked(DbCodeType object, boolean bold) throws IOException { nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + ((DbObject)object).getId() + "\">" + encodeString(object.getNameString()) + (bold ? "</b>" : "") + "</td>"); *************** *** 427,430 **** --- 465,480 ---- } /** + * Add a HTML-Hyperlink within a table-cell to any given Object. + * @param id + * @param text + * @param bold + * @throws IOException + */ + protected void tableDataLinked(final String id, String text, boolean bold) throws IOException { + nativeContent("<td>" + (bold ? "<b>" : "") + "<a href=\"" + id + "\">" + encodeString(text) + (bold ? "</b>" : "") + "</td>"); + + csvWriter.cell(text); + } + /** * Overwrites. */ *************** *** 492,495 **** --- 542,558 ---- } /** + * Encode a Table-cell with a linked code. + * @param code + * @throws IOException + */ + protected final void tableDataCode(Object code) throws IOException { + if (code instanceof DbCodeType) { + tableDataLinked((DbCodeType)code, false); + } else { + // <Undefined> Code + tableDataLinked((String)code, getCodeName(code), false); + } + } + /** * */ *************** *** 578,582 **** header(prefix + "." + subChapter++, level + 1, service); startParagraph(); ! encodeCostBlock(service, service.getObjectServer().retrieveCodes(CostType.class), Calculator.COST_TYPE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); } --- 641,646 ---- header(prefix + "." + subChapter++, level + 1, service); startParagraph(); ! //TODO NASTY: usually CostCause code-list not wanted here ! encodeCostBlock(service, service.getObjectServer().retrieveCodes(CostCause.class), Calculator.COST_CAUSE_UNDEFINED, ModelUtility.getTypeString(CostCause.class)); endParagraph(); } *************** *** 593,597 **** } } - public void startHtml() throws IOException { super.startHtml(); --- 657,660 ---- Index: ReportStaff.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportStaff.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReportStaff.java 25 Nov 2005 18:12:07 -0000 1.2 --- ReportStaff.java 13 Jan 2006 17:43:28 -0000 1.3 *************** *** 21,30 **** import org.tcotool.model.*; import org.tcotool.tools.Calculator; import org.tcotool.application.*; import ch.softenvironment.jomm.mvc.controller.DbCodeTypeComparator; - import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; import ch.softenvironment.util.Tracer; import ch.softenvironment.client.ResourceManager; --- 21,32 ---- import org.tcotool.model.*; import org.tcotool.tools.Calculator; + import org.tcotool.tools.ModelUtility; import org.tcotool.application.*; import ch.softenvironment.jomm.mvc.controller.DbCodeTypeComparator; import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; + import ch.softenvironment.util.NlsUtils; + import ch.softenvironment.util.StringUtils; import ch.softenvironment.util.Tracer; import ch.softenvironment.client.ResourceManager; *************** *** 74,96 **** header(2, getRsc("CIPersonalRapportedEffort")); ! startParagraph(); ! boldValuePair(getRsc("CIInternalHours") + " ", totalPersonalInternalHours); ! breakLine(); ! ! boldValuePair(getRsc("CIExternalHours") + " ", totalPersonalExternalHours); ! breakLine(); ! //TODO innacurate because man-year may be different duration in Role's compared to SystemParameter#manYear ! boldValuePair(getRsc("CIInternalManYear") + " ~", totalPersonalInternalHours / sysPar.getManYearHoursInternal().doubleValue()); ! breakLine(); ! boldValuePair(getRsc("CIExternalManYear") + " ~", totalPersonalExternalHours / sysPar.getManYearHoursExternal().doubleValue()); ! endParagraph(); ! header(2, getRsc("CIOtherPersonalCost")); ! startParagraph(); ! boldValuePair(getRsc("CIInternalLump"), totalPersonalInternalLumpSum, true); ! breakLine(); ! boldValuePair(getRsc("CIExternalLump"), totalPersonalExternalLumpSum, true); ! breakLine(); endParagraph(); --- 76,125 ---- header(2, getRsc("CIPersonalRapportedEffort")); ! startParagraph(); ! startTable(1); ! startTableRow(); ! tableHeader(ResourceManager.getResource(PersonalCostDetailView.class, "ChxInternal_text")); ! tableHeader("[h]"); ! tableHeader(ResourceManager.getResource(RoleDetailView.class, "LblYearlyHours_text", false) + " ~"); ! endTableRow(); ! startTableRow(); ! tableData(StringUtils.getBooleanString(Boolean.TRUE)); ! tableDataHour(totalPersonalInternalHours, false); ! tableDataHour(totalPersonalInternalHours / sysPar.getManYearHoursInternal().doubleValue(), false); ! endTableRow(); ! startTableRow(); ! tableData(StringUtils.getBooleanString(Boolean.FALSE)); ! tableDataHour(totalPersonalExternalHours, false); ! tableDataHour(totalPersonalExternalHours / sysPar.getManYearHoursExternal().doubleValue(), false); ! endTableRow(); ! startTableRow(); //TODO innacurate because man-year may be different duration in Role's compared to SystemParameter#manYear ! tableData(" "); ! tableDataHour(totalPersonalInternalHours + totalPersonalExternalHours, true); ! tableDataHour(totalPersonalInternalHours / sysPar.getManYearHoursInternal().doubleValue() + totalPersonalExternalHours / sysPar.getManYearHoursExternal().doubleValue(), true); ! endTableRow(); ! endTable(); ! endParagraph(); ! header(2, getRsc("CIOtherPersonalCost")); ! startParagraph(); ! startTable(1); ! startTableRow(); ! tableHeader(ResourceManager.getResource(PersonalCostDetailView.class, "ChxInternal_text")); ! tableHeader(NlsUtils.formatMessage(ResourceManager.getResource(ReportTool.class, "CTLump"), ModelUtility.getTypeString(Role.class)) + " [" + getCostUnit() + "]"); ! endTableRow(); ! startTableRow(); ! tableDataLinked(ReportTool.PERSONAL_COST_INTERNAL, StringUtils.getBooleanString(Boolean.TRUE), false); ! tableDataAmount(totalPersonalInternalLumpSum, false); ! endTableRow(); ! startTableRow(); ! tableDataLinked(ReportTool.PERSONAL_COST_EXTERNAL, StringUtils.getBooleanString(Boolean.FALSE), false); ! tableDataAmount(totalPersonalExternalLumpSum, false); ! endTableRow(); ! startTableRow(); ! tableData(" "); ! tableDataAmount(totalPersonalInternalLumpSum + totalPersonalExternalLumpSum, true); ! endTableRow(); ! endTable(); endParagraph(); *************** *** 98,102 **** // only print Codes relevant for Personal ressources startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(CostType.class), Calculator.COST_TYPE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); startParagraph(); --- 127,131 ---- // only print Codes relevant for Personal ressources startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(CostCause.class), Calculator.COST_CAUSE_UNDEFINED, ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text")); endParagraph(); startParagraph(); *************** *** 165,173 **** // name of CostType //tableData(getCodeName(code)); ! if (code instanceof DbCodeType) { ! tableDataLinked((DbCodeType)code, false); ! } else { ! tableData(getCodeName(code)); ! } List personalCosts = calculator.getCosts(root, Calculator.PERSONAL_TCO, code); --- 194,198 ---- // name of CostType //tableData(getCodeName(code)); ! tableDataCode(code); List personalCosts = calculator.getCosts(root, Calculator.PERSONAL_TCO, code); *************** *** 204,206 **** } } ! } --- 229,231 ---- } } ! } \ No newline at end of file |