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...> - 2008-06-15 18:39:09
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28783/src/org/tcotool/tools Modified Files: Calculator.java Added Files: CalculatorTco.java CalculatorLinearDepreciation.java CalculatorDegressiveDepreciation.java Log Message: Refactoring: Algorithm exchange --- NEW FILE: CalculatorDegressiveDepreciation.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 org.tcotool.model.Cost; import org.tcotool.model.CostDriver; import org.tcotool.model.FactCost; import org.tcotool.model.Service; import org.tcotool.model.TcoObject; import ch.softenvironment.math.FinancialUtils; import ch.softenvironment.math.MathUtils; /** * Accounting calculator for "linear depreciation with compound interest". * @author Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1 $ $Date: 2008/06/15 18:39:14 $ */ public class CalculatorDegressiveDepreciation extends Calculator { /** * Initialize calculator for given rootObject and TotalCosts only. * @param object */ public CalculatorDegressiveDepreciation(ModelUtility utility) { this(utility, (TcoObject)utility.getRoot(), 0); } /** * @see #Calculator(ModelUtility, TcoObject, long, ServiceCategory, Responsibility) */ public CalculatorDegressiveDepreciation(ModelUtility utility, TcoObject rootObject, long maxDurationMonths) { super(utility, rootObject, maxDurationMonths, null); } /** * Accumulate costs of financial matters for e.g. accounting, interests, depreciation and the like * for the given cost in driver and service. * * (PersonalCost cannot be depreciated!) * @param service * @param driver * @param cost Consider FactCost's with a depreciationDuration > 1 year * @param capital (cost * factor) */ protected void calculate(Service service, CostDriver driver, Cost cost, double capital) { if (cost instanceof FactCost) { FactCost fCost = (FactCost)cost; boolean repeatable = (cost.getRepeatable() != null) && cost.getRepeatable().booleanValue(); int baseOffset = (cost.getBaseOffset() == null ? 0 : cost.getBaseOffset().intValue()); int baseYear = baseOffset / 12; long depreciationDuration = fCost.getDepreciationDuration() == null ? 0 : fCost.getDepreciationDuration().longValue(); if (depreciationDuration > 0) { // 1) [0] total FactCost independent of depreciation (baseOffset irrelevant) accumulateCodes(service, driver, cost, INDEX_TOTAL, capital); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, INDEX_TOTAL, capital); // 2) [1+baseOffset..n] year // [1..fCost.depreciationYears] of first period of FactCost's depreciationDuration int year = calcDepreciation(service, driver, fCost, capital, INDEX_TOTAL); // [after fCost.depreciationYears years] repeatable periods if ((cost.getRepeatable() != null) && cost.getRepeatable().booleanValue() && (year < getDurationYears())) { // repeat the costs until maxDuration while (year < getDurationYears()) { //TODO Check: probably degressive depreciation costs from duration before are not calculated further on, which would go infinitely down to 0 year = calcDepreciation(service, driver, fCost, capital, year); } } } } } /** * Calculate the <b>linear depreciation</b> over the whole FactCost-DepreciationDuration. * Algorithm: * - Linear Depreciation * @param costCapital * @param costDuration * @return year of last Cost-entry */ private int calcDepreciation(Service service, CostDriver driver, FactCost cost, double costCapital, int yearIndex) { int duration = cost.getDepreciationDuration().intValue(); int completeYears = duration / 12; if (duration % 12 > 0) { // consider a partial duration after last complete year as one more year completeYears++; } int year = 0; for (; year<completeYears; year++) { int period = year + 1; //double amount = FinancialUtils.calcDepreciationLinear(costCapital, completeYears, period); // [de] Buchwert // depreciation over full year //accumulateCodes(service, driver, cost, DEPRECIATION_LINEAR, yearIndex + period, amount); double amount = FinancialUtils.calcDepreciationGeometricDegressive(costCapital, utility.getInterestRate(), period); // [de] Buchwert // depreciation over full year accumulateCodes(service, driver, cost, yearIndex + period, amount); } return year + yearIndex; } /** * Return cost-list over given object. * @param object null for all services * @return [FactCosts_Total; Depreciation_Year1;.. TCO_YearN] public List getDepreciationCostBlock(TcoObject object, final String type) { TcoObject costObject = (object == null ? rootObject : object); // return getCosts(costObject, KIND_FC, type); List costs = new ArrayList(); List totalFacts = getTotalCosts(costObject, type); costs.add(new Double(getValue(totalFacts, INDEX_TOTAL))); for (int i=0; i<getDurationYears(); i++) { // print Depreciation-Years int index = i + INDEX_TOTAL + 1; costs.add(new Double(getValue(totalFacts, index))); } return costs; }*/ } --- NEW FILE: CalculatorTco.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 org.tcotool.model.Cost; import org.tcotool.model.CostDriver; import org.tcotool.model.FactCost; import org.tcotool.model.PersonalCost; import org.tcotool.model.Service; import org.tcotool.model.TcoObject; import ch.softenvironment.jomm.mvc.model.DbCodeType; /** * Calculator for specific TCO-Calculations. * @author Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1 $ $Date: 2008/06/15 18:39:14 $ */ public class CalculatorTco extends Calculator { public CalculatorTco(ModelUtility utility) { this(utility, (TcoObject)utility.getRoot(), 0); } public CalculatorTco(ModelUtility utility, TcoObject rootObject, long maxDurationMonths) { this(utility, rootObject, maxDurationMonths, null); } public CalculatorTco(ModelUtility utility, TcoObject rootObject, long maxDurationMonths, DbCodeType maskCode) { super(utility, rootObject, maxDurationMonths, maskCode); } /** * Accumulate the TCO-Costs for given cost' CostType: * @param driver owner of given cost * @param cost * @param totalCost (costs * factor) */ protected void calculate(Service service, CostDriver driver, Cost cost, double totalCost) { //double totalCost = cost.getAmount().doubleValue() * factor; boolean repeatable = (cost.getRepeatable() != null) && cost.getRepeatable().booleanValue(); int baseOffset = cost.getBaseOffset().intValue(); int baseYear = baseOffset / 12; int year = INDEX_TOTAL + 1 + baseYear; if (cost instanceof PersonalCost) { // usage=12 months! // 1) [0] total PersonalCost for a year (baseOffset irrelevant) accumulateCodes(service, driver, cost, INDEX_TOTAL, totalCost); // [1..n years] personal effort is the SAME for each following TCO-Year (usage=12 months!) /*if (repeatable) { calcTcoRepeatable(service, driver, cost, PERSONAL_TCO, totalCost, baseOffset); } else {*/ // 2) calculate [1+baseOffset] year if (baseOffset % 12 == 0) { accumulateCodes(service, driver, cost, year++, totalCost); } else { // treat first year partially ONLY! double part = totalCost / 12.0 * (12.0 - (double)(baseOffset - baseYear * 12.0)); accumulateCodes(service, driver, cost, year++, part); if (!repeatable) { // 3.1) book rest part of the costs in the following year accumulateCodes(service, driver, cost, year, totalCost - part); } } // 3.2) [2+baseOffset..n] years personal cost is the SAME for each following TCO-Year if (repeatable) { long completeYears = getMaxDurationMonths() / 12; for (; year<completeYears+1; year++) { accumulateCodes(service, driver, cost, year, totalCost); } // if the last year is not even in maxUsage long partialMonthInYear = getMaxDurationMonths() % 12; if (partialMonthInYear > 0) { // ignore partial costs in case of (baseOffset%12!=0) because repeatable anyway accumulateCodes(service, driver, cost, year, totalCost / 12.0 * partialMonthInYear); } } //} } else { FactCost fCost = (FactCost)cost; if ((fCost.getUsageDuration() != null) && (fCost.getUsageDuration().longValue() > 0)) { // 1) [0] total FactCost independent of usage (baseOffset irrelevant) accumulateCodes(service, driver, cost, INDEX_TOTAL, totalCost); // 2) [1+baseOffset..n] year double costPerMonth = totalCost / fCost.getUsageDuration().doubleValue(); for (int month=0; month<getMaxDurationMonths(); month++) { if ((month<fCost.getUsageDuration().intValue()) || repeatable) { if ((month > 0) && (month % 12 == 0)) { // next year year++; } accumulateCodes(service, driver, cost, year, costPerMonth); } else { break; } } /* // [1..n years] FactCost's divided by usage if (repeatable) { // usageDuration is in maxUsage range anyway if (fCost.getUsageDuration().longValue() < 12) { // the given cost-amount counts for whole year calcTcoRepeatable(service, driver, cost, FACT_TCO, totalCost, baseOffset); } else { calcTcoRepeatable(service, driver, cost, FACT_TCO, costPerMonth * 12.0, baseOffset); } } else { // once in maxUsage for whole UsageDuration long completeYears = fCost.getUsageDuration().longValue() / 12; double correctionCosts = 0.0; if (baseYear > 0) { // if baseOffset points to middle of year, only calculate costs partially in first relevant year double months = 12.0 - (double)(baseOffset % 12); correctionCosts = correctionCosts + costPerMonth * months; cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * months); year++; } for (; year<completeYears; year++) { // usage over full year correctionCosts = correctionCosts + costPerMonth * 12.0; cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * 12.0); } long partialMonthInYear = fCost.getUsageDuration().longValue() % 12; if (partialMonthInYear > 0) { // last Usage year adds only fraction part correctionCosts = correctionCosts + costPerMonth * (double)partialMonthInYear; cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * (double)partialMonthInYear); year++; } if (correctionCosts > totalCost) { // NASTY: because of baseOffset to many costs were booked in last year cummulateCodes(service, driver, cost, FACT_TCO, year - 1, totalCost - correctionCosts); } } */ } } } /** * Repeatable Cost's must be reconsidered after UsageDuration in years 1..n. private void calcTcoRepeatable(Service service, CostDriver driver, Cost cost, final String keyPrefix, double costPerYear, int baseOffset) { int baseYear = baseOffset / 12; // [1..n years] personal effort is added to each following TCO-Year long completeYears = getMaxDurationMonths() / 12; int year = 0 + baseYear; for (; year<completeYears; year++) { accumulateCodes(service, driver, cost, METHOD_TCO, year + INDEX_TOTAL + 1, costPerYear); } // if the last year is not even in maxUsage long partialMonthInYear = getMaxDurationMonths() % 12; if (partialMonthInYear > 0) { accumulateCodes(service, driver, cost, METHOD_TCO, year + INDEX_TOTAL + 1, costPerYear / 12.0 * partialMonthInYear); } } */ } --- NEW FILE: CalculatorLinearDepreciation.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 org.tcotool.model.Cost; import org.tcotool.model.CostDriver; import org.tcotool.model.FactCost; import org.tcotool.model.Service; import org.tcotool.model.TcoObject; import ch.softenvironment.math.MathUtils; /** * Accounting calculator for "linear depreciation". * @author Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1 $ $Date: 2008/06/15 18:39:14 $ */ public class CalculatorLinearDepreciation extends Calculator { /** * Initialize calculator for given rootObject and TotalCosts only. * @param object */ public CalculatorLinearDepreciation(ModelUtility utility) { this(utility, (TcoObject)utility.getRoot(), 0); } /** * @see #Calculator(ModelUtility, TcoObject, long, ServiceCategory, Responsibility) */ public CalculatorLinearDepreciation(ModelUtility utility, TcoObject rootObject, long maxDurationMonths) { super(utility, rootObject, maxDurationMonths, null); } /** * Accumulate costs of financial matters for e.g. accounting, interests, depreciation and the like * for the given cost in driver and service. * * (PersonalCost cannot be depreciated!) * @param service * @param driver * @param cost Consider FactCost's with a depreciationDuration > 1 year * @param capital (cost * factor) */ protected void calculate(Service service, CostDriver driver, Cost cost, double capital) { if (cost instanceof FactCost) { boolean repeatable = (cost.getRepeatable() != null) && cost.getRepeatable().booleanValue(); int baseOffset = (cost.getBaseOffset() == null ? 0 : cost.getBaseOffset().intValue()); int baseYear = baseOffset / 12; long depreciationDuration = ((FactCost)cost).getDepreciationDuration() == null ? 0 : ((FactCost)cost).getDepreciationDuration().longValue(); if (depreciationDuration > 12) { // 1) [0] total FactCost independent of depreciation (baseOffset irrelevant) accumulateCodes(service, driver, cost, INDEX_TOTAL, capital); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, INDEX_TOTAL, capital); // 2) [1+baseOffset..n] year double depreciationPerMonth = MathUtils.negate(new Double(capital / (double)depreciationDuration)).doubleValue(); // de: Abschreibungsbetrag per month FinancialUtils.calcDepreciationLinear(capital, cost.getDepreciationDuration().intValue(), 1); double currentCapital = capital; int year = INDEX_TOTAL + 1 + baseYear; // first relevant year accumulateCodes(service, driver, cost, year, capital); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, year, capital); for (int month=0; month<getMaxDurationMonths(); month++) { if ((month > 0) && (month % 12 == 0)) { // next year year++; // following years accumulateCodes(service, driver, cost, year, currentCapital); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, year, currentCapital); } accumulateCodes(service, driver, cost, year, depreciationPerMonth); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, year, depreciationPerMonth); currentCapital = currentCapital + depreciationPerMonth; if ((MathUtils.compare(currentCapital, 0.0) == 0) || (currentCapital < 0.0 /* should not happen */)) { if (repeatable) { // re-invest currentCapital = capital; accumulateCodes(service, driver, cost, year, capital); //storeIntoCodeList(serviceMap, KIND_FC, DEPRECIATION_LINEAR, year, capital); } else { // no more depreciable: currentCapital => 0.0; break; } } } } } } /** * Return cost-list over given object. * @param object null for all services * @return [FactCosts_Total; Depreciation_Year1;.. TCO_YearN] public List getDepreciationCostBlock(TcoObject object, final String type) { TcoObject costObject = (object == null ? rootObject : object); // return getCosts(costObject, KIND_FC, type); List costs = new ArrayList(); List totalFacts = getTotalCosts(costObject, type); costs.add(new Double(getValue(totalFacts, INDEX_TOTAL))); for (int i=0; i<getDurationYears(); i++) { // print Depreciation-Years int index = i + INDEX_TOTAL + 1; costs.add(new Double(getValue(totalFacts, index))); } return costs; }*/ } Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Calculator.java 15 May 2008 20:27:35 -0000 1.8 --- Calculator.java 15 Jun 2008 18:39:14 -0000 1.9 *************** *** 24,32 **** import org.tcotool.application.LauncherView; import org.tcotool.model.*; - import org.tcotool.standard.report.ReportTool; - import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; - import ch.softenvironment.math.FinancialUtils; import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.DeveloperException; --- 24,29 ---- [...1103 lines suppressed...] - * Return cost-list over given object. - * @param object null for all services - * @return [FactCosts_Total; Depreciation_Year1;.. TCO_YearN] - */ - public List getDepreciationCostBlock(TcoObject object, final String type) { - TcoObject costObject = (object == null ? rootObject : object); - List costs = new ArrayList(); - - List totalFacts = getTotalCosts(costObject, type); - costs.add(new Double(getValue(totalFacts, INDEX_TOTAL))); - for (int i=0; i<getDurationYears(); i++) { - // print Depreciation-Years - int index = i + INDEX_TOTAL + 1; - costs.add(new Double(getValue(totalFacts, index))); - } - return costs; - } } \ No newline at end of file --- 763,765 ---- |
From: Hirzel P. <ph...@us...> - 2008-05-18 16:25:22
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts/resources In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22607/src/org/tcotool/standard/charts/resources Modified Files: ChartTool_de.properties ChartTool.properties Log Message: NLS translations Index: ChartTool_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts/resources/ChartTool_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChartTool_de.properties 13 Jan 2006 13:07:48 -0000 1.2 --- ChartTool_de.properties 18 May 2008 16:25:12 -0000 1.3 *************** *** 3,5 **** CIYear = Jahr CIPersonalFact = PK + SK ! CITotal = Total Investitionen \ No newline at end of file --- 3,7 ---- CIYear = Jahr CIPersonalFact = PK + SK ! CITotal = Total Investitionen ! CWNoCode_text = Es sind keine spezifischen Codes definiert, diese Auswertung macht deshalb keinen Sinn. ! CWNoCode_title = Keine Codes für: \ No newline at end of file Index: ChartTool.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts/resources/ChartTool.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ChartTool.properties 13 Jan 2006 13:07:48 -0000 1.2 --- ChartTool.properties 18 May 2008 16:25:12 -0000 1.3 *************** *** 3,5 **** CIYear = Year CIPersonalFact = PC + FC ! CITotal = Total Investments \ No newline at end of file --- 3,7 ---- CIYear = Year CIPersonalFact = PC + FC ! CITotal = Total Investments ! CWNoCode_text = There are no specific codes defined, this report makes therefore no sense. ! CWNoCode_title = No codes for: \ No newline at end of file |
From: Hirzel P. <ph...@us...> - 2008-05-18 16:24:11
|
Update of /cvsroot/tcotool/TCO-Tool/plugins/org.tcotool.core.runtime/source/org/tcotool/core/runtime In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22194/plugins/org.tcotool.core.runtime/source/org/tcotool/core/runtime Modified Files: ApplicationPlugin.java Log Message: Error handling enhanced 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.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ApplicationPlugin.java 29 Jun 2006 22:51:36 -0000 1.6 --- ApplicationPlugin.java 18 May 2008 16:24:13 -0000 1.7 *************** *** 219,226 **** Class toolClass = pluginClass.getClassLoader().loadClass(ext.getParameter("class").valueAsString()); ! String text = ext.getParameter(key).valueAsString(); ! text = ResourceManager.getResource(toolClass, text, loader); if (StringUtils.isNullOrEmpty(text)) { ! Tracer.getInstance().runtimeWarning("No property for: " + key); return ""; } else { --- 219,230 ---- Class toolClass = pluginClass.getClassLoader().loadClass(ext.getParameter("class").valueAsString()); ! String text = null; ! Parameter param = ext.getParameter(key); ! if (param != null) { ! text = ResourceManager.getResource(toolClass, param.valueAsString(), loader); ! } ! if (StringUtils.isNullOrEmpty(text)) { ! Tracer.getInstance().runtimeWarning("No property in plugin.xml for <parameter id=\"" + key + "\"> (evtl. optional?)"); return ""; } else { *************** *** 228,232 **** } } catch (Throwable e) { ! Tracer.getInstance().runtimeWarning("Key: " + key + " failed (evtl. optional only): " + e.getLocalizedMessage()); return ""; } --- 232,236 ---- } } catch (Throwable e) { ! Tracer.getInstance().runtimeWarning("see plugin.xml for <parameter id=\"" + key + "\"> " + e.getLocalizedMessage()); return ""; } |
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19351/src/org/tcotool/application/resources Modified Files: ServiceDetailView_de.properties splash.jpg CostDriverDetailView.properties FindDialog_de.properties SystemParameterDetailView.properties CodeDetailView_de.properties CourseDetailView.properties CourseDetailView_de.properties ServiceDetailView.properties FindDialog.properties CodeDetailView.properties splash_de.jpg Added Files: ServiceDetailView_fr.properties CostCauseDetailView_fr.properties Log Message: NLS translations --- NEW FILE: CostCauseDetailView_fr.properties --- (This appears to be a binary file; contents omitted.) Index: CostDriverDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CostDriverDetailView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CostDriverDetailView.properties 7 May 2006 14:26:01 -0000 1.2 --- CostDriverDetailView.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,12 **** ! FrmWindow_text = Costdriver LblSite_text = Site: LblPhase_text = Phase: LblProcess_text = Process: LblCycle_text = Lifecycle: ! LblOccurance_text = Occurance per Site: ! LblTotal_toolTipText = Total of Costdriver by multitude ! LblTotalOccurance_toolTipText = Sum of all Occurances PnlCost_text = Costs ! PnlSite_text = Site-Assignment PnlRisk_text = Risk TbcType_text = Type --- 1,12 ---- ! FrmWindow_text = Cost driver LblSite_text = Site: LblPhase_text = Phase: LblProcess_text = Process: LblCycle_text = Lifecycle: ! LblOccurance_text = Occurrence per site: ! LblTotal_toolTipText = Sum of cost driver multiplied by multitude ! LblTotalOccurance_toolTipText = Sum of all occurrences PnlCost_text = Costs ! PnlSite_text = Site-assignment PnlRisk_text = Risk TbcType_text = Type --- NEW FILE: ServiceDetailView_fr.properties --- (This appears to be a binary file; contents omitted.) Index: splash_de.jpg =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/splash_de.jpg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsEUS28Z and /tmp/cvsVio50S differ Index: ServiceDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/ServiceDetailView_de.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ServiceDetailView_de.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- ServiceDetailView_de.properties 18 May 2008 16:18:05 -0000 1.2 *************** *** 2,6 **** LblName_text = Bezeichnung: LblMultitude_text = Menge: - LblBaseDate_text = Bezugsdatum: PnlDetail_text = Detail PnlCostDriver_text = Kostentreiber --- 2,5 ---- Index: CourseDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CourseDetailView_de.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CourseDetailView_de.properties 7 May 2006 14:24:52 -0000 1.1 --- CourseDetailView_de.properties 18 May 2008 16:18:05 -0000 1.2 *************** *** 3,7 **** LblSource_toolTipText = Standard Währung gemäss <{0}>: LblTarget_text = Ziel-Währung: ! LblFactor_text = Faktor: ! LblFactor_toolTipText = Ziel = Quelle * Faktor PnlDetails_text = Details \ No newline at end of file --- 3,7 ---- LblSource_toolTipText = Standard Währung gemäss <{0}>: LblTarget_text = Ziel-Währung: ! LblFactor_text = Kursfaktor: ! LblFactor_toolTipText = Ziel = Quelle * Kursfaktor PnlDetails_text = Details \ No newline at end of file Index: CourseDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CourseDetailView.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CourseDetailView.properties 7 May 2006 14:24:52 -0000 1.1 --- CourseDetailView.properties 18 May 2008 16:18:05 -0000 1.2 *************** *** 1,7 **** 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 \ No newline at end of file --- 1,7 ---- FrmWindow_text = Currencies ! LblSource_text = Source-currency: ! LblSource_toolTipText = Default currency according to <{0}> ! LblTarget_text = Target-currency: ! LblFactor_text = Exchange rate: ! LblFactor_toolTipText = Target = source * exchange rate PnlDetails_text = Details \ No newline at end of file Index: ServiceDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/ServiceDetailView.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ServiceDetailView.properties 29 Aug 2005 09:41:00 -0000 1.1.1.1 --- ServiceDetailView.properties 18 May 2008 16:18:05 -0000 1.2 *************** *** 2,11 **** LblName_text = Name: LblMultitude_text = Multitude: - LblBaseDate_text = Base date: PnlDetail_text = Detail PnlCostDriver_text = Costdriver PnlCost_text = Cost PnlDependencies_text = Dependencies ! LblCategory_text = Categorie: LblResponsibility_text = Responsibility: LblResponsibility_toolTipText = Service-Responsibilities --- 2,10 ---- LblName_text = Name: LblMultitude_text = Multitude: PnlDetail_text = Detail PnlCostDriver_text = Costdriver PnlCost_text = Cost PnlDependencies_text = Dependencies ! LblCategory_text = Category: LblResponsibility_text = Responsibility: LblResponsibility_toolTipText = Service-Responsibilities Index: SystemParameterDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/SystemParameterDetailView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SystemParameterDetailView.properties 25 Nov 2005 18:08:08 -0000 1.2 --- SystemParameterDetailView.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,16 **** ! FrmWindow_text = Options (Defaults) LblDepreciationInterestRate_text = Interest rate: ! LblDepreciationInterestRate_toolTipText = Interest rate relevant to calculate depreciation LblManYearHoursExternal_text = Man-year EXTERNAL: LblManYearHoursInternal_text = Man-year INTERNAL: CIMonth = Months LblReportCostExponent_toolTipText = Represenation of amounts ! LblReportCostExponent_text = Cost-\"Dimension\": LblReportDepreciationDuration_toolTipText = Duration to consider depreciation-costs. ! LblReportDepreciationDuration_text = Max. Depreciation duration: LblReportUsageDuration_toolTipText = Duration to consider TCO-costs. ! LblReportUsageDuration_text = Max. Usage duration: PnlBenchmarking_text = Benchmarking ! PnlCommon_text = Common TCO-Objekt settings PnlFactCost_text = Factcost settings PnlReporting_text = Reporting settings \ No newline at end of file --- 1,16 ---- ! FrmWindow_text = Options (defaults) LblDepreciationInterestRate_text = Interest rate: ! LblDepreciationInterestRate_toolTipText = Interest rate which is relevant to calculate depreciation LblManYearHoursExternal_text = Man-year EXTERNAL: LblManYearHoursInternal_text = Man-year INTERNAL: CIMonth = Months LblReportCostExponent_toolTipText = Represenation of amounts ! LblReportCostExponent_text = Cost-\"dimension\": LblReportDepreciationDuration_toolTipText = Duration to consider depreciation-costs. ! LblReportDepreciationDuration_text = Max. depreciation duration: LblReportUsageDuration_toolTipText = Duration to consider TCO-costs. ! LblReportUsageDuration_text = Max. usage duration: PnlBenchmarking_text = Benchmarking ! PnlCommon_text = Common TCO-object settings PnlFactCost_text = Factcost settings PnlReporting_text = Reporting settings \ No newline at end of file Index: FindDialog_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/FindDialog_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FindDialog_de.properties 25 Nov 2005 18:07:53 -0000 1.2 --- FindDialog_de.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,4 **** FrmWindow_text = Suchen ! LblExpression_text = Ausdruck: PnlScope_text = Bereich PnlOptions_text = Optionen --- 1,4 ---- FrmWindow_text = Suchen ! LblExpression_text = Suchen nach: PnlScope_text = Bereich PnlOptions_text = Optionen Index: FindDialog.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/FindDialog.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FindDialog.properties 25 Nov 2005 18:07:53 -0000 1.2 --- FindDialog.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,4 **** FrmWindow_text = Find ! LblExpression_text = Expression: PnlScope_text = Scope PnlOptions_text = Options --- 1,4 ---- FrmWindow_text = Find ! LblExpression_text = Search for: PnlScope_text = Scope PnlOptions_text = Options Index: CodeDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CodeDetailView_de.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeDetailView_de.properties 25 Nov 2005 18:07:53 -0000 1.2 --- CodeDetailView_de.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,6 **** FrmWindow_text = Codes verwalten (global) - PnlCost_text = Kosten-Codes - PnlCostDriver_text = Kostentreiber-Codes - PnlService_text = Dienst-Codes CERemoveCode = Achtung: Das Löschen von Codes kann dazu führen, dass ungültige Referenzen entstehen!\nDas Problem wird spätestens nach dem Speichern und Neuladen des ganzen Modells aufgelöst.\n\nWollen sie die Löschaktion trotzdem ausführen? CWImportCodes_title = Geschäftsobjekte (Codes) importieren --- 1,3 ---- Index: CodeDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/CodeDetailView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeDetailView.properties 25 Nov 2005 18:07:53 -0000 1.2 --- CodeDetailView.properties 18 May 2008 16:18:05 -0000 1.3 *************** *** 1,6 **** FrmWindow_text = Code administration (global settings) - PnlCost_text = Cost-Codes - PnlCostDriver_text = Costdriver-Codes - PnlService_text = Service-Codes CERemoveCode = Attention: Removing codes may lead to invalid references!\nSuch a problem will be corrected by saving and reloading a configuration atuomatically.\n\nDo you want to continue the remove action? CWImportCodes_title = Import Business-Objects (Codes) --- 1,3 ---- Index: splash.jpg =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/splash.jpg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsG8UZia and /tmp/cvsjbIVr3 differ |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:56:24
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10557/src/org/tcotool Modified Files: TcotoolUtility.java Log Message: Index: TcotoolUtility.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/TcotoolUtility.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TcotoolUtility.java 13 Jun 2007 20:13:56 -0000 1.5 --- TcotoolUtility.java 18 May 2008 15:56:28 -0000 1.6 *************** *** 39,43 **** server.register(org.tcotool.model.Currency.class,"tcotool.model.Currency"); server.register(org.tcotool.model.CostCause.class,"tcotool.model.CostCause"); ! server.register(org.tcotool.model.CostType.class,"tcotool.model.CostType"); server.register(org.tcotool.model.CostExponent.class,"tcotool.model.CostExponent"); server.register(org.tcotool.model.CostCentre.class,"tcotool.model.CostCentre"); --- 39,43 ---- server.register(org.tcotool.model.Currency.class,"tcotool.model.Currency"); server.register(org.tcotool.model.CostCause.class,"tcotool.model.CostCause"); ! //server.register(org.tcotool.model.CostType.class,"tcotool.model.CostType"); server.register(org.tcotool.model.CostExponent.class,"tcotool.model.CostExponent"); server.register(org.tcotool.model.CostCentre.class,"tcotool.model.CostCentre"); |
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9345/src/org/tcotool/application Modified Files: ServiceDetailView.java ModelDetailView.java DependencyDetailView.java PackageDetailView.java CostDriverDetailView.java Log Message: TcoObject#baseOffset removed Index: CostDriverDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CostDriverDetailView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CostDriverDetailView.java 13 Jun 2007 20:13:56 -0000 1.5 --- CostDriverDetailView.java 18 May 2008 15:54:14 -0000 1.6 *************** *** 1,13 **** package org.tcotool.application; - import java.text.NumberFormat; - import java.util.EventObject; - - import javax.swing.JMenuItem; - import javax.swing.JSeparator; - import ch.ehi.basics.i18n.ResourceBundle; - import ch.softenvironment.util.AmountFormat; - import ch.softenvironment.view.*; - import ch.softenvironment.view.swingext.JComboBoxUtility; /* * This library is free software; you can redistribute it and/or --- 1,4 ---- *************** *** 25,28 **** --- 16,31 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + import java.util.EventObject; + + import javax.swing.JMenuItem; + import javax.swing.JSeparator; + + import ch.ehi.basics.i18n.ResourceBundle; + import ch.softenvironment.util.AmountFormat; + import ch.softenvironment.util.ParserCSV; + import ch.softenvironment.view.*; + import ch.softenvironment.view.swingext.JComboBoxUtility; + import ch.softenvironment.view.table.NumberTableCellRenderer; + import ch.softenvironment.client.ResourceManager; import ch.softenvironment.client.UserActionRights; *************** *** 34,37 **** --- 37,41 ---- import org.tcotool.model.*; import org.tcotool.model.Process; + import org.tcotool.standard.report.ReportTool; import org.tcotool.tools.ModelUtility; /** *************** *** 65,71 **** private boolean ivjConnPtoP57Aligning = false; private boolean ivjConnPtoP58Aligning = false; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private javax.swing.JSeparator ivjJSeparator11 = null; private javax.swing.JPopupMenu ivjMnpPersonalCosts = null; --- 69,73 ---- *************** *** 78,82 **** private javax.swing.JMenuItem ivjMniNewFactCost = null; private javax.swing.JMenu ivjMnuNew = null; - private boolean ivjConnPtoP9Aligning = false; private javax.swing.JMenuItem ivjMniChangeCost = null; private javax.swing.JMenuItem ivjMniCopyCost = null; --- 80,83 ---- *************** *** 184,191 **** if (evt.getSource() == CostDriverDetailView.this.getObject() && (evt.getPropertyName().equals("cycle"))) connPtoP58SetTarget(); - if (evt.getSource() == CostDriverDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == CostDriverDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); if (evt.getSource() == CostDriverDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); --- 185,188 ---- *************** *** 464,468 **** } } - /** * connEtoC2: (ScpCostDriver.mouse.mouseReleased(java.awt.event.MouseEvent) --> CostDriverDetailView.genericPopupDisplay(Ljava.awt.event.MouseEvent;Ljavax.swing.JPopupMenu;)V) --- 461,464 ---- *************** *** 1001,1054 **** } /** - * connPtoP9SetSource: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetSource() { - /* Set the source from the target */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getObject().setBaseDate(getTxtBaseDate().getDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** - * connPtoP9SetTarget: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetTarget() { - /* Set the target from the source */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getTxtBaseDate().setDate(getObject().getBaseDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** * Create a new Object as a "copy" of a selected one (and open * it for e.g. in a DetailView). --- 997,1000 ---- *************** *** 1253,1257 **** java.awt.GridBagConstraints constraintsTbpGeneral = new java.awt.GridBagConstraints(); ! constraintsTbpGeneral.gridx = 0; constraintsTbpGeneral.gridy = 3; constraintsTbpGeneral.gridwidth = 2; constraintsTbpGeneral.fill = java.awt.GridBagConstraints.BOTH; --- 1199,1203 ---- java.awt.GridBagConstraints constraintsTbpGeneral = new java.awt.GridBagConstraints(); ! constraintsTbpGeneral.gridx = 0; constraintsTbpGeneral.gridy = 2; constraintsTbpGeneral.gridwidth = 2; constraintsTbpGeneral.fill = java.awt.GridBagConstraints.BOTH; *************** *** 1271,1290 **** getJPanel1().add(getLblMultitude(), constraintsLblMultitude); - java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); - constraintsLblBaseDate.gridx = 0; constraintsLblBaseDate.gridy = 2; - constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; - constraintsLblBaseDate.ipadx = 88; - constraintsLblBaseDate.insets = new java.awt.Insets(3, 13, 12, 6); - getJPanel1().add(getLblBaseDate(), constraintsLblBaseDate); - - 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; - constraintsTxtBaseDate.weightx = 1.0; - constraintsTxtBaseDate.ipadx = 114; - constraintsTxtBaseDate.insets = new java.awt.Insets(2, 7, 7, 374); - getJPanel1().add(getTxtBaseDate(), constraintsTxtBaseDate); - java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); constraintsTxtMultitude.gridx = 1; constraintsTxtMultitude.gridy = 1; --- 1217,1220 ---- *************** *** 1305,1309 **** return ivjJPanel1; } - /** * Return the JSeparator11 property value. --- 1235,1238 ---- *************** *** 1347,1372 **** } /** - * Return the JLabel18 property value. - * @return javax.swing.JLabel - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JLabel getLblBaseDate() { - if (ivjLblBaseDate == null) { - try { - ivjLblBaseDate = new javax.swing.JLabel(); - ivjLblBaseDate.setName("LblBaseDate"); - ivjLblBaseDate.setText("Bezugsdatum:"); - // user code begin {1} - ivjLblBaseDate.setText(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text")); - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjLblBaseDate; - } - /** * Return the JLabel11 property value. * @return javax.swing.JLabel --- 1276,1279 ---- *************** *** 1527,1531 **** return ivjLblTotal; } - /** * Return the JLabel322 property value. --- 1434,1437 ---- *************** *** 1553,1557 **** return ivjLblTotalFactCost; } - /** * Return the LblSumOccurance property value. --- 1459,1462 ---- *************** *** 1603,1607 **** return ivjLblTotalPersonalCost; } - /** * Return the MniChangeDriver property value. --- 1508,1511 ---- *************** *** 1814,1818 **** public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblOccurance()); } }); --- 1718,1722 ---- public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblOccurance(), ParserCSV.DEFAULT_SEPARATOR); } }); *************** *** 1850,1854 **** public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblCost()); } }); --- 1754,1758 ---- public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblCost(), ParserCSV.DEFAULT_SEPARATOR); } }); *************** *** 2003,2007 **** return ivjPnlDetail; } - /** * Return the SimpleEditorPanel1 property value. --- 1907,1910 ---- *************** *** 2272,2296 **** } /** - * Return the TxtBaseDate property value. - * @return ch.softenvironment.view.swingext.DateTextField - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private ch.softenvironment.view.swingext.DateTextField getTxtBaseDate() { - if (ivjTxtBaseDate == null) { - try { - ivjTxtBaseDate = new ch.softenvironment.view.swingext.DateTextField(); - ivjTxtBaseDate.setName("TxtBaseDate"); - ivjTxtBaseDate.setEditable(false); - // user code begin {1} - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjTxtBaseDate; - } - /** * Return the JTextField1 property value. * @return ch.softenvironment.view.swingext.NumberTextField --- 2175,2178 ---- *************** *** 2422,2426 **** return ivjTxtSumTotal; } - /** * Called whenever the part throws an exception. --- 2304,2307 ---- *************** *** 2457,2461 **** getMniChangeOccurance().addActionListener(ivjEventHandler); getMniRemoveOccurance().addActionListener(ivjEventHandler); - getTxtBaseDate().addPropertyChangeListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); connPtoP6SetTarget(); --- 2338,2341 ---- *************** *** 2466,2473 **** connPtoP58SetTarget(); connPtoP7SetTarget(); - connPtoP9SetTarget(); connPtoP4SetTarget(); } - /** * Initialize the class. --- 2346,2351 ---- *************** *** 2489,2498 **** 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())); ! /* ! javax.swing.ButtonGroup group = new javax.swing.ButtonGroup(); ! group.add(getRbtHardware()); ! group.add(getRbtSoftware()); ! group.add(getRbtStorage()); ! */ setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostDriver.class)); --- 2367,2371 ---- 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())); ! setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostDriver.class)); *************** *** 2508,2515 **** getCbxLifeCycle().setVisible(false); } - if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { - getLblBaseDate().setVisible(false); - getTxtBaseDate().setVisible(false); - } // user code end } --- 2381,2384 ---- *************** *** 2523,2530 **** tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblMultitude_text"), "multitude", 50); tm.addColumnAmount(ResourceManager.getResource(ServiceDetailView.class, "PnlCost_text"), "amount", 100); ! tm.addColumnEvaluated(ResourceManager.getResource(ServiceDetailView.class, "TbcTotal_text"), Formatter.COST_TOTAL, 100, new ch.softenvironment.view.table.AmountTableCellRenderer(), evaluator); ! tm.addColumn(ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text"), "currency", 40); tm.addColumn(ResourceManager.getResource(FactCostDetailView.class, "LblRepeatable_text"), "repeatable", 40); ! tm.addColumnEvaluated("%", Formatter.COST_PERCENTAGE, 40, new ch.softenvironment.view.table.PercentTableCellRenderer(), evaluator); tm.addColumn(ResourceManager.getResource(ServiceDetailView.class, "PnlNote_text"), "documentation", 100); tm.adjustTable(getTblCost()); --- 2392,2400 ---- tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblMultitude_text"), "multitude", 50); tm.addColumnAmount(ResourceManager.getResource(ServiceDetailView.class, "PnlCost_text"), "amount", 100); ! tm.addColumnEvaluated(ResourceManager.getResource(ServiceDetailView.class, "TbcTotal_text"), Formatter.COST_TOTAL, 100, new NumberTableCellRenderer(ch.softenvironment.util.AmountFormat.getAmountInstance()), evaluator); ! tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text"), "currency", 40, null, evaluator); ! //tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text"), Formatter.COSTDRIVER_CURRENCY, 50, null, evaluator); tm.addColumn(ResourceManager.getResource(FactCostDetailView.class, "LblRepeatable_text"), "repeatable", 40); ! tm.addColumnEvaluated("%", Formatter.COST_PERCENTAGE, 40, new ch.softenvironment.view.table.NumberTableCellRenderer(ReportTool.PERCENTAGE_FRACTION_DIGITS), evaluator); tm.addColumn(ResourceManager.getResource(ServiceDetailView.class, "PnlNote_text"), "documentation", 100); tm.adjustTable(getTblCost()); *************** *** 2652,2656 **** try { if (source.equals(getMniRemoveCost())) { ! java.util.List removedItems = removeSelectedItems(getTblCost()); //((DbTableModel)getTblCost().getModel()).remove(getTblCost().getSelectedRows()); //TODO Patch: XmlObjectServer cannot handle #deletePersistent() //getObject().getCost().removeAll(removedItems); --- 2522,2526 ---- try { if (source.equals(getMniRemoveCost())) { ! java.util.List removedItems = DbTableModel.removeSelectedItems(getTblCost(), getViewOptions(), false); //TODO Patch: XmlObjectServer cannot handle #deletePersistent() //getObject().getCost().removeAll(removedItems); *************** *** 2669,2673 **** refreshCost(); } else if (source.equals(getMniRemoveOccurance())) { ! java.util.List removedItems = removeSelectedItems(getTblOccurance()); // ((DbTableModel)getTblCostDriver().getModel()).remove(getTblCostDriver().getSelectedRows()); //getObject().getDriver().removeAll(removedItems); java.util.List list = new java.util.ArrayList(getObject().getOccurrance()); --- 2539,2543 ---- refreshCost(); } else if (source.equals(getMniRemoveOccurance())) { ! java.util.List removedItems = DbTableModel.removeSelectedItems(getTblOccurance(), getViewOptions(), false); //getObject().getDriver().removeAll(removedItems); java.util.List list = new java.util.ArrayList(getObject().getOccurrance()); *************** *** 2765,2774 **** DbObjectServer server = (((DbObject)object).getObjectServer()); // 1) common settings ! JComboBoxUtility.initComboBox(getCbxCurrencyFact(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyPersonal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxProjectPhase(), server.retrieveCodes(ProjectPhase.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(), JComboBoxUtility.SORT_KEEP_ORDER); ! JComboBoxUtility.initComboBox(getCbxLifeCycle(), server.retrieveCodes(LifeCycle.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(), JComboBoxUtility.SORT_KEEP_ORDER); ! JComboBoxUtility.initComboBox(getCbxProcess(), server.retrieveCodes(org.tcotool.model.Process.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); setObject((CostDriver)object); --- 2635,2644 ---- DbObjectServer server = (((DbObject)object).getObjectServer()); // 1) common settings ! JComboBoxUtility.initComboBox(getCbxCurrencyFact(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyPersonal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxProjectPhase(), server.retrieveCodes(ProjectPhase.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), JComboBoxUtility.SORT_KEEP_ORDER); ! JComboBoxUtility.initComboBox(getCbxLifeCycle(), server.retrieveCodes(LifeCycle.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), JComboBoxUtility.SORT_KEEP_ORDER); ! JComboBoxUtility.initComboBox(getCbxProcess(), server.retrieveCodes(org.tcotool.model.Process.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); setObject((CostDriver)object); *************** *** 2808,2812 **** connPtoP58SetTarget(); connPtoP7SetTarget(); - connPtoP9SetTarget(); connPtoP4SetTarget(); // user code begin {1} --- 2678,2681 ---- Index: ServiceDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/ServiceDetailView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ServiceDetailView.java 13 Jun 2007 20:13:56 -0000 1.5 --- ServiceDetailView.java 18 May 2008 15:54:14 -0000 1.6 *************** *** 1,3 **** --- 1,4 ---- package org.tcotool.application; + /* * This library is free software; you can redistribute it and/or *************** *** 25,33 **** --- 26,37 ---- import ch.softenvironment.jomm.mvc.model.DbObject; import ch.softenvironment.util.AmountFormat; + import ch.softenvironment.util.ParserCSV; import ch.softenvironment.view.BaseFrame; import ch.softenvironment.view.CommonUserAccess; import ch.softenvironment.view.swingext.JComboBoxUtility; import ch.softenvironment.view.table.*; + import org.tcotool.model.*; + import org.tcotool.standard.report.ReportTool; import org.tcotool.tools.Calculator; import org.tcotool.tools.ModelUtility; *************** *** 71,77 **** private javax.swing.JMenuItem ivjMniChangeDriver = null; private boolean ivjConnPtoP7Aligning = false; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; private javax.swing.JTextField ivjTxtName = null; --- 75,79 ---- *************** *** 98,102 **** private boolean ivjConnPtoP3Aligning = false; private boolean ivjConnPtoP4Aligning = false; - private boolean ivjConnPtoP9Aligning = false; private javax.swing.JLabel ivjLblDependencySum = null; private javax.swing.JLabel ivjLblTotalFactCost = null; --- 100,103 ---- *************** *** 182,189 **** if (evt.getSource() == ServiceDetailView.this.getObject() && (evt.getPropertyName().equals("responsibility"))) connPtoP13SetTarget(); - if (evt.getSource() == ServiceDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == ServiceDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); if (evt.getSource() == ServiceDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); --- 183,186 ---- *************** *** 1016,1069 **** } /** - * connPtoP9SetSource: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetSource() { - /* Set the source from the target */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getObject().setBaseDate(getTxtBaseDate().getDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** - * connPtoP9SetTarget: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetTarget() { - /* Set the target from the source */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getTxtBaseDate().setDate(getObject().getBaseDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** * Create a new Object as a "copy" of a selected one (and open * it for e.g. in a DetailView). --- 1013,1016 ---- *************** *** 1125,1129 **** return ivjCbxCategory; } - /** * Return the CbxCostCentre property value. --- 1072,1075 ---- *************** *** 1147,1151 **** return ivjCbxCostCentre; } - /** * Return the CbxCurrencyDependency property value. --- 1093,1096 ---- *************** *** 1279,1283 **** return ivjCbxResponsibility; } - /** * Return the ConsistencyController property value. --- 1224,1227 ---- *************** *** 1319,1323 **** java.awt.GridBagConstraints constraintsTbpMain = new java.awt.GridBagConstraints(); ! constraintsTbpMain.gridx = 0; constraintsTbpMain.gridy = 3; constraintsTbpMain.gridwidth = 2; constraintsTbpMain.fill = java.awt.GridBagConstraints.BOTH; --- 1263,1267 ---- java.awt.GridBagConstraints constraintsTbpMain = new java.awt.GridBagConstraints(); ! constraintsTbpMain.gridx = 0; constraintsTbpMain.gridy = 2; constraintsTbpMain.gridwidth = 2; constraintsTbpMain.fill = java.awt.GridBagConstraints.BOTH; *************** *** 1337,1356 **** getJPanel1().add(getLblMultitude(), constraintsLblMultitude); - java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); - constraintsLblBaseDate.gridx = 0; constraintsLblBaseDate.gridy = 2; - constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; - constraintsLblBaseDate.ipadx = 50; - constraintsLblBaseDate.insets = new java.awt.Insets(5, 11, 8, 10); - getJPanel1().add(getLblBaseDate(), constraintsLblBaseDate); - - 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; - constraintsTxtBaseDate.weightx = 1.0; - constraintsTxtBaseDate.ipadx = 126; - constraintsTxtBaseDate.insets = new java.awt.Insets(2, 10, 5, 381); - getJPanel1().add(getTxtBaseDate(), constraintsTxtBaseDate); - java.awt.GridBagConstraints constraintsTxtMultitude = new java.awt.GridBagConstraints(); constraintsTxtMultitude.gridx = 1; constraintsTxtMultitude.gridy = 1; --- 1281,1284 ---- *************** *** 1371,1375 **** return ivjJPanel1; } - /** * Return the JSeparator1 property value. --- 1299,1302 ---- *************** *** 1413,1438 **** } /** - * Return the JLabel18 property value. - * @return javax.swing.JLabel - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JLabel getLblBaseDate() { - if (ivjLblBaseDate == null) { - try { - ivjLblBaseDate = new javax.swing.JLabel(); - ivjLblBaseDate.setName("LblBaseDate"); - ivjLblBaseDate.setText("Bezugsdatum:"); - // user code begin {1} - ivjLblBaseDate.setText(getResourceString("LblBaseDate_text")); - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjLblBaseDate; - } - /** * Return the LblCostCentre1 property value. * @return javax.swing.JLabel --- 1340,1343 ---- *************** *** 1599,1603 **** return ivjLblTotalFactCost; } - /** * Return the JLabel311 property value. --- 1504,1507 ---- *************** *** 1625,1629 **** return ivjLblTotalPersonalCost; } - /** * Return the JLabel31 property value. --- 1529,1532 ---- *************** *** 1652,1656 **** return ivjLblTotalWithDependencyCost; } - /** * Return the JLabel3 property value. --- 1555,1558 ---- *************** *** 1679,1683 **** return ivjLblTotalWithoutDependencyCost; } - /** * Return the MniOpen property value. --- 1581,1584 ---- *************** *** 1869,1873 **** public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblServices()); } }); --- 1770,1774 ---- public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblServices(), ParserCSV.DEFAULT_SEPARATOR); } }); *************** *** 1905,1909 **** public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblCostDriver()); } }); --- 1806,1810 ---- public void actionPerformed(java.awt.event.ActionEvent e) { // call after extension-points are realized of extension ! exportTableData(getTblCostDriver(), ParserCSV.DEFAULT_SEPARATOR); } }); *************** *** 2297,2321 **** } /** - * Return the TxtBaseDate property value. - * @return ch.softenvironment.view.swingext.DateTextField - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private ch.softenvironment.view.swingext.DateTextField getTxtBaseDate() { - if (ivjTxtBaseDate == null) { - try { - ivjTxtBaseDate = new ch.softenvironment.view.swingext.DateTextField(); - ivjTxtBaseDate.setName("TxtBaseDate"); - ivjTxtBaseDate.setEditable(false); - // user code begin {1} - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjTxtBaseDate; - } - /** * Return the TxtMultitude property value. * @return ch.softenvironment.view.swingext.NumberTextField --- 2198,2201 ---- *************** *** 2504,2508 **** getCbxCategory().addItemListener(ivjEventHandler); getCbxResponsibility().addItemListener(ivjEventHandler); - getTxtBaseDate().addPropertyChangeListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); connPtoP6SetTarget(); --- 2384,2387 ---- *************** *** 2513,2520 **** connPtoP13SetTarget(); connPtoP14SetTarget(); - connPtoP9SetTarget(); connPtoP4SetTarget(); } - /** * Initialize the class. --- 2392,2397 ---- *************** *** 2541,2552 **** getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(Service.class)); getPnlStandardToolbar().setObjects(getObjects()); - - if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { - getLblBaseDate().setVisible(false); - getTxtBaseDate().setVisible(false); - } // user code end } public void initializeView() throws Throwable { DbTableModel tm = new DbTableModel(); tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblName_text"), "name", 80); --- 2418,2425 ---- getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(Service.class)); getPnlStandardToolbar().setObjects(getObjects()); // user code end } public void initializeView() throws Throwable { + NumberTableCellRenderer amountCellRenderer = new NumberTableCellRenderer(ch.softenvironment.util.AmountFormat.getAmountInstance()); DbTableModel tm = new DbTableModel(); tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblName_text"), "name", 80); *************** *** 2554,2572 **** // tm.addColumn("Typ", "type", 100); tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblMultitude_text"), "multitude", 50); ! tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "FrmWindow_text"), Formatter.COSTDRIVER_FACT_COST, 100, new AmountTableCellRenderer(), evaluator); ! tm.addColumnEvaluated(ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"), Formatter.COSTDRIVER_PERSONAL_COST, 100, new AmountTableCellRenderer(), evaluator); ! tm.addColumnEvaluated(getResourceString("TbcTotal_text"), Formatter.COSTDRIVER_TOTAL, 100, new AmountTableCellRenderer(), evaluator); tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text"), Formatter.COSTDRIVER_CURRENCY, 50, null, evaluator); ! tm.addColumnEvaluated("%", Formatter.COSTDRIVER_PERCENTAGE, 40, new PercentTableCellRenderer(), evaluator); tm.addColumn(getResourceString("PnlNote_text"), "documentation", 100); tm.adjustTable(getTblCostDriver()); ! String currency = LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency().getNameString(); tm = new DbTableModel(); tm.addColumnEvaluated(ResourceManager.getResource(DependencyDetailView.class, "PnlSupplier_text"), Formatter.SUPPLIER_NAME, 100, null, evaluator); tm.addColumnEvaluated(getResourceString("TbcType_text"), Formatter.SUPPLIER_TYPE, 60, null, evaluator); ! tm.addColumnEvaluated(getResourceString("PnlCost_text") + "[" + currency + "]", Formatter.SUPPLIER_COST, 60, new AmountTableCellRenderer(), evaluator); ! tm.addColumn(ResourceManager.getResource(DependencyDetailView.class, "SliDistribution_text") + " [%]", "distribution", 40, new PercentTableCellRenderer()); ! tm.addColumnEvaluated(ResourceManager.getResource(DependencyDetailView.class, "SliDistribution_text") + " [" + currency + "]", Formatter.SUPPLIER_CLIENT_COST, 60, new AmountTableCellRenderer(), evaluator); tm.addColumn(ResourceManager.getResourceAsNonLabeled(DependencyDetailView.class, "LblSupplierInfluence"), "supplierInfluence", 60); tm.addColumn(ResourceManager.getResource(DependencyDetailView.class, "ChxVariant_text"), "variant", 30); --- 2427,2445 ---- // tm.addColumn("Typ", "type", 100); tm.addColumn(ResourceManager.getResourceAsNonLabeled(ServiceDetailView.class, "LblMultitude_text"), "multitude", 50); ! tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "FrmWindow_text"), Formatter.COSTDRIVER_FACT_COST, 100, amountCellRenderer, evaluator); ! tm.addColumnEvaluated(ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"), Formatter.COSTDRIVER_PERSONAL_COST, 100, amountCellRenderer, evaluator); ! tm.addColumnEvaluated(getResourceString("TbcTotal_text"), Formatter.COSTDRIVER_TOTAL, 100, amountCellRenderer, evaluator); tm.addColumnEvaluated(ResourceManager.getResource(FactCostDetailView.class, "LblCurrency_text"), Formatter.COSTDRIVER_CURRENCY, 50, null, evaluator); ! tm.addColumnEvaluated("%", Formatter.COSTDRIVER_PERCENTAGE, 40, new NumberTableCellRenderer(ReportTool.PERCENTAGE_FRACTION_DIGITS), evaluator); tm.addColumn(getResourceString("PnlNote_text"), "documentation", 100); tm.adjustTable(getTblCostDriver()); ! String currency = LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency().getNameString(ModelUtility.getCodeTypeLocale()); tm = new DbTableModel(); tm.addColumnEvaluated(ResourceManager.getResource(DependencyDetailView.class, "PnlSupplier_text"), Formatter.SUPPLIER_NAME, 100, null, evaluator); tm.addColumnEvaluated(getResourceString("TbcType_text"), Formatter.SUPPLIER_TYPE, 60, null, evaluator); ! tm.addColumnEvaluated(getResourceString("PnlCost_text") + "[" + currency + "]", Formatter.SUPPLIER_COST, 60, amountCellRenderer, evaluator); ! tm.addColumn(ResourceManager.getResource(DependencyDetailView.class, "SliDistribution_text") + " [%]", "distribution", 40, new NumberTableCellRenderer(ReportTool.PERCENTAGE_FRACTION_DIGITS)); ! tm.addColumnEvaluated(ResourceManager.getResource(DependencyDetailView.class, "SliDistribution_text") + " [" + currency + "]", Formatter.SUPPLIER_CLIENT_COST, 60, amountCellRenderer, evaluator); tm.addColumn(ResourceManager.getResourceAsNonLabeled(DependencyDetailView.class, "LblSupplierInfluence"), "supplierInfluence", 60); tm.addColumn(ResourceManager.getResource(DependencyDetailView.class, "ChxVariant_text"), "variant", 30); *************** *** 2707,2711 **** //TODO Patch: XmlObjectServer cannot handle #deletePersistent() if (source.equals(getMniRemoveDriver())) { ! java.util.List removedItems = removeSelectedItems(getTblCostDriver()); // ((DbTableModel)getTblCostDriver().getModel()).remove(getTblCostDriver().getSelectedRows()); //getObject().getDriver().removeAll(removedItems); java.util.List list = new java.util.ArrayList(getObject().getDriver()); --- 2580,2584 ---- //TODO Patch: XmlObjectServer cannot handle #deletePersistent() if (source.equals(getMniRemoveDriver())) { ! java.util.List removedItems = DbTableModel.removeSelectedItems(getTblCostDriver(), getViewOptions(), false); //getObject().getDriver().removeAll(removedItems); java.util.List list = new java.util.ArrayList(getObject().getDriver()); *************** *** 2723,2727 **** refreshDriver(); } else if (source.equals(getMniRemoveDependency())) { ! java.util.List removedItems = removeSelectedItems(getTblServices()); java.util.Iterator iterator = removedItems.iterator(); while (iterator.hasNext()) { --- 2596,2600 ---- refreshDriver(); } else if (source.equals(getMniRemoveDependency())) { ! java.util.List removedItems = DbTableModel.removeSelectedItems(getTblServices(), getViewOptions(), false); java.util.Iterator iterator = removedItems.iterator(); while (iterator.hasNext()) { *************** *** 2809,2820 **** DbObjectServer server = ((DbObject)object).getObjectServer(); // reset codes ! JComboBoxUtility.initComboBox(getCbxCategory(), server.retrieveCodes(org.tcotool.model.ServiceCategory.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCostCentre(), server.retrieveCodes(org.tcotool.model.CostCentre.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxResponsibility(), server.retrieveCodes(org.tcotool.model.Responsibility.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyFact(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyResources(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyDependency(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyLocal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyAll(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); setObject((org.tcotool.model.Service)object); --- 2682,2693 ---- DbObjectServer server = ((DbObject)object).getObjectServer(); // reset codes ! JComboBoxUtility.initComboBox(getCbxCategory(), server.retrieveCodes(org.tcotool.model.ServiceCategory.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCostCentre(), server.retrieveCodes(org.tcotool.model.CostCentre.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxResponsibility(), server.retrieveCodes(org.tcotool.model.Responsibility.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyFact(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyResources(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyDependency(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyLocal(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyAll(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); setObject((org.tcotool.model.Service)object); *************** *** 2855,2859 **** connPtoP13SetTarget(); connPtoP14SetTarget(); - connPtoP9SetTarget(); connPtoP4SetTarget(); // user code begin {1} --- 2728,2731 ---- Index: PackageDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/PackageDetailView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PackageDetailView.java 13 Jun 2007 20:13:56 -0000 1.6 --- PackageDetailView.java 18 May 2008 15:54:14 -0000 1.7 *************** *** 38,49 **** private javax.swing.JPanel ivjPnlImport = null; private javax.swing.JTextField ivjTxtName = null; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; private boolean ivjConnPtoP1Aligning = false; private boolean ivjConnPtoP2Aligning = false; private boolean ivjConnPtoP4Aligning = false; - private boolean ivjConnPtoP9Aligning = false; private javax.swing.JButton ivjBtnFile = null; private javax.swing.JLabel ivjLblFile = null; --- 38,46 ---- *************** *** 69,76 **** if (evt.getSource() == PackageDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); - if (evt.getSource() == PackageDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == PackageDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); if (evt.getSource() == PackageDetailView.this.getConsistencyController() && (evt.getPropertyName().equals("inconsistencies"))) connEtoM1(evt); --- 66,69 ---- *************** *** 398,451 **** } /** - * connPtoP9SetSource: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetSource() { - /* Set the source from the target */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getObject().setBaseDate(getTxtBaseDate().getDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** - * connPtoP9SetTarget: (Object.baseDate <--> TxtBaseDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetTarget() { - /* Set the target from the source */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getTxtBaseDate().setDate(getObject().getBaseDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** * Create a new Object as a "copy" of a selected one (and open * it for e.g. in a DetailView). --- 391,394 ---- *************** *** 530,534 **** java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 55; --- 473,477 ---- java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 0; constraintsLblName.gridy = 0; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 55; *************** *** 537,541 **** 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; --- 480,484 ---- 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; *************** *** 546,550 **** java.awt.GridBagConstraints constraintsJTabbedPane1 = new java.awt.GridBagConstraints(); ! constraintsJTabbedPane1.gridx = 1; constraintsJTabbedPane1.gridy = 4; constraintsJTabbedPane1.gridwidth = 2; constraintsJTabbedPane1.fill = java.awt.GridBagConstraints.BOTH; --- 489,493 ---- java.awt.GridBagConstraints constraintsJTabbedPane1 = new java.awt.GridBagConstraints(); ! constraintsJTabbedPane1.gridx = 0; constraintsJTabbedPane1.gridy = 2; constraintsJTabbedPane1.gridwidth = 2; constraintsJTabbedPane1.fill = java.awt.GridBagConstraints.BOTH; *************** *** 558,562 **** java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 1; constraintsLblMultitude.gridy = 2; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 90; --- 501,505 ---- java.awt.GridBagConstraints constraintsLblMultitude = new java.awt.GridBagConstraints(); ! constraintsLblMultitude.gridx = 0; constraintsLblMultitude.gridy = 1; constraintsLblMultitude.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblMultitude.ipadx = 90; *************** *** 564,576 **** getJPanel1().add(getLblMultitude(), constraintsLblMultitude); - java.awt.GridBagConstraints constraintsLblBaseDate = new java.awt.GridBagConstraints(); - constraintsLblBaseDate.gridx = 1; constraintsLblBaseDate.gridy = 3; - constraintsLblBaseDate.anchor = java.awt.GridBagConstraints.NORTHWEST; - constraintsLblBaseDate.ipadx = 50; - constraintsLblBaseDate.insets = new java.awt.Insets(5, 17, 11, 7); - getJPanel1().add(getLblBaseDate(), constraintsLblBaseDate); - 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; --- 507,512 ---- getJPanel1().add(getLblMultitude(), constraintsLblMultitude); 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; *************** *** 579,591 **** constraintsTxtMultitude.insets = new java.awt.Insets(2, 8, 2, 292); getJPanel1().add(getTxtMultitude(), constraintsTxtMultitude); - - 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; - constraintsTxtBaseDate.weightx = 1.0; - constraintsTxtBaseDate.ipadx = 91; - constraintsTxtBaseDate.insets = new java.awt.Insets(2, 8, 8, 270); - getJPanel1().add(getTxtBaseDate(), constraintsTxtBaseDate); // user code begin {1} // user code end --- 515,518 ---- *************** *** 623,648 **** } /** - * Return the JLabel18 property value. - * @return javax.swing.JLabel - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JLabel getLblBaseDate() { - if (ivjLblBaseDate == null) { - try { - ivjLblBaseDate = new javax.swing.JLabel(); - ivjLblBaseDate.setName("LblBaseDate"); - ivjLblBaseDate.setText("Bezugsdatum:"); - // user code begin {1} - ivjLblBaseDate.setText(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text")); - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjLblBaseDate; - } - /** * Return the JLabel2 property value. * @return javax.swing.JLabel --- 550,553 ---- *************** *** 835,859 **** } /** - * Return the TxtBaseDate property value. - * @return ch.softenvironment.view.swingext.DateTextField - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private ch.softenvironment.view.swingext.DateTextField getTxtBaseDate() { - if (ivjTxtBaseDate == null) { - try { - ivjTxtBaseDate = new ch.softenvironment.view.swingext.DateTextField(); - ivjTxtBaseDate.setName("TxtBaseDate"); - ivjTxtBaseDate.setEditable(false); - // user code begin {1} - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjTxtBaseDate; - } - /** * Return the JTextField2 property value. * @return javax.swing.JTextField --- 740,743 ---- *************** *** 938,947 **** getPnlStandardToolbar().addToolBarListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); - getTxtBaseDate().addPropertyChangeListener(ivjEventHandler); connPtoP1SetTarget(); connPtoP2SetTarget(); connPtoP3SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); connPtoP6SetTarget(); } --- 822,829 ---- *************** *** 970,978 **** getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(TcoPackage.class)); getPnlStandardToolbar().setObjects(getObjects()); - - if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { - getLblBaseDate().setVisible(false); - getTxtBaseDate().setVisible(false); - } // user code end } --- 852,855 ---- *************** *** 1074,1078 **** connPtoP3SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); // user code begin {1} // user code end --- 951,954 ---- Index: DependencyDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/DependencyDetailView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DependencyDetailView.java 13 Jun 2007 20:13:56 -0000 1.3 --- DependencyDetailView.java 18 May 2008 15:54:14 -0000 1.4 *************** *** 1550,1556 **** setObject(null); DbObjectServer server = ((Dependency)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCurrencySupplier(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyDistribution(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxDegree(), server.retrieveCodes(org.tcotool.model.SupplierInfluence.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(), JComboBoxUtility.SORT_KEEP_ORDER); setObject((org.tcotool.model.Dependency)object); --- 1550,1556 ---- setObject(null); DbObjectServer server = ((Dependency)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCurrencySupplier(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyDistribution(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxDegree(), server.retrieveCodes(org.tcotool.model.SupplierInfluence.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), JComboBoxUtility.SORT_KEEP_ORDER); setObject((org.tcotool.model.Dependency)object); Index: ModelDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/ModelDetailView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ModelDetailView.java 13 Jun 2007 20:13:56 -0000 1.5 --- ModelDetailView.java 18 May 2008 15:54:14 -0000 1.6 *************** *** 43,57 **** private boolean ivjConnPtoP4Aligning = false; private javax.swing.JLabel ivjLblMultitude = null; - private boolean ivjConnPtoP9Aligning = false; private boolean ivjConnPtoP3Aligning = false; private boolean ivjConnPtoP5Aligning = false; - private javax.swing.JPanel ivjPnlImport = null; private javax.swing.JTextField ivjTxtAuthor = null; private javax.swing.JTextField ivjTxtName = null; private javax.swing.JTextField ivjTxtVersion = null; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { --- 43,56 ---- private boolean ivjConnPtoP4Aligning = false; private javax.swing.JLabel ivjLblMultitude = null; private boolean ivjConnPtoP3Aligning = false; private boolean ivjConnPtoP5Aligning = false; private javax.swing.JTextField ivjTxtAuthor = null; private javax.swing.JTextField ivjTxtName = null; private javax.swing.JTextField ivjTxtVersion = null; private javax.swing.JLabel ivjLblName = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; + private javax.swing.JLabel ivjLblAuthor = null; + private javax.swing.JLabel ivjLblVersion = null; + private ch.softenvironment.view.SimpleEditorPanel ivjPnlNote = null; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { *************** *** 87,94 **** if (evt.getSource() == ModelDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); - if (evt.getSource() == ModelDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == ModelDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; --- 86,89 ---- *************** *** 111,120 **** }; }; - private javax.swing.JButton ivjBtnChangeFile = null; - private javax.swing.JLabel ivjLblAuthor = null; - private javax.swing.JLabel ivjLblFile = null; - private javax.swing.JLabel ivjLblVersion = null; - private ch.softenvironment.view.SimpleEditorPanel ivjPnlNote = null; - private javax.swing.JTextField ivjTxtFile = null; /** * Constructor --- 106,109 ---- *************** *** 516,569 **** } /** - * connPtoP9SetSource: (Object.baseDate <--> TxtDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetSource() { - /* Set the source from the target */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getObject().setBaseDate(getTxtBaseDate().getDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** - * connPtoP9SetTarget: (Object.baseDate <--> TxtDate.date) - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private void connPtoP9SetTarget() { - /* Set the target from the source */ - try { - if (ivjConnPtoP9Aligning == false) { - // user code begin {1} - // user code end - ivjConnPtoP9Aligning = true; - if ((getObject() != null)) { - getTxtBaseDate().setDate(getObject().getBaseDate()); - } - // user code begin {2} - // user code end - ivjConnPtoP9Aligning = false; - } - } catch (java.lang.Throwable ivjExc) { - ivjConnPtoP9Aligning = false; - // user code begin {3} - // user code end - handleException(ivjExc); - } - } - /** * Create a new Object as a "copy" of a selected one (and open * it for e.g. in a DetailView). --- 505,508 ---- *************** *** 603,629 **** } /** - * Return the JButton1 property value. - * @return javax.swing.JButton - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JButton getBtnChangeFile() { - if (ivjBtnChangeFile == null) { - try { - ivjBtnChangeFile = new javax.swing.JButton(); - ivjBtnChangeFile.setName("BtnChangeFile"); - ivjBtnChangeFile.setText("..."); - ivjBtnChangeFile.setBounds(405, 20, 47, 25); - ivjBtnChangeFile.setEnabled(false); - // user code begin {1} - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjBtnChangeFile; - } - /** * Return the ConsistencyController property value. * @return ch.softenvironment.jomm.controls.ConsistencyController --- 542,545 ---- *************** *** 650,656 **** getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); getJPanel1().add(getLblMultitude(), getLblMultitude().getName()); - getJPanel1().add(getLblBaseDate(), getLblBaseDate().getName()); getJPanel1().add(getTxtMultitude(), getTxtMultitude().getName()); - getJPanel1().add(getTxtBaseDate(), getTxtBaseDate().getName()); // user code begin {1} // user code end --- 566,570 ---- *************** *** 673,677 **** ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); ! ivjJTabbedPane1.setBounds(9, 96, 507, 262); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); ivjJTabbedPane1.insertTab("Notiz", null, getPnlNote(), null, 1); --- 587,591 ---- ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); ! ivjJTabbedPane1.setBounds(9, 72, 507, 286); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); ivjJTabbedPane1.insertTab("Notiz", null, getPnlNote(), null, 1); *************** *** 713,764 **** } /** - * Return the JLabel18 property value. - * @return javax.swing.JLabel - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JLabel getLblBaseDate() { - if (ivjLblBaseDate == null) { - try { - ivjLblBaseDate = new javax.swing.JLabel(); - ivjLblBaseDate.setName("LblBaseDate"); - ivjLblBaseDate.setText("Bezugsdatum:"); - ivjLblBaseDate.setBounds(17, 63, 131, 14); - // user code begin {1} - ivjLblBaseDate.setText(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text")); - // user code end - } catch (java.lang.Throwable ivjExc) { - // user code begin {2} - // user code end - handleException(ivjExc); - } - } - return ivjLblBaseDate; - } - /** - * Return the JLabel2 property value. - * @return javax.swing.JLabel - */ - /* WARNING: THIS METHOD WILL BE REGENERATED. */ - private javax.swing.JLabel getLblFile() { - if (ivjLblFile == null) { - try { - ivjLblFile = new javax.swing.JLabel(); - ivjLblFile.setName("LblFile"); - ivjLblFile.setToolTipText("Import einer externen TCO-Konfiguration"); - ivjLblFile.setText("Datei:"); - ivjLblFile.setBounds(12, 26, 119, 14); - // user code begin {1} - ivjLblFile.setToolTipText(getResourceString("LblFile_toolTipText")); - iv... [truncated message content] |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:45:00
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5636/src/org/tcotool/application Modified Files: RiskDialog.java Log Message: Obsolete Index: RiskDialog.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/RiskDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RiskDialog.java 13 Jun 2007 20:13:56 -0000 1.2 --- RiskDialog.java 18 May 2008 15:44:58 -0000 1.3 *************** *** 1,5 **** package org.tcotool.application; - import ch.ehi.basics.i18n.ResourceBundle; /* --- 1,4 ---- *************** *** 24,27 **** --- 23,27 ---- * @author Peter Hirzel <i>soft</i>Environment * @version $Revision$ $Date$ + * @deprecated */ public class RiskDialog extends ch.softenvironment.view.BaseDialog { *************** *** 43,47 **** * @param modal boolean */ ! public RiskDialog(java.awt.Component owner, String title, boolean modal) { super(owner, modal); initialize(); --- 43,47 ---- * @param modal boolean */ ! public RiskDialog(java.awt.Frame owner, String title, boolean modal) { super(owner, modal); initialize(); |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:43:13
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5227/src/org/tcotool/standard/report Modified Files: ReportComplete.java ReportTco.java ReportTool.java ReportStaff.java ReportInvestment.java Log Message: Minor/Cosmetical changes Index: ReportInvestment.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportInvestment.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ReportInvestment.java 19 Jun 2007 07:03:57 -0000 1.5 --- ReportInvestment.java 18 May 2008 15:43:17 -0000 1.6 *************** *** 25,28 **** --- 25,29 ---- import org.tcotool.model.TcoPackage; import org.tcotool.tools.Calculator; + import org.tcotool.tools.ModelUtility; import ch.softenvironment.client.ResourceManager; *************** *** 86,90 **** // print data by CostType try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); --- 87,91 ---- // print data by CostType try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); Index: ReportComplete.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportComplete.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ReportComplete.java 13 Jun 2007 20:17:33 -0000 1.4 --- ReportComplete.java 18 May 2008 15:43:17 -0000 1.5 *************** *** 23,27 **** import ch.softenvironment.jomm.mvc.model.DbCodeType; - import ch.softenvironment.util.NlsUtils; import ch.softenvironment.client.ResourceManager; --- 23,26 ---- *************** *** 130,139 **** tableData("" + ModelUtility.getMultitudeFactor(object)); endElement(/*tr*/); - if (object.getBaseDate() != null) { - startTableRow(); - tableData(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text"), abstractCell); - tableData(NlsUtils.formatDate(object.getBaseDate())); - endTableRow(); - } if (object instanceof Service) { encodeCompleteEnum(ResourceManager.getResource(ServiceDetailView.class, "LblCategory_text"), ((Service)object).getCategory()); --- 129,132 ---- Index: ReportTco.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTco.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReportTco.java 19 Jun 2007 07:03:57 -0000 1.6 --- ReportTco.java 18 May 2008 15:43:17 -0000 1.7 *************** *** 20,23 **** --- 20,24 ---- import org.tcotool.model.*; import org.tcotool.tools.Calculator; + import org.tcotool.tools.ModelUtility; import org.tcotool.application.*; *************** *** 83,89 **** endTableRow(); ! // print data by CostType try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); --- 84,90 ---- endTableRow(); ! // print data by CostCause try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); *************** *** 94,98 **** } ! // print totals // List totalPersonal = calculator.getTotalCosts(root, Calculator.PERSONAL_TCO); // List totalFacts = calculator.getTotalCosts(root, Calculator.FACT_TCO); --- 95,99 ---- } ! // print total bottom lines // List totalPersonal = calculator.getTotalCosts(root, Calculator.PERSONAL_TCO); // List totalFacts = calculator.getTotalCosts(root, Calculator.FACT_TCO); *************** *** 164,191 **** /** * Print Columns for TCO in HTML: ! * [CostType] [PersonTotal] [[FactTotal] [TCO_Y1] [TCO_Y2]...] ! * @param service print to data of given service (null for all services) */ ! 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; ! List personalCosts = new ArrayList(); ! // if (reportKind == TCO) { ! // total FactCost's at all ! factCosts = calculator.getCosts(root, Calculator.FACT_TCO, code); ! // total PersonalCost's at all ! personalCosts = calculator.getCosts(root, Calculator.PERSONAL_TCO, code); ! // double personalTotal = Calculator.getValue(personalCosts, Calculator.INDEX_TOTAL); ! // tableDataAmount(personalTotal, false); ! // } ! ! // tableDataAmount(Calculator.getValue(factCosts, Calculator.INDEX_TOTAL), false); ! // sum Personal- & FactCost's together for TCO-Year-columns int year = 0; double sumTcoOverUsage = 0.0; --- 165,178 ---- /** * Print Columns for TCO in HTML: ! * [CostType] [TCO_Y1 (P+F)] [TCO_Y2 (P+F)]... ! * @param root @see Calculater#getCosts() */ ! protected void encodeCostBlockColumns(TcoObject root, Object code) throws IOException { ! List factCosts = calculator.getCosts(root, Calculator.FACT_TCO, code); ! List personalCosts = calculator.getCosts(root, Calculator.PERSONAL_TCO, code); ! startTableRow(); ! tableDataCode(code); ! // sum Personal- & FactCost's together for each TCO-Year[n]-column int year = 0; double sumTcoOverUsage = 0.0; Index: ReportTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportTool.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ReportTool.java 19 Jun 2007 08:21:14 -0000 1.9 --- ReportTool.java 18 May 2008 15:43:17 -0000 1.10 *************** *** 46,51 **** */ 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"; private static final long DEFAULT_DURATION = 48; protected Calculator calculator = null; --- 46,50 ---- */ public abstract class ReportTool extends ch.softenvironment.jomm.serialize.HtmlSerializer { ! public static final int PERCENTAGE_FRACTION_DIGITS = 1; private static final long DEFAULT_DURATION = 48; protected Calculator calculator = null; Index: ReportStaff.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/report/ReportStaff.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReportStaff.java 19 Jun 2007 07:03:57 -0000 1.6 --- ReportStaff.java 18 May 2008 15:43:17 -0000 1.7 *************** *** 63,70 **** TcoObject element = (TcoObject)rootObject; if (element instanceof TcoPackage) { ! double totalPersonalInternalHours = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.HOURS_INTERNAL), Calculator.INDEX_TOTAL);//Calculator.getValue(hours, 0); ! double totalPersonalExternalHours = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.HOURS_EXTERNAL), Calculator.INDEX_TOTAL); ! double totalPersonalInternalLumpSum = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); ! double totalPersonalExternalLumpSum = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); SystemParameter sysPar = LauncherView.getInstance().getUtility().getSystemParameter(); --- 63,70 ---- TcoObject element = (TcoObject)rootObject; if (element instanceof TcoPackage) { ! double totalPersonalInternalHours = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL);//Calculator.getValue(hours, 0); ! double totalPersonalExternalHours = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); ! double totalPersonalInternalLumpSum = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); ! double totalPersonalExternalLumpSum = Calculator.getValue(calculator.getCosts(element, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); SystemParameter sysPar = LauncherView.getInstance().getUtility().getSystemParameter(); *************** *** 110,118 **** 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(); --- 110,118 ---- endTableRow(); startTableRow(); ! tableDataLinked(Calculator.PERSONAL_COST_INTERNAL, StringUtils.getBooleanString(Boolean.TRUE), false); tableDataAmount(totalPersonalInternalLumpSum, false); endTableRow(); startTableRow(); ! tableDataLinked(Calculator.PERSONAL_COST_EXTERNAL, StringUtils.getBooleanString(Boolean.FALSE), false); tableDataAmount(totalPersonalExternalLumpSum, false); endTableRow(); *************** *** 130,137 **** endParagraph(); startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(Role.class), Calculator.ROLE_UNDEFINED, ResourceManager.getResource(RoleDetailView.class, "FrmWindow_text")); endParagraph(); startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(Activity.class), Calculator.ACTIVITY_UNDEFINED, ResourceManager.getResourceAsNonLabeled(PersonalCostDetailView.class, "LblActivity_text")); endParagraph(); } --- 130,137 ---- endParagraph(); startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(Role.class), Calculator.PERSONAL_ROLE_UNDEFINED, ResourceManager.getResource(RoleDetailView.class, "FrmWindow_text")); endParagraph(); startParagraph(); ! encodeCostBlock(null, element.getObjectServer().retrieveCodes(Activity.class), Calculator.PERSONAL_ACTIVITY_UNDEFINED, ResourceManager.getResourceAsNonLabeled(PersonalCostDetailView.class, "LblActivity_text")); endParagraph(); } *************** *** 158,162 **** // print data by CostType try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); --- 158,162 ---- // print data by CostType try { ! Iterator types = ListUtils.sort(codes, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale()), DbObject.PROPERTY_NAME).iterator(); while (types.hasNext()) { encodeCostBlockColumns(root, types.next()); |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:35:55
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1964/src/org/tcotool/tools Modified Files: ModelUtility.java Log Message: Refactoring Index: ModelUtility.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/ModelUtility.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ModelUtility.java 3 Mar 2008 22:06:29 -0000 1.12 --- ModelUtility.java 18 May 2008 15:35:54 -0000 1.13 *************** *** 50,56 **** */ 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(); --- 50,57 ---- */ public class ModelUtility implements ch.softenvironment.view.tree.TreeNodeUtility { ! //public static final Long EXPENDABLE_DURATION = new Long(12); // 12 month ! public static final String XSD = "http://www.interlis.ch/INTERLIS2.2 TcoTool.xsd"; private TcoModel model = null; ! private String filename = null; private Diagram dependencyDiagram = null; private Map iconMap = new HashMap(); *************** *** 61,65 **** public ModelUtility(DbObjectServer server) throws Throwable { super(); ! file = null; dependencyDiagram = null; // define DbEnumerations --- 62,66 ---- public ModelUtility(DbObjectServer server) throws Throwable { super(); ! filename = null; dependencyDiagram = null; // define DbEnumerations *************** *** 76,83 **** * @param model root-element */ ! public ModelUtility(TcoModel model, String file) throws Throwable { super(); this.model = model; ! this.file = file; fixModel(model); --- 77,84 ---- * @param model root-element */ ! public ModelUtility(TcoModel model, String filename) throws Throwable { super(); this.model = model; ! setFilename(filename); fixModel(model); *************** *** 269,273 **** group.setName(ResourceManager.getResource(ModelUtility.class, "CIItPlattform")); } ! private static CostCause createCostCause(XmlObjectServer server, Locale locale, final String iliCode, final String name, Boolean direct) throws Throwable { CostCause cause = (CostCause)server.createInstance(CostCause.class); cause.setIliCode(iliCode); --- 270,284 ---- group.setName(ResourceManager.getResource(ModelUtility.class, "CIItPlattform")); } ! public static CostCentre createCostCenter(XmlObjectServer server, Locale locale, final String iliCode, final String name) throws Throwable { ! CostCentre centre = (CostCentre)server.createInstance(CostCentre.class); ! centre.setIliCode(iliCode); ! centre.getName().setValue(name, locale); ! //cause.setDirect(direct); ! centre.save(); ! server.cacheCode(centre); ! centre.getNameString(); ! return centre; ! } ! public static CostCause createCostCause(XmlObjectServer server, Locale locale, final String iliCode, final String name, Boolean direct) throws Throwable { CostCause cause = (CostCause)server.createInstance(CostCause.class); cause.setIliCode(iliCode); *************** *** 440,448 **** * @return */ ! public String getFile() { ! return file; } ! public void setFile(String file) { ! this.file = file; } /** --- 451,462 ---- * @return */ ! public String getFilename() { ! return filename; } ! public void setFilename(final String filename) { ! this.filename = filename; ! if (getRoot() != null) { ! ((TcoModel)getRoot()).setName(new java.io.File(filename).getName()); ! } } /** *************** *** 619,622 **** --- 633,649 ---- } /** + * Return the given object as package or root if null. + * Convenience method. + * @param object + * @return + */ + public static TcoPackage getTcoPackageOrRoot(Object object) { + if (object == null) { + return (TcoPackage)LauncherView.getInstance().getUtility().getRoot(); + } else { + return (TcoPackage)object; + } + } + /** * Reuse data of assigned Catalogue. * @param cost *************** *** 689,693 **** * Return the root-element of the Model-Tree. */ ! public Object getRoot() { return model; } --- 716,720 ---- * Return the root-element of the Model-Tree. */ ! public Object /*TcoModel*/ getRoot() { return model; } *************** *** 743,746 **** --- 770,775 ---- } else if (type.equals(PersonalCost.class)) { return ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"); + } else if (type.equals(Cost.class)) { + return ResourceManager.getResource(FactCostDetailView.class, "FrmWindow_text") + "/" + ResourceManager.getResource(PersonalCostDetailView.class, "FrmWindow_text"); // DbEnumeration's } else if (type.equals(CostCause.class)) { *************** *** 885,888 **** --- 914,920 ---- return java.util.Locale.getDefault(); } + public static String getIliSender() { + return "www.tcotool.org (" + LauncherView.getVersion() + ")"; + } /** * Register the default DbCode's for new Configurations. *************** *** 907,918 **** server.mapCodes(org.tcotool.model.ServiceCategory.class, nlsText, locale); ! nlsText = new String[]{ ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIInternal"), ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIInfrastructure"), ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIMerchandising"), ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIEducation"), ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIAdministration"), ! ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIProduction") }; ! server.mapCodes(org.tcotool.model.CostCentre.class, nlsText, locale); nlsText = new String[]{ --- 939,948 ---- server.mapCodes(org.tcotool.model.ServiceCategory.class, nlsText, locale); ! createCostCenter(server, locale, CostCentre.INTERNAL, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIInternal")); ! createCostCenter(server, locale, CostCentre.INFRASTRUCTURE, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIInfrastructure")); ! createCostCenter(server, locale, CostCentre.MERCHANDISING, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIMerchandising")); ! createCostCenter(server, locale, CostCentre.EDUCATION, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIEducation")); ! createCostCenter(server, locale, CostCentre.ADMINISTRATION, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIAdministration")); ! createCostCenter(server, locale, CostCentre.PRODUCTION, ResourceManager.getResource(org.tcotool.model.CostCentre.class, "CIProduction")); nlsText = new String[]{ *************** *** 991,1007 **** java.util.Locale locale = getCodeTypeLocale(); - /*TODO remove OBSOLETE DbEnumeration CostType might only be referenced in configurations stored before V1.4 (do not create them any more!) - 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")); --- 1021,1024 ---- |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:34:21
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1530/src/org/tcotool/standard/charts Modified Files: ChartTool.java Log Message: Refactoring: adapt to JFreeChart V1.0.9 Index: ChartTool.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/standard/charts/ChartTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ChartTool.java 13 Jun 2007 20:16:39 -0000 1.5 --- ChartTool.java 18 May 2008 15:34:22 -0000 1.6 *************** *** 54,58 **** --- 54,60 ---- import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; + import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.NlsUtils; + import ch.softenvironment.util.UserException; import ch.softenvironment.client.ResourceManager; /** *************** *** 172,176 **** */ public JPanel createTcoBarChart(Class dbCodeType) throws Throwable { ! CategoryDataset categorydataset = createTotalCodeDataset(rootObject.getObjectServer().retrieveCodes(dbCodeType)); JFreeChart jfreechart = createBarChart(categorydataset, NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(dbCodeType)), LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency().getNameString()); ChartPanel chart = new ChartPanel(jfreechart); --- 174,182 ---- */ public JPanel createTcoBarChart(Class dbCodeType) throws Throwable { ! List codes = rootObject.getObjectServer().retrieveCodes(dbCodeType); ! if ((codes == null) || (codes.size() == 0)) { ! throw new UserException(ResourceManager.getResource(ChartTool.class, "CWNoCode_text"), ResourceManager.getResource(ChartTool.class, "CWNoCode_title") + " " + ModelUtility.getTypeString(dbCodeType)); ! } ! CategoryDataset categorydataset = createTotalCodeDataset(codes); JFreeChart jfreechart = createBarChart(categorydataset, NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(dbCodeType)), LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency().getNameString()); ChartPanel chart = new ChartPanel(jfreechart); *************** *** 197,202 **** * @throws Throwable */ ! public JPanel createTcoPieChart(Class dbCodeType) throws Throwable { ! CategoryDataset categorydataset = createTotalCodeDataset(rootObject.getObjectServer().retrieveCodes(dbCodeType)); JFreeChart jfreechart = createPieChart(categorydataset, dbCodeType); ChartPanel chartpanel = new ChartPanel(jfreechart); --- 203,212 ---- * @throws Throwable */ ! public JPanel createTcoPieChart(Class dbCodeType) throws Throwable { ! List codes = rootObject.getObjectServer().retrieveCodes(dbCodeType); ! if ((codes == null) || (codes.size() == 0)) { ! throw new UserException(ResourceManager.getResource(ChartTool.class, "CWNoCode_text"), ResourceManager.getResource(ChartTool.class, "CWNoCode_title") + " " + ModelUtility.getTypeString(dbCodeType)); ! } ! CategoryDataset categorydataset = createTotalCodeDataset(codes); JFreeChart jfreechart = createPieChart(categorydataset, dbCodeType); ChartPanel chartpanel = new ChartPanel(jfreechart); *************** *** 213,232 **** JFreeChart jfreechart = ChartFactory.createMultiplePieChart(NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(dbCodeType)), categorydataset, ! TableOrder.BY_COLUMN, true, ! true, false); MultiplePiePlot multiplepieplot = (MultiplePiePlot)jfreechart.getPlot(); ! multiplepieplot.setBackgroundPaint(Color.white); multiplepieplot.setOutlineStroke(new BasicStroke(1.0F)); ! JFreeChart jfreechart_0_ = multiplepieplot.getPieChart(); ! PiePlot pieplot = (PiePlot)jfreechart_0_.getPlot(); ! pieplot.setBackgroundPaint(null); ! pieplot.setOutlineStroke(null); pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator// StandardPieItemLabelGenerator (in JFreeCharts V0.9.6) ! ("{0} ({2})", ! NumberFormat.getNumberInstance(), ! NumberFormat.getPercentInstance())); ! pieplot.setMaximumLabelWidth(0.35); ! pieplot.setLabelFont(new java.awt.Font("SansSerif", 0, 9)); ! pieplot.setInteriorGap(0.3); return jfreechart; } --- 223,262 ---- JFreeChart jfreechart = ChartFactory.createMultiplePieChart(NlsUtils.formatMessage(ResourceManager.getResource(ChartTool.class, "CTCostByCodeType"), ModelUtility.getTypeString(dbCodeType)), categorydataset, ! TableOrder.BY_COLUMN, ! true, ! true, ! false); MultiplePiePlot multiplepieplot = (MultiplePiePlot)jfreechart.getPlot(); ! //multiplepieplot.setBackgroundPaint(Color.white); multiplepieplot.setOutlineStroke(new BasicStroke(1.0F)); ! JFreeChart pieChart = multiplepieplot.getPieChart(); ! PiePlot pieplot = (PiePlot)pieChart.getPlot(); ! //pieplot.setBackgroundPaint(null); ! //pieplot.setOutlineStroke(null); ! String currency = ""; ! try { ! currency = LauncherView.getInstance().getUtility().getSystemParameter().getDefaultCurrency().getNameString(); ! } catch(Throwable ex) { ! //ignore: don't show currency ! } ! //pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}")); pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator// StandardPieItemLabelGenerator (in JFreeCharts V0.9.6) ! (/*"{0} +*/ " {1}" + currency + " [{2}]", ! AmountFormat.getAmountInstance(LauncherView.getInstance().getSettings().getPlattformLocale()), ! NumberFormat.getPercentInstance())); // {0}=Text corresponding to color; {1}=partial value; {2}=partial % ! pieplot.setLabelFont(new java.awt.Font("SansSerif", 0, 7)); ! ! // only show existing parts ! pieplot.setIgnoreNullValues(true); ! pieplot.setIgnoreZeroValues(true); ! ! // set width of label and circle ! /* ! pieplot.setMaximumLabelWidth(0.25); // ==> buggy in V1.0.9 ! pieplot.setInteriorGap(0.07); // influences circle size ! pieplot.setLabelGap(0.07); ! */ ! pieplot.setSimpleLabels(true); ! return jfreechart; } |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:08:31
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25247/src/org/tcotool/model Removed Files: CostType.java Log Message: Obsolete CostType removed --- CostType.java DELETED --- |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:08:08
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25222/src/org/tcotool/model Modified Files: ProjectPhase.java LifeCycle.java Log Message: Set to @deprecated Index: LifeCycle.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/LifeCycle.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LifeCycle.java 13 Jun 2007 20:15:54 -0000 1.2 --- LifeCycle.java 18 May 2008 15:08:11 -0000 1.3 *************** *** 4,7 **** --- 4,10 ---- import ch.softenvironment.jomm.mvc.model.DbEnumeration; + /** + * @deprecated + */ public final class LifeCycle extends DbEnumeration { public static final String DEVELOPMENT = "Development"; Index: ProjectPhase.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/ProjectPhase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProjectPhase.java 13 Jun 2007 20:15:54 -0000 1.2 --- ProjectPhase.java 18 May 2008 15:08:11 -0000 1.3 *************** *** 2,5 **** --- 2,8 ---- import ch.softenvironment.jomm.descriptor.DbDescriptor; + /** + * @deprecated + */ import ch.softenvironment.jomm.mvc.model.DbCode; public final class ProjectPhase extends DbCode { |
From: Hirzel P. <ph...@us...> - 2008-05-18 15:07:15
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24829/src/org/tcotool/model Modified Files: CostCause.java CostCentre.java Log Message: Schema: #iliCode, #documentation Index: CostCause.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/CostCause.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CostCause.java 13 Jun 2007 20:15:54 -0000 1.4 --- CostCause.java 18 May 2008 15:07:13 -0000 1.5 *************** *** 1,5 **** --- 1,21 ---- package org.tcotool.model; + /* + * 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 org.tcotool.application.CostCauseDetailView; + import org.tcotool.tools.ModelUtility; import ch.softenvironment.client.ResourceManager; *************** *** 10,19 **** import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; - import ch.softenvironment.util.DeveloperException; /** ! * @author generated by the umleditor */ public final class CostCause extends DbCode { ! // standard CodeCause's for the most TCO-Configuration public static final String INSTALLATION = "Installation"; public static final String SERVICE = "Service"; --- 26,37 ---- import ch.softenvironment.jomm.mvc.model.DbCode; import ch.softenvironment.jomm.mvc.model.DbCodeType; /** ! * Cause/kind of costs. According to Gartner these can be defined by 2 categories: ! * - direct costs ! * - indirect costs ! * @author Peter Hirzel <i>soft</i>Environment */ public final class CostCause extends DbCode { ! // IliCode => DIRECT costs: HW, SW, Operation, Administration public static final String INSTALLATION = "Installation"; public static final String SERVICE = "Service"; *************** *** 27,92 **** public static final String HARDWARE = "Hardware"; public static final String STORAGE = "Storage"; ! ! public CostCause(ch.softenvironment.jomm.DbObjectServer objectServer) { ! super(objectServer); ! } ! public static DbDescriptor createDescriptor(Class dbCode) { ! DbDescriptor descriptor = DbCode.createDescriptor(dbCode); ! descriptor.add(DbCodeType.PROPERTY_ILICODE, DbCode.ATTRIBUTE_ILICODE, new DbTextFieldDescriptor(DbCode.ILI_CODE_LENGTH), new DbMultiplicityRange(0, 1)); ! descriptor.add("direct","direct",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); ! return descriptor; ! } ! private String fieldIliCode; ! /** ! * Overwrites. ! */ ! public final String getIliCode() { ! return fieldIliCode; ! } ! /** ! * Makes sense here because morphed from CostType-DbEnumeration. ! * @param iliCode ! */ ! public final void setIliCode(String iliCode) { ! if (getIliCode() != null) { ! throw new DeveloperException("IliCode must not be changed!"); } ! ! String oldValue = fieldIliCode; ! fieldIliCode = iliCode; ! firePropertyChange("iliCode", oldValue, iliCode); ! } ! private Boolean fieldDirect; ! /** ! * ! */ ! public final Boolean getDirect() { ! return fieldDirect; ! } ! /** ! * According to Gartner costs may be "direct" or "indirect". ! * ! */ ! public void setDirect(Boolean direct) { ! Boolean oldValue = fieldDirect; ! fieldDirect = direct; ! firePropertyChange("direct", oldValue, direct); ! } ! /** ! * Overwrites ! */ ! public String getNameString() { ! String text = ""; ! // return getNameString(java.util.Locale.getDefault()); ! if (getName() != null) { ! text = getName().getValue(); ! if (getDirect().booleanValue()) { ! text = text + " [" + ResourceManager.getResourceAsNonLabeled(CostCauseDetailView.class, "LblDirect_text") + "]"; ! } else { ! text = text + " [" + ResourceManager.getResourceAsNonLabeled(CostCauseDetailView.class, "LblIndirect_text") + "]"; ! } ! } ! return text; ! } } \ No newline at end of file --- 45,121 ---- public static final String HARDWARE = "Hardware"; public static final String STORAGE = "Storage"; + // IliCode => CodeCause's standard types: INDIRECT + public static final String DOWNTIME = "Downtime"; // server down, non-productive time, etc + public static final String END_USER_OPERATION = "EndUserOperation"; // if peers educate other users, User-Support, Surfing, etc ! public static DbDescriptor createDescriptor(Class dbCode) { ! DbDescriptor descriptor = DbCode.createDescriptor(dbCode); ! descriptor.add("documentation", "documentation", new DbTextFieldDescriptor(1024), new DbMultiplicityRange(0,1)); ! 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; } ! public CostCause(ch.softenvironment.jomm.DbObjectServer objectServer) { ! super(objectServer); ! } ! ! private String fieldIliCode; ! /** ! * Overwrites. ! */ ! public final String getIliCode() { ! return fieldIliCode; ! } ! /** ! * Define UNIQUE identifier (INTERLIS enumerator). ! * @param iliCode ! */ ! public final void setIliCode(String iliCode) { ! //TODO check whether new code is UNIQUE among all CostCause's ! String oldValue = fieldIliCode; ! fieldIliCode = iliCode; ! firePropertyChange("iliCode", oldValue, iliCode); ! } ! private Boolean fieldDirect; ! public final Boolean getDirect() { ! return fieldDirect; ! } ! /** ! * According to Gartner costs may be "direct" or "indirect". ! */ ! public void setDirect(Boolean direct) { ! Boolean oldValue = fieldDirect; ! fieldDirect = direct; ! firePropertyChange("direct", oldValue, direct); ! } ! /** ! * Overwrites ! */ ! public String getNameString() { ! String text = ""; ! // return getNameString(java.util.Locale.getDefault()); ! if (getName() != null) { ! text = getName().getValue(ModelUtility.getCodeTypeLocale()); ! if (getDirect().booleanValue()) { ! text = text + " [" + ResourceManager.getResourceAsNonLabeled(CostCauseDetailView.class, "LblDirect_text") + "]"; ! } else { ! text = text + " [" + ResourceManager.getResourceAsNonLabeled(CostCauseDetailView.class, "LblIndirect_text") + "]"; ! } ! } ! return text; ! } ! private String fieldDocumentation; ! public String getDocumentation() { ! refresh(false); // read lazy initialized objects ! return fieldDocumentation; ! } ! /** ! * Note about CostCause. ! * @param documentation ! */ ! public void setDocumentation(String documentation){ ! String oldValue=fieldDocumentation; ! fieldDocumentation=documentation; ! firePropertyChange("documentation", oldValue, fieldDocumentation); ! } } \ No newline at end of file Index: CostCentre.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/CostCentre.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CostCentre.java 13 Jun 2007 20:15:54 -0000 1.2 --- CostCentre.java 18 May 2008 15:07:13 -0000 1.3 *************** *** 1,8 **** --- 1,79 ---- package org.tcotool.model; + /* + * 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.jomm.descriptor.DbDescriptor; + import ch.softenvironment.jomm.descriptor.DbMultiplicityRange; + import ch.softenvironment.jomm.descriptor.DbTextFieldDescriptor; import ch.softenvironment.jomm.mvc.model.DbCode; + import ch.softenvironment.jomm.mvc.model.DbCodeType; + import ch.softenvironment.util.DeveloperException; + /** + * Cost centre. + * Accounting category. + * @author Peter Hirzel <i>soft</i>Environment + */ public final class CostCentre extends DbCode { + // IliCode => DIRECT costs: HW, SW, Operation, Administration + public static final String INTERNAL = "Internal"; + public static final String INFRASTRUCTURE = "Infrastructure"; + public static final String MERCHANDISING = "Merchandising"; + public static final String EDUCATION = "Education"; + public static final String ADMINISTRATION = "Administration"; + public static final String PRODUCTION = "Production"; + + public static DbDescriptor createDescriptor(Class dbCode) { + DbDescriptor descriptor = DbCode.createDescriptor(dbCode); + descriptor.add("documentation", "documentation", new DbTextFieldDescriptor(1024), new DbMultiplicityRange(0,1)); + 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; + } public CostCentre(ch.softenvironment.jomm.DbObjectServer objectServer) { super(objectServer); } + private String fieldIliCode; + /** + * Overwrites. + */ + public final String getIliCode() { + return fieldIliCode; + } + /** + * Makes sense here because morphed from CostType-DbEnumeration. + * @param iliCode + */ + public final void setIliCode(String iliCode) { + //TODO check whether new code is UNIQUE among all CostCentre's + String oldValue = fieldIliCode; + fieldIliCode = iliCode; + firePropertyChange("iliCode", oldValue, iliCode); + } + private String fieldDocumentation; + public String getDocumentation() { + refresh(false); // read lazy initialized objects + return fieldDocumentation; + } + /** + * Note about CostCause. + * @param documentation + */ + public void setDocumentation(String documentation){ + String oldValue=fieldDocumentation; + fieldDocumentation=documentation; + firePropertyChange("documentation", oldValue, fieldDocumentation); + } } |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:55:32
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20540/src/org/tcotool/model Modified Files: FactCost.java Cost.java Log Message: Feature: Cost#baseOffset, #expendable Index: Cost.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/Cost.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Cost.java 28 Dec 2005 11:52:30 -0000 1.2 --- Cost.java 18 May 2008 14:55:35 -0000 1.3 *************** *** 5,9 **** import ch.softenvironment.jomm.descriptor.DbNumericFieldDescriptor; /** ! * Effective calcuable Cost-Parameters. * @author generated by the umleditor */ --- 5,9 ---- import ch.softenvironment.jomm.descriptor.DbNumericFieldDescriptor; /** ! * Effective calculateable Cost-Parameters. * @author generated by the umleditor */ *************** *** 66,86 **** firePropertyChange("cause", oldValue, fieldCause); } - private org.tcotool.model.CostType fieldType; - /** - * @deprecated (replaced by CostCause - */ - public org.tcotool.model.CostType getType() { - refresh(false); // read lazy initialized objects - return fieldType; - } - /** - * @deprecated (replaced by CostCause - */ - public void setType(org.tcotool.model.CostType type){ - org.tcotool.model.CostType oldValue=fieldType; - fieldType=type; - firePropertyChange("type", oldValue, fieldType); - } - private java.lang.Long fieldDriverId; public java.lang.Long getDriverId() { --- 66,69 ---- *************** *** 95,98 **** --- 78,82 ---- public static DbDescriptor createDescriptor() { DbDescriptor descriptor = new DbDescriptor(Cost.class); + descriptor.add("baseOffset","baseOffset",new DbNumericFieldDescriptor(java.lang.Long.class,0.0,9999999.0,0),new DbMultiplicityRange(1,1)); descriptor.add("amount","amount",new DbNumericFieldDescriptor(java.lang.Double.class,0.0,9.99999999999E11,2),new DbMultiplicityRange(1,1)); descriptor.addCode("currency", "currency", new DbMultiplicityRange(1,1)); *************** *** 100,107 **** descriptor.add("repeatable","repeatable",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); descriptor.addCode("cause", "cause", new DbMultiplicityRange(0,1)); ! //TODO @deprecated CostType ! descriptor.addCode("type", "type", new DbMultiplicityRange(0,1)); descriptor.addManyToOneReferenceId(DbDescriptor.ASSOCIATION, "driverId", "T_Id_driver", new DbMultiplicityRange(1,1)); return descriptor; } } --- 84,105 ---- descriptor.add("repeatable","repeatable",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); descriptor.addCode("cause", "cause", new DbMultiplicityRange(0,1)); ! //descriptor.addCode("type", "type", new DbMultiplicityRange(0,1)); descriptor.addManyToOneReferenceId(DbDescriptor.ASSOCIATION, "driverId", "T_Id_driver", new DbMultiplicityRange(1,1)); return descriptor; } + + private java.lang.Long fieldBaseOffset; + public java.lang.Long getBaseOffset() { + return fieldBaseOffset; + } + /** + * Offset of cost impact from the very beginning of the whole + * TCO-Configuration in months. + * @param fieldBaseOffset + */ + public void setBaseOffset(java.lang.Long baseOffset) { + java.lang.Long oldValue=fieldBaseOffset; + fieldBaseOffset=baseOffset; + firePropertyChange("baseOffset", oldValue, fieldBaseOffset); + } } Index: FactCost.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/FactCost.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FactCost.java 18 Mar 2006 17:08:28 -0000 1.3 --- FactCost.java 18 May 2008 14:55:35 -0000 1.4 *************** *** 2,5 **** --- 2,6 ---- import ch.softenvironment.jomm.descriptor.DbDescriptor; + import ch.softenvironment.jomm.descriptor.DbFieldTypeDescriptor; import ch.softenvironment.jomm.descriptor.DbMultiplicityRange; import ch.softenvironment.jomm.descriptor.DbNumericFieldDescriptor; *************** *** 23,26 **** --- 24,29 ---- 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("expendable","expendable",new DbFieldTypeDescriptor(java.lang.Boolean.class),new DbMultiplicityRange(1,1)); + //TODO @deprecated 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)); *************** *** 85,88 **** --- 88,95 ---- firePropertyChange("catalogue", oldValue, catalogue); } + /** + * Time of accountancy depreciation time in months. + * @param depreciationDuration + */ public void setDepreciationDuration(java.lang.Long depreciationDuration){ java.lang.Long oldValue=fieldDepreciationDuration; *************** *** 122,125 **** --- 129,136 ---- firePropertyChange("serialNumber", oldValue, fieldSerialNumber); } + /** + * Time of lifecycle in months. + * @param usageDuration + */ public void setUsageDuration(java.lang.Long usageDuration){ java.lang.Long oldValue=fieldUsageDuration; *************** *** 127,129 **** --- 138,153 ---- firePropertyChange("usageDuration", oldValue, fieldUsageDuration); } + private Boolean fieldExpendable; + /** + * Define whether a thing is to be used as tool (for e.g. Computer) + * or "throw away material" like paper in a printre. (de "Verbrauchsmaterial"). + */ + public void setExpendable(Boolean expendable) { + Boolean oldValue = fieldExpendable; + fieldExpendable = expendable; + firePropertyChange("expendable", oldValue, expendable); + } + public Boolean getExpendable() { + return fieldExpendable; + } } \ No newline at end of file |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:55:32
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20540/src/org/tcotool/application Modified Files: PersonalCostDetailView.java FactCostDetailView.java Log Message: Feature: Cost#baseOffset, #expendable Index: PersonalCostDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/PersonalCostDetailView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PersonalCostDetailView.java 13 Jun 2007 20:13:56 -0000 1.6 --- PersonalCostDetailView.java 18 May 2008 14:55:35 -0000 1.7 *************** *** 36,44 **** private boolean ivjConnPtoP4Aligning = false; private javax.swing.JLabel ivjLblMultitude = null; - private boolean ivjConnPtoP9Aligning = false; private ch.softenvironment.view.SimpleEditorPanel ivjPnlNote = null; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; private javax.swing.JTextField ivjTxtName = null; --- 36,41 ---- *************** *** 78,81 **** --- 75,81 ---- private ch.softenvironment.view.swingext.NumberTextField ivjTxtAvailableHours = null; private javax.swing.JLabel ivjLblCause = null; + private javax.swing.JLabel ivjLblBaseOffset = null; + private ch.softenvironment.view.swingext.NumberTextField ivjTxtBaseOffset = null; + private javax.swing.JLabel ivjLblMonthBaseOffset = null; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { *************** *** 110,113 **** --- 110,115 ---- if (e.getSource() == PersonalCostDetailView.this.getTxtMultitude()) connPtoP4SetSource(); + if (e.getSource() == PersonalCostDetailView.this.getTxtBaseOffset()) + connPtoP9SetSource(); }; public void keyTyped(java.awt.event.KeyEvent e) {}; *************** *** 147,156 **** if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); - if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == PersonalCostDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("currency"))) connPtoP18SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; --- 149,156 ---- if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("currency"))) connPtoP18SetTarget(); + if (evt.getSource() == PersonalCostDetailView.this.getObject() && (evt.getPropertyName().equals("baseOffset"))) + connPtoP9SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; *************** *** 173,176 **** --- 173,177 ---- }; }; + private boolean ivjConnPtoP9Aligning = false; /** * Constructor *************** *** 1025,1029 **** } /** ! * connPtoP9SetSource: (Object.baseDate <--> TxtDate.date) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ --- 1026,1030 ---- } /** ! * connPtoP9SetSource: (Object.baseOffset <--> TxtBaseOffset.text) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ *************** *** 1036,1040 **** ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getObject().setBaseDate(getTxtBaseDate().getDate()); } // user code begin {2} --- 1037,1041 ---- ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getObject().setBaseOffset(new java.lang.Long(getTxtBaseOffset().getText())); } // user code begin {2} *************** *** 1050,1054 **** } /** ! * connPtoP9SetTarget: (Object.baseDate <--> TxtDate.date) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ --- 1051,1055 ---- } /** ! * connPtoP9SetTarget: (Object.baseOffset <--> TxtBaseOffset.text) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ *************** *** 1061,1065 **** ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getTxtBaseDate().setDate(getObject().getBaseDate()); } // user code begin {2} --- 1062,1066 ---- ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getTxtBaseOffset().setText(String.valueOf(getObject().getBaseOffset())); } // user code begin {2} *************** *** 1339,1345 **** getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); getJPanel1().add(getLblMultitude(), getLblMultitude().getName()); ! getJPanel1().add(getLblBaseDate(), getLblBaseDate().getName()); getJPanel1().add(getTxtMultitude(), getTxtMultitude().getName()); ! getJPanel1().add(getTxtBaseDate(), getTxtBaseDate().getName()); // user code begin {1} // user code end --- 1340,1347 ---- getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); getJPanel1().add(getLblMultitude(), getLblMultitude().getName()); ! getJPanel1().add(getLblBaseOffset(), getLblBaseOffset().getName()); getJPanel1().add(getTxtMultitude(), getTxtMultitude().getName()); ! getJPanel1().add(getTxtBaseOffset(), getTxtBaseOffset().getName()); ! getJPanel1().add(getLblMonthBaseOffset(), getLblMonthBaseOffset().getName()); // user code begin {1} // user code end *************** *** 1476,1488 **** */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private javax.swing.JLabel getLblBaseDate() { ! if (ivjLblBaseDate == null) { try { ! ivjLblBaseDate = new javax.swing.JLabel(); ! ivjLblBaseDate.setName("LblBaseDate"); ! ivjLblBaseDate.setText("Bezugsdatum:"); ! ivjLblBaseDate.setBounds(17, 63, 156, 14); // user code begin {1} ! ivjLblBaseDate.setText(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text")); // user code end } catch (java.lang.Throwable ivjExc) { --- 1478,1491 ---- */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private javax.swing.JLabel getLblBaseOffset() { ! if (ivjLblBaseOffset == null) { try { ! ivjLblBaseOffset = new javax.swing.JLabel(); ! ivjLblBaseOffset.setName("LblBaseOffset"); ! ivjLblBaseOffset.setText("Bezugsdatum:"); ! ivjLblBaseOffset.setBounds(17, 63, 156, 14); // user code begin {1} ! ivjLblBaseOffset.setText(ResourceManager.getResource(FactCostDetailView.class, "LblBaseOffset_text")); ! ivjLblBaseOffset.setToolTipText(ResourceManager.getResource(FactCostDetailView.class, "LblBaseOffset_toolTipText")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 1492,1496 **** } } ! return ivjLblBaseDate; } /** --- 1495,1499 ---- } } ! return ivjLblBaseOffset; } /** *************** *** 1587,1590 **** --- 1590,1617 ---- } /** + * Return the LblMonthBaseOffset property value. + * @return javax.swing.JLabel + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private javax.swing.JLabel getLblMonthBaseOffset() { + if (ivjLblMonthBaseOffset == null) { + try { + ivjLblMonthBaseOffset = new javax.swing.JLabel(); + ivjLblMonthBaseOffset.setName("LblMonthBaseOffset"); + ivjLblMonthBaseOffset.setText("Monate"); + ivjLblMonthBaseOffset.setBounds(263, 63, 73, 14); + // user code begin {1} + ivjLblMonthBaseOffset.setText(ResourceManager.getResource(FactCostDetailView.class, "LblMonths_text")); + ivjLblMonthBaseOffset.setBounds(263, 63, 73, 14); + // user code end + } catch (java.lang.Throwable ivjExc) { + // user code begin {2} + // user code end + handleException(ivjExc); + } + } + return ivjLblMonthBaseOffset; + } + /** * Return the LblMultitude property value. * @return javax.swing.JLabel *************** *** 1846,1861 **** } /** ! * Return the TxtBaseDate property value. ! * @return ch.softenvironment.view.swingext.DateTextField */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private ch.softenvironment.view.swingext.DateTextField getTxtBaseDate() { ! if (ivjTxtBaseDate == null) { try { ! ivjTxtBaseDate = new ch.softenvironment.view.swingext.DateTextField(); ! ivjTxtBaseDate.setName("TxtBaseDate"); ! ivjTxtBaseDate.setBounds(180, 60, 95, 20); ! ivjTxtBaseDate.setEditable(false); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 1873,1889 ---- } /** ! * Return the TxtBaseOffset property value. ! * @return ch.softenvironment.view.swingext.NumberTextField */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private ch.softenvironment.view.swingext.NumberTextField getTxtBaseOffset() { ! if (ivjTxtBaseOffset == null) { try { ! ivjTxtBaseOffset = new ch.softenvironment.view.swingext.NumberTextField(); ! ivjTxtBaseOffset.setName("TxtBaseOffset"); ! ivjTxtBaseOffset.setBounds(180, 60, 73, 20); ! ivjTxtBaseOffset.setEditable(true); // user code begin {1} + ivjTxtBaseOffset.setBounds(180, 60, 73, 20); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 1865,1869 **** } } ! return ivjTxtBaseDate; } /** --- 1893,1897 ---- } } ! return ivjTxtBaseOffset; } /** *************** *** 2026,2030 **** getTxtHours().addKeyListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); ! getTxtBaseDate().addPropertyChangeListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP1SetTarget(); --- 2054,2058 ---- getTxtHours().addKeyListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); ! getTxtBaseOffset().addKeyListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP1SetTarget(); *************** *** 2043,2048 **** connPtoP7SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); connPtoP18SetTarget(); } /** --- 2071,2076 ---- connPtoP7SetTarget(); connPtoP4SetTarget(); connPtoP18SetTarget(); + connPtoP9SetTarget(); } /** *************** *** 2070,2078 **** getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(PersonalCost.class)); getPnlStandardToolbar().setObjects(getObjects()); - - if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { - getLblBaseDate().setVisible(false); - getTxtBaseDate().setVisible(false); - } // user code end } --- 2098,2101 ---- *************** *** 2220,2229 **** DbObjectServer server = ((DbObject)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCostType(), server.retrieveCodes(CostCause.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxRole(), server.retrieveCodes(Role.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxActivity(), server.retrieveCodes(Activity.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyRole(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrency(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); setObject((org.tcotool.model.PersonalCost)object); --- 2243,2252 ---- DbObjectServer server = ((DbObject)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCostType(), server.retrieveCodes(CostCause.class), "nameString", false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxRole(), server.retrieveCodes(Role.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxActivity(), server.retrieveCodes(Activity.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyRole(), server.retrieveCodes(org.tcotool.model.Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrency(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); setObject((org.tcotool.model.PersonalCost)object); *************** *** 2270,2275 **** connPtoP7SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); connPtoP18SetTarget(); // user code begin {1} // user code end --- 2293,2298 ---- connPtoP7SetTarget(); connPtoP4SetTarget(); connPtoP18SetTarget(); + connPtoP9SetTarget(); // user code begin {1} // user code end Index: FactCostDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/FactCostDetailView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FactCostDetailView.java 13 Jun 2007 20:13:56 -0000 1.6 --- FactCostDetailView.java 18 May 2008 14:55:35 -0000 1.7 *************** *** 51,57 **** private boolean ivjConnPtoP9Aligning = false; private ch.softenvironment.view.SimpleEditorPanel ivjPnlNote = null; - private javax.swing.JLabel ivjLblBaseDate = null; private javax.swing.JLabel ivjLblName = null; - private ch.softenvironment.view.swingext.DateTextField ivjTxtBaseDate = null; private ch.softenvironment.view.swingext.NumberTextField ivjTxtMultitude = null; private javax.swing.JTextField ivjTxtName = null; --- 51,55 ---- *************** *** 97,100 **** --- 95,104 ---- private boolean ivjConnPtoP19Aligning = false; private javax.swing.JComboBox ivjCbxCatalogue = null; + private javax.swing.JLabel ivjLblCause = null; + private javax.swing.JLabel ivjLblBaseOffset = null; + private ch.softenvironment.view.swingext.NumberTextField ivjTxtBaseOffset = null; + private javax.swing.JLabel ivjLblMonthBaseOffset = null; + private javax.swing.JCheckBox ivjChxExpendable = null; + private boolean ivjConnPtoP20Aligning = false; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { *************** *** 112,115 **** --- 116,121 ---- if (e.getSource() == FactCostDetailView.this.getCbxCurrency()) connPtoP12SetTarget(); + if (e.getSource() == FactCostDetailView.this.getChxExpendable()) + connPtoP20SetSource(); }; public void keyPressed(java.awt.event.KeyEvent e) {}; *************** *** 133,136 **** --- 139,144 ---- if (e.getSource() == FactCostDetailView.this.getTxtMultitude()) connPtoP4SetSource(); + if (e.getSource() == FactCostDetailView.this.getTxtBaseOffset()) + connPtoP9SetSource(); }; public void keyTyped(java.awt.event.KeyEvent e) {}; *************** *** 172,181 **** if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); - if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("baseDate"))) - connPtoP9SetTarget(); - if (evt.getSource() == FactCostDetailView.this.getTxtBaseDate() && (evt.getPropertyName().equals("date"))) - connPtoP9SetSource(); if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("catalogue"))) connPtoP19SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; --- 180,189 ---- if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("multitude"))) connPtoP4SetTarget(); if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("catalogue"))) connPtoP19SetTarget(); + if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("baseOffset"))) + connPtoP9SetTarget(); + if (evt.getSource() == FactCostDetailView.this.getObject() && (evt.getPropertyName().equals("expendable"))) + connPtoP20SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; *************** *** 198,202 **** }; }; - private javax.swing.JLabel ivjLblCause = null; /** * Constructor --- 206,209 ---- *************** *** 775,778 **** --- 782,835 ---- } /** + * connPtoP20SetSource: (Object.expendable <--> ChxExpendable.selected) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP20SetSource() { + /* Set the source from the target */ + try { + if (ivjConnPtoP20Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP20Aligning = true; + if ((getObject() != null)) { + getObject().setExpendable(new java.lang.Boolean(getChxExpendable().isSelected())); + } + // user code begin {2} + // user code end + ivjConnPtoP20Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP20Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** + * connPtoP20SetTarget: (Object.expendable <--> ChxExpendable.selected) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP20SetTarget() { + /* Set the target from the source */ + try { + if (ivjConnPtoP20Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP20Aligning = true; + if ((getObject() != null)) { + getChxExpendable().setSelected((getObject().getExpendable()).booleanValue()); + } + // user code begin {2} + // user code end + ivjConnPtoP20Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP20Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** * connPtoP2SetSource: (object.name <--> JTextField1.text) */ *************** *** 1153,1157 **** ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getObject().setBaseDate(getTxtBaseDate().getDate()); } // user code begin {2} --- 1210,1214 ---- ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getObject().setBaseOffset(new java.lang.Long(getTxtBaseOffset().getText())); } // user code begin {2} *************** *** 1178,1182 **** ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getTxtBaseDate().setDate(getObject().getBaseDate()); } // user code begin {2} --- 1235,1239 ---- ivjConnPtoP9Aligning = true; if ((getObject() != null)) { ! getTxtBaseOffset().setText(String.valueOf(getObject().getBaseOffset())); } // user code begin {2} *************** *** 1325,1329 **** ivjChxEstimated.setName("ChxEstimated"); ivjChxEstimated.setText("Geschätzt (!)"); ! ivjChxEstimated.setBounds(460, 154, 139, 22); ivjChxEstimated.setEnabled(true); // user code begin {1} --- 1382,1386 ---- ivjChxEstimated.setName("ChxEstimated"); ivjChxEstimated.setText("Geschätzt (!)"); ! ivjChxEstimated.setBounds(460, 154, 182, 22); ivjChxEstimated.setEnabled(true); // user code begin {1} *************** *** 1339,1342 **** --- 1396,1424 ---- } /** + * Return the ChxEstimated1 property value. + * @return javax.swing.JCheckBox + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private javax.swing.JCheckBox getChxExpendable() { + if (ivjChxExpendable == null) { + try { + ivjChxExpendable = new javax.swing.JCheckBox(); + ivjChxExpendable.setName("ChxExpendable"); + ivjChxExpendable.setText("Verbrauchsmaterial"); + ivjChxExpendable.setBounds(460, 127, 182, 22); + ivjChxExpendable.setEnabled(true); + // user code begin {1} + ivjChxExpendable.setText(ResourceManager.getResource(CatalogueDetailView.class, "ChxExpendable_text")); + ivjChxExpendable.setToolTipText(ResourceManager.getResource(CatalogueDetailView.class, "ChxExpendable_toolTipText")); + // user code end + } catch (java.lang.Throwable ivjExc) { + // user code begin {2} + // user code end + handleException(ivjExc); + } + } + return ivjChxExpendable; + } + /** * Return the JCheckBox1 property value. * @return javax.swing.JCheckBox *************** *** 1388,1394 **** getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); getJPanel1().add(getLblMultitude(), getLblMultitude().getName()); ! getJPanel1().add(getLblBaseDate(), getLblBaseDate().getName()); getJPanel1().add(getTxtMultitude(), getTxtMultitude().getName()); ! getJPanel1().add(getTxtBaseDate(), getTxtBaseDate().getName()); // user code begin {1} // user code end --- 1470,1477 ---- getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); getJPanel1().add(getLblMultitude(), getLblMultitude().getName()); ! getJPanel1().add(getLblBaseOffset(), getLblBaseOffset().getName()); getJPanel1().add(getTxtMultitude(), getTxtMultitude().getName()); ! getJPanel1().add(getTxtBaseOffset(), getTxtBaseOffset().getName()); ! getJPanel1().add(getLblMonthBaseOffset(), getLblMonthBaseOffset().getName()); // user code begin {1} // user code end *************** *** 1481,1493 **** */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private javax.swing.JLabel getLblBaseDate() { ! if (ivjLblBaseDate == null) { try { ! ivjLblBaseDate = new javax.swing.JLabel(); ! ivjLblBaseDate.setName("LblBaseDate"); ! ivjLblBaseDate.setText("Bezugsdatum:"); ! ivjLblBaseDate.setBounds(17, 63, 163, 14); // user code begin {1} ! ivjLblBaseDate.setText(ResourceManager.getResource(ServiceDetailView.class, "LblBaseDate_text")); // user code end } catch (java.lang.Throwable ivjExc) { --- 1564,1577 ---- */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private javax.swing.JLabel getLblBaseOffset() { ! if (ivjLblBaseOffset == null) { try { ! ivjLblBaseOffset = new javax.swing.JLabel(); ! ivjLblBaseOffset.setName("LblBaseOffset"); ! ivjLblBaseOffset.setText("Bezugsdatum:"); ! ivjLblBaseOffset.setBounds(17, 63, 163, 14); // user code begin {1} ! ivjLblBaseOffset.setText(ResourceManager.getResource(FactCostDetailView.class, "LblBaseOffset_text")); ! ivjLblBaseOffset.setToolTipText(ResourceManager.getResource(FactCostDetailView.class, "LblBaseOffset_toolTipText")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 1497,1501 **** } } ! return ivjLblBaseDate; } /** --- 1581,1585 ---- } } ! return ivjLblBaseOffset; } /** *************** *** 1572,1575 **** --- 1656,1682 ---- } /** + * Return the LblMonthBaseOffset property value. + * @return javax.swing.JLabel + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private javax.swing.JLabel getLblMonthBaseOffset() { + if (ivjLblMonthBaseOffset == null) { + try { + ivjLblMonthBaseOffset = new javax.swing.JLabel(); + ivjLblMonthBaseOffset.setName("LblMonthBaseOffset"); + ivjLblMonthBaseOffset.setText("Monate"); + ivjLblMonthBaseOffset.setBounds(266, 64, 73, 14); + // user code begin {1} + ivjLblMonthBaseOffset.setText(getResourceString("LblMonths_text")); + // user code end + } catch (java.lang.Throwable ivjExc) { + // user code begin {2} + // user code end + handleException(ivjExc); + } + } + return ivjLblMonthBaseOffset; + } + /** * Return the JLabel413 property value. * @return javax.swing.JLabel *************** *** 1872,1875 **** --- 1979,1983 ---- getPnlDetail().add(getLblCatalogue(), getLblCatalogue().getName()); getPnlDetail().add(getCbxCatalogue(), getCbxCatalogue().getName()); + getPnlDetail().add(getChxExpendable(), getChxExpendable().getName()); // user code begin {1} // user code end *************** *** 2000,2014 **** } /** ! * Return the TxtBaseDate property value. ! * @return ch.softenvironment.view.swingext.DateTextField */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private ch.softenvironment.view.swingext.DateTextField getTxtBaseDate() { ! if (ivjTxtBaseDate == null) { try { ! ivjTxtBaseDate = new ch.softenvironment.view.swingext.DateTextField(); ! ivjTxtBaseDate.setName("TxtBaseDate"); ! ivjTxtBaseDate.setBounds(188, 60, 95, 20); ! ivjTxtBaseDate.setEditable(false); // user code begin {1} // user code end --- 2108,2122 ---- } /** ! * Return the TxtBaseOffset property value. ! * @return ch.softenvironment.view.swingext.NumberTextField */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! private ch.softenvironment.view.swingext.NumberTextField getTxtBaseOffset() { ! if (ivjTxtBaseOffset == null) { try { ! ivjTxtBaseOffset = new ch.softenvironment.view.swingext.NumberTextField(); ! ivjTxtBaseOffset.setName("TxtBaseOffset"); ! ivjTxtBaseOffset.setBounds(188, 60, 73, 20); ! ivjTxtBaseOffset.setEditable(true); // user code begin {1} // user code end *************** *** 2019,2023 **** } } ! return ivjTxtBaseDate; } /** --- 2127,2131 ---- } } ! return ivjTxtBaseOffset; } /** *************** *** 2269,2274 **** getTxtPortsServer().addKeyListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); - getTxtBaseDate().addPropertyChangeListener(ivjEventHandler); getCbxCatalogue().addItemListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP1SetTarget(); --- 2377,2383 ---- getTxtPortsServer().addKeyListener(ivjEventHandler); getTxtMultitude().addKeyListener(ivjEventHandler); getCbxCatalogue().addItemListener(ivjEventHandler); + getTxtBaseOffset().addKeyListener(ivjEventHandler); + getChxExpendable().addItemListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP1SetTarget(); *************** *** 2287,2293 **** connPtoP16SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); connPtoP19SetTarget(); connPtoP12SetTarget(); } /** --- 2396,2403 ---- connPtoP16SetTarget(); connPtoP4SetTarget(); connPtoP19SetTarget(); connPtoP12SetTarget(); + connPtoP9SetTarget(); + connPtoP20SetTarget(); } /** *************** *** 2315,2323 **** getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(FactCost.class)); getPnlStandardToolbar().setObjects(getObjects()); - - if (!LauncherView.getInstance().getSettings().isModeAdvanced()) { - getLblBaseDate().setVisible(false); - getTxtBaseDate().setVisible(false); - } // user code end } --- 2425,2428 ---- *************** *** 2335,2339 **** Catalogue catalogue = (Catalogue)getCbxCatalogue().getSelectedItem(); // other catalog assigned -> reuse name initially ! getObject().setName(catalogue.getNameString()); } refreshTotal(); // will also set catalogue changes --- 2440,2444 ---- Catalogue catalogue = (Catalogue)getCbxCatalogue().getSelectedItem(); // other catalog assigned -> reuse name initially ! getObject().setName(catalogue.getNameString()); } refreshTotal(); // will also set catalogue changes *************** *** 2361,2368 **** getTxtUsage().setEditable(catalogMissing); getTxtDepreciation().setEditable(catalogMissing); if (!catalogMissing) { ModelUtility.updateCatalogue(getObject()); } ! java.text.NumberFormat af = AmountFormat.getInstance(LauncherView.getInstance().getSettings().getPlattformLocale()); getTxtCostTotal().setText(af.format(org.tcotool.tools.Calculator.calc(getObject()))); } catch(Throwable e) { --- 2466,2474 ---- getTxtUsage().setEditable(catalogMissing); getTxtDepreciation().setEditable(catalogMissing); + getChxExpendable().setEnabled(catalogMissing); if (!catalogMissing) { ModelUtility.updateCatalogue(getObject()); } ! java.text.NumberFormat af = AmountFormat.getAmountInstance(LauncherView.getInstance().getSettings().getPlattformLocale()); getTxtCostTotal().setText(af.format(org.tcotool.tools.Calculator.calc(getObject()))); } catch(Throwable e) { *************** *** 2443,2450 **** DbObjectServer server = ((DbObject)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCostType(), server.retrieveCodes(CostCause.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrency(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); ! JComboBoxUtility.initComboBox(getCbxCatalogue(), server.retrieveCodes(Catalogue.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); setObject((org.tcotool.model.FactCost)object); --- 2549,2556 ---- DbObjectServer server = ((DbObject)object).getObjectServer(); ! JComboBoxUtility.initComboBox(getCbxCostType(), server.retrieveCodes(CostCause.class), "nameString", false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrency(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCurrencyTotal(), server.retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); ! JComboBoxUtility.initComboBox(getCbxCatalogue(), server.retrieveCodes(Catalogue.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); setObject((org.tcotool.model.FactCost)object); *************** *** 2500,2505 **** connPtoP16SetTarget(); connPtoP4SetTarget(); - connPtoP9SetTarget(); connPtoP19SetTarget(); // user code begin {1} // user code end --- 2606,2612 ---- connPtoP16SetTarget(); connPtoP4SetTarget(); connPtoP19SetTarget(); + connPtoP9SetTarget(); + connPtoP20SetTarget(); // user code begin {1} // user code end |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:55:31
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20540/src/org/tcotool/application/resources Modified Files: PersonalCostDetailView.properties FactCostDetailView_de.properties FactCostDetailView.properties Added Files: PersonalCostDetailView_fr.properties FactCostDetailView_fr.properties Log Message: Feature: Cost#baseOffset, #expendable Index: PersonalCostDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/PersonalCostDetailView.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PersonalCostDetailView.properties 22 Dec 2005 12:36:34 -0000 1.2 --- PersonalCostDetailView.properties 18 May 2008 14:55:35 -0000 1.3 *************** *** 1,3 **** ! FrmWindow_text = Personalcosts LblActivity_text = Activity: LblHours_text = Number of: --- 1,3 ---- ! FrmWindow_text = Personal costs LblActivity_text = Activity: LblHours_text = Number of: Index: FactCostDetailView_de.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/FactCostDetailView_de.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FactCostDetailView_de.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- FactCostDetailView_de.properties 18 May 2008 14:55:35 -0000 1.2 *************** *** 1,7 **** --- 1,10 ---- FrmWindow_text = Sachkosten + LblBaseOffset_text = Basis Offset: + LblBaseOffset_toolTipText = Offset der Kostenwirksamkeit bezüglich des anfangs der gesamten TCO-Konfiguration. LblCurrency_text = Währung LblRepeatable_text = Wiederkehrend LblRepeatable_toolTipText = Kosten wiederholen sich nach Ablauf der Nutzungs- bzw. Abschreibungsdauer ChxEstimated_text = Geschätzt (!) + ChxKnown_text = Exakt bekannt PnlTechInfo_text = Technische Angaben LblDepreciationDuration_text = Abschreibung (BH): *************** *** 16,18 **** LblUsageDuration_toolTipText = Geplante Einsatzdauer bis zur Ablösung PnlStorage_text = Storage ! LblMonths_text = Monate \ No newline at end of file --- 19,21 ---- LblUsageDuration_toolTipText = Geplante Einsatzdauer bis zur Ablösung PnlStorage_text = Storage ! LblMonths_text = [Monat] \ No newline at end of file --- NEW FILE: PersonalCostDetailView_fr.properties --- (This appears to be a binary file; contents omitted.) Index: FactCostDetailView.properties =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/resources/FactCostDetailView.properties,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FactCostDetailView.properties 29 Aug 2005 09:41:02 -0000 1.1.1.1 --- FactCostDetailView.properties 18 May 2008 14:55:35 -0000 1.2 *************** *** 1,7 **** ! FrmWindow_text = Factcosts LblCurrency_text = Currency LblRepeatable_text = Repeatable ! LblRepeatable_toolTipText = Costs will be repeated after terminated duration of Usage- or Depreciation ChxEstimated_text = Estimated (!) PnlTechInfo_text = Technical Details LblDepreciationDuration_text = Depreciation (Bookings): --- 1,10 ---- ! FrmWindow_text = Fact costs ! LblBaseOffset_text = Base offset: ! LblBaseOffset_toolTipText = Offset of cost impact from the very beginning of the whole TCO-Configuration. LblCurrency_text = Currency LblRepeatable_text = Repeatable ! LblRepeatable_toolTipText = Recurring Costs will be repeated after terminated duration of Usage- or Depreciation ChxEstimated_text = Estimated (!) + ChxKnown_text = Well known PnlTechInfo_text = Technical Details LblDepreciationDuration_text = Depreciation (Bookings): *************** *** 10,18 **** LblPortsServer_text = For Server/Reserve: LblPortsTotal_text = Ports Total: ! LblPortsUsable_text = Ports useable: LblSerialNumber_text = Serial-Number (Device): LblTotal_toolTipText = Costs * Multitude LblUsageDuration_text = TCO-Usage duration: ! LblUsageDuration_toolTipText = Planned Usage-Duration until replacement PnlStorage_text = Storage ! LblMonths_text = Months \ No newline at end of file --- 13,21 ---- LblPortsServer_text = For Server/Reserve: LblPortsTotal_text = Ports Total: ! LblPortsUsable_text = Ports usable: LblSerialNumber_text = Serial-Number (Device): LblTotal_toolTipText = Costs * Multitude LblUsageDuration_text = TCO-Usage duration: ! LblUsageDuration_toolTipText = Expected lifespan of the investment resp. planned Usage-Duration until replacement PnlStorage_text = Storage ! LblMonths_text = [Month] \ No newline at end of file --- NEW FILE: FactCostDetailView_fr.properties --- (This appears to be a binary file; contents omitted.) |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:49:27
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19201/src/org/tcotool/application Modified Files: CodeDetailView.java Log Message: Import disabled => makes no sense Index: CodeDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CodeDetailView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CodeDetailView.java 13 Jun 2007 20:13:56 -0000 1.7 --- CodeDetailView.java 18 May 2008 14:49:30 -0000 1.8 *************** *** 109,122 **** private javax.swing.JLabel ivjLblCostCause = null; private ch.softenvironment.jomm.mvc.view.DbCodeManageView ivjPnlCostCause = null; ! /** ! * Constructor ! * @param owner Symbol ! * @param modal Symbol ! */ ! /* WARNING: THIS METHOD WILL BE REGENERATED. */ ! public CodeDetailView(java.awt.Component owner, boolean modal) { ! super(owner, modal); ! initialize(); ! } /** * CodeDetailView constructor comment. --- 109,113 ---- private javax.swing.JLabel ivjLblCostCause = null; private ch.softenvironment.jomm.mvc.view.DbCodeManageView ivjPnlCostCause = null; ! /** * CodeDetailView constructor comment. *************** *** 210,216 **** if (saveDialog.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { ch.softenvironment.jomm.target.xml.XmlUserObject userObject = new ch.softenvironment.jomm.target.xml.XmlUserObject(saveDialog.getSelectedFile().getAbsolutePath()); ! userObject.setSender("www.tcotool.org (" + LauncherView.getVersion() + ")"); // TODO NYI: XSD ! userObject.setXsd("http://www.interlis.ch/INTERLIS2.2 TcoTool.xsd"); // userObject.setXsl("http://www.tcotool.org/XSLT/TCOModel_Tree.xsl"); server.setUserObject(userObject); --- 201,207 ---- if (saveDialog.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) { ch.softenvironment.jomm.target.xml.XmlUserObject userObject = new ch.softenvironment.jomm.target.xml.XmlUserObject(saveDialog.getSelectedFile().getAbsolutePath()); ! userObject.setSender(ModelUtility.getIliSender()); // TODO NYI: XSD ! userObject.setXsd(ModelUtility.XSD); // userObject.setXsl("http://www.tcotool.org/XSLT/TCOModel_Tree.xsl"); server.setUserObject(userObject); *************** *** 265,269 **** ivjBtnExport = new javax.swing.JButton(); ivjBtnExport.setName("BtnExport"); ! ivjBtnExport.setToolTipText("Sämtliche Geschäftsobjekte in ein Set exportieren."); ivjBtnExport.setText("Export..."); ivjBtnExport.setBounds(190, 475, 113, 25); --- 256,260 ---- ivjBtnExport = new javax.swing.JButton(); ivjBtnExport.setName("BtnExport"); ! ivjBtnExport.setToolTipText("Export all Business-Object's into one Configuration.xml file."); ivjBtnExport.setText("Export..."); ivjBtnExport.setBounds(190, 475, 113, 25); *************** *** 281,284 **** --- 272,276 ---- * Return the BtnImport property value. * @return javax.swing.JButton + * @deprecated (@see #importCodes()) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ *************** *** 288,295 **** ivjBtnImport = new javax.swing.JButton(); ivjBtnImport.setName("BtnImport"); ! ivjBtnImport.setToolTipText("Sämtliche Geschäftsobjekte von einem Set importieren."); ivjBtnImport.setText("Import..."); ivjBtnImport.setBounds(320, 475, 113, 25); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 280,288 ---- ivjBtnImport = new javax.swing.JButton(); ivjBtnImport.setName("BtnImport"); ! ivjBtnImport.setToolTipText("Sämtliche Geschäftsobjekte aus einer anderen Konfiguration importieren."); ivjBtnImport.setText("Import..."); ivjBtnImport.setBounds(320, 475, 113, 25); // user code begin {1} + ivjBtnImport.setEnabled(false); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 645,649 **** // user code begin {1} getPnlCost().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(getResourceString("PnlCost_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end --- 638,642 ---- // user code begin {1} getPnlCost().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(ResourceManager.getResource(ServiceDetailView.class, "PnlCost_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end *************** *** 718,722 **** // user code begin {1} getPnlCostDriver().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(getResourceString("PnlCostDriver_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end --- 711,715 ---- // user code begin {1} getPnlCostDriver().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(ResourceManager.getResource(ServiceDetailView.class, "PnlCostDriver_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end *************** *** 833,837 **** // user code begin {1} getPnlService().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(getResourceString("PnlService_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end --- 826,830 ---- // user code begin {1} getPnlService().setBorder(javax.swing.BorderFactory.createCompoundBorder( ! javax.swing.BorderFactory.createTitledBorder(ResourceManager.getResource(ServiceDetailView.class, "FrmWindow_text")), javax.swing.BorderFactory.createEmptyBorder(5,5,5,5))); // user code end *************** *** 915,918 **** --- 908,912 ---- * Import codes from a file. * Keep DbEnumeration's and Model-Objects. + * @deprecated (this function is no help so far: update/extend codes acc. to IliCode would be nice) */ private void importCodes() { *************** *** 923,927 **** openDialog.addChoosableFileFilter(GenericFileFilter.createXmlFilter()); if (openDialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { ! //TODO Nasty removes given configuration except root to prevent TID-duplication and Code-Reference problems! ((TcoModel)LauncherView.getInstance().getUtility().getRoot()).setOwnedElement(new ArrayList()); --- 917,921 ---- openDialog.addChoosableFileFilter(GenericFileFilter.createXmlFilter()); if (openDialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { ! //TODO Nasty removes given configuration except root to prevent TID-duplication and Code-Reference problems! COMPARE IliCode where possible instead ((TcoModel)LauncherView.getInstance().getUtility().getRoot()).setOwnedElement(new ArrayList()); *************** *** 1011,1015 **** 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()); --- 1005,1009 ---- 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, CostCentreDetailView.class, getViewOptions()); getPnlPhase().setCode(server, ProjectPhase.class, ModelUtility.getTypeString(ProjectPhase.class) /*ResourceManager.getResource(CostDriverDetailView.class, "LblPhase_text", false)*/, DbObject.PROPERTY_NAME, null, getViewOptions()); *************** *** 1017,1021 **** getPnlProcess().setCode(server, org.tcotool.model.Process.class, ResourceManager.getResourceAsNonLabeled(CostDriverDetailView.class, "LblProcess_text"), 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()); --- 1011,1015 ---- getPnlProcess().setCode(server, org.tcotool.model.Process.class, ResourceManager.getResourceAsNonLabeled(CostDriverDetailView.class, "LblProcess_text"), DbObject.PROPERTY_NAME, null, getViewOptions()); ! getPnlCostCause().setCode(server, org.tcotool.model.CostCause.class, ModelUtility.getTypeString(CostCause.class) /*ResourceManager.getResource(CostDriverDetailView.class, "TbcCosttype_text", false)*/, "nameString", 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()); |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:47:20
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18386/src/org/tcotool/application Modified Files: CatalogueDetailView.java Log Message: Feature: Catalogue#expendable Index: CatalogueDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CatalogueDetailView.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CatalogueDetailView.java 13 Jun 2007 20:13:56 -0000 1.5 --- CatalogueDetailView.java 18 May 2008 14:47:21 -0000 1.6 *************** *** 1469,1473 **** } ! JComboBoxUtility.initComboBox(getCbxCurrency(), ((Catalogue)object).getObjectServer().retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator()); if (((Catalogue)object).getPersistencyState().isNew()) { --- 1469,1473 ---- } ! JComboBoxUtility.initComboBox(getCbxCurrency(), ((Catalogue)object).getObjectServer().retrieveCodes(Currency.class), DbObject.PROPERTY_NAME, false, new DbObjectEvaluator(ModelUtility.getCodeTypeLocale())); if (((Catalogue)object).getPersistencyState().isNew()) { *************** *** 1479,1483 **** ((Catalogue)object).setUsageDuration(LauncherView.getInstance().getUtility().getSystemParameter().getDefaultUsageDuration()); } ! if (((Catalogue)object).getExpendable().booleanValue()) { // @see #updateModel() --- 1479,1483 ---- ((Catalogue)object).setUsageDuration(LauncherView.getInstance().getUtility().getSystemParameter().getDefaultUsageDuration()); } ! /* if (((Catalogue)object).getExpendable().booleanValue()) { // @see #updateModel() *************** *** 1485,1489 **** getTxtDepreciation().setEditable(false); } ! setObject((org.tcotool.model.Catalogue)object); initialName = getObject().getNameString(); --- 1485,1489 ---- getTxtDepreciation().setEditable(false); } ! */ setObject((org.tcotool.model.Catalogue)object); initialName = getObject().getNameString(); *************** *** 1570,1574 **** evt.getPropertyName().equals("usageDuration") || evt.getPropertyName().equals("depreciationDuration") || evt.getPropertyName().equals("expendable")) { ! if (evt.getPropertyName().equals("expendable")) { if (getObject().getExpendable().booleanValue()) { // fix duration to one year --- 1570,1575 ---- evt.getPropertyName().equals("usageDuration") || evt.getPropertyName().equals("depreciationDuration") || evt.getPropertyName().equals("expendable")) { ! /* ! if (evt.getPropertyName().equals("expendable")) { if (getObject().getExpendable().booleanValue()) { // fix duration to one year *************** *** 1582,1585 **** --- 1583,1587 ---- } } + */ // @see #treatFactCost() TreeTool treeTool = new TreeTool(this); |
From: Hirzel P. <ph...@us...> - 2008-05-18 14:47:18
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18386/src/org/tcotool/model Modified Files: Catalogue.java Log Message: Feature: Catalogue#expendable Index: Catalogue.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/Catalogue.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Catalogue.java 13 Jun 2007 20:15:54 -0000 1.4 --- Catalogue.java 18 May 2008 14:47:21 -0000 1.5 *************** *** 102,107 **** private Boolean fieldExpendable; /** ! * If expendable (de "Verbrauchsmaterial") then UsageDuration and ! * DepreciationDuration is fixed to one year . */ public void setExpendable(Boolean expendable) { --- 102,106 ---- private Boolean fieldExpendable; /** ! * @see FactCost#setExpendable(Boolean) */ public void setExpendable(Boolean expendable) { |
From: Hirzel P. <ph...@us...> - 2008-05-18 13:07:48
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11579/src/org/tcotool/model Modified Files: TcoObject.java Log Message: Schema: #baseDate removed Index: TcoObject.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/model/TcoObject.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TcoObject.java 13 Jun 2007 20:15:54 -0000 1.3 --- TcoObject.java 18 May 2008 13:07:53 -0000 1.4 *************** *** 1,5 **** package org.tcotool.model; - import ch.softenvironment.jomm.descriptor.DbDateFieldDescriptor; import ch.softenvironment.jomm.descriptor.DbDescriptor; import ch.softenvironment.jomm.descriptor.DbMultiplicityRange; --- 1,19 ---- package org.tcotool.model; + /* + * 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.jomm.descriptor.DbDescriptor; import ch.softenvironment.jomm.descriptor.DbMultiplicityRange; *************** *** 8,13 **** import ch.softenvironment.jomm.mvc.model.DbEntityBean; /** ! * [implements ModelElement] ! * @author generated by the umleditor */ public abstract class TcoObject extends DbEntityBean { --- 22,27 ---- import ch.softenvironment.jomm.mvc.model.DbEntityBean; /** ! * Generic TCO-object. ! * @author Peter Hirzel <i>soft</i>Environment */ public abstract class TcoObject extends DbEntityBean { *************** *** 15,19 **** private String fieldDocumentation; private java.lang.Double fieldMultitude; // NOT NULL - private java.util.Date fieldBaseDate; private java.util.List fieldClientId=new java.util.ArrayList(); private java.util.List fieldSupplierId=new java.util.ArrayList(); --- 29,32 ---- *************** *** 25,32 **** public static DbDescriptor createDescriptor() { DbDescriptor descriptor = new DbDescriptor(TcoObject.class); ! descriptor.add("name","name",new DbTextFieldDescriptor(250),new DbMultiplicityRange(1,1)); ! descriptor.add("documentation","documentation",new DbTextFieldDescriptor(1024),new DbMultiplicityRange(0,1)); ! descriptor.add("multitude","multitude",new DbNumericFieldDescriptor(java.lang.Double.class,0.0,9999999.0,2),new DbMultiplicityRange(1,1)); ! descriptor.add("baseDate","baseDate",new DbDateFieldDescriptor(DbDateFieldDescriptor.DATE),new DbMultiplicityRange(0,1)); descriptor.addAssociationAttributed(DbDescriptor.AGGREGATION, "clientId", new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), Dependency.class, "supplierId"); descriptor.addAssociationAttributed(DbDescriptor.ASSOCIATION, "supplierId", new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), Dependency.class, "clientId"); --- 38,44 ---- public static DbDescriptor createDescriptor() { DbDescriptor descriptor = new DbDescriptor(TcoObject.class); ! descriptor.add("name", "name", new DbTextFieldDescriptor(250), new DbMultiplicityRange(1,1)); ! descriptor.add("documentation", "documentation", new DbTextFieldDescriptor(1024), new DbMultiplicityRange(0,1)); ! descriptor.add("multitude", "multitude", new DbNumericFieldDescriptor(java.lang.Double.class,0.0,9999999.0,2), new DbMultiplicityRange(1,1)); descriptor.addAssociationAttributed(DbDescriptor.AGGREGATION, "clientId", new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), Dependency.class, "supplierId"); descriptor.addAssociationAttributed(DbDescriptor.ASSOCIATION, "supplierId", new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), new DbMultiplicityRange(0,DbMultiplicityRange.UNBOUND), Dependency.class, "clientId"); *************** *** 34,41 **** return descriptor; } - public java.util.Date getBaseDate() { - refresh(false); // read lazy initialized objects - return fieldBaseDate; - } public java.util.List getClientId() { refresh(false); // read lazy initialized objects --- 46,49 ---- *************** *** 62,70 **** return fieldSupplierId; } - public void setBaseDate(java.util.Date baseDate){ - java.util.Date oldValue=fieldBaseDate; - fieldBaseDate=baseDate; - firePropertyChange("baseDate", oldValue, fieldBaseDate); - } public void setClientId(java.util.List client) { java.util.List oldValue=fieldClientId; --- 70,73 ---- |
From: Hirzel P. <ph...@us...> - 2008-05-18 13:06:04
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11115/src/org/tcotool/application Modified Files: CostCauseDetailView.java Log Message: Refactoring: adapting to CostCause Index: CostCauseDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CostCauseDetailView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CostCauseDetailView.java 13 Jun 2007 20:13:56 -0000 1.4 --- CostCauseDetailView.java 18 May 2008 13:06:08 -0000 1.5 *************** *** 47,52 **** private javax.swing.JLabel ivjLblDirect = null; private javax.swing.JLabel ivjLblIliCode = null; ! class IvjEventHandler implements ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { public void itemStateChanged(java.awt.event.ItemEvent e) { if (e.getSource() == CostCauseDetailView.this.getChxDirect()) --- 47,56 ---- private javax.swing.JLabel ivjLblDirect = null; private javax.swing.JLabel ivjLblIliCode = null; + private javax.swing.JCheckBox ivjChxDirect = null; + private boolean ivjConnPtoP1Aligning = false; + private ch.softenvironment.view.SimpleEditorPanel ivjPnlDocumentation = null; + private boolean ivjConnPtoP3Aligning = false; ! class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { public void itemStateChanged(java.awt.event.ItemEvent e) { if (e.getSource() == CostCauseDetailView.this.getChxDirect()) *************** *** 78,81 **** --- 82,87 ---- if (evt.getSource() == CostCauseDetailView.this.getObject() && (evt.getPropertyName().equals("direct"))) connPtoP1SetTarget(); + if (evt.getSource() == CostCauseDetailView.this.getObject() && (evt.getPropertyName().equals("documentation"))) + connPtoP3SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; *************** *** 93,99 **** }; public void tbbUndoAction_actionPerformed(java.util.EventObject newEvent) {}; }; - private javax.swing.JCheckBox ivjChxDirect = null; - private boolean ivjConnPtoP1Aligning = false; /** * Constructor --- 99,107 ---- }; public void tbbUndoAction_actionPerformed(java.util.EventObject newEvent) {}; + public void txaEditorKey_keyReleased(java.util.EventObject newEvent) { + if (newEvent.getSource() == CostCauseDetailView.this.getPnlDocumentation()) + connPtoP3SetSource(); + }; }; /** * Constructor *************** *** 309,312 **** --- 317,370 ---- } /** + * connPtoP3SetSource: (Object.documentation <--> PnlDocumentation.text) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP3SetSource() { + /* Set the source from the target */ + try { + if (ivjConnPtoP3Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP3Aligning = true; + if ((getObject() != null)) { + getObject().setDocumentation(getPnlDocumentation().getText()); + } + // user code begin {2} + // user code end + ivjConnPtoP3Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP3Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** + * connPtoP3SetTarget: (Object.documentation <--> PnlDocumentation.text) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP3SetTarget() { + /* Set the target from the source */ + try { + if (ivjConnPtoP3Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP3Aligning = true; + if ((getObject() != null)) { + getPnlDocumentation().setText(getObject().getDocumentation()); + } + // user code begin {2} + // user code end + ivjConnPtoP3Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP3Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** * connPtoP4SetSource: (Object.producer <--> JTextField1.text) */ *************** *** 456,460 **** ivjChxDirect.setName("ChxDirect"); ivjChxDirect.setText(""); ! ivjChxDirect.setBounds(161, 22, 24, 22); // user code begin {1} // user code end --- 514,518 ---- ivjChxDirect.setName("ChxDirect"); ivjChxDirect.setText(""); ! ivjChxDirect.setBounds(162, 51, 24, 22); // user code begin {1} // user code end *************** *** 487,494 **** ivjJPanel1 = new javax.swing.JPanel(); ivjJPanel1.setName("JPanel1"); ! ivjJPanel1.setLayout(null); ! getJPanel1().add(getLblName(), getLblName().getName()); ! getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); ! getJPanel1().add(getPnlName(), getPnlName().getName()); // user code begin {1} // user code end --- 545,578 ---- ivjJPanel1 = new javax.swing.JPanel(); ivjJPanel1.setName("JPanel1"); ! ivjJPanel1.setLayout(new java.awt.GridBagLayout()); ! ! java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; ! constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsLblName.ipadx = 55; ! constraintsLblName.insets = new java.awt.Insets(16, 11, 14, 16); ! getJPanel1().add(getLblName(), constraintsLblName); ! ! java.awt.GridBagConstraints constraintsJTabbedPane1 = new java.awt.GridBagConstraints(); ! constraintsJTabbedPane1.gridx = 1; constraintsJTabbedPane1.gridy = 2; ! constraintsJTabbedPane1.gridwidth = 2; ! constraintsJTabbedPane1.fill = java.awt.GridBagConstraints.BOTH; ! constraintsJTabbedPane1.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsJTabbedPane1.weightx = 1.0; ! constraintsJTabbedPane1.weighty = 1.0; ! constraintsJTabbedPane1.ipadx = 488; ! constraintsJTabbedPane1.ipady = 92; ! constraintsJTabbedPane1.insets = new java.awt.Insets(7, 7, 19, 12); ! getJPanel1().add(getJTabbedPane1(), constraintsJTabbedPane1); ! ! java.awt.GridBagConstraints constraintsPnlName = new java.awt.GridBagConstraints(); ! constraintsPnlName.gridx = 2; constraintsPnlName.gridy = 1; ! constraintsPnlName.fill = java.awt.GridBagConstraints.HORIZONTAL; ! constraintsPnlName.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsPnlName.weightx = 1.0; ! constraintsPnlName.weighty = 1.0; ! constraintsPnlName.ipadx = 137; ! constraintsPnlName.insets = new java.awt.Insets(11, 16, 7, 12); ! getJPanel1().add(getPnlName(), constraintsPnlName); // user code begin {1} // user code end *************** *** 511,517 **** ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); - ivjJTabbedPane1.setBounds(7, 51, 486, 157); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 595,603 ---- ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); + ivjJTabbedPane1.insertTab("Note", null, getPnlDocumentation(), null, 1); // user code begin {1} + ivjJTabbedPane1.setTitleAt(0, ResourceManager.getResource(ServiceDetailView.class, "PnlDetail_text")); + ivjJTabbedPane1.setTitleAt(1, ResourceManager.getResource(ServiceDetailView.class, "PnlNote_text")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 534,538 **** ivjLblDirect.setName("LblDirect"); ivjLblDirect.setText("Direkte Kosten:"); ! ivjLblDirect.setBounds(11, 25, 143, 14); // user code begin {1} ivjLblDirect.setText(getResourceString("LblDirect_text")); --- 620,624 ---- ivjLblDirect.setName("LblDirect"); ivjLblDirect.setText("Direkte Kosten:"); ! ivjLblDirect.setBounds(12, 54, 143, 14); // user code begin {1} ivjLblDirect.setText(getResourceString("LblDirect_text")); *************** *** 558,563 **** ivjLblIliCode.setName("LblIliCode"); ivjLblIliCode.setText("IliCode:"); ! ivjLblIliCode.setBounds(11, 52, 143, 14); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 644,652 ---- ivjLblIliCode.setName("LblIliCode"); ivjLblIliCode.setText("IliCode:"); ! ivjLblIliCode.setBounds(12, 23, 143, 14); // user code begin {1} + //TODO NLS + ivjLblIliCode.setText("Nr:"); + ivjLblIliCode.setToolTipText("IliCode [UNIQUE!]"); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 580,584 **** ivjLblName.setName("LblName"); ivjLblName.setText("Bezeichnung:"); - ivjLblName.setBounds(11, 16, 131, 14); // user code begin {1} ivjLblName.setText(ResourceManager.getResource(ServiceDetailView.class, "LblName_text")); --- 669,672 ---- *************** *** 628,631 **** --- 716,739 ---- } /** + * Return the PnlDocumentation property value. + * @return ch.softenvironment.view.SimpleEditorPanel + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private ch.softenvironment.view.SimpleEditorPanel getPnlDocumentation() { + if (ivjPnlDocumentation == null) { + try { + ivjPnlDocumentation = new ch.softenvironment.view.SimpleEditorPanel(); + ivjPnlDocumentation.setName("PnlDocumentation"); + // user code begin {1} + // user code end + } catch (java.lang.Throwable ivjExc) { + // user code begin {2} + // user code end + handleException(ivjExc); + } + } + return ivjPnlDocumentation; + } + /** * Return the PnlName property value. * @return ch.softenvironment.jomm.mvc.view.DbNlsStringView *************** *** 637,641 **** ivjPnlName = new ch.softenvironment.jomm.mvc.view.DbNlsStringView(); ivjPnlName.setName("PnlName"); - ivjPnlName.setBounds(149, 11, 344, 26); // user code begin {1} // user code end --- 745,748 ---- *************** *** 698,703 **** ivjTxtName1 = new javax.swing.JTextField(); ivjTxtName1.setName("TxtName1"); ! ivjTxtName1.setBounds(161, 49, 309, 20); ! ivjTxtName1.setEditable(false); // user code begin {1} // user code end --- 805,810 ---- ivjTxtName1 = new javax.swing.JTextField(); ivjTxtName1.setName("TxtName1"); ! ivjTxtName1.setBounds(162, 20, 309, 20); ! ivjTxtName1.setEditable(true); // user code begin {1} // user code end *************** *** 730,733 **** --- 837,841 ---- getTxtName1().addKeyListener(ivjEventHandler); getChxDirect().addItemListener(ivjEventHandler); + getPnlDocumentation().addSimpleEditorPanelListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP2SetTarget(); *************** *** 735,738 **** --- 843,847 ---- connPtoP4SetTarget(); connPtoP1SetTarget(); + connPtoP3SetTarget(); } /** *************** *** 747,751 **** setName("CatalogueDialog"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); ! setSize(505, 305); setTitle("Kostenart"); setContentPane(getBaseDialogContentPane()); --- 856,860 ---- setName("CatalogueDialog"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); ! setSize(534, 272); setTitle("Kostenart"); setContentPane(getBaseDialogContentPane()); *************** *** 757,760 **** --- 866,870 ---- setTitle(ModelUtility.getTypeString(CostCause.class)); setIconImage(ResourceBundle.getImageIcon(LauncherView.class, "TCO_Icon.png").getImage()); + setSize(543, 315); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostCause.class)); *************** *** 844,848 **** if (((CostCause)object).getPersistencyState().isNew()) { ((CostCause)object).refresh(false); ! ((CostCause)object).setDirect(Boolean.TRUE); } --- 954,958 ---- if (((CostCause)object).getPersistencyState().isNew()) { ((CostCause)object).refresh(false); ! ((CostCause)object).setDirect(Boolean.TRUE); //default @see ModelUtility#fixModel() } *************** *** 875,878 **** --- 985,989 ---- connPtoP4SetTarget(); connPtoP1SetTarget(); + connPtoP3SetTarget(); // user code begin {1} // user code end |
From: Hirzel P. <ph...@us...> - 2008-05-18 13:05:15
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10761/src/org/tcotool/application Added Files: CostCentreDetailView.java Log Message: New specific dialog --- NEW FILE: CostCentreDetailView.java --- 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.ehi.basics.i18n.ResourceBundle; import ch.softenvironment.client.ResourceManager; import ch.softenvironment.jomm.mvc.controller.*; import org.tcotool.model.*; import org.tcotool.tools.ModelUtility; /** * DetailView of CostCause. * * @author Peter Hirzel <i>soft</i>Environment * @version $Revision: 1.1 $ $Date: 2008/05/18 13:05:20 $ */ public class CostCentreDetailView extends ch.softenvironment.jomm.mvc.view.DbBaseFrame implements ch.softenvironment.view.DetailView { private ch.softenvironment.view.DetailView caller = null; private javax.swing.JPanel ivjBaseDialogContentPane = null; private javax.swing.JTabbedPane ivjJTabbedPane1 = null; IvjEventHandler ivjEventHandler = new IvjEventHandler(); private javax.swing.JPanel ivjPnlDetail = null; private boolean ivjConnPtoP2Aligning = false; private javax.swing.JPanel ivjJPanel1 = null; private CostCentre ivjObject = null; private ch.softenvironment.view.ToolBar ivjPnlStandardToolbar = null; private ch.softenvironment.view.StatusBar ivjPnlStatusBar = null; private ConsistencyController ivjConsistencyController = null; private boolean ivjConnPtoP6Aligning = false; private javax.swing.JLabel ivjLblName = null; private boolean ivjConnPtoP4Aligning = false; private ch.softenvironment.jomm.mvc.view.DbNlsStringView ivjPnlName = null; private javax.swing.JLabel ivjLblIliCode = null; private javax.swing.JTextField ivjTxtIliCode = null; private boolean ivjConnPtoP1Aligning = false; private ch.softenvironment.view.SimpleEditorPanel ivjPnlNote = null; class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { public void keyPressed(java.awt.event.KeyEvent e) {}; public void keyReleased(java.awt.event.KeyEvent e) { if (e.getSource() == CostCentreDetailView.this.getTxtIliCode()) connPtoP4SetSource(); }; public void keyTyped(java.awt.event.KeyEvent e) {}; public void propertyChange(java.beans.PropertyChangeEvent evt) { if (evt.getSource() == CostCentreDetailView.this.getConsistencyController() && (evt.getPropertyName().equals("isSaveable"))) connPtoP6SetTarget(); if (evt.getSource() == CostCentreDetailView.this.getPnlStandardToolbar() && (evt.getPropertyName().equals("tbbSaveEnabled"))) connPtoP6SetSource(); if (evt.getSource() == CostCentreDetailView.this.getConsistencyController() && (evt.getPropertyName().equals("inconsistencies"))) connEtoM1(evt); if (evt.getSource() == CostCentreDetailView.this.getPnlStandardToolbar() && (evt.getPropertyName().equals("currentObject"))) connEtoC1(evt); if (evt.getSource() == CostCentreDetailView.this.getObject()) connEtoC2(evt); if (evt.getSource() == CostCentreDetailView.this.getObject() && (evt.getPropertyName().equals("name"))) connPtoP2SetTarget(); if (evt.getSource() == CostCentreDetailView.this.getPnlName() && (evt.getPropertyName().equals("dbNlsString"))) connPtoP2SetSource(); if (evt.getSource() == CostCentreDetailView.this.getObject() && (evt.getPropertyName().equals("iliCode"))) connPtoP4SetTarget(); if (evt.getSource() == CostCentreDetailView.this.getObject() && (evt.getPropertyName().equals("documentation"))) connPtoP1SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbCutAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbDeleteAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbFindAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbNewAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbOpenAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbPasteAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbPrintAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbRedoAction_actionPerformed(java.util.EventObject newEvent) {}; public void tbbSaveAction_actionPerformed(java.util.EventObject newEvent) { if (newEvent.getSource() == CostCentreDetailView.this.getPnlStandardToolbar()) connEtoC7(newEvent); }; public void tbbUndoAction_actionPerformed(java.util.EventObject newEvent) {}; public void txaEditorKey_keyReleased(java.util.EventObject newEvent) { if (newEvent.getSource() == CostCentreDetailView.this.getPnlNote()) connPtoP1SetSource(); }; }; /** * Constructor * @param viewOptions Symbol */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ public CostCentreDetailView(ch.softenvironment.view.ViewOptions viewOptions) { super(viewOptions); initialize(); } /** * Constructor */ public CostCentreDetailView(ch.softenvironment.view.ViewOptions viewOptions, java.util.List objects, ch.softenvironment.view.DetailView caller) { super(viewOptions, objects); this.caller = caller; initialize(); } /** * Assign a set of aggregates given in objects. * @param objects */ public void assignObjects(java.util.List objects) {} /** * connEtoC1: (PnlStandardToolbar.currentObject --> ServiceDetailView.executeSetCurrentObject(Ljava.lang.Object;)V) * @param arg1 java.beans.PropertyChangeEvent */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connEtoC1(java.beans.PropertyChangeEvent arg1) { try { // user code begin {1} // user code end this.setCurrentObject(getPnlStandardToolbar().getCurrentObject()); // user code begin {2} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {3} // user code end handleException(ivjExc); } } /** * connEtoC2: (Object.propertyChange.propertyChange(java.beans.PropertyChangeEvent) --> CatalogueDetailView.updateModel()V) * @param arg1 java.beans.PropertyChangeEvent */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connEtoC2(java.beans.PropertyChangeEvent arg1) { try { // user code begin {1} // user code end this.updateModel(arg1); // user code begin {2} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {3} // user code end handleException(ivjExc); } } /** * connEtoC7: (PnlStandardToolbar.toolBar.tbbSaveAction_actionPerformed(java.util.EventObject) --> ServiceDetailView.executeSaveObject()V) * @param arg1 java.util.EventObject */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connEtoC7(java.util.EventObject arg1) { try { // user code begin {1} // user code end this.saveObject(); // user code begin {2} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {3} // user code end handleException(ivjExc); } } /** * connEtoM1: (ConsistencyController.inconsistencies --> PnlStandardToolbar.setItems(Ljava.util.Vector;)V) * @param arg1 java.beans.PropertyChangeEvent */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connEtoM1(java.beans.PropertyChangeEvent arg1) { try { // user code begin {1} // user code end getPnlStandardToolbar().setItems(getConsistencyController().getInconsistencies()); // user code begin {2} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP18SetTarget: (Object.mark <--> PnlStatusBar.mark) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP18SetTarget() { /* Set the target from the source */ try { if ((getObject() != null)) { getPnlStatusBar().setMark(getObject().getMark()); } // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP1SetSource: (Object.direct <--> ChxDirect.selected) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP1SetSource() { /* Set the source from the target */ try { if (ivjConnPtoP1Aligning == false) { // user code begin {1} // user code end ivjConnPtoP1Aligning = true; if ((getObject() != null)) { getObject().setDocumentation(getPnlNote().getText()); } // user code begin {2} // user code end ivjConnPtoP1Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP1Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP1SetTarget: (Object.direct <--> ChxDirect.selected) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP1SetTarget() { /* Set the target from the source */ try { if (ivjConnPtoP1Aligning == false) { // user code begin {1} // user code end ivjConnPtoP1Aligning = true; if ((getObject() != null)) { getPnlNote().setText(getObject().getDocumentation()); } // user code begin {2} // user code end ivjConnPtoP1Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP1Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP2SetSource: (Object.name <--> PnlName.name) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP2SetSource() { /* Set the source from the target */ try { if (ivjConnPtoP2Aligning == false) { // user code begin {1} // user code end ivjConnPtoP2Aligning = true; if ((getObject() != null)) { getObject().setName(getPnlName().getDbNlsString()); } // user code begin {2} // user code end ivjConnPtoP2Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP2Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP2SetTarget: (Object.name <--> TxtName.text) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP2SetTarget() { /* Set the target from the source */ try { if (ivjConnPtoP2Aligning == false) { // user code begin {1} // user code end ivjConnPtoP2Aligning = true; if ((getObject() != null)) { getPnlName().setDbNlsString(getObject().getName()); } // user code begin {2} // user code end ivjConnPtoP2Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP2Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP4SetSource: (Object.producer <--> JTextField1.text) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP4SetSource() { /* Set the source from the target */ try { if (ivjConnPtoP4Aligning == false) { // user code begin {1} // user code end ivjConnPtoP4Aligning = true; if ((getObject() != null)) { getObject().setIliCode(getTxtIliCode().getText()); } // user code begin {2} // user code end ivjConnPtoP4Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP4Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP4SetTarget: (Object.producer <--> JTextField1.text) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP4SetTarget() { /* Set the target from the source */ try { if (ivjConnPtoP4Aligning == false) { // user code begin {1} // user code end ivjConnPtoP4Aligning = true; if ((getObject() != null)) { getTxtIliCode().setText(getObject().getIliCode()); } // user code begin {2} // user code end ivjConnPtoP4Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP4Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP6SetSource: (ConsistencyController.isSaveable <--> PnlStandardToolbar.tbbSaveEnabled) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP6SetSource() { /* Set the source from the target */ try { if (ivjConnPtoP6Aligning == false) { // user code begin {1} // user code end ivjConnPtoP6Aligning = true; if ((getConsistencyController() != null)) { getConsistencyController().setIsSaveable(getPnlStandardToolbar().getTbbSaveEnabled()); } // user code begin {2} // user code end ivjConnPtoP6Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP6Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * connPtoP6SetTarget: (ConsistencyController.isSaveable <--> PnlStandardToolbar.tbbSaveEnabled) */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void connPtoP6SetTarget() { /* Set the target from the source */ try { if (ivjConnPtoP6Aligning == false) { // user code begin {1} // user code end ivjConnPtoP6Aligning = true; if ((getConsistencyController() != null)) { getPnlStandardToolbar().setTbbSaveEnabled(getConsistencyController().getIsSaveable()); } // user code begin {2} // user code end ivjConnPtoP6Aligning = false; } } catch (java.lang.Throwable ivjExc) { ivjConnPtoP6Aligning = false; // user code begin {3} // user code end handleException(ivjExc); } } /** * Create a new Object as a "copy" of a selected one (and open * it for e.g. in a DetailView). * @param source (for e.g. a Popup-MenuItem) */ public void copyObject(java.lang.Object source) {} /** * Overwrites. */ public void dispose() { getObject().removePropertyChangeListener(getConsistencyController()); super.dispose(); } /** * Return the BaseDialogContentPane property value. * @return javax.swing.JPanel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JPanel getBaseDialogContentPane() { if (ivjBaseDialogContentPane == null) { try { ivjBaseDialogContentPane = new javax.swing.JPanel(); ivjBaseDialogContentPane.setName("BaseDialogContentPane"); ivjBaseDialogContentPane.setLayout(new java.awt.BorderLayout()); getBaseDialogContentPane().add(getJPanel1(), "Center"); getBaseDialogContentPane().add(getPnlStandardToolbar(), "North"); getBaseDialogContentPane().add(getPnlStatusBar(), "South"); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjBaseDialogContentPane; } /** * Return the ConsistencyController property value. * @return ch.softenvironment.jomm.controls.ConsistencyController */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private ch.softenvironment.jomm.mvc.controller.ConsistencyController getConsistencyController() { // user code begin {1} // user code end return ivjConsistencyController; } /** * Return the JPanel1 property value. * @return javax.swing.JPanel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JPanel getJPanel1() { if (ivjJPanel1 == null) { try { ivjJPanel1 = new javax.swing.JPanel(); ivjJPanel1.setName("JPanel1"); ivjJPanel1.setLayout(new java.awt.GridBagLayout()); java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsLblName.ipadx = 55; constraintsLblName.insets = new java.awt.Insets(16, 11, 14, 14); getJPanel1().add(getLblName(), constraintsLblName); java.awt.GridBagConstraints constraintsJTabbedPane1 = new java.awt.GridBagConstraints(); constraintsJTabbedPane1.gridx = 1; constraintsJTabbedPane1.gridy = 2; constraintsJTabbedPane1.gridwidth = 2; constraintsJTabbedPane1.fill = java.awt.GridBagConstraints.BOTH; constraintsJTabbedPane1.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsJTabbedPane1.weightx = 1.0; constraintsJTabbedPane1.weighty = 1.0; constraintsJTabbedPane1.ipadx = 490; constraintsJTabbedPane1.ipady = 92; constraintsJTabbedPane1.insets = new java.awt.Insets(7, 7, 27, 19); getJPanel1().add(getJTabbedPane1(), constraintsJTabbedPane1); java.awt.GridBagConstraints constraintsPnlName = new java.awt.GridBagConstraints(); constraintsPnlName.gridx = 2; constraintsPnlName.gridy = 1; constraintsPnlName.fill = java.awt.GridBagConstraints.HORIZONTAL; constraintsPnlName.anchor = java.awt.GridBagConstraints.NORTHWEST; constraintsPnlName.weightx = 1.0; constraintsPnlName.weighty = 1.0; constraintsPnlName.ipadx = 138; constraintsPnlName.insets = new java.awt.Insets(11, 15, 7, 23); getJPanel1().add(getPnlName(), constraintsPnlName); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjJPanel1; } /** * Return the JTabbedPane1 property value. * @return javax.swing.JTabbedPane */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JTabbedPane getJTabbedPane1() { if (ivjJTabbedPane1 == null) { try { ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); ivjJTabbedPane1.insertTab("Note", null, getPnlNote(), null, 1); // user code begin {1} ivjJTabbedPane1.setTitleAt(0, ResourceManager.getResource(ServiceDetailView.class, "PnlDetail_text")); ivjJTabbedPane1.setTitleAt(1, ResourceManager.getResource(ServiceDetailView.class, "PnlNote_text")); // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjJTabbedPane1; } /** * Return the LblIliCode property value. * @return javax.swing.JLabel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JLabel getLblIliCode() { if (ivjLblIliCode == null) { try { ivjLblIliCode = new javax.swing.JLabel(); ivjLblIliCode.setName("LblIliCode"); ivjLblIliCode.setText("IliCode:"); ivjLblIliCode.setBounds(12, 22, 143, 14); // user code begin {1} //TODO NLS ivjLblIliCode.setText("Nr:"); ivjLblIliCode.setToolTipText("IliCode [UNIQUE!]"); // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLblIliCode; } /** * Return the JLabel1 property value. * @return javax.swing.JLabel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JLabel getLblName() { if (ivjLblName == null) { try { ivjLblName = new javax.swing.JLabel(); ivjLblName.setName("LblName"); ivjLblName.setText("Bezeichnung:"); // user code begin {1} ivjLblName.setText(ResourceManager.getResource(ServiceDetailView.class, "LblName_text")); // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjLblName; } /** * Return the Object property value. * @return org.tcotool.model.CostCause */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private org.tcotool.model.CostCentre getObject() { // user code begin {1} // user code end return ivjObject; } /** * Return the PnlDetail property value. * @return javax.swing.JPanel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JPanel getPnlDetail() { if (ivjPnlDetail == null) { try { ivjPnlDetail = new javax.swing.JPanel(); ivjPnlDetail.setName("PnlDetail"); ivjPnlDetail.setLayout(null); getPnlDetail().add(getLblIliCode(), getLblIliCode().getName()); getPnlDetail().add(getTxtIliCode(), getTxtIliCode().getName()); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjPnlDetail; } /** * Return the PnlName property value. * @return ch.softenvironment.jomm.mvc.view.DbNlsStringView */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private ch.softenvironment.jomm.mvc.view.DbNlsStringView getPnlName() { if (ivjPnlName == null) { try { ivjPnlName = new ch.softenvironment.jomm.mvc.view.DbNlsStringView(); ivjPnlName.setName("PnlName"); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjPnlName; } /** * Return the PnlNote property value. * @return ch.softenvironment.view.SimpleEditorPanel */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private ch.softenvironment.view.SimpleEditorPanel getPnlNote() { if (ivjPnlNote == null) { try { ivjPnlNote = new ch.softenvironment.view.SimpleEditorPanel(); ivjPnlNote.setName("PnlNote"); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjPnlNote; } /** * Return the PnlStandardToolbar property value. * @return ch.softenvironment.view.ToolBar */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private ch.softenvironment.view.ToolBar getPnlStandardToolbar() { if (ivjPnlStandardToolbar == null) { try { ivjPnlStandardToolbar = new ch.softenvironment.view.ToolBar(); ivjPnlStandardToolbar.setName("PnlStandardToolbar"); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjPnlStandardToolbar; } /** * Return the PnlStatusBar property value. * @return ch.softenvironment.view.StatusBar */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private ch.softenvironment.view.StatusBar getPnlStatusBar() { if (ivjPnlStatusBar == null) { try { ivjPnlStatusBar = new ch.softenvironment.view.StatusBar(); ivjPnlStatusBar.setName("PnlStatusBar"); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjPnlStatusBar; } /** * Return the TxtName1 property value. * @return javax.swing.JTextField */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private javax.swing.JTextField getTxtIliCode() { if (ivjTxtIliCode == null) { try { ivjTxtIliCode = new javax.swing.JTextField(); ivjTxtIliCode.setName("TxtIliCode"); ivjTxtIliCode.setBounds(162, 19, 309, 20); ivjTxtIliCode.setEditable(true); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } } return ivjTxtIliCode; } /** * Called whenever the part throws an exception. * @param exception java.lang.Throwable */ protected void handleException(java.lang.Throwable exception) { super.handleException(exception); } /** * Initializes connections * @exception java.lang.Exception The exception description. */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void initConnections() throws java.lang.Exception { // user code begin {1} // user code end getPnlStandardToolbar().addPropertyChangeListener(ivjEventHandler); getPnlStandardToolbar().addToolBarListener(ivjEventHandler); getPnlName().addPropertyChangeListener(ivjEventHandler); getTxtIliCode().addKeyListener(ivjEventHandler); getPnlNote().addSimpleEditorPanelListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP2SetTarget(); connPtoP18SetTarget(); connPtoP4SetTarget(); connPtoP1SetTarget(); } /** * Initialize the class. */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void initialize() { try { // user code begin {1} initializeView(); // user code end setName("CatalogueDialog"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setSize(543, 280); setTitle("Kostenstelle"); setContentPane(getBaseDialogContentPane()); initConnections(); } catch (java.lang.Throwable ivjExc) { handleException(ivjExc); } // user code begin {2} setTitle(ModelUtility.getTypeString(CostCause.class)); setIconImage(ResourceBundle.getImageIcon(LauncherView.class, "TCO_Icon.png").getImage()); setSize(543, 315); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostCause.class)); getPnlStandardToolbar().setObjects(getObjects()); // user code end } public void initializeView() throws Throwable { } /** * Redo the last undoing changes of an Object represented by this GUI. */ public void redoObject() {} /** * Save an Object represented by DetailView. */ public void saveObject() { try { getObject().save(); getObject().getObjectServer().cacheCode(getObject()); if (caller != null) { caller.assignObjects(ch.softenvironment.util.ListUtils.createList(getObject())); } LauncherView.getInstance().saveObject(); closeOnSave(); } catch(Throwable e) { handleException(e); } } /** * Set the ConsistencyController to a new value. * @param newValue ch.softenvironment.jomm.controls.ConsistencyController */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void setConsistencyController(ch.softenvironment.jomm.mvc.controller.ConsistencyController newValue) { if (ivjConsistencyController != newValue) { try { /* Stop listening for events from the current object */ if (ivjConsistencyController != null) { ivjConsistencyController.removePropertyChangeListener(ivjEventHandler); } ivjConsistencyController = newValue; /* Listen for events from the new object */ if (ivjConsistencyController != null) { ivjConsistencyController.addPropertyChangeListener(ivjEventHandler); } connPtoP6SetTarget(); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } }; // user code begin {3} // user code end } /** * Make the View represent the given Object. * @param currentObject * * Example Code: try { if ((object != null) && object.equals(getObject())) { return; } if (getObject() != null) { getObject().removeChangeListener(getConsistencyController()); } ((DbObject)object).refresh(true); setObject(object); object.addChangeListener(getconsistencyController()); } catch(Throwable e) { handleException(e); } */ public void setCurrentObject(java.lang.Object object) { try { if (getObject() != null) { getObject().removePropertyChangeListener(getConsistencyController()); } if (((CostCentre)object).getPersistencyState().isNew()) { ((CostCentre)object).refresh(false); } setObject((CostCentre)object); getObject().addPropertyChangeListener(getConsistencyController()); } catch(Throwable e) { handleException(e); } } /** * Set the Object to a new value. * @param newValue org.tcotool.model.CostCause */ /* WARNING: THIS METHOD WILL BE REGENERATED. */ private void setObject(org.tcotool.model.CostCentre newValue) { if (ivjObject != newValue) { try { /* Stop listening for events from the current object */ if (ivjObject != null) { ivjObject.removePropertyChangeListener(ivjEventHandler); } ivjObject = newValue; /* Listen for events from the new object */ if (ivjObject != null) { ivjObject.addPropertyChangeListener(ivjEventHandler); } connPtoP2SetTarget(); connPtoP18SetTarget(); connPtoP4SetTarget(); connPtoP1SetTarget(); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { // user code begin {2} // user code end handleException(ivjExc); } }; // user code begin {3} // user code end } /** * Undo the changes of an Object represented by this GUI. */ public void undoObject() { setCurrentObject(getObject()); } /** * Make sure any FactCost entries are recalculated. */ private void updateModel(java.beans.PropertyChangeEvent evt) { try { if (evt != null) { // be aware of ping-pong effect if (evt.getPropertyName().equals("price") || evt.getPropertyName().equals("currency")) { //TODO Tune fixModel -> needs only to correct PersonalCost entries LauncherView.getInstance().getUtility().fixModel((TcoObject)LauncherView.getInstance().getUtility().getRoot()); } } } catch(Throwable e) { handleException(e); } } } |
From: Hirzel P. <ph...@us...> - 2008-05-15 20:27:45
|
Update of /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9446/test/org/tcotool/tools/test Modified Files: CalculatorTestCase.java Log Message: Feature: calculating Cost#baseOffset (n*12 months) Index: CalculatorTestCase.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/test/org/tcotool/tools/test/CalculatorTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CalculatorTestCase.java 13 Jun 2007 20:19:50 -0000 1.3 --- CalculatorTestCase.java 15 May 2008 20:27:35 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- */ + import org.tcotool.model.FactCost; import org.tcotool.model.PersonalCost; import org.tcotool.model.TcoObject; *************** *** 21,24 **** --- 22,28 ---- import org.tcotool.tools.ModelUtility; + import ch.softenvironment.math.FinancialUtils; + import ch.softenvironment.math.MathUtils; + import junit.framework.TestCase; *************** *** 56,60 **** assertTrue("Multitude driver", ModelUtility.getMultitudeFactor(m.driver) == 5.0); ! assertTrue("Multitude driver", m.utility.getMultitudeFactor((TcoObject)m.driver, true) == m.driverFactor); try { --- 60,64 ---- assertTrue("Multitude driver", ModelUtility.getMultitudeFactor(m.driver) == 5.0); ! assertTrue("Multitude driver", m.utility.getMultitudeFactor((TcoObject)m.driver, true) == m.getDriverFactor()); try { *************** *** 68,72 **** assertTrue("Multitude driver", m.utility.getMultitudeFactor(pcost, true) == 0.0); pcost.setMultitude(new Double(6.0)); ! assertTrue("Multitude driver", m.utility.getMultitudeFactor(pcost, true) == m.driverFactor * 6.0); } catch(Throwable e) { fail(e.getLocalizedMessage()); --- 72,76 ---- assertTrue("Multitude driver", m.utility.getMultitudeFactor(pcost, true) == 0.0); pcost.setMultitude(new Double(6.0)); ! assertTrue("Multitude driver", m.utility.getMultitudeFactor(pcost, true) == m.getDriverFactor() * 6.0); } catch(Throwable e) { fail(e.getLocalizedMessage()); *************** *** 77,84 **** * @see Calculator#getPersonalHours() */ ! public void testPersonalHoursInternal() { try { double hours = 65.0; ! double total = m.driverFactor * 6.0 * hours; PersonalCost pcost = m.addPersonalCost(); // pcost.setAmount(new Double(195)); --- 81,88 ---- * @see Calculator#getPersonalHours() */ ! public void testTcoPersonalHoursInternal() { try { double hours = 65.0; ! double total = m.getDriverFactor() * 6.0 * hours; PersonalCost pcost = m.addPersonalCost(); // pcost.setAmount(new Double(195)); *************** *** 87,97 **** Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { --- 91,101 ---- Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL /* "INTERNAL"*/), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL /*"EXTERNAL"*/), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP /*"INTERNAL_LUMP"*/), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP /*"EXTERNAL_LUMP"*/), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { *************** *** 103,110 **** * @see Calculator#getPersonalHours() */ ! public void testPersonalHoursExternal() { try { double hours = 65.0; ! double total = m.driverFactor * 6.0 * hours; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(195)); --- 107,114 ---- * @see Calculator#getPersonalHours() */ ! public void testTcoPersonalHoursExternal() { try { double hours = 65.0; ! double total = m.getDriverFactor() * 6.0 * hours; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(195)); *************** *** 113,123 **** Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { --- 117,127 ---- Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC External", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { *************** *** 129,136 **** * @see Calculator#getPersonalHours() */ ! public void testPersonalCostLumpInternal() { try { double amount = 195.0; ! double total = m.driverFactor * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(amount)); --- 133,140 ---- * @see Calculator#getPersonalHours() */ ! public void testTcoPersonalCostLumpInternal() { try { double amount = 195.0; ! double total = m.getDriverFactor() * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(amount)); *************** *** 138,148 **** Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { --- 142,152 ---- Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == total); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { *************** *** 154,161 **** * @see Calculator#getPersonalHours() */ ! public void testPersonalCostLumpExternal() { try { double amount = 195.0; ! double total = m.driverFactor * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(amount)); --- 158,165 ---- * @see Calculator#getPersonalHours() */ ! public void testTcoPersonalCostLumpExternal() { try { double amount = 195.0; ! double total = m.getDriverFactor() * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setAmount(new Double(amount)); *************** *** 163,173 **** Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == total); } catch(Throwable e) { --- 167,177 ---- Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == total); } catch(Throwable e) { *************** *** 175,194 **** } } ! public void testPersonalRoleFTE() { try { ! // double total = m.driverFactor * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setRole(m.role); ! m.utility.updateRole(pcost); ! double hours = m.driverFactor * 6.0 * m.role.getYearlyHours().doubleValue(); Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == hours); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { --- 179,198 ---- } } ! public void testTcoPersonalRoleFTE() { try { ! // double total = m.getDriverFactor() * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setRole(m.role); ! ModelUtility.updateRole(pcost); ! double hours = m.getDriverFactor() * 6.0 * m.role.getYearlyHours().doubleValue(); Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == hours); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { *************** *** 196,216 **** } } ! public void testPersonalRoleHours() { try { ! // double total = m.driverFactor * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setRole(m.role); pcost.setHours(new Double(13.0)); m.utility.updateRole(pcost); ! double hours = m.driverFactor * 6.0 * 13.0; Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_INTERNAL*/ "INTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == hours); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.HOURS_EXTERNAL*/ "EXTERNAL"), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_INTERNAL_LUMP*/ "INTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, /*Calculator.COST_EXTERNAL_LUMP*/ "EXTERNAL_LUMP"), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { --- 200,220 ---- } } ! public void testTcoPersonalRoleHours() { try { ! // double total = m.getDriverFactor() * 6.0 * amount; PersonalCost pcost = m.addPersonalCost(); pcost.setRole(m.role); pcost.setHours(new Double(13.0)); m.utility.updateRole(pcost); ! double hours = m.getDriverFactor() * 6.0 * 13.0; Calculator c = new Calculator(m.utility); ! double val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_INTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC Internal", val == hours); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_HOURS_EXTERNAL), Calculator.INDEX_TOTAL); assertTrue("PC External", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_INTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC Internal Lump", val == 0.0); ! val = Calculator.getValue(c.getCosts(m.model, Calculator.PERSONAL_TCO, Calculator.PERSONAL_COST_EXTERNAL_LUMP), Calculator.INDEX_TOTAL); assertTrue("PC External Lump", val == 0.0); } catch(Throwable e) { *************** *** 218,220 **** --- 222,496 ---- } } + /** + * Test the DIRECT/INDIRECT costs defined by CostCause. + */ + public void testTcoCostDirect() { + try { + Calculator c = new Calculator(m.utility /*, durationMonths*/); + double pDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT), Calculator.INDEX_TOTAL); + double pIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_INDIRECT), Calculator.INDEX_TOTAL); + double pUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + double fDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT), Calculator.INDEX_TOTAL); + double fIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_INDIRECT), Calculator.INDEX_TOTAL); + double fUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + assertTrue("Personal DIRECT", MathUtils.compare(0.0, pDirect) == 0); + assertTrue("Personal INDIRECT", MathUtils.compare(0.0, pIndirect) == 0); + assertTrue("Personal UNDEFINED", MathUtils.compare(0.0, pUndefined) == 0); + assertTrue("Fact DIRECT", MathUtils.compare(0.0, fDirect) == 0); + assertTrue("Fact INDIRECT", MathUtils.compare(0.0, fIndirect) == 0); + assertTrue("Fact UNDEFINED", MathUtils.compare(0.0, fUndefined) == 0); + + PersonalCost pCost = m.addPersonalCost(); + //pCost.setRole(m.role); + //pCost.setHours(new Double(13.0)); + pCost.setAmount(new Double(100.45)); + c = new Calculator(m.utility); + pDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT), Calculator.INDEX_TOTAL); + pIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_INDIRECT), Calculator.INDEX_TOTAL); + pUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + fDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT), Calculator.INDEX_TOTAL); + fIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_INDIRECT), Calculator.INDEX_TOTAL); + fUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + assertTrue("Personal DIRECT", MathUtils.compare(0.0, pDirect) == 0); + assertTrue("Personal INDIRECT", MathUtils.compare(0.0, pIndirect) == 0); + assertTrue("Personal UNDEFINED", MathUtils.compare(m.getDriverFactor() * 6.0 * 100.45, pUndefined) == 0); + assertTrue("Fact DIRECT", MathUtils.compare(0.0, fDirect) == 0); + assertTrue("Fact INDIRECT", MathUtils.compare(0.0, fIndirect) == 0); + assertTrue("Fact UNDEFINED", MathUtils.compare(0.0, fUndefined) == 0); + + FactCost fCost = m.addFactCost(); + fCost.setAmount(new Double(93.17)); + c = new Calculator(m.utility); + pDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT), Calculator.INDEX_TOTAL); + pIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_INDIRECT), Calculator.INDEX_TOTAL); + pUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + fDirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT), Calculator.INDEX_TOTAL); + fIndirect = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_INDIRECT), Calculator.INDEX_TOTAL); + fUndefined = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL); + assertTrue("Personal DIRECT", MathUtils.compare(0.0, pDirect) == 0); + assertTrue("Personal INDIRECT", MathUtils.compare(0.0, pIndirect) == 0); + assertTrue("Personal UNDEFINED", MathUtils.compare(m.getDriverFactor() * 6.0 * 100.45, pUndefined) == 0); + assertTrue("Fact DIRECT", MathUtils.compare(0.0, fDirect) == 0); + assertTrue("Fact INDIRECT", MathUtils.compare(0.0, fIndirect) == 0); + assertTrue("Fact UNDEFINED", MathUtils.compare(m.getDriverFactor() * 7.0 * 93.17, fUndefined) == 0); + //TODO for real CostCause instances + } catch(Throwable e) { + fail(e.getLocalizedMessage()); + } + } + public void testTcoCostEstimated() { + try { + Calculator c = new Calculator(m.utility /*, durationMonths*/); + double pEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_ESTIMATED), Calculator.INDEX_TOTAL); + double pKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_KNOWN), Calculator.INDEX_TOTAL); + double fEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_ESTIMATED), Calculator.INDEX_TOTAL); + double fKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_KNOWN), Calculator.INDEX_TOTAL); + double totalEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.ESTIMATED), Calculator.INDEX_TOTAL); + double totalKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.KNOWN), Calculator.INDEX_TOTAL); + assertTrue("Personal ESTIMATED", MathUtils.compare(0.0, pEstimated) == 0); + assertTrue("Personal KNOWN", MathUtils.compare(0.0, pKnown) == 0); + assertTrue("Fact ESTIMATED", MathUtils.compare(0.0, fEstimated) == 0); + assertTrue("Fact KNOWN", MathUtils.compare(0.0, fKnown) == 0); + assertTrue("Total ESTIMATED", MathUtils.compare(0.0, totalEstimated) == 0); + assertTrue("TOTAL KNOWN", MathUtils.compare(0.0, totalKnown) == 0); + + PersonalCost pCost = m.addPersonalCost(); + pCost.setAmount(new Double(100.0)); + pCost.setEstimated(Boolean.TRUE); + pCost = m.addPersonalCost(); + pCost.setAmount(new Double(50.0)); + pCost.setEstimated(Boolean.FALSE); + FactCost fCost = m.addFactCost(); + fCost.setAmount(new Double(70.0)); + fCost.setEstimated(Boolean.TRUE); + fCost = m.addFactCost(); + fCost.setAmount(new Double(30.0)); + fCost.setEstimated(Boolean.FALSE); + c = new Calculator(m.utility); + pEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_ESTIMATED), Calculator.INDEX_TOTAL); + pKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_KNOWN), Calculator.INDEX_TOTAL); + fEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_ESTIMATED), Calculator.INDEX_TOTAL); + fKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_KNOWN), Calculator.INDEX_TOTAL); + totalEstimated = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.ESTIMATED), Calculator.INDEX_TOTAL); + totalKnown = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.KNOWN), Calculator.INDEX_TOTAL); + double pTmp = m.getDriverFactor() * 6.0 * 100.0; + assertTrue("Personal ESTIMATED", MathUtils.compare(pTmp, pEstimated) == 0); + double fTmp = m.getDriverFactor() * 7.0 * 70.0; + assertTrue("Fact ESTIMATED", MathUtils.compare(fTmp, fEstimated) == 0); + assertTrue("Total ESTIMATED", MathUtils.compare(pTmp + fTmp, totalEstimated) == 0); + pTmp = m.getDriverFactor() * 6.0 * 50.0; + assertTrue("Personal KNOWN", MathUtils.compare(pTmp, pKnown) == 0); + fTmp = m.getDriverFactor() * 7.0 * 30.0; + assertTrue("Fact KNOWN", MathUtils.compare(fTmp, fKnown) == 0); + assertTrue("TOTAL KNOWN", MathUtils.compare(pTmp + fTmp, totalKnown) == 0); + //TODO for real CostCause instances + } catch(Throwable e) { + fail(e.getLocalizedMessage()); + } + } + public void testTcoFactCostBaseOffset() { + try { + long durationMonths = 48; + double perYear = durationMonths / 12; + m.utility.getSystemParameter().setDefaultUsageDuration(new Long(durationMonths)); + + FactCost fCost = m.addFactCost(); + fCost.setUsageDuration(new Long(durationMonths)); + fCost.setAmount(new Double(2000.0)); + fCost.setBaseOffset(new Long(0)); + fCost.setRepeatable(Boolean.FALSE); + + double total0 = m.getDriverFactor() * (7.0*2000.0); + + // 1st TCO-Year + Calculator c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + double f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=0", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=0", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=0", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 3); + assertTrue("3. year; offset=0", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 4); + assertTrue("4. year; offset=0", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 5); + assertTrue("5. year; offset=0, non-repeatable", MathUtils.compare(0.0, f) == 0); + + fCost.setBaseOffset(new Long(12)); + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=12", MathUtils.compare(0.0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 3); + assertTrue("3. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 4); + assertTrue("4. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 5); + assertTrue("5. year; offset=12;", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 6); + assertTrue("6. year; offset=12; non-repeatable", MathUtils.compare(0.0, f) == 0); + + fCost.setRepeatable(Boolean.TRUE); + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=12", MathUtils.compare(0.0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 3); + assertTrue("3. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 4); + assertTrue("4. year; offset=12", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 5); + assertTrue("5. year; offset=12;", MathUtils.compare(total0 /perYear, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 6); + assertTrue("6. year; offset=12; repeatable=>never ending", MathUtils.compare(total0 /perYear, f) == 0); + + fCost.setBaseOffset(new Long(3)); // check offset in the middle of the year + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.FACT_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + //TODO test years + } catch(Throwable e) { + fail(e.getLocalizedMessage()); + } + } + public void testTcoPersonalCostBaseOffset() { + try { + int durationMonths = 12; // PersonalCost always meant for 1 year! + + PersonalCost fCost = m.addPersonalCost(); + fCost.setMultitude(new Double(7.0)); + fCost.setAmount(new Double(2000.0)); + fCost.setBaseOffset(new Long(0)); + fCost.setRepeatable(Boolean.FALSE); + + double total0 = m.getDriverFactor() * (7.0*2000.0); + + // 1st TCO-Year + Calculator c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + double f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=0", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=0", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=0", MathUtils.compare(0.0, f) == 0); + + fCost.setBaseOffset(new Long(12)); + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=12", MathUtils.compare(0.0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 3); + assertTrue("3. year; offset=12; non-repeatable", MathUtils.compare(0.0, f) == 0); + + fCost.setRepeatable(Boolean.TRUE); + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+36 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + assertTrue("Total cost; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 1); + assertTrue("1. year; offset=12", MathUtils.compare(0.0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 2); + assertTrue("2. year; offset=12", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 3); + assertTrue("3. year; offset=12, repeatable!!!", MathUtils.compare(total0, f) == 0); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 4); + assertTrue("4. year; offset=12, repeatable!!!", MathUtils.compare(total0, f) == 0); + + fCost.setBaseOffset(new Long(3)); // check offset in the middle of the year + c = new Calculator(m.utility, (TcoObject)m.utility.getRoot(), durationMonths+24 /*must be longer*/); + f = Calculator.getValue(c.getTcoCodeTotal((TcoObject)m.utility.getRoot(), Calculator.PERSONAL_DIRECT_UNDEFINED), Calculator.INDEX_TOTAL + 0); + //TODO + } catch(Throwable e) { + fail(e.getLocalizedMessage()); + } + + + } + /** + * Check with sample: + * http://www.harri-deutsch.de/verlag/titel/pfeifer/k01_1736.pdf + */ + public void testCalcDepreciationLinear() { + double value = 10000; // Buchwert des Wirtschaftsgutes zu Beginn + int usageDuration = 5; // years + + assertTrue("Linear Begin", FinancialUtils.calcDepreciationLinear(value, usageDuration, 0) == value); + assertTrue("Linear 1.Year", FinancialUtils.calcDepreciationLinear(value, usageDuration, 1) == 8000.0); + assertTrue("Linear 2.Year", FinancialUtils.calcDepreciationLinear(value, usageDuration, 2) == 6000.0); + assertTrue("Linear 3.Year", FinancialUtils.calcDepreciationLinear(value, usageDuration, 3) == 4000.0); + assertTrue("Linear 4.Year", FinancialUtils.calcDepreciationLinear(value, usageDuration, 4) == 2000.0); + assertTrue("Linear 5.Year", FinancialUtils.calcDepreciationLinear(value, usageDuration, 5) == 0.0); + assertTrue("Linear after depreciation", FinancialUtils.calcDepreciationLinear(value, usageDuration, 6) == 0.0); + } + /** + * Check with sample: + * http://www.harri-deutsch.de/verlag/titel/pfeifer/k01_1736.pdf + */ + public void testCalcDepreciationGeometricDegressive() { + double value = 10000; // Buchwert des Wirtschaftsgutes zu Beginn + int usageDuration = 5; // years + + double p = 20; // %-Satz der jährlich vom Buchwert abgeschrieben werden soll + assertTrue("Degressive Begin", FinancialUtils.calcDepreciationGeometricDegressive(value, p, 0) == value); + assertTrue("Degressive 1.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 1) == 8000); + assertTrue("Degressive 2.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 2) == 6400); + assertTrue("Degressive 3.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 3) == 5120); + assertTrue("Degressive 4.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 4) == 4096); + assertTrue("Degressive 5.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 5) == 3276); + + value = 120000; + p = 5; + usageDuration = 4; + assertTrue("Degressive Begin", FinancialUtils.calcDepreciationGeometricDegressive(value, p, 0) == value); + assertTrue("Degressive 1.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 1) == 114000); + assertTrue("Degressive 2.Year", (long)FinancialUtils.calcDepreciationGeometricDegressive(value, p, 2) == 108300); + } } |
From: Hirzel P. <ph...@us...> - 2008-05-15 20:27:34
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9446/src/org/tcotool/tools Modified Files: Calculator.java Log Message: Feature: calculating Cost#baseOffset (n*12 months) Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Calculator.java 14 May 2008 11:09:23 -0000 1.7 --- Calculator.java 15 May 2008 20:27:35 -0000 1.8 *************** *** 230,233 **** --- 230,274 ---- } /** + * Depending on given base-offset the cost impact might happen later. + * @param cost + * @param yearOffset + * @param factor + * @return + * @deprecated + */ + public static double calcTcoCostInYear(Cost cost, int yearOffset, double factor) { + double totalCost = cost.getAmount().doubleValue() * factor; + + if (yearOffset == INDEX_TOTAL) { + // overall cost independent of yearly base-offset + return totalCost; + } else { + double costPerMonth = -1.0; + if (cost instanceof FactCost) { + costPerMonth = totalCost / ((FactCost)cost).getUsageDuration().doubleValue(); + } else { + // PersonalCost are on a yearly usage + //TODO PersonalCost#getUsageDuration() + costPerMonth = totalCost / 12.0; + } + + int currentYearInMonth = yearOffset * 12; // 1st year = 12 [month] + int baseOffset = cost.getBaseOffset() == null ? 0 : cost.getBaseOffset().intValue(); // in [month] + if (baseOffset == 0) { + + } + if (currentYearInMonth <= baseOffset) { + // cost relevant after baseOffset only + return 0.0; + } else { + if (currentYearInMonth > baseOffset) { + + } + //TODO consider Cost#BaseOffset + return totalCost; + } + } + } + /** * Summarize total (PersonalCost + FactCost + DependencyCost) in tree for given object (inclusive). */ *************** *** 430,493 **** private void calcTco(Service service, CostDriver driver, Cost cost, double factor) { double totalCost = cost.getAmount().doubleValue() * factor; ! if (cost instanceof PersonalCost) { ! // [0] total PersonalCost for a year cummulateCodes(service, driver, cost, PERSONAL_TCO, INDEX_TOTAL, totalCost); ! // [1..n years] personal effort is added to each following TCO-Year ! if ((cost.getRepeatable() != null) && cost.getRepeatable().booleanValue()) { ! calcTcoRepeatable(service, driver, cost, PERSONAL_TCO, totalCost); ! } else { ! // at least charge personal Cost ONCE ! //TODO find the year of the baseOffset ! cummulateCodes(service, driver, cost, PERSONAL_TCO, INDEX_TOTAL + 1, totalCost); ! } } else { FactCost fCost = (FactCost)cost; ! if ((fCost.getUsageDuration() != null) && (fCost.getUsageDuration().longValue() > 0)) { ! // [0] total FactCost independent of usage cummulateCodes(service, driver, cost, FACT_TCO, INDEX_TOTAL, totalCost); ! // [1..n years] FactCost's divided by usage ! double costPerMonth = totalCost / fCost.getUsageDuration().doubleValue(); ! if ((cost.getRepeatable() != null) && cost.getRepeatable().booleanValue()) { // usageDuration is in maxUsage range anyway if (fCost.getUsageDuration().longValue() < 12) { // the given cost-amount counts for whole year ! // calcTcoRepeatable(costTypeValues, cost.getAmount().doubleValue()); ! calcTcoRepeatable(service, driver, cost, FACT_TCO, totalCost); } else { ! calcTcoRepeatable(service, driver, cost, FACT_TCO, costPerMonth * 12.0); } } else { // once in maxUsage for whole UsageDuration - //TODO find the year of the baseOffset long completeYears = fCost.getUsageDuration().longValue() / 12; ! int year = 0; for (; year<completeYears; year++) { // usage over full year ! cummulateCodes(service, driver, cost, FACT_TCO, year + INDEX_TOTAL + 1, costPerMonth * 12.0); } long partialMonthInYear = fCost.getUsageDuration().longValue() % 12; if (partialMonthInYear > 0) { // last Usage year adds only fraction part ! cummulateCodes(service, driver, cost, FACT_TCO, year + INDEX_TOTAL + 1, costPerMonth * (double)partialMonthInYear); year++; } } } } } - private static double getCostInYear(Cost cost, int yearOffset) { - return 0.0; - } /** ! * Repeatable Cost's must be reconsidered after UsageDuration. */ ! private void calcTcoRepeatable(Service service, CostDriver driver, Cost cost, final String keyPrefix, double costPerYear) { ! //??? Map serviceMap = getServiceMap(costs, service); // [1..n years] personal effort is added to each following TCO-Year long completeYears = getMaxDurationMonths() / 12; ! int year = 0; for (; year<completeYears; year++) { cummulateCodes(service, driver, cost, keyPrefix, year + INDEX_TOTAL + 1, costPerYear); --- 471,585 ---- private void calcTco(Service service, CostDriver driver, Cost cost, double factor) { double totalCost = cost.getAmount().doubleValue() * factor; + boolean repeatable = (cost.getRepeatable() != null) && cost.getRepeatable().booleanValue(); + int baseOffset = (cost.getBaseOffset() == null ? 0 : cost.getBaseOffset().intValue()); + int baseYear = baseOffset / 12; + int year = INDEX_TOTAL + 1 + baseYear; ! if (cost instanceof PersonalCost) { // usage=12 months! ! // 1) [0] total PersonalCost for a year (baseOffset irrelevant) cummulateCodes(service, driver, cost, PERSONAL_TCO, INDEX_TOTAL, totalCost); ! // [1..n years] personal effort is the SAME for each following TCO-Year (usage=12 months!) ! /*if (repeatable) { ! calcTcoRepeatable(service, driver, cost, PERSONAL_TCO, totalCost, baseOffset); ! } else {*/ ! // 2) calc [1+baseOffset] year ! if (baseOffset % 12.0 == 0) { ! cummulateCodes(service, driver, cost, PERSONAL_TCO, year++, totalCost); ! } else { ! // treat first year partially ONLY! ! double part = totalCost / 12.0 * (12.0 - (double)(baseOffset - baseYear * 12.0)); ! cummulateCodes(service, driver, cost, PERSONAL_TCO, year++, part); ! if (!repeatable) { ! // 3.1) book rest part of the costs in the following year ! cummulateCodes(service, driver, cost, PERSONAL_TCO, year, totalCost - part); ! } ! } ! // 3.2) [2+baseOffset..n] years personal cost is the SAME for each following TCO-Year ! if (repeatable) { ! long completeYears = getMaxDurationMonths() / 12; ! ! for (; year<completeYears+1; year++) { ! cummulateCodes(service, driver, cost, PERSONAL_TCO, year, totalCost); ! } ! // if the last year is not even in maxUsage ! long partialMonthInYear = getMaxDurationMonths() % 12; ! if (partialMonthInYear > 0) { ! // ignore partial costs in case of (baseOffset%12!=0) because repeatable anyway ! cummulateCodes(service, driver, cost, PERSONAL_TCO, year, totalCost / 12.0 * partialMonthInYear); ! } ! } ! //} } else { FactCost fCost = (FactCost)cost; ! if ((fCost.getUsageDuration() != null) && (fCost.getUsageDuration().longValue() > 0)) { ! // 1) [0] total FactCost independent of usage (baseOffset irrelevant) cummulateCodes(service, driver, cost, FACT_TCO, INDEX_TOTAL, totalCost); ! // 2) [1+baseOffset..n] year ! double costPerMonth = totalCost / fCost.getUsageDuration().doubleValue(); ! for (int month=0; month<getMaxDurationMonths(); month++) { ! if ((month<fCost.getUsageDuration().intValue()) || repeatable) { ! if ((month > 0) && (month % 12 == 0)) { ! // next year ! year++; ! } ! cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth); ! } else { ! break; ! } ! } ! /* ! // [1..n years] FactCost's divided by usage ! if (repeatable) { // usageDuration is in maxUsage range anyway if (fCost.getUsageDuration().longValue() < 12) { // the given cost-amount counts for whole year ! calcTcoRepeatable(service, driver, cost, FACT_TCO, totalCost, baseOffset); } else { ! calcTcoRepeatable(service, driver, cost, FACT_TCO, costPerMonth * 12.0, baseOffset); } } else { // once in maxUsage for whole UsageDuration long completeYears = fCost.getUsageDuration().longValue() / 12; ! double correctionCosts = 0.0; ! if (baseYear > 0) { ! // if baseOffset points to middle of year, only calculate costs partially in first relevant year ! double months = 12.0 - (double)(baseOffset % 12); ! correctionCosts = correctionCosts + costPerMonth * months; ! cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * months); ! year++; ! } for (; year<completeYears; year++) { // usage over full year ! correctionCosts = correctionCosts + costPerMonth * 12.0; ! cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * 12.0); } long partialMonthInYear = fCost.getUsageDuration().longValue() % 12; if (partialMonthInYear > 0) { // last Usage year adds only fraction part ! correctionCosts = correctionCosts + costPerMonth * (double)partialMonthInYear; ! cummulateCodes(service, driver, cost, FACT_TCO, year, costPerMonth * (double)partialMonthInYear); year++; } + if (correctionCosts > totalCost) { + // NASTY: because of baseOffset to many costs were booked in last year + cummulateCodes(service, driver, cost, FACT_TCO, year - 1, totalCost - correctionCosts); + } } + */ } } } /** ! * Repeatable Cost's must be reconsidered after UsageDuration in years 1..n. ! * @deprecated */ ! private void calcTcoRepeatable(Service service, CostDriver driver, Cost cost, final String keyPrefix, double costPerYear, int baseOffset) { ! int baseYear = baseOffset / 12; ! // [1..n years] personal effort is added to each following TCO-Year long completeYears = getMaxDurationMonths() / 12; ! int year = 0 + baseYear; for (; year<completeYears; year++) { cummulateCodes(service, driver, cost, keyPrefix, year + INDEX_TOTAL + 1, costPerYear); *************** *** 650,660 **** */ private void storeIntoCodeList(Map serviceMap, final String kind, Object code, int year, double amount) { ! // 1) keep the costs for service, year and code ! List codeList = getCodeList(serviceMap, createCodeKey(kind, code)); ! if (codeList.size() > year) { ! codeList.set(year, new Double(((Double)codeList.get(year)). doubleValue() + amount)); ! } else { ! codeList.add(new Double(amount)); } } /** --- 742,752 ---- */ private void storeIntoCodeList(Map serviceMap, final String kind, Object code, int year, double amount) { ! // keep the costs for service, year and code ! List codeList = getCodeList(serviceMap, createCodeKey(kind, code)); ! for (int i=codeList.size(); i<=year; i++) { ! // (first entry in this year) || (Cost#baseOffset > 1 year) ! codeList.add(new Double(0.0)); } + codeList.set(year, new Double(((Double)codeList.get(year)). doubleValue() + amount)); } /** *************** *** 820,824 **** // repeat the costs until maxDuration while (year < getDurationYears()) { ! //TODO Check: probably degressive depreciation costs from duration before are not calculated further on, which would go infinitely down to 0 year = calcDepreciation(service, driver, fCost, capital, year); } --- 912,916 ---- // repeat the costs until maxDuration while (year < getDurationYears()) { ! //TODO Check: probably degressive depreciation costs from duration before are not calculated further on, which would go infinitely down to 0 year = calcDepreciation(service, driver, fCost, capital, year); } |
From: Hirzel P. <ph...@us...> - 2008-05-14 11:09:22
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5108/src/org/tcotool/tools Modified Files: Calculator.java Log Message: Feature: Estimated & Direct costs Index: Calculator.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/tools/Calculator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Calculator.java 13 Jun 2007 20:17:33 -0000 1.6 --- Calculator.java 14 May 2008 11:09:23 -0000 1.7 *************** *** 28,32 **** import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; ! import ch.softenvironment.math.MathUtils; import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.DeveloperException; --- 28,32 ---- import ch.softenvironment.jomm.mvc.model.DbCodeType; import ch.softenvironment.jomm.mvc.model.DbObject; ! import ch.softenvironment.math.FinancialUtils; import ch.softenvironment.util.AmountFormat; import ch.softenvironment.util.DeveloperException; *************** *** 37,41 **** * Service individually. * ! * Costs-Map strucutre: * Map-Key | Values * ----------------------------------------------------------------------------------- --- 37,41 ---- * Service individually. * ! * Costs-Map structure: * Map-Key | Values * ----------------------------------------------------------------------------------- *************** *** 46,50 **** */ public class Calculator { ! // kind of costs public static final String FACT_TCO = "FCTCO_"; public static final String PERSONAL_TCO = "PCTCO_"; --- 46,50 ---- */ public class Calculator { ! // kind of cost-relevance public static final String FACT_TCO = "FCTCO_"; public static final String PERSONAL_TCO = "PCTCO_"; *************** *** 58,72 **** public static final String SITE_UNDEFINED = "SITE_UNDEFINED"; public static final String CATALOGUE_UNDEFINED = "CATALOGUE_UNDEFINED"; ! public static final String ROLE_UNDEFINED = "ROLE_UNDEFINED"; ! public static final String ACTIVITY_UNDEFINED = "ACTIVITY_UNDEFINED"; ! // pseudo Codes ! public static final String ESTIMATED = "ESTIMATED"; ! public static final String KNOWN = "KNOWN"; ! public static final String HOURS_INTERNAL = "INTERNAL"; ! public static final String HOURS_EXTERNAL = "EXTERNAL"; ! public static final String COST_INTERNAL_LUMP = "INTERNAL_LUMP"; ! public static final String COST_EXTERNAL_LUMP = "EXTERNAL_LUMP"; // calculation constants public static final double PERSONAL_HOURS_UNDEFINED = -1.0; private Map costs = new HashMap(); // map to keep costs per service --- 58,92 ---- public static final String SITE_UNDEFINED = "SITE_UNDEFINED"; public static final String CATALOGUE_UNDEFINED = "CATALOGUE_UNDEFINED"; ! public static final String PERSONAL_ROLE_UNDEFINED = "ROLE_UNDEFINED"; ! public static final String PERSONAL_ACTIVITY_UNDEFINED = "ACTIVITY_UNDEFINED"; ! ! // pseudo code ESTIMATED related to Cost#estimated ! public static final String FACT_ESTIMATED = FACT_TCO + "ESTIMATED"; ! public static final String PERSONAL_ESTIMATED = PERSONAL_TCO + "ESTIMATED"; ! public static final String ESTIMATED = "ESTIMATED"; // FACT_ESTIMATED + PERSONAL_ESTIMATED (which is the opposite of KNOWN) ! public static final String FACT_KNOWN = FACT_TCO + "KNOWN"; ! public static final String PERSONAL_KNOWN = PERSONAL_TCO + "KNOWN"; ! public static final String KNOWN = "KNOWN"; // FACT_KNOWN + PERSONAL_KNOWN (which is the opposite of ESTIMATED) ! // pseudo code DIRECT/INDIRECT related to CostCause#direct ! public static final String FACT_DIRECT_UNDEFINED = FACT_TCO + "DIRECT_UNKNOWN"; ! public static final String FACT_DIRECT = FACT_TCO + "DIRECT"; ! public static final String FACT_INDIRECT = FACT_TCO + "INDIRECT"; ! public static final String PERSONAL_DIRECT_UNDEFINED = PERSONAL_TCO + "DIRECT_UNKNOWN"; ! public static final String PERSONAL_DIRECT = PERSONAL_TCO + "DIRECT"; ! public static final String PERSONAL_INDIRECT = PERSONAL_TCO + "INDIRECT"; ! // pseudo code related to PersonalCost ! public static final String PERSONAL_HOURS_INTERNAL = PERSONAL_TCO + "HOURS_INTERNAL"; ! public static final String PERSONAL_HOURS_EXTERNAL = PERSONAL_TCO + "HOURS_EXTERNAL"; ! public static final String PERSONAL_COST_INTERNAL_LUMP = PERSONAL_TCO + "INTERNAL_LUMP"; ! public static final String PERSONAL_COST_EXTERNAL_LUMP = PERSONAL_TCO + "EXTERNAL_LUMP"; ! public static final String PERSONAL_COST_EXTERNAL = PERSONAL_TCO + "EXTERN"; ! public static final String PERSONAL_COST_INTERNAL = PERSONAL_TCO + "INTERN"; ! // calculation constants public static final double PERSONAL_HOURS_UNDEFINED = -1.0; + + // financial/accounting + public static final String DEPRECIATION_LINEAR = "DEPR_LIN_"; + public static final String DEPRECIATION_GEOMETRIC_DEGRESSIVE = "DEPR_DEGR"; private Map costs = new HashMap(); // map to keep costs per service *************** *** 273,279 **** } private static String createCodeKey(final String kind, Object code) { ! if (code instanceof DbObject) { return kind + ((DbObject)code).getId().toString(); } else { return kind + code; } --- 293,302 ---- } private static String createCodeKey(final String kind, Object code) { ! if (code == null) { ! throw new IllegalArgumentException("no key exists for code==null"); ! } else if (code instanceof DbObject) { return kind + ((DbObject)code).getId().toString(); } else { + // <undefined> code return kind + code; } *************** *** 401,405 **** /** * Cummulate the TCO-Costs for given cost' CostType: ! * @paran driver owner of given cost * @param cost * @param factor (including the given Cost's factor) --- 424,428 ---- /** * Cummulate the TCO-Costs for given cost' CostType: ! * @param driver owner of given cost * @param cost * @param factor (including the given Cost's factor) *************** *** 416,420 **** calcTcoRepeatable(service, driver, cost, PERSONAL_TCO, totalCost); } else { ! // at least charge personal Cost in 1st Year cummulateCodes(service, driver, cost, PERSONAL_TCO, INDEX_TOTAL + 1, totalCost); } --- 439,444 ---- calcTcoRepeatable(service, driver, cost, PERSONAL_TCO, totalCost); } else { ! // at least charge personal Cost ONCE ! //TODO find the year of the baseOffset cummulateCodes(service, driver, cost, PERSONAL_TCO, INDEX_TOTAL + 1, totalCost); } *************** *** 438,441 **** --- 462,466 ---- } else { // once in maxUsage for whole UsageDuration + //TODO find the year of the baseOffset long completeYears = fCost.getUsageDuration().longValue() / 12; int year = 0; *************** *** 454,457 **** --- 479,485 ---- } } + private static double getCostInYear(Cost cost, int yearOffset) { + return 0.0; + } /** * Repeatable Cost's must be reconsidered after UsageDuration. *************** *** 471,485 **** } } - /** - * 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) { if (!map.containsKey(key.getId())) { --- 499,502 ---- *************** *** 489,493 **** } /** ! * Distribute the given costs among all codes involved. * @param year 0=Total at all; 1..n=TCO/Depreciation-distribution * @param amount costs to charge for given year --- 506,510 ---- } /** ! * Cummulate the given cost among all codes involved. * @param year 0=Total at all; 1..n=TCO/Depreciation-distribution * @param amount costs to charge for given year *************** *** 539,551 **** key = COST_CAUSE_UNDEFINED; if (cost.getCause() != null) { ! key = cost.getCause(); } storeIntoCodeList(serviceMap, kind, key, year, amount); - if (cost.getEstimated().booleanValue()) { - storeIntoCodeList(serviceMap, kind, ESTIMATED, year, amount); - } else { - storeIntoCodeList(serviceMap, kind, KNOWN, year, amount); - } if (cost instanceof FactCost) { key = CATALOGUE_UNDEFINED; if (((FactCost)cost).getCatalogue() != null) { --- 556,581 ---- key = COST_CAUSE_UNDEFINED; if (cost.getCause() != null) { ! key = cost.getCause(); } storeIntoCodeList(serviceMap, kind, key, year, amount); if (cost instanceof FactCost) { + // pseudo-code "DIRECT/INDIRECT" + if ((cost.getCause() == null) || (cost.getCause().getDirect() == null)) { + storeIntoCodeList(serviceMap, kind, FACT_DIRECT_UNDEFINED, year, amount); + } else if (cost.getCause().getDirect().booleanValue()) { + storeIntoCodeList(serviceMap, kind, FACT_DIRECT, year, amount); + } else { + storeIntoCodeList(serviceMap, kind, FACT_INDIRECT, year, amount); + } + + // pseudo-code "ESTIMATED/KNOWN" + if (cost.getEstimated().booleanValue()) { + storeIntoCodeList(serviceMap, kind, FACT_ESTIMATED, year, amount); + storeIntoCodeList(serviceMap, kind, ESTIMATED, year, amount); + } else { + storeIntoCodeList(serviceMap, kind, FACT_KNOWN, year, amount); + storeIntoCodeList(serviceMap, kind, KNOWN, year, amount); + } + key = CATALOGUE_UNDEFINED; if (((FactCost)cost).getCatalogue() != null) { *************** *** 554,561 **** storeIntoCodeList(serviceMap, kind, key, year, amount); } else if (cost instanceof PersonalCost) { ! // kind == PERSONAL_TCO PersonalCost pCost = (PersonalCost)cost; ! key = ACTIVITY_UNDEFINED; if (pCost.getActivity() != null) { key = pCost.getActivity(); --- 584,608 ---- storeIntoCodeList(serviceMap, kind, key, year, amount); } else if (cost instanceof PersonalCost) { ! // pseudo-code "DIRECT/INDIRECT" ! if ((cost.getCause() == null) || (cost.getCause().getDirect() == null)) { ! storeIntoCodeList(serviceMap, kind, PERSONAL_DIRECT_UNDEFINED, year, amount); ! } else if (cost.getCause().getDirect().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, PERSONAL_DIRECT, year, amount); ! } else { ! storeIntoCodeList(serviceMap, kind, PERSONAL_INDIRECT, year, amount); ! } ! ! // pseudo-code "ESTIMATED/KNOWN" ! if (cost.getEstimated().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, PERSONAL_ESTIMATED, year, amount); ! storeIntoCodeList(serviceMap, kind, ESTIMATED, year, amount); ! } else { ! storeIntoCodeList(serviceMap, kind, PERSONAL_KNOWN, year, amount); ! storeIntoCodeList(serviceMap, kind, KNOWN, year, amount); ! } ! PersonalCost pCost = (PersonalCost)cost; ! key = PERSONAL_ACTIVITY_UNDEFINED; if (pCost.getActivity() != null) { key = pCost.getActivity(); *************** *** 563,567 **** storeIntoCodeList(serviceMap, kind, key, year, amount); ! key = ROLE_UNDEFINED; if (pCost.getRole() != null) { key = pCost.getRole(); --- 610,614 ---- storeIntoCodeList(serviceMap, kind, key, year, amount); ! key = PERSONAL_ROLE_UNDEFINED; if (pCost.getRole() != null) { key = pCost.getRole(); *************** *** 573,586 **** // just count amount generally (Lump = "Pauschal" (de)) if (pCost.getInternal().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, COST_INTERNAL_LUMP, year, amount); } else { ! storeIntoCodeList(serviceMap, kind, COST_EXTERNAL_LUMP, year, amount); } } else { hours *= utility.getMultitudeFactor(pCost, true); if (pCost.getInternal().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, HOURS_INTERNAL, year, hours); } else { ! storeIntoCodeList(serviceMap, kind, HOURS_EXTERNAL, year, hours); } } --- 620,633 ---- // just count amount generally (Lump = "Pauschal" (de)) if (pCost.getInternal().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, PERSONAL_COST_INTERNAL_LUMP, year, amount); } else { ! storeIntoCodeList(serviceMap, kind, PERSONAL_COST_EXTERNAL_LUMP, year, amount); } } else { hours *= utility.getMultitudeFactor(pCost, true); if (pCost.getInternal().booleanValue()) { ! storeIntoCodeList(serviceMap, kind, PERSONAL_HOURS_INTERNAL, year, hours); } else { ! storeIntoCodeList(serviceMap, kind, PERSONAL_HOURS_EXTERNAL, year, hours); } } *************** *** 613,619 **** /** * Return total costs for given service and code. ! * @param service null for cummulated costs over all services * @param kind ! * @param code * @return [Total_Kind_Code; Year1_Kind_Code;..YearN_Kind_Code] */ --- 660,666 ---- /** * Return total costs for given service and code. ! * @param object null for cummulated costs over all services * @param kind ! * @param code DbCode; String for undefined code; null for * @return [Total_Kind_Code; Year1_Kind_Code;..YearN_Kind_Code] */ *************** *** 737,741 **** } /** ! * */ public int getDurationYears() { --- 784,790 ---- } /** ! * Calculate the duration in years, where last partial year counts ! * as one year more. ! * Useful as title-column count. */ public int getDurationYears() { *************** *** 746,748 **** --- 795,877 ---- return years; } + // finance/accounting + /** + * Cummulate costs of financial matters for e.g. accounting, interests, depreciation and the like + * for the given cost in driver and service. + * @param service + * @param driver + * @param cost Consider FactCost's with a depreciationDuration > 1 year + * @param factor (including the given Cost's factor) + */ + protected void calcFinances(Service service, CostDriver driver, Cost cost, double factor) { + if (cost instanceof FactCost) { + FactCost fCost = (FactCost)cost; + if ((fCost.getDepreciationDuration() != null) && (fCost.getDepreciationDuration().longValue() > 12.0)) { + // [0] total FactCost independent of depreciation + double capital = fCost.getAmount().doubleValue() * factor; + cummulateCodes(service, driver, cost, DEPRECIATION_LINEAR, INDEX_TOTAL, capital); + cummulateCodes(service, driver, cost, DEPRECIATION_GEOMETRIC_DEGRESSIVE, INDEX_TOTAL, capital); + + // [1..fCost.depreciationYears] of first period of FactCost's depreciationDuration + int year = calcDepreciation(service, driver, fCost, capital, INDEX_TOTAL); + + // [after fCost.depreciationYears years] repeatable periods + if ((cost.getRepeatable() != null) && cost.getRepeatable().booleanValue() && (year < getDurationYears())) { + // repeat the costs until maxDuration + while (year < getDurationYears()) { + //TODO Check: probably degressive depreciation costs from duration before are not calculated further on, which would go infinitely down to 0 + year = calcDepreciation(service, driver, fCost, capital, year); + } + } + } + } + } + /** + * Calculate the <b>linear depreciation</b> over the whole FactCost-DepreciationDuration. + * Algorithm: + * - Linear Depreciation + * @param costCapital + * @param costDuration + * @return year of last Cost-entry + */ + private int calcDepreciation(Service service, CostDriver driver, FactCost cost, double costCapital, int yearIndex) { + int duration = cost.getDepreciationDuration().intValue(); + int completeYears = duration / 12; + if (duration % 12 > 0) { + // consider a partial duration after last complete year as one more year + completeYears++; + } + + int year = 0; + for (; year<completeYears; year++) { + int period = year + 1; + double amount /*[de] Buchwert*/ = FinancialUtils.calcDepreciationLinear(costCapital, completeYears, period); + // depreciation over full year + cummulateCodes(service, driver, cost, DEPRECIATION_LINEAR, yearIndex + period, amount); + + amount /*[de] Buchwert*/ = FinancialUtils.calcDepreciationGeometricDegressive(costCapital, utility.getInterestRate(), period); + // depreciation over full year + cummulateCodes(service, driver, cost, DEPRECIATION_GEOMETRIC_DEGRESSIVE, yearIndex + period, amount); + } + + return year + yearIndex; + } + /** + * Return cost-list over given object. + * @param object null for all services + * @return [FactCosts_Total; Depreciation_Year1;.. TCO_YearN] + */ + public List getDepreciationCostBlock(TcoObject object, final String type) { + TcoObject costObject = (object == null ? rootObject : object); + List costs = new ArrayList(); + + List totalFacts = getTotalCosts(costObject, type); + costs.add(new Double(getValue(totalFacts, INDEX_TOTAL))); + for (int i=0; i<getDurationYears(); i++) { + // print Depreciation-Years + int index = i + INDEX_TOTAL + 1; + costs.add(new Double(getValue(totalFacts, index))); + } + return costs; + } } \ No newline at end of file |