You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(148) |
Jun
(48) |
Jul
(107) |
Aug
(292) |
Sep
(301) |
Oct
(530) |
Nov
(142) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thies <tg...@us...> - 2007-12-05 23:22:45
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/analysis/walk In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22072/src/test/net/sf/tail/analysis/walk Modified Files: WalkForwardTest.java Log Message: Refatoração nos scripts Index: WalkForwardTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/analysis/walk/WalkForwardTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** WalkForwardTest.java 21 Nov 2007 21:55:20 -0000 1.21 --- WalkForwardTest.java 5 Dec 2007 23:22:46 -0000 1.22 *************** *** 20,23 **** --- 20,24 ---- import net.sf.tail.sample.SampleTimeSeries; import net.sf.tail.series.RegularSlicer; + import net.sf.tail.strategiesSet.JavaStrategiesSet; import net.sf.tail.strategy.FakeStrategy; *************** *** 81,85 **** Walker walk = new WalkForward(new HigherValueEvaluatorFactory(), new HistoryRunnerFactory()); ! List<Decision> decisions = walk.walk(strategies, splittedSeries, criteria).getDecisions(); assertEquals(secondStrategy, decisions.get(0).getStrategy()); assertEquals(15d/30, decisions.get(0).evaluateCriterion()); --- 82,86 ---- Walker walk = new WalkForward(new HigherValueEvaluatorFactory(), new HistoryRunnerFactory()); ! List<Decision> decisions = walk.walk(new JavaStrategiesSet( strategies), splittedSeries, criteria).getDecisions(); assertEquals(secondStrategy, decisions.get(0).getStrategy()); assertEquals(15d/30, decisions.get(0).evaluateCriterion()); |
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/strategy In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22072/src/java/net/sf/tail/strategy Modified Files: CombinedBuyAndSellStrategy.java MinValueStarterStrategy.java DistanceBetweenIndicatorsStrategy.java IndicatorOverIndicatorStrategy.java ResistanceStrategy.java StopGainStrategy.java StopLossStrategy.java AndStrategy.java OrStrategy.java IndicatorCrossedIndicatorStrategy.java FakeStrategy.java NotSoFastStrategy.java SupportStrategy.java PipeEnterStrategy.java ParabolicSarAndDMIStrategy.java JustBuyOnceStrategy.java Log Message: Refatoração nos scripts Index: ParabolicSarAndDMIStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/ParabolicSarAndDMIStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParabolicSarAndDMIStrategy.java 26 Sep 2007 19:24:06 -0000 1.1 --- ParabolicSarAndDMIStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 23,25 **** --- 23,56 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((dmiStrategy == null) ? 0 : dmiStrategy.hashCode()); + result = prime * result + ((parabolicStrategy == null) ? 0 : parabolicStrategy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ParabolicSarAndDMIStrategy other = (ParabolicSarAndDMIStrategy) obj; + if (dmiStrategy == null) { + if (other.dmiStrategy != null) + return false; + } else if (!dmiStrategy.equals(other.dmiStrategy)) + return false; + if (parabolicStrategy == null) { + if (other.parabolicStrategy != null) + return false; + } else if (!parabolicStrategy.equals(other.parabolicStrategy)) + return false; + return true; + } + } Index: MinValueStarterStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/MinValueStarterStrategy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MinValueStarterStrategy.java 25 Aug 2007 12:30:00 -0000 1.10 --- MinValueStarterStrategy.java 5 Dec 2007 23:22:45 -0000 1.11 *************** *** 37,39 **** --- 37,75 ---- return String.format("%s start: %i", this.getClass().getSimpleName(), start); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((indicator == null) ? 0 : indicator.hashCode()); + long temp; + temp = Double.doubleToLongBits(start); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final MinValueStarterStrategy other = (MinValueStarterStrategy) obj; + if (indicator == null) { + if (other.indicator != null) + return false; + } else if (!indicator.equals(other.indicator)) + return false; + if (Double.doubleToLongBits(start) != Double.doubleToLongBits(other.start)) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + return true; + } } Index: OrStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/OrStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OrStrategy.java 25 Aug 2007 14:04:32 -0000 1.1 --- OrStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 28,30 **** --- 28,61 ---- return String.format("%s or %s",strategy.getName(),strategy2.getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + result = prime * result + ((strategy2 == null) ? 0 : strategy2.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final OrStrategy other = (OrStrategy) obj; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + if (strategy2 == null) { + if (other.strategy2 != null) + return false; + } else if (!strategy2.equals(other.strategy2)) + return false; + return true; + } } Index: FakeStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/FakeStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FakeStrategy.java 7 Nov 2007 22:22:10 -0000 1.1 --- FakeStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 1,4 **** --- 1,6 ---- package net.sf.tail.strategy; + import java.util.Arrays; + import net.sf.tail.Operation; *************** *** 29,31 **** --- 31,58 ---- return false; } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Arrays.hashCode(enter); + result = prime * result + Arrays.hashCode(exit); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final FakeStrategy other = (FakeStrategy) obj; + if (!Arrays.equals(enter, other.enter)) + return false; + if (!Arrays.equals(exit, other.exit)) + return false; + return true; + } } Index: IndicatorOverIndicatorStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/IndicatorOverIndicatorStrategy.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IndicatorOverIndicatorStrategy.java 25 Aug 2007 12:30:00 -0000 1.8 --- IndicatorOverIndicatorStrategy.java 5 Dec 2007 23:22:45 -0000 1.9 *************** *** 33,35 **** --- 33,66 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((first == null) ? 0 : first.hashCode()); + result = prime * result + ((second == null) ? 0 : second.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final IndicatorOverIndicatorStrategy other = (IndicatorOverIndicatorStrategy) obj; + if (first == null) { + if (other.first != null) + return false; + } else if (!first.equals(other.first)) + return false; + if (second == null) { + if (other.second != null) + return false; + } else if (!second.equals(other.second)) + return false; + return true; + } + } Index: DistanceBetweenIndicatorsStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/DistanceBetweenIndicatorsStrategy.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DistanceBetweenIndicatorsStrategy.java 25 Aug 2007 12:30:00 -0000 1.8 --- DistanceBetweenIndicatorsStrategy.java 5 Dec 2007 23:22:45 -0000 1.9 *************** *** 51,53 **** --- 51,94 ---- .getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(difference); + result = prime * result + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(distance); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((lower == null) ? 0 : lower.hashCode()); + result = prime * result + ((upper == null) ? 0 : upper.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final DistanceBetweenIndicatorsStrategy other = (DistanceBetweenIndicatorsStrategy) obj; + if (Double.doubleToLongBits(difference) != Double.doubleToLongBits(other.difference)) + return false; + if (Double.doubleToLongBits(distance) != Double.doubleToLongBits(other.distance)) + return false; + if (lower == null) { + if (other.lower != null) + return false; + } else if (!lower.equals(other.lower)) + return false; + if (upper == null) { + if (other.upper != null) + return false; + } else if (!upper.equals(other.upper)) + return false; + return true; + } + } Index: PipeEnterStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/PipeEnterStrategy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PipeEnterStrategy.java 27 Aug 2007 13:03:34 -0000 1.10 --- PipeEnterStrategy.java 5 Dec 2007 23:22:45 -0000 1.11 *************** *** 42,44 **** --- 42,75 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((crossDown == null) ? 0 : crossDown.hashCode()); + result = prime * result + ((crossUp == null) ? 0 : crossUp.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final PipeEnterStrategy other = (PipeEnterStrategy) obj; + if (crossDown == null) { + if (other.crossDown != null) + return false; + } else if (!crossDown.equals(other.crossDown)) + return false; + if (crossUp == null) { + if (other.crossUp != null) + return false; + } else if (!crossUp.equals(other.crossUp)) + return false; + return true; + } + } Index: JustBuyOnceStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/JustBuyOnceStrategy.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JustBuyOnceStrategy.java 25 Aug 2007 12:30:00 -0000 1.7 --- JustBuyOnceStrategy.java 5 Dec 2007 23:22:45 -0000 1.8 *************** *** 21,23 **** --- 21,45 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (operated ? 1231 : 1237); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final JustBuyOnceStrategy other = (JustBuyOnceStrategy) obj; + if (operated != other.operated) + return false; + return true; + } + } Index: CombinedBuyAndSellStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/CombinedBuyAndSellStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CombinedBuyAndSellStrategy.java 10 Oct 2007 20:03:29 -0000 1.1 --- CombinedBuyAndSellStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 27,29 **** --- 27,60 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((buyStrategy == null) ? 0 : buyStrategy.hashCode()); + result = prime * result + ((sellStrategy == null) ? 0 : sellStrategy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final CombinedBuyAndSellStrategy other = (CombinedBuyAndSellStrategy) obj; + if (buyStrategy == null) { + if (other.buyStrategy != null) + return false; + } else if (!buyStrategy.equals(other.buyStrategy)) + return false; + if (sellStrategy == null) { + if (other.sellStrategy != null) + return false; + } else if (!sellStrategy.equals(other.sellStrategy)) + return false; + return true; + } + } Index: NotSoFastStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/NotSoFastStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NotSoFastStrategy.java 15 Oct 2007 22:14:56 -0000 1.1 --- NotSoFastStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 35,37 **** --- 35,65 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + numberOfTicks; + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final NotSoFastStrategy other = (NotSoFastStrategy) obj; + if (numberOfTicks != other.numberOfTicks) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + return true; + } + } Index: StopGainStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/StopGainStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StopGainStrategy.java 31 Oct 2007 17:08:56 -0000 1.1 --- StopGainStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 46,48 **** --- 46,88 ---- return String.format("%s stoper: %s over %s", this.getClass().getSimpleName(), ""+ loss, strategy.getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((indicator == null) ? 0 : indicator.hashCode()); + long temp; + temp = Double.doubleToLongBits(loss); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + temp = Double.doubleToLongBits(value); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final StopGainStrategy other = (StopGainStrategy) obj; + if (indicator == null) { + if (other.indicator != null) + return false; + } else if (!indicator.equals(other.indicator)) + return false; + if (Double.doubleToLongBits(loss) != Double.doubleToLongBits(other.loss)) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + if (Double.doubleToLongBits(value) != Double.doubleToLongBits(other.value)) + return false; + return true; + } } Index: AndStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/AndStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AndStrategy.java 25 Aug 2007 14:04:32 -0000 1.1 --- AndStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 28,30 **** --- 28,62 ---- return String.format("%s and %s",strategy.getName(),strategy2.getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + result = prime * result + ((strategy2 == null) ? 0 : strategy2.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final AndStrategy other = (AndStrategy) obj; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + if (strategy2 == null) { + if (other.strategy2 != null) + return false; + } else if (!strategy2.equals(other.strategy2)) + return false; + return true; + } + } Index: SupportStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/SupportStrategy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SupportStrategy.java 25 Aug 2007 12:30:00 -0000 1.9 --- SupportStrategy.java 5 Dec 2007 23:22:45 -0000 1.10 *************** *** 39,41 **** --- 39,77 ---- .format("%s suport: %i strategy: %s", this.getClass().getSimpleName(), support, strategy.getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((indicator == null) ? 0 : indicator.hashCode()); + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + long temp; + temp = Double.doubleToLongBits(support); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final SupportStrategy other = (SupportStrategy) obj; + if (indicator == null) { + if (other.indicator != null) + return false; + } else if (!indicator.equals(other.indicator)) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + if (Double.doubleToLongBits(support) != Double.doubleToLongBits(other.support)) + return false; + return true; + } } Index: StopLossStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/StopLossStrategy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StopLossStrategy.java 31 Oct 2007 17:08:56 -0000 1.1 --- StopLossStrategy.java 5 Dec 2007 23:22:45 -0000 1.2 *************** *** 46,48 **** --- 46,88 ---- return String.format("%s stoper: %s over %s", this.getClass().getSimpleName(), ""+ loss, strategy.getName()); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((indicator == null) ? 0 : indicator.hashCode()); + long temp; + temp = Double.doubleToLongBits(loss); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + temp = Double.doubleToLongBits(value); + result = prime * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final StopLossStrategy other = (StopLossStrategy) obj; + if (indicator == null) { + if (other.indicator != null) + return false; + } else if (!indicator.equals(other.indicator)) + return false; + if (Double.doubleToLongBits(loss) != Double.doubleToLongBits(other.loss)) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + if (Double.doubleToLongBits(value) != Double.doubleToLongBits(other.value)) + return false; + return true; + } } Index: IndicatorCrossedIndicatorStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/IndicatorCrossedIndicatorStrategy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IndicatorCrossedIndicatorStrategy.java 25 Aug 2007 12:30:00 -0000 1.10 --- IndicatorCrossedIndicatorStrategy.java 5 Dec 2007 23:22:45 -0000 1.11 *************** *** 41,43 **** --- 41,86 ---- } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((crossDown == null) ? 0 : crossDown.hashCode()); + result = prime * result + ((crossUp == null) ? 0 : crossUp.hashCode()); + result = prime * result + ((lower == null) ? 0 : lower.hashCode()); + result = prime * result + ((upper == null) ? 0 : upper.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final IndicatorCrossedIndicatorStrategy other = (IndicatorCrossedIndicatorStrategy) obj; + if (crossDown == null) { + if (other.crossDown != null) + return false; + } else if (!crossDown.equals(other.crossDown)) + return false; + if (crossUp == null) { + if (other.crossUp != null) + return false; + } else if (!crossUp.equals(other.crossUp)) + return false; + if (lower == null) { + if (other.lower != null) + return false; + } else if (!lower.equals(other.lower)) + return false; + if (upper == null) { + if (other.upper != null) + return false; + } else if (!upper.equals(other.upper)) + return false; + return true; + } } Index: ResistanceStrategy.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/strategy/ResistanceStrategy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ResistanceStrategy.java 25 Aug 2007 12:30:00 -0000 1.9 --- ResistanceStrategy.java 5 Dec 2007 23:22:45 -0000 1.10 *************** *** 41,43 **** --- 41,79 ---- } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((indicator == null) ? 0 : indicator.hashCode()); + long temp; + temp = Double.doubleToLongBits(resistance); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((strategy == null) ? 0 : strategy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final ResistanceStrategy other = (ResistanceStrategy) obj; + if (indicator == null) { + if (other.indicator != null) + return false; + } else if (!indicator.equals(other.indicator)) + return false; + if (Double.doubleToLongBits(resistance) != Double.doubleToLongBits(other.resistance)) + return false; + if (strategy == null) { + if (other.strategy != null) + return false; + } else if (!strategy.equals(other.strategy)) + return false; + return true; + } + } |
From: Thies <tg...@us...> - 2007-12-05 23:22:33
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/strategiesSet In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22054/src/java/net/sf/tail/strategiesSet Log Message: Directory /cvsroot/tail/Tail/src/java/net/sf/tail/strategiesSet added to the repository |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:29
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** NewReportFrame.java 5 Nov 2007 23:18:28 -0000 1.39 --- NewReportFrame.java 3 Dec 2007 18:25:22 -0000 1.40 *************** *** 88,91 **** --- 88,92 ---- protected EnumIndicator selectedEnum; + private JLabel subtitle; public NewReportFrame(Index index, StockAnalysis stockAnalysis) { *************** *** 125,128 **** --- 126,130 ---- reportNameField = new JTextField(); reportNameLabel = new JLabel(); + subtitle = new JLabel(); saveScriptButton = new TailButton(new ImageIcon(iconBundle.getString("SAVE"))); openScriptButton = new TailButton(new ImageIcon(iconBundle.getString("OPEN"))); *************** *** 156,159 **** --- 158,163 ---- reportNameField.setMaximumSize(new Dimension(170, 20)); + subtitle.setText("Ctrl+1: code snippets Ctrl+Space: auto complete"); + createButtonDefaultPanel.setText("Create"); createButtonDefaultPanel.addActionListener(new ActionListener() { *************** *** 304,308 **** openScriptButton))).addGroup( GroupLayout.Alignment.TRAILING, ! jPanel1Layout.createSequentialGroup().addComponent(customStrategyCancelButton).addPreferredGap( LayoutStyle.ComponentPlacement.RELATED).addComponent(customStrategyCreateButton))) .addContainerGap())); --- 308,312 ---- openScriptButton))).addGroup( GroupLayout.Alignment.TRAILING, ! jPanel1Layout.createSequentialGroup().addComponent(subtitle).addContainerGap(20,20).addComponent(customStrategyCancelButton).addPreferredGap( LayoutStyle.ComponentPlacement.RELATED).addComponent(customStrategyCreateButton))) .addContainerGap())); *************** *** 315,319 **** jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(customStrategyPane, GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup( ! jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(customStrategyCreateButton) .addComponent(customStrategyCancelButton)).addGap(18))); newReportTabbedPane.addTab("Custom Report", customReportPanel); --- 319,323 ---- jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(customStrategyPane, GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup( ! jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(subtitle).addComponent(customStrategyCreateButton) .addComponent(customStrategyCancelButton)).addGap(18))); newReportTabbedPane.addTab("Custom Report", customReportPanel); |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:21
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis2.java NewStockAnalysis3.java Log Message: Index: NewStockAnalysis2.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis2.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NewStockAnalysis2.java 5 Nov 2007 17:19:39 -0000 1.15 --- NewStockAnalysis2.java 3 Dec 2007 18:25:22 -0000 1.16 *************** *** 115,119 **** }); ! criterionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Additional Criteria")); criterionPanel.setLayout(new GridLayout(0, 1, 10, 10)); criterionPanel.setMaximumSize(new Dimension(400, 0)); --- 115,119 ---- }); ! criterionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Additional Criteria to report")); criterionPanel.setLayout(new GridLayout(0, 1, 10, 10)); criterionPanel.setMaximumSize(new Dimension(400, 0)); Index: NewStockAnalysis3.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis3.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NewStockAnalysis3.java 21 Nov 2007 21:55:11 -0000 1.16 --- NewStockAnalysis3.java 3 Dec 2007 18:25:22 -0000 1.17 *************** *** 13,16 **** --- 13,18 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.awt.event.KeyEvent; + import java.awt.event.KeyListener; import java.util.List; import java.util.ResourceBundle; *************** *** 44,47 **** --- 46,51 ---- import org.joda.time.Period; + import com.greef.ui.calendar.JCalendar; + /** * *************** *** 51,333 **** private static final ResourceBundle messageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Messages"); private static final ResourceBundle iconBundle = ResourceBundle.getBundle("net.sf.tails.i18n.icons"); ! private static final long serialVersionUID = 1L; private SerializableTimeSeries stock; private AnalysisCriterion selectedCriterion; private List<AnalysisCriterion> additionalCriteria; ! private JTextField daysField; ! private JLabel daysLabel; ! private JButton finishButton; ! private JTextField hoursField; ! private JLabel hoursLabel; ! private JButton cancelButton; ! private JTextField minutesField; ! private JLabel minutesLabel; ! private JTextField monthsField; ! private JLabel monthsLabel; ! private JComboBox slicerTypeComboBox; ! private JLabel slicerTypeLabel; ! private JPanel slicesPeriodPanel; ! private JTextField startDateField; ! private JLabel startDateLabel; ! private JTextField yearsField; ! private JLabel yearsLabel; ! private JTextField slicesNumberField; ! private JLabel slicesNumberLabel; ! private JComboBox runnerTypeComboBox; ! private JLabel runnerTypeLabel; private Index index; ! private FrameHelper helper; ! ! public NewStockAnalysis3(Index index, SerializableTimeSeries stock, AnalysisCriterion selectedCriterion, List<AnalysisCriterion> additionalCriteria) { ! this.index = index; ! this.stock = stock; ! this.selectedCriterion = selectedCriterion; ! this.additionalCriteria = additionalCriteria; ! initComponents(); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ! this.setIconImage(new ImageIcon(iconBundle.getString("TAILS_ICON")).getImage()); ! this.setResizable(false); ! this.setLocationByPlatform(true); ! this.setTitle(messageBundle.getString("STOCKANALYSIS_TITLE")); ! } ! ! private void initComponents() { ! helper = new FrameHelper(); ! slicesPeriodPanel = new JPanel(); ! yearsLabel = new JLabel(); ! yearsField = new JTextField(); ! monthsLabel = new JLabel(); ! monthsField = new JTextField(); ! daysLabel = new JLabel(); ! daysField = new JTextField(); ! hoursLabel = new JLabel(); ! hoursField = new JTextField(); ! minutesLabel = new JLabel(); ! minutesField = new JTextField(); ! startDateLabel = new JLabel(); ! slicerTypeLabel = new JLabel(); ! runnerTypeLabel = new JLabel(); ! slicerTypeComboBox = new JComboBox(); ! runnerTypeComboBox = new JComboBox(); ! startDateField = new JTextField(); ! finishButton = new JButton(); ! cancelButton = new JButton(); ! slicesNumberField = new JTextField(); ! slicesNumberLabel = new JLabel(); ! ! slicesNumberField.setText("1"); ! slicesNumberField.setVisible(false); ! slicesNumberLabel.setText("Number of Slices:"); ! slicesNumberLabel.setVisible(false); ! ! DateTime date = stock.getSeries().getTick(stock.getSeries().getBegin()).getDate(); ! startDateField.setText(date.getDayOfMonth() + "/" + date.getMonthOfYear() + "/" + date.getYear()); ! ! slicesPeriodPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Slices Period", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION)); ! yearsLabel.setFont(new Font("Dialog", 1, 10)); ! yearsLabel.setText("Years:"); ! yearsField.setMinimumSize(new Dimension(26, 19)); ! yearsField.setPreferredSize(new Dimension(26, 19)); ! yearsField.setText("0"); - monthsLabel.setFont(new Font("Dialog", 1, 10)); - monthsLabel.setText("Months:"); ! monthsField.setMinimumSize(new Dimension(26, 19)); ! monthsField.setPreferredSize(new Dimension(26, 19)); ! monthsField.setText("0"); ! daysLabel.setFont(new Font("Dialog", 1, 10)); ! daysLabel.setText("Days:"); ! daysField.setMinimumSize(new Dimension(26, 19)); ! daysField.setPreferredSize(new Dimension(26, 19)); ! daysField.setText("0"); ! hoursLabel.setFont(new Font("Dialog", 1, 10)); ! hoursLabel.setText("Hours:"); ! hoursField.setMinimumSize(new Dimension(26, 19)); ! hoursField.setPreferredSize(new Dimension(26, 19)); ! hoursField.setText("0"); ! minutesLabel.setFont(new Font("Dialog", 1, 10)); ! minutesLabel.setText("Minutes:"); ! minutesField.setMinimumSize(new Dimension(26, 19)); ! minutesField.setPreferredSize(new Dimension(26, 19)); ! minutesField.setText("0"); ! GroupLayout slicesPeriodPanelLayout = new GroupLayout(slicesPeriodPanel); ! slicesPeriodPanel.setLayout(slicesPeriodPanelLayout); ! slicesPeriodPanelLayout.setHorizontalGroup( ! slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(slicesPeriodPanelLayout.createSequentialGroup() ! .addContainerGap() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) ! .addGroup(GroupLayout.Alignment.LEADING, slicesPeriodPanelLayout.createSequentialGroup() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(monthsLabel) ! .addComponent(yearsLabel) ! .addComponent(daysLabel) ! .addComponent(hoursLabel) ! .addComponent(minutesLabel)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false) ! .addComponent(hoursField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(daysField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(yearsField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(monthsField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(minutesField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ! .addGap(468, 468, 468)) ! ); ! slicesPeriodPanelLayout.setVerticalGroup( ! slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(slicesPeriodPanelLayout.createSequentialGroup() ! .addContainerGap() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(yearsLabel) ! .addComponent(yearsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(monthsLabel) ! .addComponent(monthsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(daysField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(daysLabel)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(hoursLabel) ! .addComponent(hoursField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(minutesLabel) ! .addComponent(minutesField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addContainerGap(21, Short.MAX_VALUE)) ! ); ! startDateLabel.setText("Start Date:"); ! ! runnerTypeLabel.setText("Runner Type:"); ! runnerTypeComboBox.setModel(new DefaultComboBoxModel(new String[]{ "HistoryRunnerFactory", "ShortSellRunnerFactory" })); ! runnerTypeComboBox.setMinimumSize(new Dimension(178, 23)); ! runnerTypeComboBox.setPreferredSize(new Dimension(178, 23)); ! ! slicerTypeLabel.setText("Slicer Type:"); ! ! slicerTypeComboBox.setModel(new DefaultComboBoxModel(new String[]{ "Regular", "Fully", "Partial" })); ! slicerTypeComboBox.setMinimumSize(new Dimension(178, 23)); ! slicerTypeComboBox.setPreferredSize(new Dimension(178, 23)); ! slicerTypeComboBox.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! slicerChangedActionPerformed(evt); ! } ! }); ! finishButton.setText("Finish"); ! finishButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! finishButtonActionPerformed(evt); ! } ! }); ! cancelButton.setText("Cancel"); ! cancelButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! cancelButtonActionPerformed(evt); ! } ! }); ! GroupLayout layout = new GroupLayout(getContentPane()); ! getContentPane().setLayout(layout); ! layout.setHorizontalGroup( ! layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(30, 30, 30) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(11, 11, 11) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(runnerTypeLabel) ! .addComponent(startDateLabel) ! .addComponent(slicerTypeLabel)) ! .addGap(20, 20, 20) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(runnerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(startDateField, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE) ! .addComponent(slicerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addGap(28, 28, 28) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(slicesNumberLabel)) ! .addGap(20, 20, 20) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(slicesNumberField))) ! .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() ! .addComponent(slicesPeriodPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)))) ! .addGroup(layout.createSequentialGroup() ! .addGap(235, 235, 235) ! .addComponent(finishButton) ! .addGap(19, 19, 19) ! .addComponent(cancelButton))) ! .addContainerGap(30, Short.MAX_VALUE)) ! ); ! layout.setVerticalGroup( ! layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(23, 23, 23) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(startDateLabel) ! .addComponent(startDateField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addGap(15, 15, 15) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(runnerTypeLabel) ! .addComponent(runnerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addGap(15, 15, 15) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(slicerTypeLabel) ! .addComponent(slicerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(slicesNumberLabel) ! .addComponent(slicesNumberField)) ! .addGap(14, 14, 14) ! .addComponent(slicesPeriodPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addGap(18, 18, 18) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(finishButton) ! .addComponent(cancelButton)) ! .addContainerGap(20, Short.MAX_VALUE)) ! ); ! pack(); ! } ! protected void slicerChangedActionPerformed(ActionEvent evt) { ! if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { ! slicesNumberField.setVisible(true); ! slicesNumberLabel.setVisible(true); ! } ! else ! { ! slicesNumberField.setVisible(false); ! slicesNumberLabel.setVisible(false); ! } } private void cancelButtonActionPerformed(ActionEvent evt) { ! this.dispose(); ! } ! private void finishButtonActionPerformed(ActionEvent evt) { Cursor cursor = Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ); setCursor( cursor ); ! DateTime startDate; try { startDate = helper.getDate(startDateField.getText()); --- 55,396 ---- private static final ResourceBundle messageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Messages"); private static final ResourceBundle iconBundle = ResourceBundle.getBundle("net.sf.tails.i18n.icons"); ! private static final long serialVersionUID = 1L; private SerializableTimeSeries stock; private AnalysisCriterion selectedCriterion; private List<AnalysisCriterion> additionalCriteria; ! private JTextField daysField; ! private JLabel daysLabel; ! private JButton finishButton; ! private JTextField hoursField; ! private JLabel hoursLabel; ! private JButton cancelButton; ! private JTextField minutesField; ! private JLabel minutesLabel; ! private JTextField monthsField; ! private JLabel monthsLabel; ! private JComboBox slicerTypeComboBox; ! private JLabel slicerTypeLabel; ! private JPanel slicesPeriodPanel; ! private JTextField startDateField; ! private JLabel startDateLabel; ! private JTextField yearsField; ! private JLabel yearsLabel; ! private JTextField slicesNumberField; ! private JLabel slicesNumberLabel; ! private JComboBox runnerTypeComboBox; ! private JLabel runnerTypeLabel; private Index index; ! private FrameHelper helper; ! private JButton calendarButton; ! private JCalendar calendar = new JCalendar(); ! public NewStockAnalysis3(Index index, SerializableTimeSeries stock, AnalysisCriterion selectedCriterion, List<AnalysisCriterion> additionalCriteria) { ! this.index = index; ! this.stock = stock; ! this.selectedCriterion = selectedCriterion; ! this.additionalCriteria = additionalCriteria; ! initComponents(); ! this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); ! this.setIconImage(new ImageIcon(iconBundle.getString("TAILS_ICON")).getImage()); ! this.setResizable(false); ! this.setLocationByPlatform(true); ! this.setTitle(messageBundle.getString("STOCKANALYSIS_TITLE")); ! } ! private void initComponents() { ! helper = new FrameHelper(); ! slicesPeriodPanel = new JPanel(); ! yearsLabel = new JLabel(); ! yearsField = new JTextField(); ! monthsLabel = new JLabel(); ! monthsField = new JTextField(); ! daysLabel = new JLabel(); ! daysField = new JTextField(); ! hoursLabel = new JLabel(); ! hoursField = new JTextField(); ! minutesLabel = new JLabel(); ! minutesField = new JTextField(); ! startDateLabel = new JLabel(); ! slicerTypeLabel = new JLabel(); ! runnerTypeLabel = new JLabel(); ! slicerTypeComboBox = new JComboBox(); ! runnerTypeComboBox = new JComboBox(); ! startDateField = new JTextField(); ! calendarButton = new JButton("Calendar"); ! finishButton = new JButton(); ! cancelButton = new JButton(); ! slicesNumberField = new JTextField(); ! slicesNumberLabel = new JLabel(); ! slicesNumberField.setText("1"); ! slicesNumberField.setVisible(false); ! slicesNumberLabel.setText("Number of Slices:"); ! slicesNumberLabel.setVisible(false); ! DateTime date = getStockDate(); ! calendar.setYear(date.getYear()); ! calendar.setMonth(date.getMonthOfYear()); ! calendar.setVisible(false); ! calendarButton.setVisible(false); ! ! startDateField.setText(date.getDayOfMonth() + "/" + date.getMonthOfYear() + "/" + date.getYear()); ! slicesPeriodPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Slices Period", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION)); ! yearsLabel.setFont(new Font("Dialog", 1, 10)); ! yearsLabel.setText("Years:"); ! yearsField.setMinimumSize(new Dimension(26, 19)); ! yearsField.setPreferredSize(new Dimension(26, 19)); ! yearsField.setText("0"); ! monthsLabel.setFont(new Font("Dialog", 1, 10)); ! monthsLabel.setText("Months:"); ! monthsField.setMinimumSize(new Dimension(26, 19)); ! monthsField.setPreferredSize(new Dimension(26, 19)); ! monthsField.setText("0"); ! daysLabel.setFont(new Font("Dialog", 1, 10)); ! daysLabel.setText("Days:"); ! daysField.setMinimumSize(new Dimension(26, 19)); ! daysField.setPreferredSize(new Dimension(26, 19)); ! daysField.setText("0"); ! hoursLabel.setFont(new Font("Dialog", 1, 10)); ! hoursLabel.setText("Hours:"); ! hoursField.setMinimumSize(new Dimension(26, 19)); ! hoursField.setPreferredSize(new Dimension(26, 19)); ! hoursField.setText("0"); ! minutesLabel.setFont(new Font("Dialog", 1, 10)); ! minutesLabel.setText("Minutes:"); ! minutesField.setMinimumSize(new Dimension(26, 19)); ! minutesField.setPreferredSize(new Dimension(26, 19)); ! minutesField.setText("0"); ! GroupLayout slicesPeriodPanelLayout = new GroupLayout(slicesPeriodPanel); ! slicesPeriodPanel.setLayout(slicesPeriodPanelLayout); ! slicesPeriodPanelLayout.setHorizontalGroup( ! slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(slicesPeriodPanelLayout.createSequentialGroup() ! .addContainerGap() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING) ! .addGroup(GroupLayout.Alignment.LEADING, slicesPeriodPanelLayout.createSequentialGroup() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(monthsLabel) ! .addComponent(yearsLabel) ! .addComponent(daysLabel) ! .addComponent(hoursLabel) ! .addComponent(minutesLabel)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false) ! .addComponent(hoursField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(daysField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(yearsField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(monthsField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ! .addComponent(minutesField, 40, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ! .addGap(468, 468, 468)) ! ); ! slicesPeriodPanelLayout.setVerticalGroup( ! slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(slicesPeriodPanelLayout.createSequentialGroup() ! .addContainerGap() ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(yearsLabel) ! .addComponent(yearsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(monthsLabel) ! .addComponent(monthsField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(daysField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(daysLabel)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(hoursLabel) ! .addComponent(hoursField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) ! .addGroup(slicesPeriodPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(minutesLabel) ! .addComponent(minutesField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addContainerGap(21, Short.MAX_VALUE)) ! ); ! startDateLabel.setText("Start Date:"); ! ! runnerTypeLabel.setText("Runner Type:"); ! ! runnerTypeComboBox.setModel(new DefaultComboBoxModel(new String[]{ "HistoryRunnerFactory", "ShortSellRunnerFactory" })); ! runnerTypeComboBox.setMinimumSize(new Dimension(178, 23)); ! runnerTypeComboBox.setPreferredSize(new Dimension(178, 23)); ! ! slicerTypeLabel.setText("Slicer Type:"); ! ! slicerTypeComboBox.setModel(new DefaultComboBoxModel(new String[]{ "Regular", "Fully", "Partial" })); ! slicerTypeComboBox.setMinimumSize(new Dimension(178, 23)); ! slicerTypeComboBox.setPreferredSize(new Dimension(178, 23)); ! slicerTypeComboBox.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! slicerChangedActionPerformed(evt); ! } ! }); ! ! calendar.enableInputMethods(true); ! ! calendar.addKeyListener(new KeyListener(){ ! ! @Override ! public void keyPressed(KeyEvent e) { ! updateDate(e); ! ! } ! ! @Override ! public void keyReleased(KeyEvent e) { ! // TODO Auto-generated method stub ! ! } ! ! @Override ! public void keyTyped(KeyEvent e) { ! // TODO Auto-generated method stub ! ! } ! ! }); ! ! finishButton.setText("Finish"); ! finishButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! finishButtonActionPerformed(evt); ! } ! }); ! ! calendarButton.setText("Calendar"); ! calendarButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! CalendarButtonActionPerformed(evt); ! } ! ! private void CalendarButtonActionPerformed(ActionEvent evt) { ! if(calendar.isVisible()){ ! calendar.setVisible(false); ! }else{ ! //calendar.setVisible(true); ! } ! } ! }); ! ! cancelButton.setText("Cancel"); ! cancelButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent evt) { ! cancelButtonActionPerformed(evt); ! } ! }); ! ! GroupLayout layout = new GroupLayout(getContentPane()); ! getContentPane().setLayout(layout); ! layout.setHorizontalGroup( ! layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(30, 30, 30) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(11, 11, 11) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(runnerTypeLabel) ! .addComponent(startDateLabel) ! .addComponent(slicerTypeLabel)) ! .addGap(20, 20, 20) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(runnerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(startDateField, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE) ! .addComponent(slicerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addGap(28, 28, 28) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(calendarButton, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(slicesNumberLabel)) ! .addGap(20, 20, 20) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addComponent(calendar) ! .addComponent(slicesNumberField))) ! .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() ! .addComponent(slicesPeriodPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)))) ! .addGroup(layout.createSequentialGroup() ! .addGap(235, 235, 235) ! .addComponent(finishButton) ! .addGap(19, 19, 19) ! .addComponent(cancelButton))) ! .addContainerGap(30, Short.MAX_VALUE)) ! ); ! layout.setVerticalGroup( ! layout.createParallelGroup(GroupLayout.Alignment.LEADING) ! .addGroup(layout.createSequentialGroup() ! .addGap(23, 23, 23) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(startDateLabel).addComponent(startDateField) ! .addComponent(calendarButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(calendar)) ! .addGap(15, 15, 15) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(runnerTypeLabel) ! .addComponent(runnerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ! .addGap(15, 15, 15) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(slicerTypeLabel) ! .addComponent(slicerTypeComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addComponent(slicesNumberLabel) ! .addComponent(slicesNumberField)) ! .addGap(14, 14, 14) ! .addComponent(slicesPeriodPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) ! .addGap(18, 18, 18) ! .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) ! .addComponent(finishButton) ! .addComponent(cancelButton)) ! .addContainerGap(20, Short.MAX_VALUE)) ! ); ! pack(); ! } ! ! private DateTime getStockDate() { ! return stock.getSeries().getTick(stock.getSeries().getBegin()).getDate(); ! } ! ! protected void slicerChangedActionPerformed(ActionEvent evt) { ! if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { ! slicesNumberField.setVisible(true); ! slicesNumberLabel.setVisible(true); ! } ! else ! { ! slicesNumberField.setVisible(false); ! slicesNumberLabel.setVisible(false); ! } } private void cancelButtonActionPerformed(ActionEvent evt) { ! this.dispose(); ! } ! private void updateDate(KeyEvent e) { ! startDateField.setText("fjewijfei"); ! ! } ! ! private void finishButtonActionPerformed(ActionEvent evt) { Cursor cursor = Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ); setCursor( cursor ); ! DateTime startDate; try { startDate = helper.getDate(startDateField.getText()); *************** *** 336,340 **** return; } ! if(yearsField.getText().equals("") || monthsField.getText().equals("") || daysField.getText().equals("") || hoursField.getText().equals("") || minutesField.getText().equals("")) { --- 399,403 ---- return; } ! if(yearsField.getText().equals("") || monthsField.getText().equals("") || daysField.getText().equals("") || hoursField.getText().equals("") || minutesField.getText().equals("")) { *************** *** 342,349 **** return; } ! int year = 0, month = 0, day = 0, hour = 0, minute = 0; try { ! year = Integer.parseInt(yearsField.getText()); month = Integer.parseInt(monthsField.getText()); day = Integer.parseInt(daysField.getText()); --- 405,412 ---- return; } ! int year = 0, month = 0, day = 0, hour = 0, minute = 0; try { ! year = Integer.parseInt(yearsField.getText()); month = Integer.parseInt(monthsField.getText()); day = Integer.parseInt(daysField.getText()); *************** *** 354,358 **** } ! if(year<=0 && month<=0 && day<=0 && hour<=0 && minute<=0) { --- 417,421 ---- } ! if(year<=0 && month<=0 && day<=0 && hour<=0 && minute<=0) { *************** *** 363,369 **** return; } ! if(startDate.isBefore(stock.getSeries().getTick(stock.getSeries().getBegin()).getDate().getMillis()) || ! startDate.isAfter(stock.getSeries().getTick(stock.getSeries().getEnd()).getDate().getMillis())) { JOptionPane.showMessageDialog(null, "Start Date must be between " + --- 426,432 ---- return; } ! if(startDate.isBefore(stock.getSeries().getTick(stock.getSeries().getBegin()).getDate().getMillis()) || ! startDate.isAfter(stock.getSeries().getTick(stock.getSeries().getEnd()).getDate().getMillis())) { JOptionPane.showMessageDialog(null, "Start Date must be between " + *************** *** 376,380 **** Period period = new Period(year, month, 0, day, hour, minute, 0, 0); if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { if (slicesNumberField.getText().equals("")) { --- 439,443 ---- Period period = new Period(year, month, 0, day, hour, minute, 0, 0); if (slicerTypeComboBox.getSelectedItem().toString().equals("Partial")) ! { if (slicesNumberField.getText().equals("")) { *************** *** 390,394 **** return; } ! if (slicesNumber <= 0) { --- 453,457 ---- return; } ! if (slicesNumber <= 0) { *************** *** 396,413 **** return; } ! ! slicer = new PartialMemorizedSlicer(stock, period, startDate, slicesNumber); ! } else if (slicerTypeComboBox.getSelectedItem().toString().equals("Fully")) ! { ! slicer = new FullyMemorizedSlicer(stock, period, startDate); ! } ! else ! { ! slicer = new RegularSlicer(stock, period, startDate); ! } StockAnalysis stockAnalysis = null; ! try { stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluatorFactory(), helper.getSelectedRunner(runnerTypeComboBox.getSelectedItem().toString())); --- 459,476 ---- return; } ! ! slicer = new PartialMemorizedSlicer(stock, period, startDate, slicesNumber); ! } else if (slicerTypeComboBox.getSelectedItem().toString().equals("Fully")) ! { ! slicer = new FullyMemorizedSlicer(stock, period, startDate); ! } ! else ! { ! slicer = new RegularSlicer(stock, period, startDate); ! } StockAnalysis stockAnalysis = null; ! try { stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluatorFactory(), helper.getSelectedRunner(runnerTypeComboBox.getSelectedItem().toString())); *************** *** 416,427 **** return; } ! ! stockAnalysis.addCriteria(additionalCriteria); ! index.loadStockAnalysis(stockAnalysis); ! ! this.dispose(); ! cursor = Cursor.getDefaultCursor(); setCursor( cursor ); ! } } --- 479,490 ---- return; } ! ! stockAnalysis.addCriteria(additionalCriteria); ! index.loadStockAnalysis(stockAnalysis); ! ! this.dispose(); ! cursor = Cursor.getDefaultCursor(); setCursor( cursor ); ! } } |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:21
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Index.java 12 Nov 2007 22:13:45 -0000 1.50 --- Index.java 3 Dec 2007 18:25:22 -0000 1.51 *************** *** 25,29 **** import java.io.OutputStream; import java.io.PrintWriter; - import java.lang.reflect.Method; import java.util.ResourceBundle; --- 25,28 ---- *************** *** 732,763 **** @SuppressWarnings("unchecked") protected void helpButtonActionPerformed(ActionEvent evt) { ! String osName = System.getProperty("os.name"); String url = "http://tail.cvs.sourceforge.net/*checkout*/tail/TailS/Data/Help/TailSHelp.html?revision=1.3#Runner"; ! try { ! if (osName.startsWith("Mac OS")) { ! Class fileMgr = Class.forName("com.apple.eio.FileManager"); ! Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); ! openURL.invoke(null, new Object[] {url}); ! } ! else if (osName.startsWith("Windows")) { ! Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); ! } ! else { ! //Unix ou Linux ! String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; ! String browser = null; ! for (int count = 0; count < browsers.length && browser == null; count++) ! { ! if (Runtime.getRuntime().exec( new String[] {"which", browsers[count]}).waitFor() == 0) browser = browsers[count]; ! } ! if (browser == null) ! JOptionPane.showMessageDialog(null, messageBundle.getString("LINUX"), "Error", 0); ! else Runtime.getRuntime().exec(new String[] {browser, url}); ! } ! } ! catch (Exception e) { ! JOptionPane.showMessageDialog(null, messageBundle.getString("MAC_WIN_LINUX"), "Error", 0); ! } } --- 731,739 ---- @SuppressWarnings("unchecked") protected void helpButtonActionPerformed(ActionEvent evt) { ! String url = "http://tail.cvs.sourceforge.net/*checkout*/tail/TailS/Data/Help/TailSHelp.html?revision=1.3#Runner"; ! ! helper.openURL(url); } *************** *** 845,849 **** CompleteReportGenerator complete = new CompleteReportGenerator(this); try { ! complete.generateHTMLFile(stockAnalysis.getReports().get(reportTable.getSelectedRow()), stockAnalysis.getAdditionalCriteria(), stockAnalysis.getSlicer().getPeriod(), directoryPath, directoryName); } catch (IOException e) { JOptionPane.showMessageDialog(null, messageBundle.getString("REPORT_HTML_ERROR"), "Error", 2); --- 821,828 ---- CompleteReportGenerator complete = new CompleteReportGenerator(this); try { ! String url = complete.generateHTMLFile(stockAnalysis.getReports().get(reportTable.getSelectedRow()), stockAnalysis.getAdditionalCriteria(), stockAnalysis.getSlicer().getPeriod(), directoryPath, directoryName); ! ! helper.openURLAfterReportFinish(url,reportProgress); ! } catch (IOException e) { JOptionPane.showMessageDialog(null, messageBundle.getString("REPORT_HTML_ERROR"), "Error", 2); |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:21
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/src/java/net/sf/tails/i18n Modified Files: Classes.properties Log Message: Index: Classes.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/Classes.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Classes.properties 31 Oct 2007 18:57:20 -0000 1.6 --- Classes.properties 3 Dec 2007 18:25:23 -0000 1.7 *************** *** 1,5 **** ANALYSIS_CRITERIA =AverageProfitCriterion;BuyAndHoldCriterion;MaximumDrawDownCriterion;NumberOfTicksCriterion;NumberOfTradesCriterion;RewardRiskRatioCriterion;TotalProfitCriterion;BrazilianTotalProfitCriterion;BrazilianTransactionCostsCriterion;BrazilianRewardRiskRatioCriterion;AverageProfitableTradesCriterion GENERIC_CRITERIA =VersusBuyAndHoldCriterion ! DEFAULT_CRITERIA =Total Profit ! SELECTED_CRITERIA=BuyAndHoldCriterion;NumberOfTicksCriterion;RewardRiskRatioCriterion;BrazilianTotalProfitCriterion LOADERS =CedroTimeSeriesLoader \ No newline at end of file --- 1,5 ---- ANALYSIS_CRITERIA =AverageProfitCriterion;BuyAndHoldCriterion;MaximumDrawDownCriterion;NumberOfTicksCriterion;NumberOfTradesCriterion;RewardRiskRatioCriterion;TotalProfitCriterion;BrazilianTotalProfitCriterion;BrazilianTransactionCostsCriterion;BrazilianRewardRiskRatioCriterion;AverageProfitableTradesCriterion GENERIC_CRITERIA =VersusBuyAndHoldCriterion ! DEFAULT_CRITERIA =BrazilianRewardRiskRatioCriterion ! SELECTED_CRITERIA=TotalProfitCriterion;BuyAndHoldCriterion;NumberOfTicksCriterion;RewardRiskRatioCriterion;BrazilianTotalProfitCriterion LOADERS =CedroTimeSeriesLoader \ No newline at end of file |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:20
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/src/java/net/sf/tails/swing/helper Modified Files: CompleteReportGenerator.java FrameHelper.java Added Files: CalendarFrame.java Log Message: --- NEW FILE: CalendarFrame.java --- package net.sf.tails.swing.helper; import java.awt.Point; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import javax.swing.GroupLayout; import javax.swing.JFrame; import javax.swing.JTextField; import org.joda.time.DateTime; import com.greef.ui.calendar.JCalendar; public class CalendarFrame extends JFrame { private static final long serialVersionUID = 8339682604292292370L; private JCalendar calendar = new JCalendar(); private JTextField startDateField; public CalendarFrame(JTextField startDateField, DateTime date){ this.startDateField = startDateField; calendar.setYear(date.getYear()); calendar.setMonth(date.getMonthOfYear()); initComponents(); Point p = startDateField.getLocationOnScreen(); p.translate(startDateField.getCaretPosition(), 0); this.setLocation(p); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" C�digo Gerado "> private void initComponents() { setUndecorated(true); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(calendar, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(calendar, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE) ); calendar.addKeyListener(new KeyListener(){ public void keyPressed(KeyEvent e) { jScrollPane1KeyPressed(e); } public void keyReleased(KeyEvent e) { } public void keyTyped(KeyEvent e) { } }); calendar.addMouseListener(new MouseListener(){ @Override public void mouseClicked(MouseEvent e) { calendarFrameMouseClicked(e); } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } }); pack(); }// </editor-fold> private void calendarFrameMouseClicked(MouseEvent e) { DateTime date = new DateTime(calendar.getSelectedDate()); this.startDateField.setText(date.toString("dd/M/yyyy")); } private void jScrollPane1KeyPressed(KeyEvent evt) { switch (evt.getKeyCode()) { case KeyEvent.VK_ESCAPE: this.dispose(); break; default: break; } } } Index: FrameHelper.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/FrameHelper.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** FrameHelper.java 21 Nov 2007 21:55:11 -0000 1.24 --- FrameHelper.java 3 Dec 2007 18:25:22 -0000 1.25 *************** *** 15,22 **** --- 15,25 ---- import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; import java.text.NumberFormat; import java.util.Locale; import java.util.ResourceBundle; + import javax.swing.JOptionPane; + import javax.swing.JProgressBar; import javax.swing.table.TableModel; *************** *** 34,38 **** */ public class FrameHelper { ! private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); private static final ResourceBundle packageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Packages"); --- 37,42 ---- */ public class FrameHelper { ! ! private static final ResourceBundle messageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Messages"); private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); private static final ResourceBundle packageBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Packages"); *************** *** 234,236 **** --- 238,286 ---- } + @SuppressWarnings("unchecked") + public void openURL(String url) { + String osName = System.getProperty("os.name"); + try { + if (osName.startsWith("Mac OS")) { + Class fileMgr = Class.forName("com.apple.eio.FileManager"); + Method openURL = fileMgr.getDeclaredMethod("openURL", new Class[] {String.class}); + openURL.invoke(null, new Object[] {url}); + } + else if (osName.startsWith("Windows")) { + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); + } + else { + //Unix ou Linux + String[] browsers = { "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" }; + String browser = null; + for (int count = 0; count < browsers.length && browser == null; count++) + { + if (Runtime.getRuntime().exec( new String[] {"which", browsers[count]}).waitFor() == 0) browser = browsers[count]; + } + if (browser == null) + JOptionPane.showMessageDialog(null, messageBundle.getString("LINUX"), "Error", 0); + else Runtime.getRuntime().exec(new String[] {browser, url}); + } + } + catch (Exception e) { + JOptionPane.showMessageDialog(null, messageBundle.getString("MAC_WIN_LINUX"), "Error", 0); + } + } + + public void openURLAfterReportFinish(final String url, final JProgressBar reportProgress) { + new Thread(new Runnable(){ + + @Override + public void run() { + while(reportProgress.getPercentComplete() < 1d){ + + } + openURL(url); + + } + + }).start(); + + } + } Index: CompleteReportGenerator.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/CompleteReportGenerator.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CompleteReportGenerator.java 21 Nov 2007 21:55:11 -0000 1.11 --- CompleteReportGenerator.java 3 Dec 2007 18:25:22 -0000 1.12 *************** *** 78,84 **** }}).start(); } ! public void generateHTMLFile(final Report report, final List<AnalysisCriterion> criteria, final Period period, final String filePath, final String fileName) throws IOException { final ReportHTMLGenerator generator = new ReportHTMLGenerator(); --- 78,85 ---- }}).start(); + } ! public String generateHTMLFile(final Report report, final List<AnalysisCriterion> criteria, final Period period, final String filePath, final String fileName) throws IOException { final ReportHTMLGenerator generator = new ReportHTMLGenerator(); *************** *** 88,91 **** --- 89,93 ---- final String decisionDir = reportDir + File.separatorChar + "Decisions"; final List<String> urls = new ArrayList<String>(); + new Thread(new Runnable() { *************** *** 124,127 **** --- 126,130 ---- } }).start(); + return reportDir + File.separatorChar + report.getName() + ".html"; } *************** *** 142,145 **** --- 145,149 ---- private File createHTML(String name, StringBuffer html, String directory) throws FileNotFoundException { String htmlPath = directory + File.separatorChar + name; + File reportHtml = new File(htmlPath); OutputStream out = new BufferedOutputStream(new FileOutputStream(reportHtml)); |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:19
|
Update of /cvsroot/tail/TailS/lib In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17586/lib Added Files: jcalendar.jar Log Message: --- NEW FILE: jcalendar.jar --- (This appears to be a binary file; contents omitted.) |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:08
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/src/java/net/sf/tail/report/xls Modified Files: CellStylist.java TimeSeriesXlsGenerator.java Log Message: Index: TimeSeriesXlsGenerator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/TimeSeriesXlsGenerator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimeSeriesXlsGenerator.java 21 Nov 2007 21:55:20 -0000 1.8 --- TimeSeriesXlsGenerator.java 3 Dec 2007 18:24:20 -0000 1.9 *************** *** 2,5 **** --- 2,7 ---- import java.io.IOException; + import java.util.ArrayList; + import java.util.List; import net.sf.tail.ConstrainedTimeSeries; *************** *** 16,19 **** --- 18,22 ---- import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; + import org.apache.poi.hssf.util.Region; public class TimeSeriesXlsGenerator { *************** *** 46,56 **** row = generateTitle(row, title, style); ! style = stylist.createSubTitleCellStyle(); ! String[] subtitle = new String[4]; ! subtitle[0] = "Stock:"; ! subtitle[1] = report.getSlicer().getSeries().getName(); ! subtitle[2] = "for:"; ! subtitle[3] = report.getSlicer().getSeries().getPeriodName(); ! row = generateSubTitle(row, subtitle, style); style = stylist.createHeaderCellStyle(); --- 49,68 ---- row = generateTitle(row, title, style); ! List<HSSFCellStyle> styles = new ArrayList<HSSFCellStyle>(); ! styles.add(stylist.createHeaderCellStyle()); ! styles.add(stylist.createScriptStyle()); ! styles.add(stylist.createHeaderCellStyle()); ! styles.add(stylist.createScriptStyle()); ! ! List<String> line = new ArrayList<String>(); ! line.add("Stock:"); ! line.add(report.getSlicer().getSeries().getName()); ! line.add("for:"); ! line.add(report.getSlicer().getSeries().getPeriodName()); ! row = generateLine(row, line, styles); ! ! int flag = row++; ! ! row++; style = stylist.createHeaderCellStyle(); *************** *** 62,65 **** --- 74,89 ---- stylist.rearrangeSheet(sheet, 11); + + + + this.sheet.addMergedRegion(new Region(4,(short)2,3,(short)8)); + + style = stylist.createScriptStyle(); + + line = new ArrayList<String>(); + line.add("Script:"); + line.add(report.getStrategiesScript()); + + row = generateLine(flag, line, styles); LOG.info("Time Series generated (" + (System.currentTimeMillis() - time )+ " miliseconds)"); *************** *** 78,91 **** } ! private int generateSubTitle(int firstRow, String[] title, HSSFCellStyle style) { HSSFRow rowHeader = sheet.createRow((short) firstRow); int columnIndex = INDEX_FIRST_COLUMN; ! createCell(rowHeader, title[0], (short) columnIndex++, style); ! createCell(rowHeader, title[1], (short) columnIndex++, style); ! createCell(rowHeader, title[2], (short) columnIndex++, style); ! createCell(rowHeader, title[3], (short) columnIndex++, style); ! LOG.info("Subtitle created"); return firstRow+2; } --- 102,114 ---- } ! private int generateLine(int firstRow, List<String> title,List<HSSFCellStyle> styles) { HSSFRow rowHeader = sheet.createRow((short) firstRow); int columnIndex = INDEX_FIRST_COLUMN; ! for (int i = 0; i < title.size(); i++) { ! createCell(rowHeader, title.get(i), (short) columnIndex++, styles.get(i)); ! } ! LOG.info("Line created"); return firstRow+2; } Index: CellStylist.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/xls/CellStylist.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CellStylist.java 5 Nov 2007 23:25:59 -0000 1.9 --- CellStylist.java 3 Dec 2007 18:24:20 -0000 1.10 *************** *** 226,229 **** --- 226,241 ---- return style; } + + public HSSFCellStyle createScriptStyle() { + HSSFCellStyle style = workbook.createCellStyle(); + style.setAlignment(HSSFCellStyle.ALIGN_LEFT); + + HSSFFont font = workbook.createFont(); + font.setFontName("Arial"); + font.setFontHeightInPoints((short) 12); + font.setColor(HSSFColor.BLACK.index); + style.setFont(font); + return style; + } } \ No newline at end of file |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:03
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/report/xls In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/src/test/net/sf/tail/report/xls Modified Files: TImeSeriesXlsGeneratorTest.java Log Message: Index: TImeSeriesXlsGeneratorTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/report/xls/TImeSeriesXlsGeneratorTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TImeSeriesXlsGeneratorTest.java 21 Nov 2007 21:55:20 -0000 1.3 --- TImeSeriesXlsGeneratorTest.java 3 Dec 2007 18:24:20 -0000 1.4 *************** *** 66,70 **** HSSFSheet sheet = XLStimeSeries.generate(report); ! assertEquals(12, sheet.getPhysicalNumberOfRows()); } } --- 66,70 ---- HSSFSheet sheet = XLStimeSeries.generate(report); ! assertEquals(13, sheet.getPhysicalNumberOfRows()); } } |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:25:03
|
Update of /cvsroot/tail/Tail/Data/templates/complete In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/Data/templates/complete Modified Files: header.ftl Log Message: Index: header.ftl =================================================================== RCS file: /cvsroot/tail/Tail/Data/templates/complete/header.ftl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** header.ftl 5 Nov 2007 18:59:47 -0000 1.2 --- header.ftl 3 Dec 2007 18:24:20 -0000 1.3 *************** *** 11,14 **** --- 11,16 ---- <h2>Stock: <span class="titleHeader">${report.slicer.series.name} for: ${report.slicer.series.periodName}</span></h2> + + <h3><span class="settingsFixed">Slicer:</span><span class="settings">${report.slicer.name}</span> <span class="settingsFixed">Strategy: </span> <span class="settings">${report.decisions[0].strategy.class.simpleName}</span> |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:24:52
|
Update of /cvsroot/tail/TailS/Data/templates/complete In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17174/Data/templates/complete Modified Files: header.ftl Log Message: Index: header.ftl =================================================================== RCS file: /cvsroot/tail/TailS/Data/templates/complete/header.ftl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** header.ftl 5 Nov 2007 18:59:42 -0000 1.2 --- header.ftl 3 Dec 2007 18:24:55 -0000 1.3 *************** *** 11,15 **** <h2>Stock: <span class="titleHeader">${report.slicer.series.name} for: ${report.slicer.series.periodName}</span></h2> <h3><span class="settingsFixed">Slicer:</span><span class="settings">${report.slicer.name}</span> <span class="settingsFixed">Strategy: </span> <span class="settings">${report.decisions[0].strategy.class.simpleName}</span> ! <span class="settingsFixed">Criteria: </span> <span class="settings">${report.applyedCriterion.class.simpleName}</span></h3> \ No newline at end of file --- 11,20 ---- <h2>Stock: <span class="titleHeader">${report.slicer.series.name} for: ${report.slicer.series.periodName}</span></h2> + <h3><span class="settingsFixed">Slicer:</span><span class="settings">${report.slicer.name}</span> <span class="settingsFixed">Strategy: </span> <span class="settings">${report.decisions[0].strategy.class.simpleName}</span> ! <span class="settingsFixed">Criteria: </span> <span class="settings">${report.applyedCriterion.class.simpleName}</span></h3> ! ! <h3><span class="settingsFixed">Script:</span><span class="settings"> ! ${report.strategiesScript} ! </span></h3> |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:24:18
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/criteria In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/src/java/net/sf/tail/analysis/criteria Modified Files: VersusBuyAndHoldCriterion.java Log Message: Index: VersusBuyAndHoldCriterion.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/criteria/VersusBuyAndHoldCriterion.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** VersusBuyAndHoldCriterion.java 29 Oct 2007 22:50:00 -0000 1.11 --- VersusBuyAndHoldCriterion.java 3 Dec 2007 18:24:20 -0000 1.12 *************** *** 43,47 **** public String getName() { ! return "Versus Buy and Hold of " + criterion.getName(); } --- 43,47 ---- public String getName() { ! return "VB&H " + criterion.getName(); } |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:24:18
|
Update of /cvsroot/tail/Tail/Data/templates/total In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/Data/templates/total Modified Files: header.ftl Log Message: Index: header.ftl =================================================================== RCS file: /cvsroot/tail/Tail/Data/templates/total/header.ftl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** header.ftl 10 Oct 2007 19:04:10 -0000 1.1 --- header.ftl 3 Dec 2007 18:24:19 -0000 1.2 *************** *** 7,11 **** <body> - <h1>Walk Forward Report</h1> <h2>Stock: <span class="titleHeader">${report.slicer.series.name}</span></h2> --- 7,10 ---- |
From: Márcio V. d. S. <mv...@us...> - 2007-12-03 18:24:18
|
Update of /cvsroot/tail/Tail/Data/templates/slice In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17118/Data/templates/slice Modified Files: header.ftl Log Message: Index: header.ftl =================================================================== RCS file: /cvsroot/tail/Tail/Data/templates/slice/header.ftl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** header.ftl 21 Nov 2007 21:55:21 -0000 1.3 --- header.ftl 3 Dec 2007 18:24:20 -0000 1.4 *************** *** 7,11 **** <body> - <h1>Slice Report</h1> <h2>Stock: <span class="titleHeader">${decision.getActualSlice().name} for: ${decision.getActualSlice().periodName}</span></h2> --- 7,10 ---- |
From: Thies <tg...@us...> - 2007-12-01 12:29:31
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17393/src/java/net/sf/tail/dsl/ruby Modified Files: RubyDSL.java Log Message: Refatoração Index: RubyDSL.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby/RubyDSL.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RubyDSL.java 28 Nov 2007 16:04:43 -0000 1.8 --- RubyDSL.java 1 Dec 2007 12:29:31 -0000 1.9 *************** *** 29,33 **** public RubyDSL(String header, TimeSeries series) { ! this.header = read(header) + NEWLINE; this.series = series; factory = new ScriptEngineManager(); --- 29,33 ---- public RubyDSL(String header, TimeSeries series) { ! this.header = header+ NEWLINE; this.series = series; factory = new ScriptEngineManager(); |
From: Thies <tg...@us...> - 2007-11-28 23:42:34
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26256/src/java/net/sf/tail/report Modified Files: Report.java Log Message: Refatoração Index: Report.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/Report.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Report.java 5 Nov 2007 23:16:10 -0000 1.26 --- Report.java 28 Nov 2007 23:42:33 -0000 1.27 *************** *** 175,179 **** return criterionValue; } ! throw new IllegalArgumentException("Criteria not found"); } --- 175,179 ---- return criterionValue; } ! return criteria.summarize(slicer.getSeries(), decisions); } |
From: Thies <tg...@us...> - 2007-11-28 16:53:26
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26332/src/java/net/sf/tail/dsl/ruby Modified Files: RubyDSL.java Log Message: Desligando o log Index: RubyDSL.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby/RubyDSL.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RubyDSL.java 26 Nov 2007 22:23:36 -0000 1.7 --- RubyDSL.java 28 Nov 2007 16:04:43 -0000 1.8 *************** *** 52,56 **** engine.put("series", series); engine.put("close", new ClosePriceIndicator(series)); - System.out.println(header+ code); engine.eval(header + code ); --- 52,55 ---- |
From: Thies <tg...@us...> - 2007-11-28 16:04:46
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/walk In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26332/src/java/net/sf/tail/analysis/walk Modified Files: WalkForward.java Log Message: Desligando o log Index: WalkForward.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/walk/WalkForward.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** WalkForward.java 21 Nov 2007 21:55:20 -0000 1.23 --- WalkForward.java 28 Nov 2007 16:04:43 -0000 1.24 *************** *** 15,18 **** --- 15,19 ---- import net.sf.tail.runner.RunnerFactory; + import org.apache.log4j.Level; import org.apache.log4j.Logger; *************** *** 29,32 **** --- 30,34 ---- this.evaluatorFactory = evaluatorFactory; this.runnerFactory = runnerFactory; + LOG.setLevel(Level.WARN); } |
From: Thies <tg...@us...> - 2007-11-28 16:04:42
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/evaluator In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26332/src/java/net/sf/tail/analysis/evaluator Modified Files: HigherValueEvaluator.java Log Message: Desligando o log Index: HigherValueEvaluator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/evaluator/HigherValueEvaluator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HigherValueEvaluator.java 21 Nov 2007 21:55:19 -0000 1.2 --- HigherValueEvaluator.java 28 Nov 2007 16:04:43 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- import net.sf.tail.runner.RunnerFactory; + import org.apache.log4j.Level; import org.apache.log4j.Logger; *************** *** 34,38 **** this.criterion = criterion; this.slicePosition = 0; ! this.hashRunner = new HashMap<Strategy, Runner>(); --- 35,39 ---- this.criterion = criterion; this.slicePosition = 0; ! LOG.setLevel(Level.WARN); this.hashRunner = new HashMap<Strategy, Runner>(); |
From: Thies <tg...@us...> - 2007-11-28 16:04:41
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/runner In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26332/src/java/net/sf/tail/runner Modified Files: HistoryRunner.java Log Message: Desligando o log Index: HistoryRunner.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/runner/HistoryRunner.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** HistoryRunner.java 26 Nov 2007 17:42:32 -0000 1.21 --- HistoryRunner.java 28 Nov 2007 16:04:43 -0000 1.22 *************** *** 10,13 **** --- 10,14 ---- import net.sf.tail.Trade; + import org.apache.log4j.Level; import org.apache.log4j.Logger; *************** *** 30,34 **** this.strategy = strategy; this.operationType = type; ! listTradesResults = new ArrayList<List<Trade>>(); } --- 31,35 ---- this.strategy = strategy; this.operationType = type; ! LOG.setLevel(Level.WARN); listTradesResults = new ArrayList<List<Trade>>(); } |
From: xanaot <xa...@us...> - 2007-11-26 22:23:35
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv593/src/java/net/sf/tail/dsl/ruby Modified Files: RubyDSL.java Log Message: Acerto no scripts do ruby Index: RubyDSL.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/dsl/ruby/RubyDSL.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RubyDSL.java 8 Oct 2007 21:02:31 -0000 1.6 --- RubyDSL.java 26 Nov 2007 22:23:36 -0000 1.7 *************** *** 1,5 **** --- 1,8 ---- package net.sf.tail.dsl.ruby; + import java.io.FileInputStream; + import java.io.FileNotFoundException; import java.util.LinkedHashSet; + import java.util.Scanner; import java.util.Set; *************** *** 26,30 **** public RubyDSL(String header, TimeSeries series) { ! this.header = header + NEWLINE; this.series = series; factory = new ScriptEngineManager(); --- 29,33 ---- public RubyDSL(String header, TimeSeries series) { ! this.header = read(header) + NEWLINE; this.series = series; factory = new ScriptEngineManager(); *************** *** 56,58 **** --- 59,76 ---- } + public static String read(String name) { + String text = ""; + Scanner scanner; + try { + scanner = new Scanner(new FileInputStream(name)); + while (scanner.hasNextLine()) { + text += scanner.nextLine() + "\n"; + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + + return text; + } + } |
From: xanaot <xa...@us...> - 2007-11-26 22:23:33
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/analysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv593/src/java/net/sf/tail/analysis Modified Files: StockAnalysis.java Log Message: Acerto no scripts do ruby Index: StockAnalysis.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/analysis/StockAnalysis.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** StockAnalysis.java 21 Nov 2007 21:55:21 -0000 1.16 --- StockAnalysis.java 26 Nov 2007 22:23:36 -0000 1.17 *************** *** 1,11 **** package net.sf.tail.analysis; - import java.io.FileInputStream; - import java.io.FileNotFoundException; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; - import java.util.Scanner; import java.util.Set; --- 1,8 ---- *************** *** 67,71 **** private void createDSL() { try { ! String dslHeader = read(fileBundle.getString("RUBY_UTILS_FILE")); dsl = new RubyDSL(dslHeader, this.getStock()); } catch (Exception e) { --- 64,68 ---- private void createDSL() { try { ! String dslHeader = RubyDSL.read(fileBundle.getString("RUBY_UTILS_FILE")); dsl = new RubyDSL(dslHeader, this.getStock()); } catch (Exception e) { *************** *** 214,232 **** } - private static String read(String name) { - String text = ""; - Scanner scanner; - try { - scanner = new Scanner(new FileInputStream(name)); - while (scanner.hasNextLine()) { - text += scanner.nextLine() + "\n"; - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - - return text; - } - public RunnerFactory getRunnerFactory() { return runnerFactory; --- 211,214 ---- |
From: xanaot <xa...@us...> - 2007-11-26 17:42:31
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/runner In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4834/src/java/net/sf/tail/runner Modified Files: HistoryRunner.java Log Message: Refatoracaão do history para cobrir o caso do fully memorized Index: HistoryRunner.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/runner/HistoryRunner.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** HistoryRunner.java 21 Nov 2007 21:55:20 -0000 1.20 --- HistoryRunner.java 26 Nov 2007 17:42:32 -0000 1.21 *************** *** 92,96 **** int j = 1; while(slicer.getSlices() > slicePosition + j) { ! int start = slicer.getSlice(slicePosition + j).getBegin(); int last = slicer.getSlice(slicePosition + j).getEnd(); --- 92,96 ---- int j = 1; while(slicer.getSlices() > slicePosition + j) { ! int start = Math.max(slicer.getSlice(slicePosition + j).getBegin(), end); int last = slicer.getSlice(slicePosition + j).getEnd(); |