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-10-10 23:10:37
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/indicator/tracker In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22687/src/test/net/sf/tail/indicator/tracker Removed Files: OnBalanceVolumeIndicatorTest.java Log Message: Mudanca nas cores das setas e mudanca de lugar do OnBalanceVolumeIndicator --- OnBalanceVolumeIndicatorTest.java DELETED --- |
|
From: Thies <tg...@us...> - 2007-10-10 23:10:37
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/indicator/volume In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22648/src/java/net/sf/tail/indicator/volume Log Message: Directory /cvsroot/tail/Tail/src/java/net/sf/tail/indicator/volume added to the repository |
|
From: Thies <tg...@us...> - 2007-10-10 23:10:37
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/indicator/tracker In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22687/src/java/net/sf/tail/indicator/tracker Removed Files: OnBalanceVolumeIndicator.java Log Message: Mudanca nas cores das setas e mudanca de lugar do OnBalanceVolumeIndicator --- OnBalanceVolumeIndicator.java DELETED --- |
|
From: Thies <tg...@us...> - 2007-10-10 23:10:37
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22687/src/java/net/sf/tail/graphics Modified Files: SeriesChart.java Log Message: Mudanca nas cores das setas e mudanca de lugar do OnBalanceVolumeIndicator Index: SeriesChart.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/graphics/SeriesChart.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SeriesChart.java 3 Sep 2007 21:55:27 -0000 1.3 --- SeriesChart.java 10 Oct 2007 23:10:36 -0000 1.4 *************** *** 67,79 **** for (int i = 0; i < dataSet.getRowCount(); i++) { ! if (dataSet.getRowKey(i).equals("Buy")) lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getDownArrow()); ! else if (dataSet.getRowKey(i).equals("Sell")) lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getUpperArrow()); else lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getPoint()); } plot.setRenderer(lineAndShapeRenderer); ! } public void datasetChanged(DatasetChangeEvent event) { --- 67,83 ---- for (int i = 0; i < dataSet.getRowCount(); i++) { ! if (dataSet.getRowKey(i).equals("Buy")) { lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getDownArrow()); ! lineAndShapeRenderer.setSeriesPaint(i, Color.GREEN); ! } ! else if (dataSet.getRowKey(i).equals("Sell")) { lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getUpperArrow()); + lineAndShapeRenderer.setSeriesPaint(i, Color.RED); + } else lineAndShapeRenderer.setSeriesShape(i, ShapeFactory.getPoint()); } plot.setRenderer(lineAndShapeRenderer); ! } public void datasetChanged(DatasetChangeEvent event) { |
|
From: Thies <tg...@us...> - 2007-10-10 23:10:37
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/indicator/volume In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22687/src/test/net/sf/tail/indicator/volume Added Files: AccumulationDistributionIndicatorTest.java OnBalanceVolumeIndicatorTest.java Log Message: Mudanca nas cores das setas e mudanca de lugar do OnBalanceVolumeIndicator --- NEW FILE: AccumulationDistributionIndicatorTest.java --- package net.sf.tail.indicator.volume; import java.util.ArrayList; import java.util.List; import net.sf.tail.Tick; import net.sf.tail.TimeSeries; import net.sf.tail.sample.SampleTimeSeries; import static org.junit.Assert.*; import org.junit.Test; public class AccumulationDistributionIndicatorTest { @Test public void testAccumulationDistribution() { List<Tick> ticks = new ArrayList<Tick>(); ticks.add(new Tick(null, 0d, 10d, 12d, 8d, 0d, 0d, 0d, 200d,0));//2-2 * 200 / 4 ticks.add(new Tick(null, 0d, 8d, 10d, 7d, 0d, 0d, 0d, 100d,0));//1-2 *100 / 3 ticks.add(new Tick(null, 0d, 9d, 15d, 6d, 0d, 0d, 0d, 300d,0));//3-6 *300 /9 ticks.add(new Tick(null, 0d, 20d, 40d, 5d, 0d, 0d, 0d, 50d,0));//15-20 *50 / 35 ticks.add(new Tick(null, 0d, 30d, 30d, 3d, 0d, 0d, 0d, 600d,0));//27-0 *600 /27 TimeSeries series = new SampleTimeSeries(ticks); AccumulationDistributionIndicator ac = new AccumulationDistributionIndicator(series); assertEquals(0d, ac.getValue(0)); assertEquals(-100d / 3, ac.getValue(1)); assertEquals(-100d -(100d / 3) , ac.getValue(2)); assertEquals((-250d/35) + (-100d -(100d / 3)), ac.getValue(3)); assertEquals(600d + ((-250d/35) + (-100d -(100d / 3))), ac.getValue(4)); } } --- NEW FILE: OnBalanceVolumeIndicatorTest.java --- package net.sf.tail.indicator.volume; import static junit.framework.Assert.assertEquals; import java.util.ArrayList; import java.util.List; import net.sf.tail.Tick; import net.sf.tail.sample.SampleTimeSeries; import org.junit.Test; public class OnBalanceVolumeIndicatorTest { @Test public void testGetValue() { List<Tick> ticks = new ArrayList<Tick>(); ticks.add(new Tick(null, 0, 10, 0, 0, 0, 0, 0, 4, 0)); ticks.add(new Tick(null, 0, 5, 0, 0, 0, 0, 0, 2, 0)); ticks.add(new Tick(null, 0, 6, 0, 0, 0, 0, 0, 3, 0)); ticks.add(new Tick(null, 0, 7, 0, 0, 0, 0, 0, 8, 0)); ticks.add(new Tick(null, 0, 7, 0, 0, 0, 0, 0, 6, 0)); ticks.add(new Tick(null, 0, 6, 0, 0, 0, 0, 0, 10, 0)); OnBalanceVolumeIndicator onBalance = new OnBalanceVolumeIndicator(new SampleTimeSeries(ticks)); assertEquals(0d, onBalance.getValue(0)); assertEquals(-2d, onBalance.getValue(1)); assertEquals(1d, onBalance.getValue(2)); assertEquals(9d, onBalance.getValue(3)); assertEquals(9d, onBalance.getValue(4)); assertEquals(-1d, onBalance.getValue(5)); } } |
|
From: Carlos <ma...@us...> - 2007-10-10 22:49:51
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12654/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: Adicionados default strategies na tela New Report. Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NewReportFrame.java 10 Oct 2007 22:00:50 -0000 1.18 --- NewReportFrame.java 10 Oct 2007 22:46:39 -0000 1.19 *************** *** 30,33 **** --- 30,35 ---- private static final ResourceBundle messageBundle = ResourceBundle .getBundle("net.sf.tails.i18n.Messages"); + private static final ResourceBundle indicatorBundle = ResourceBundle + .getBundle("net.sf.tails.i18n.IndicatorDescription"); private static final long serialVersionUID = 4704921929974302846L; *************** *** 40,44 **** private javax.swing.JPanel defaultReportPanel; private javax.swing.JPanel radioGroupPanel; ! private javax.swing.JRadioButton jRadioButtonSMA; private javax.swing.JScrollPane customStrategyPane; private javax.swing.JScrollPane radioGroupScrollPane; --- 42,50 ---- private javax.swing.JPanel defaultReportPanel; private javax.swing.JPanel radioGroupPanel; ! private javax.swing.JRadioButton radioButtonSMA; ! private javax.swing.JRadioButton radioButtonEMA; ! private javax.swing.JRadioButton radioButtonRSI; ! private javax.swing.JRadioButton radioButtonBollingerBands; ! private javax.swing.JRadioButton radioButtonParabolicSAR; private javax.swing.JScrollPane customStrategyPane; private javax.swing.JScrollPane radioGroupScrollPane; *************** *** 70,74 **** radioGroupScrollPane = new javax.swing.JScrollPane(); radioGroupPanel = new javax.swing.JPanel(); ! jRadioButtonSMA = new javax.swing.JRadioButton(); customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); --- 76,84 ---- radioGroupScrollPane = new javax.swing.JScrollPane(); radioGroupPanel = new javax.swing.JPanel(); ! radioButtonSMA = new javax.swing.JRadioButton(); ! radioButtonEMA = new javax.swing.JRadioButton(); ! radioButtonRSI = new javax.swing.JRadioButton(); ! radioButtonBollingerBands = new javax.swing.JRadioButton(); ! radioButtonParabolicSAR = new javax.swing.JRadioButton(); customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); *************** *** 100,115 **** radioGroupScrollPane ! .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ! indicatorsButtonGroup.add(jRadioButtonSMA); ! jRadioButtonSMA.setText("SMA"); ! jRadioButtonSMA.setBorder(javax.swing.BorderFactory ! .createTitledBorder("")); ! jRadioButtonSMA.setBorderPainted(true); ! jRadioButtonSMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! jRadioButtonSMA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectedEnum = EnumIndicator.SMA; } }); javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout( radioGroupPanel); --- 110,160 ---- radioGroupScrollPane ! .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); ! indicatorsButtonGroup.add(radioButtonSMA); ! indicatorsButtonGroup.add(radioButtonEMA); ! indicatorsButtonGroup.add(radioButtonRSI); ! indicatorsButtonGroup.add(radioButtonBollingerBands); ! indicatorsButtonGroup.add(radioButtonParabolicSAR); ! ! radioButtonSMA.setText("SMA - " + indicatorBundle.getString("SMAIndicator")); ! radioButtonSMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! radioButtonSMA.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { selectedEnum = EnumIndicator.SMA; } }); + + radioButtonEMA.setText("EMA - " + indicatorBundle.getString("EMAIndicator")); + radioButtonEMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); + radioButtonEMA.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectedEnum = EnumIndicator.EMA; + } + }); + + radioButtonRSI.setText("RSI - " + indicatorBundle.getString("RSIIndicator")); + radioButtonRSI.setMargin(new java.awt.Insets(0, 0, 0, 0)); + radioButtonRSI.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectedEnum = EnumIndicator.RSI; + } + }); + + radioButtonBollingerBands.setText("Bollinger Bands - " + indicatorBundle.getString("BollingerBandsIndicator")); + radioButtonBollingerBands.setMargin(new java.awt.Insets(0, 0, 0, 0)); + radioButtonBollingerBands.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectedEnum = EnumIndicator.BOLLINGERBANDS; + } + }); + + radioButtonParabolicSAR.setText("Parabolic SAR - " + indicatorBundle.getString("ParabolicSarIndicator")); + radioButtonParabolicSAR.setMargin(new java.awt.Insets(0, 0, 0, 0)); + radioButtonParabolicSAR.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + selectedEnum = EnumIndicator.PARABOLICSAR; + } + }); + javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout( radioGroupPanel); *************** *** 119,125 **** .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) - .addGroup( - radioGroupPanelLayout - .createSequentialGroup() .addGroup( radioGroupPanelLayout --- 164,167 ---- *************** *** 127,132 **** javax.swing.GroupLayout.Alignment.LEADING) .addComponent( ! jRadioButtonSMA)) ! .addGap(314, 314, 314))); radioGroupPanelLayout .setVerticalGroup(radioGroupPanelLayout --- 169,198 ---- javax.swing.GroupLayout.Alignment.LEADING) .addComponent( ! radioButtonSMA)) ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! radioButtonEMA)) ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! radioButtonRSI)) ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! radioButtonBollingerBands)) ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! radioButtonParabolicSAR)) ! .addGap(314, 314, 314)); radioGroupPanelLayout .setVerticalGroup(radioGroupPanelLayout *************** *** 136,140 **** radioGroupPanelLayout .createSequentialGroup() ! .addComponent(jRadioButtonSMA) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, --- 202,214 ---- radioGroupPanelLayout .createSequentialGroup() ! .addComponent(radioButtonSMA) ! .addGap(10,10,10) ! .addComponent(radioButtonEMA) ! .addGap(10,10,10) ! .addComponent(radioButtonRSI) ! .addGap(10,10,10) ! .addComponent(radioButtonBollingerBands) ! .addGap(10,10,10) ! .addComponent(radioButtonParabolicSAR) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, |
|
From: Carlos <ma...@us...> - 2007-10-10 22:49:50
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12654/src/java/net/sf/tails/i18n Modified Files: IndicatorDescription.properties Log Message: Adicionados default strategies na tela New Report. Index: IndicatorDescription.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/IndicatorDescription.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IndicatorDescription.properties 10 Oct 2007 18:44:32 -0000 1.2 --- IndicatorDescription.properties 10 Oct 2007 22:46:39 -0000 1.3 *************** *** 1,6 **** ! ! SMAIndicator=Generate default strategy for SMA indicator using Indicator Crossed Indicator Strategy ! EMAIndicator=Generate default strategy for EMA indicator using Indicator Crossed Indicator Strategy ! RSIIndicator=Generate default strategy for RSI indicator using Pipe Enter Strategy ! ParabolicSarIndicator=Generate default strategy for ParabolicSar indicator using Indicator Crossed Indicator and ParabolicSar And DMI Strategy ! BollingerBandsIndicator=Generate default strategy for BollingerBands indicator using Pipe Enter Strategy \ No newline at end of file --- 1,5 ---- ! SMAIndicator=Generate default strategy for SMA indicator using Indicator Crossed Indicator Strategy. ! EMAIndicator=Generate default strategy for EMA indicator using Indicator Crossed Indicator Strategy. ! RSIIndicator=Generate default strategy for RSI indicator using Pipe Enter Strategy. ! ParabolicSarIndicator=Generate default strategy for ParabolicSar indicator using Indicator Crossed Indicator and ParabolicSar And DMI Strategy. ! BollingerBandsIndicator=Generate default strategy for BollingerBands indicator using Pipe Enter Strategy. \ No newline at end of file |
|
From: Carlos <ma...@us...> - 2007-10-10 22:08:40
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28445/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis3.java Log Message: Adicionada opção de ShortSellRunner. Index: NewStockAnalysis3.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis3.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NewStockAnalysis3.java 10 Oct 2007 21:28:10 -0000 1.6 --- NewStockAnalysis3.java 10 Oct 2007 22:08:39 -0000 1.7 *************** *** 22,25 **** --- 22,26 ---- import net.sf.tail.analysis.evaluator.HigherValueEvaluator; import net.sf.tail.runner.HistoryRunner; + import net.sf.tail.runner.ShortSellRunner; import net.sf.tail.series.FullyMemorizedSlicer; import net.sf.tail.series.PartialMemorizedSlicer; *************** *** 61,64 **** --- 62,67 ---- private javax.swing.JTextField slicesNumberField; private javax.swing.JLabel slicesNumberLabel; + private javax.swing.JComboBox runnerTypeComboBox; + private javax.swing.JLabel runnerTypeLabel; private Index index; private FrameHelper helper; *************** *** 91,95 **** --- 94,100 ---- startDateLabel = new javax.swing.JLabel(); slicerTypeLabel = new javax.swing.JLabel(); + runnerTypeLabel = new javax.swing.JLabel(); slicerTypeComboBox = new javax.swing.JComboBox(); + runnerTypeComboBox = new javax.swing.JComboBox(); startDateField = new javax.swing.JTextField(); finishButton = new javax.swing.JButton(); *************** *** 97,100 **** --- 102,106 ---- slicesNumberField = new javax.swing.JTextField(); slicesNumberLabel = new javax.swing.JLabel(); + slicesNumberField.setText("1"); *************** *** 194,200 **** startDateLabel.setText("Start Date:"); slicerTypeLabel.setText("Slicer Type:"); ! slicerTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ "Regular", "Fully", "Partial" })); slicerTypeComboBox.setMinimumSize(new java.awt.Dimension(178, 23)); --- 200,212 ---- startDateLabel.setText("Start Date:"); + + runnerTypeLabel.setText("Runner Type:"); + runnerTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ "HystoryRunner", "ShortSellRunner" })); + runnerTypeComboBox.setMinimumSize(new java.awt.Dimension(178, 23)); + runnerTypeComboBox.setPreferredSize(new java.awt.Dimension(178, 23)); + slicerTypeLabel.setText("Slicer Type:"); ! slicerTypeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[]{ "Regular", "Fully", "Partial" })); slicerTypeComboBox.setMinimumSize(new java.awt.Dimension(178, 23)); *************** *** 232,239 **** --- 244,253 ---- .addGap(11, 11, 11) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(runnerTypeLabel) .addComponent(startDateLabel) .addComponent(slicerTypeLabel)) .addGap(20, 20, 20) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(runnerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(startDateField, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) *************** *** 263,266 **** --- 277,284 ---- .addGap(15, 15, 15) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(runnerTypeLabel) + .addComponent(runnerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(15, 15, 15) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(slicerTypeLabel) .addComponent(slicerTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) *************** *** 376,381 **** } ! ! StockAnalysis stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluator(new HistoryRunner(OperationType.BUY))); stockAnalysis.addCriteria(additionalCriteria); index.loadStockAnalysis(stockAnalysis); --- 394,406 ---- } ! StockAnalysis stockAnalysis; ! if (runnerTypeComboBox.getSelectedItem().toString() == "HystoryRunner") ! { ! stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluator(new HistoryRunner(OperationType.BUY))); ! } ! else ! { ! stockAnalysis = new StockAnalysis(stock, selectedCriterion, slicer, new HigherValueEvaluator(new ShortSellRunner())); ! } stockAnalysis.addCriteria(additionalCriteria); index.loadStockAnalysis(stockAnalysis); |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:02:52
|
Update of /cvsroot/tail/TailS In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25832 Modified Files: .classpath Log Message: Index: .classpath =================================================================== RCS file: /cvsroot/tail/TailS/.classpath,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** .classpath 10 Oct 2007 19:04:48 -0000 1.14 --- .classpath 10 Oct 2007 22:02:54 -0000 1.15 *************** *** 9,13 **** <classpathentry kind="lib" path="lib/joda-time-1.4-src-ide.zip"/> <classpathentry kind="lib" path="lib/poi-3.0.1-FINAL-20070705.jar"/> - <classpathentry kind="lib" path="lib/jeditsyntaxpackage.jar"/> <classpathentry kind="src" path="dsl"/> <classpathentry combineaccessrules="false" kind="src" path="/Tail"/> --- 9,12 ---- |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:01:23
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/dsl In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/src/java/net/sf/tails/dsl Modified Files: TailSTokenMarker.java Log Message: Index: TailSTokenMarker.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/dsl/TailSTokenMarker.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TailSTokenMarker.java 3 Oct 2007 20:20:34 -0000 1.2 --- TailSTokenMarker.java 10 Oct 2007 22:00:49 -0000 1.3 *************** *** 11,15 **** private static String[] rubyKeyWords; ! private static String[] tailKeyWords; private static KeywordMap TailSKeywords; --- 11,16 ---- private static String[] rubyKeyWords; ! private static String[] tailIndicatorsKeyWords; ! private static String[] tailStrategiesKeyWords; private static KeywordMap TailSKeywords; *************** *** 17,21 **** ResourceBundle bundle = ResourceBundle.getBundle("net.sf.tails.i18n.DSL_IDE"); rubyKeyWords = bundle.getString("RUBY_KEYWORDS").split(" "); ! tailKeyWords = bundle.getString("TAIL_KEYWORDS").split(" "); } --- 18,23 ---- ResourceBundle bundle = ResourceBundle.getBundle("net.sf.tails.i18n.DSL_IDE"); rubyKeyWords = bundle.getString("RUBY_KEYWORDS").split(" "); ! tailIndicatorsKeyWords = bundle.getString("TAIL_INDICATORS_KEYWORDS").split(" "); ! tailStrategiesKeyWords = bundle.getString("TAIL_STRATEGIES_KEYWORDS").split(" "); } *************** *** 33,39 **** TailSKeywords.add(key, Token.LABEL); } ! for (String key : tailKeyWords) { TailSKeywords.add(key, Token.LITERAL1); } } return TailSKeywords; --- 35,44 ---- TailSKeywords.add(key, Token.LABEL); } ! for (String key : tailIndicatorsKeyWords) { TailSKeywords.add(key, Token.LITERAL1); } + for (String key : tailStrategiesKeyWords) { + TailSKeywords.add(key, Token.LITERAL2); + } } return TailSKeywords; |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:01:23
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/src/java/net/sf/tails/i18n Modified Files: DSL_IDE.properties Log Message: Index: DSL_IDE.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/DSL_IDE.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DSL_IDE.properties 3 Oct 2007 22:30:54 -0000 1.2 --- DSL_IDE.properties 10 Oct 2007 22:00:50 -0000 1.3 *************** *** 1,3 **** RUBY_KEYWORDS= alias and begin break case catch class def do elsif else fail ensure for end if in module next not or raise redo rescue retry return then throw super unless undef until when while yield ! TAIL_KEYWORDS= averageGain averageLoss max min averageDirectionalMovement directionalMovement onBalanceVolume standartDeviation ema parabolicSAR RSI close amount maxPrice minPrice openPrice volume sma WilliamsR cross \ No newline at end of file --- 1,4 ---- RUBY_KEYWORDS= alias and begin break case catch class def do elsif else fail ensure for end if in module next not or raise redo rescue retry return then throw super unless undef until when while yield ! TAIL_INDICATORS_KEYWORDS= def averageGain(timeFrame) averageGain averageLoss(timeFrame) averageLoss max(indicator) min(indicator) averageDirectionalMovement(timeFrame) directionalMovement(timeFrame) onBalanceVolume standartDeviation(indicator,timeFrame) ema(timeFrame) parabolicSAR rsi(timeFrame) close amount maxPrice minPrice openPrice volume sma(timeFrame) williamsR(timeFrame) ! TAIL_STRATEGIES_KEYWORDS= cross(indicator1,indicator2) pipeEnter(indicatorUpper,indicatorLower,indicatorValue) \ No newline at end of file |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:01:23
|
Update of /cvsroot/tail/TailS/src/test/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/src/test/net/sf/tails/swing/helper Modified Files: CompleteHtmlGeneratorExecutor.java CompleteHtmlGeneratorTest.java Log Message: Index: CompleteHtmlGeneratorTest.java =================================================================== RCS file: /cvsroot/tail/TailS/src/test/net/sf/tails/swing/helper/CompleteHtmlGeneratorTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompleteHtmlGeneratorTest.java 10 Oct 2007 19:04:47 -0000 1.1 --- CompleteHtmlGeneratorTest.java 10 Oct 2007 22:00:50 -0000 1.2 *************** *** 1,6 **** package net.sf.tails.swing.helper; - import static org.junit.Assert.assertTrue; - import java.io.File; import java.io.IOException; --- 1,4 ---- Index: CompleteHtmlGeneratorExecutor.java =================================================================== RCS file: /cvsroot/tail/TailS/src/test/net/sf/tails/swing/helper/CompleteHtmlGeneratorExecutor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CompleteHtmlGeneratorExecutor.java 10 Oct 2007 19:04:47 -0000 1.1 --- CompleteHtmlGeneratorExecutor.java 10 Oct 2007 22:00:50 -0000 1.2 *************** *** 1,5 **** package net.sf.tails.swing.helper; - import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; --- 1,4 ---- |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:01:23
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/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.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NewReportFrame.java 10 Oct 2007 17:02:24 -0000 1.17 --- NewReportFrame.java 10 Oct 2007 22:00:50 -0000 1.18 *************** *** 11,15 **** import javax.swing.JFrame; import javax.swing.JOptionPane; - import javax.swing.JTextArea; import net.sf.tail.Strategy; --- 11,14 ---- *************** *** 17,25 **** import net.sf.tail.dsl.TailDSL; import net.sf.tail.dsl.ruby.RubyDSL; import net.sf.tails.swing.frame.Index; - import net.sf.tails.swing.frame.autocomplete.AutoCompleteForm; import net.sf.tails.swing.helper.DefaultStrategiesGenerator; import net.sf.tails.swing.helper.EnumIndicator; /** * --- 16,26 ---- import net.sf.tail.dsl.TailDSL; import net.sf.tail.dsl.ruby.RubyDSL; + import net.sf.tails.dsl.TailSTokenMarker; import net.sf.tails.swing.frame.Index; import net.sf.tails.swing.helper.DefaultStrategiesGenerator; import net.sf.tails.swing.helper.EnumIndicator; + import org.gjt.sp.jedit.syntax.JEditTextArea; + /** * *************** *** 43,47 **** private javax.swing.JScrollPane radioGroupScrollPane; private javax.swing.JTabbedPane newReportTabbedPane; ! private JTextArea customStrategyTextArea; private javax.swing.JLabel reportNameLabel; private javax.swing.JTextField reportNameField; --- 44,48 ---- private javax.swing.JScrollPane radioGroupScrollPane; private javax.swing.JTabbedPane newReportTabbedPane; ! private JEditTextArea customStrategyTextArea; private javax.swing.JLabel reportNameLabel; private javax.swing.JTextField reportNameField; *************** *** 72,76 **** customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); ! customStrategyTextArea = new JTextArea(); customStrategyCreateButton = new javax.swing.JButton(); customStrategyCancelButton = new javax.swing.JButton(); --- 73,77 ---- customReportPanel = new javax.swing.JPanel(); customStrategyPane = new javax.swing.JScrollPane(); ! customStrategyTextArea = new JEditTextArea(); customStrategyCreateButton = new javax.swing.JButton(); customStrategyCancelButton = new javax.swing.JButton(); *************** *** 203,207 **** newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! // customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); customStrategyTextArea.addKeyListener(new KeyListener() { --- 204,208 ---- newReportTabbedPane.addTab("Default Report", defaultReportPanel); ! customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); customStrategyTextArea.addKeyListener(new KeyListener() { *************** *** 330,334 **** switch (keyEvent.getKeyCode()) { case KeyEvent.VK_SPACE: ! new AutoCompleteForm(customStrategyTextArea).setVisible(true); break; --- 331,336 ---- switch (keyEvent.getKeyCode()) { case KeyEvent.VK_SPACE: ! ! //new AutoCompleteForm(customStrategyTextArea).setVisible(true); break; *************** *** 394,397 **** --- 396,403 ---- this.dispose(); } + + public static void main(String[] args) { + new NewReportFrame(null,null).setVisible(true); + } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:51
|
Update of /cvsroot/tail/TailS/dsl In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/dsl Modified Files: rubyDSLutils.rb Log Message: Index: rubyDSLutils.rb =================================================================== RCS file: /cvsroot/tail/TailS/dsl/rubyDSLutils.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rubyDSLutils.rb 8 Oct 2007 21:02:35 -0000 1.2 --- rubyDSLutils.rb 10 Oct 2007 22:00:53 -0000 1.3 *************** *** 59,63 **** end ! def RSI(timeFrame) Tail::RSIIndicator.new(close, timeFrame) end --- 59,63 ---- end ! def rsi(timeFrame) Tail::RSIIndicator.new(close, timeFrame) end *************** *** 91,95 **** end ! def WilliamsR(timeFrame) Tail::WilliamsRIndicator.new($close, timeFrame) end --- 91,95 ---- end ! def williamsR(timeFrame) Tail::WilliamsRIndicator.new($close, timeFrame) end *************** *** 98,99 **** --- 98,103 ---- Tail::IndicatorCrossedIndicatorStrategy.new(indicator1, indicator2) end + + def pipeEnter(indicatorUpper, indicatorLower, indicatorValue) + Tail::PipeEnterStrategy(indicatorUpper, indicatorLower, indicatorValue) + end \ No newline at end of file |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:51
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/autocomplete In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24817/src/java/net/sf/tails/swing/frame/autocomplete Added Files: AutoCompleteFrame.java AutoCompleteForm2.java Removed Files: AutoCompleteForm.java Log Message: --- NEW FILE: AutoCompleteForm2.java --- package net.sf.tails.swing.frame.autocomplete; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.util.ResourceBundle; import javax.swing.JTable; import javax.swing.JTextArea; import javax.swing.table.DefaultTableModel; public class AutoCompleteForm2 extends javax.swing.JFrame { /** * */ private javax.swing.JTable reportTable; private JTextArea jTextArea; private static final long serialVersionUID = 8339682604292292370L; private static String[] rubyKeyWords; private static String[] tailKeyWords; static{ ResourceBundle bundle = ResourceBundle.getBundle("net.sf.tails.i18n.DSL_IDE"); rubyKeyWords = bundle.getString("RUBY_KEYWORDS").split(" "); tailKeyWords = bundle.getString("TAIL_KEYWORDS").split(" "); } public AutoCompleteForm2(JTextArea jTextArea){ this.jTextArea = jTextArea; initComponents(); } /** 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=" Generated Code "> private void initComponents() { DefaultTableModel dtm = new DefaultTableModel(0,1); for (String s : tailKeyWords) { dtm.addRow(new Object[]{s}); } for (String s : rubyKeyWords) { dtm.addRow(new Object[]{s}); } reportTable = new JTable(dtm); jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1.setViewportView(reportTable); reportTable.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jScrollPane1MouseClicked(evt); } }); setUndecorated(true); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); this.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jScrollPane1KeyPressed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 276, Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold> private void jScrollPane1KeyPressed(java.awt.event.KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) { this.dispose(); } } private void jScrollPane1MouseClicked(MouseEvent evt) { JTable jt = (JTable)evt.getSource(); jTextArea.append(jt.getValueAt(jt.getSelectedRow(), jt.getSelectedColumn()).toString()); this.dispose(); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AutoCompleteForm2(null).setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JScrollPane jScrollPane1; // End of variables declaration } --- NEW FILE: AutoCompleteFrame.java --- package net.sf.tails.swing.frame.autocomplete; import java.awt.Point; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.util.Arrays; import java.util.ResourceBundle; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; import javax.swing.text.BadLocationException; import org.gjt.sp.jedit.syntax.JEditTextArea; /* * NovoJFrame.java * * Created on 10 de Outubro de 2007, 14:08 */ /** * * @author Marcio */ public class AutoCompleteFrame extends javax.swing.JFrame { private JEditTextArea jTextArea; private static final long serialVersionUID = 8339682604292292370L; private static String[] rubyKeyWords; private static String[] tailIndicatorsKeyWords; private static String[] tailStrategiesKeyWords; static{ ResourceBundle bundle = ResourceBundle.getBundle("net.sf.tails.i18n.DSL_IDE"); rubyKeyWords = bundle.getString("RUBY_KEYWORDS").split(" "); Arrays.sort(rubyKeyWords); tailIndicatorsKeyWords = bundle.getString("TAIL_INDICATORS_KEYWORDS").split(" "); Arrays.sort(tailIndicatorsKeyWords); tailStrategiesKeyWords = bundle.getString("TAIL_STRATEGIES_KEYWORDS").split(" "); Arrays.sort(tailStrategiesKeyWords); } public AutoCompleteFrame(JEditTextArea textArea){ this.jTextArea = textArea; initComponents(); Point p = textArea.getLocationOnScreen(); p.translate(textArea.getCaretPosition(), textArea.getCaretLine()); 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() { DefaultTableModel dtm = loadAutoCompleteDataModel(); jTable1 = new JTable(dtm); jScrollPane1 = new javax.swing.JScrollPane(); jScrollPane1.setViewportView(jTable1); jTable1.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jScrollPane1MouseClicked(evt); } }); jTable1.addKeyListener(new KeyListener(){ public void keyPressed(KeyEvent e) { jScrollPane1KeyPressed(e); } public void keyReleased(KeyEvent e) { } public void keyTyped(KeyEvent e) { } }); setUndecorated(true); jTable1.setBackground(new java.awt.Color(255, 255, 204)); jTable1.setFont(new java.awt.Font("Tahoma", 1, 11)); jTable1.setGridColor(new java.awt.Color(255, 255, 204)); jTable1.setSelectionBackground(new java.awt.Color(212, 208, 200)); jTable1.setTableHeader(null); jScrollPane1.setViewportView(jTable1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE) ); pack(); }// </editor-fold> private DefaultTableModel loadAutoCompleteDataModel() { DefaultTableModel dtm = new DefaultTableModel(0,1); dtm.addRow(new Object[]{"INDICATORS"}); for (String s : tailIndicatorsKeyWords) { dtm.addRow(new Object[]{s}); } dtm.addRow(new Object[]{"STRATEGIES"}); for (String s : tailStrategiesKeyWords) { dtm.addRow(new Object[]{s}); } dtm.addRow(new Object[]{"RUBYKEYWORDS"}); for (String s : rubyKeyWords) { dtm.addRow(new Object[]{s}); } return dtm; } private void jScrollPane1KeyPressed(java.awt.event.KeyEvent evt) { switch (evt.getKeyCode()) { case KeyEvent.VK_ESCAPE: this.dispose(); break; case KeyEvent.VK_ENTER: appendMethod(evt); break; default: break; } } private void jScrollPane1MouseClicked(MouseEvent evt) { appendMethod(evt); } private void appendMethod(InputEvent evt) { JTable jt = (JTable)evt.getSource(); try { jTextArea.getDocument().insertString(jTextArea.getCaretPosition() , jt.getValueAt(jt.getSelectedRow(), jt.getSelectedColumn()).toString(),null ); } catch (BadLocationException e) { e.printStackTrace(); } this.dispose(); } /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AutoCompleteFrame(null).setVisible(true); } }); } // Declaração de variáveis - não modifique private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; // Fim da declaração de variáveis } --- AutoCompleteForm.java DELETED --- |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:23
|
Update of /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit/syntax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/java/org/gjt/sp/jedit/syntax Log Message: Directory /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit/syntax added to the repository |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:22
|
Update of /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/java/org/gjt/sp/jedit Log Message: Directory /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit added to the repository |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:22
|
Update of /cvsroot/tail/TailS/src/java/org/gjt In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/java/org/gjt Log Message: Directory /cvsroot/tail/TailS/src/java/org/gjt added to the repository |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:22
|
Update of /cvsroot/tail/TailS/src/java/org/gjt/sp In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/java/org/gjt/sp Log Message: Directory /cvsroot/tail/TailS/src/java/org/gjt/sp added to the repository |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 22:00:22
|
Update of /cvsroot/tail/TailS/src/java/org In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24748/src/java/org Log Message: Directory /cvsroot/tail/TailS/src/java/org added to the repository |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-10 21:59:52
|
Update of /cvsroot/tail/Tail/dsl In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv24351/dsl Modified Files: rubyDSLutils.rb Log Message: Index: rubyDSLutils.rb =================================================================== RCS file: /cvsroot/tail/Tail/dsl/rubyDSLutils.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rubyDSLutils.rb 8 Oct 2007 21:02:31 -0000 1.6 --- rubyDSLutils.rb 10 Oct 2007 21:59:54 -0000 1.7 *************** *** 59,63 **** end ! def RSI(timeFrame) Tail::RSIIndicator.new(close, timeFrame) end --- 59,63 ---- end ! def rsi(timeFrame) Tail::RSIIndicator.new(close, timeFrame) end *************** *** 91,95 **** end ! def WilliamsR(timeFrame) Tail::WilliamsRIndicator.new($close, timeFrame) end --- 91,95 ---- end ! def williamsR(timeFrame) Tail::WilliamsRIndicator.new($close, timeFrame) end *************** *** 97,99 **** --- 97,103 ---- def cross (indicator1, indicator2) Tail::IndicatorCrossedIndicatorStrategy.new(indicator1, indicator2) + end + + def pipeEnter(indicatorUpper, indicatorLower, indicatorValue) + Tail::PipeEnterStrategy(indicatorUpper, indicatorLower, indicatorValue) end \ No newline at end of file |
|
From: Thies <tg...@us...> - 2007-10-10 21:50:34
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/indicator/tracker In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20353/src/test/net/sf/tail/indicator/tracker Added Files: WMAIndicatorTest.java Log Message: WMA Indicator e o teste --- NEW FILE: WMAIndicatorTest.java --- package net.sf.tail.indicator.tracker; import static org.junit.Assert.assertEquals; import net.sf.tail.Indicator; import net.sf.tail.indicator.simple.ClosePriceIndicator; import net.sf.tail.sample.SampleTimeSeries; import org.junit.Test; public class WMAIndicatorTest { @Test public void testWMACalculate() { SampleTimeSeries series = new SampleTimeSeries(new double[] {1d, 2d, 3d, 4d, 5d, 6d}); Indicator<Double> close = new ClosePriceIndicator(series); Indicator<Double> wmaIndicator = new WMAIndicator(close, 3); assertEquals(1d, wmaIndicator.getValue(0)); assertEquals(5d/3, wmaIndicator.getValue(1)); assertEquals(14d/6, wmaIndicator.getValue(2)); assertEquals(20d/6, wmaIndicator.getValue(3)); assertEquals(26d/6, wmaIndicator.getValue(4)); assertEquals(32d/6, wmaIndicator.getValue(5)); } @Test public void testWMACalculateJumpingIndex() { SampleTimeSeries series = new SampleTimeSeries(new double[] {1d, 2d, 3d, 4d, 5d, 6d}); Indicator<Double> close = new ClosePriceIndicator(series); Indicator<Double> wmaIndicator = new WMAIndicator(close, 3); assertEquals(32d/6, wmaIndicator.getValue(5)); } @Test public void testWMACalculateWithTimeFrameGreaterThanSeriesSize() { SampleTimeSeries series = new SampleTimeSeries(new double[] {1d, 2d, 3d, 4d, 5d, 6d}); Indicator<Double> close = new ClosePriceIndicator(series); Indicator<Double> wmaIndicator = new WMAIndicator(close, 55); assertEquals(1d, wmaIndicator.getValue(0)); assertEquals(5d/3, wmaIndicator.getValue(1)); assertEquals(14d/6, wmaIndicator.getValue(2)); assertEquals(30d/10, wmaIndicator.getValue(3)); assertEquals(55d/15, wmaIndicator.getValue(4)); assertEquals(91d/21, wmaIndicator.getValue(5)); } } |
|
From: Thies <tg...@us...> - 2007-10-10 21:50:34
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/indicator/tracker In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20353/src/java/net/sf/tail/indicator/tracker Added Files: WMAIndicator.java Log Message: WMA Indicator e o teste --- NEW FILE: WMAIndicator.java --- package net.sf.tail.indicator.tracker; import net.sf.tail.Indicator; public class WMAIndicator implements Indicator<Double> { private int timeFrame; private Indicator<? extends Number> indicator; public WMAIndicator(Indicator<? extends Number> indicator, int timeFrame) { this.indicator = indicator; this.timeFrame = timeFrame; } public String getName() { return String.format(getClass().getSimpleName() + " timeFrame: %s", timeFrame); } public Double getValue(int index) { if(index == 0) return indicator.getValue(0).doubleValue(); double value = 0; if(index - timeFrame < 0) { for(int i = index + 1; i > 0; i--) { value += i * indicator.getValue(i-1).doubleValue(); } return value / (((index + 1) * (index + 2)) / 2); } int actualIndex = index; for(int i = timeFrame; i > 0; i--) { value += i * indicator.getValue(actualIndex).doubleValue(); actualIndex--; } return value / ((timeFrame * (timeFrame + 1)) / 2); } } |
|
From: Carlos <ma...@us...> - 2007-10-10 21:28:15
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11367/src/java/net/sf/tails/swing/helper Modified Files: FrameHelper.java Log Message: Refatoração de tela para conseguir criar critérios como o versus buy and hold que necessita de outro critério em seu construtor. Index: FrameHelper.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/FrameHelper.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FrameHelper.java 8 Oct 2007 20:01:47 -0000 1.15 --- FrameHelper.java 10 Oct 2007 21:28:10 -0000 1.16 *************** *** 13,16 **** --- 13,18 ---- import java.io.File; import java.io.FileReader; + import java.lang.reflect.Constructor; + import java.lang.reflect.InvocationTargetException; import java.util.ResourceBundle; *************** *** 35,39 **** private static final ResourceBundle classBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Classes"); ! public static String[] getCriteriaFiles() { String analysisCriteria = classBundle.getString("ANALYSIS_CRITERIA"); String[] criteria = analysisCriteria.split(";"); --- 37,41 ---- private static final ResourceBundle classBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Classes"); ! public String[] getCommunCriteria() { String analysisCriteria = classBundle.getString("ANALYSIS_CRITERIA"); String[] criteria = analysisCriteria.split(";"); *************** *** 41,46 **** return criteria; } ! public static String[] getLoaderFiles() { String loaders = classBundle.getString("LOADERS"); String[] loaderArray = loaders.split(";"); --- 43,55 ---- return criteria; } + + public String[] getGenericCriteria() { + String analysisCriteria = classBundle.getString("GENERIC_CRITERIA"); + String[] criteria = analysisCriteria.split(";"); + + return criteria; + } ! public String[] getLoaders() { String loaders = classBundle.getString("LOADERS"); String[] loaderArray = loaders.split(";"); *************** *** 49,55 **** } ! public static AnalysisCriterion getSelectedCriterion(String criterionName) ! throws InstantiationException, IllegalAccessException, ! ClassNotFoundException { Class<?> cls = Class.forName(packageBundle.getString("CRITERIA_PACKAGE") + criterionName); Object object = cls.newInstance(); --- 58,64 ---- } ! public AnalysisCriterion getSelectedCommunCriterion(String criterionName) ! throws InstantiationException, IllegalAccessException, ClassNotFoundException { ! Class<?> cls = Class.forName(packageBundle.getString("CRITERIA_PACKAGE") + criterionName); Object object = cls.newInstance(); *************** *** 60,65 **** return null; } ! public static TimeSeriesLoader getSelectedLoader(String loaderName) throws InstantiationException, IllegalAccessException, ClassNotFoundException { --- 69,90 ---- return null; } + + public AnalysisCriterion getSelectedGenericCriterion(String genericCriterionName, String secondCriterionName) + throws InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, InvocationTargetException, SecurityException, NoSuchMethodException { + + Class<?> cls = Class.forName(packageBundle.getString("CRITERIA_PACKAGE") + secondCriterionName); + Object object = cls.newInstance(); + + Class<?> cls2 = Class.forName(packageBundle.getString("CRITERIA_PACKAGE") + genericCriterionName); + Constructor<?> constructor = cls2.getConstructor(new Class[]{AnalysisCriterion.class}); + Object object2 = constructor.newInstance(object); ! if (object2 instanceof AnalysisCriterion) { ! return (AnalysisCriterion) object2; ! } else ! return null; ! } ! ! public TimeSeriesLoader getSelectedLoader(String loaderName) throws InstantiationException, IllegalAccessException, ClassNotFoundException { *************** *** 73,77 **** } ! public static DateTime getDate(String dateString) throws Exception { String[] split = dateString.split("/"); int day = Integer.parseInt(split[0]); --- 98,102 ---- } ! public DateTime getDate(String dateString) throws Exception { String[] split = dateString.split("/"); int day = Integer.parseInt(split[0]); *************** *** 88,92 **** } ! public static String readFile(String name) throws Exception { BufferedReader in = new BufferedReader(new FileReader(name)); String text = ""; --- 113,117 ---- } ! public String readFile(String name) throws Exception { BufferedReader in = new BufferedReader(new FileReader(name)); String text = ""; *************** *** 98,102 **** } ! private static Object[][] getReportMatrix(StockAnalysis stockAnalysis) { Object[][] reportMatrix = new Object[stockAnalysis.getReports().size()][2+stockAnalysis.getAdditionalCriteria().size()]; --- 123,127 ---- } ! private Object[][] getReportMatrix(StockAnalysis stockAnalysis) { Object[][] reportMatrix = new Object[stockAnalysis.getReports().size()][2+stockAnalysis.getAdditionalCriteria().size()]; *************** *** 116,120 **** } ! private static String[] getColumnNames(StockAnalysis stockAnalysis) { String[] columnNames = new String[2+stockAnalysis.getAdditionalCriteria().size()]; --- 141,145 ---- } ! private String[] getColumnNames(StockAnalysis stockAnalysis) { String[] columnNames = new String[2+stockAnalysis.getAdditionalCriteria().size()]; *************** *** 128,137 **** } ! public static TableModel getTableModel(StockAnalysis stockAnalysis) { return new DefaultTableModel(getReportMatrix(stockAnalysis), getColumnNames(stockAnalysis)); } ! public static String generateStockAnalysisName() { generateFolders(folderBundle.getString("STOCKANALYSIS_DIR")); File[] files = new File(folderBundle.getString("STOCKANALYSIS_DIR")).listFiles(); --- 153,162 ---- } ! public TableModel getTableModel(StockAnalysis stockAnalysis) { return new DefaultTableModel(getReportMatrix(stockAnalysis), getColumnNames(stockAnalysis)); } ! public String generateStockAnalysisName() { generateFolders(folderBundle.getString("STOCKANALYSIS_DIR")); File[] files = new File(folderBundle.getString("STOCKANALYSIS_DIR")).listFiles(); *************** *** 147,151 **** } ! public static String getStockAnalysisPath(){ generateFolders(folderBundle.getString("STOCKANALYSIS_DIR")); File path = new File(folderBundle.getString("STOCKANALYSIS_DIR")); --- 172,176 ---- } ! public String getStockAnalysisPath(){ generateFolders(folderBundle.getString("STOCKANALYSIS_DIR")); File path = new File(folderBundle.getString("STOCKANALYSIS_DIR")); *************** *** 153,160 **** } ! public static void generateFolders(String path) { new File(path).mkdirs(); } } --- 178,196 ---- } ! public void generateFolders(String path) { new File(path).mkdirs(); } + public boolean isGenericCriteria(String criteriaName) + { + for (String generic : getGenericCriteria()) { + if(criteriaName.equals(generic)) + { + return true; + } + } + return false; + } + } |
|
From: Carlos <ma...@us...> - 2007-10-10 21:28:15
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11367/src/java/net/sf/tails/swing/frame/stockAnalysis Modified Files: NewStockAnalysis2.java NewStockAnalysis.java NewStockAnalysis3.java Log Message: Refatoração de tela para conseguir criar critérios como o versus buy and hold que necessita de outro critério em seu construtor. Index: NewStockAnalysis2.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis2.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NewStockAnalysis2.java 8 Oct 2007 19:55:29 -0000 1.4 --- NewStockAnalysis2.java 10 Oct 2007 21:28:09 -0000 1.5 *************** *** 10,13 **** --- 10,14 ---- import java.awt.Dimension; import java.awt.GridLayout; + import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; *************** *** 17,20 **** --- 18,24 ---- import javax.swing.JFrame; import javax.swing.JOptionPane; + import javax.swing.JPanel; + import javax.swing.border.EmptyBorder; + import javax.swing.border.TitledBorder; import net.sf.tail.AnalysisCriterion; *************** *** 32,43 **** private static final long serialVersionUID = 1L; private Stock stock; ! private String[] criteria; private javax.swing.JComboBox analysisComboBox; private javax.swing.JLabel analysisLabel; private javax.swing.JButton cancelButton; private javax.swing.JPanel criterionPanel; private javax.swing.JButton nextButton; private javax.swing.JCheckBox criterionCheckBox; private Index index; public NewStockAnalysis2(Index index, Stock stock) { --- 36,53 ---- private static final long serialVersionUID = 1L; private Stock stock; ! private String[] communCriteria; ! private String[] genericCriteria; ! private String[] allCriteria; private javax.swing.JComboBox analysisComboBox; + private javax.swing.JComboBox secondAnalysisComboBox; private javax.swing.JLabel analysisLabel; + private javax.swing.JLabel secondAnalysisLabel; private javax.swing.JButton cancelButton; private javax.swing.JPanel criterionPanel; + private javax.swing.JPanel communCriterionPanel; private javax.swing.JButton nextButton; private javax.swing.JCheckBox criterionCheckBox; private Index index; + private FrameHelper helper; public NewStockAnalysis2(Index index, Stock stock) { *************** *** 52,61 **** private void initComponents() { nextButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); criterionPanel = new javax.swing.JPanel(); analysisLabel = new javax.swing.JLabel(); analysisComboBox = new javax.swing.JComboBox(); ! criteria = FrameHelper.getCriteriaFiles(); nextButton.setText("Next"); --- 62,85 ---- private void initComponents() { + helper = new FrameHelper(); nextButton = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); criterionPanel = new javax.swing.JPanel(); + communCriterionPanel = new javax.swing.JPanel(); analysisLabel = new javax.swing.JLabel(); + secondAnalysisLabel = new javax.swing.JLabel(); analysisComboBox = new javax.swing.JComboBox(); ! secondAnalysisComboBox = new javax.swing.JComboBox(); ! communCriteria = helper.getCommunCriteria(); ! genericCriteria = helper.getGenericCriteria(); ! allCriteria = new String[communCriteria.length + genericCriteria.length]; ! ! int i = 0; ! for (String criteria : communCriteria) { ! allCriteria[i++] = criteria; ! } ! for (String criteria : genericCriteria) { ! allCriteria[i++] = criteria; ! } nextButton.setText("Next"); *************** *** 74,91 **** criterionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Additional Criteria", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 14))); ! criterionPanel.setLayout(new GridLayout(0, 3, 15, 15)); criterionPanel.setMaximumSize(new Dimension(400, 0)); ! for (String criterionName : criteria) { criterionCheckBox = new javax.swing.JCheckBox(); criterionCheckBox.setText(criterionName); criterionCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); criterionCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! criterionPanel.add(criterionCheckBox); } analysisLabel.setText("Analisys Criterion: "); ! analysisComboBox.setModel(new javax.swing.DefaultComboBoxModel(criteria)); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); --- 98,147 ---- criterionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Additional Criteria", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 14))); ! criterionPanel.setLayout(new GridLayout(0, 1, 15, 15)); criterionPanel.setMaximumSize(new Dimension(400, 0)); ! communCriterionPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder()); ! communCriterionPanel.setLayout(new GridLayout(0, 3, 15, 15)); ! communCriterionPanel.setMaximumSize(new Dimension(400, 0)); ! ! for (String criterionName : communCriteria) { criterionCheckBox = new javax.swing.JCheckBox(); criterionCheckBox.setText(criterionName); criterionCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); criterionCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! communCriterionPanel.add(criterionCheckBox); ! } ! ! criterionPanel.add(communCriterionPanel); ! ! for (String criteriaName : genericCriteria) { ! javax.swing.JPanel genericCriterionPanel = new javax.swing.JPanel(); ! genericCriterionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), criteriaName, javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12))); ! genericCriterionPanel.setLayout(new GridLayout(0, 3, 15, 15)); ! genericCriterionPanel.setMaximumSize(new Dimension(400, 0)); ! ! for (String criterionName : communCriteria) { ! criterionCheckBox = new javax.swing.JCheckBox(); ! criterionCheckBox.setText(criterionName); ! criterionCheckBox.setFont(new java.awt.Font("Dialog", 0, 12)); ! criterionCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); ! criterionCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); ! genericCriterionPanel.add(criterionCheckBox); ! } ! ! criterionPanel.add(genericCriterionPanel); } analysisLabel.setText("Analisys Criterion: "); + secondAnalysisLabel.setText(" of: "); ! analysisComboBox.setModel(new javax.swing.DefaultComboBoxModel(allCriteria)); ! analysisComboBox.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! analysisComboBoxActionPerformed(evt); ! } ! }); ! secondAnalysisComboBox.setModel(new javax.swing.DefaultComboBoxModel(communCriteria)); ! analysisComboBoxActionPerformed(null); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); *************** *** 96,102 **** .addGap(37, 37, 37) .addComponent(analysisLabel) ! .addGap(30, 30, 30) .addComponent(analysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addContainerGap(364, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGap(227, 227, 227) --- 152,161 ---- .addGap(37, 37, 37) .addComponent(analysisLabel) ! .addGap(20, 20, 20) .addComponent(analysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addGap(20, 20, 20) ! .addComponent(secondAnalysisLabel) ! .addGap(20, 20, 20) ! .addComponent(secondAnalysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(227, 227, 227) *************** *** 116,120 **** .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(analysisLabel) ! .addComponent(analysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) --- 175,181 ---- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(analysisLabel) ! .addComponent(analysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ! .addComponent(secondAnalysisLabel) ! .addComponent(secondAnalysisComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(16, 16, 16) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) *************** *** 129,133 **** } ! private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } --- 190,207 ---- } ! protected void analysisComboBoxActionPerformed(ActionEvent evt) { ! if(helper.isGenericCriteria(analysisComboBox.getSelectedItem().toString())) ! { ! secondAnalysisComboBox.setVisible(true); ! secondAnalysisLabel.setVisible(true); ! } ! else ! { ! secondAnalysisComboBox.setVisible(false); ! secondAnalysisLabel.setVisible(false); ! } ! } ! ! private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } *************** *** 135,164 **** private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) { AnalysisCriterion selectedCriterion = null; try { ! selectedCriterion = FrameHelper.getSelectedCriterion(analysisComboBox.getSelectedItem().toString()); } catch (Exception e) { ! JOptionPane.showMessageDialog(null, analysisComboBox.getSelectedItem().toString() + " " + messageBundle.getString("SELECTED_CRITERION"), "Error", 0); } List<AnalysisCriterion> additionalCriteria = new ArrayList<AnalysisCriterion>(); ! for (Component component : criterionPanel.getComponents()) { ! if (component instanceof JCheckBox) { ! JCheckBox checkBox = (JCheckBox) component; ! ! if (checkBox.isSelected()) ! { ! AnalysisCriterion criterion = null; ! try { ! criterion = FrameHelper.getSelectedCriterion(checkBox.getText()); ! } catch (Exception e) { ! JOptionPane.showMessageDialog(null, checkBox.getText() + " " + messageBundle.getString("SELECTED_CRITERIA"), "Error", 2); ! } ! ! if (criterion != null) ! { ! additionalCriteria.add(criterion); ! } ! } ! } ! } if (selectedCriterion == null) { --- 209,280 ---- private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) { AnalysisCriterion selectedCriterion = null; + String selectedCriterionName = analysisComboBox.getSelectedItem().toString(); try { ! if (helper.isGenericCriteria(selectedCriterionName)) ! { ! selectedCriterion = helper.getSelectedGenericCriterion(selectedCriterionName, secondAnalysisComboBox.getSelectedItem().toString()); ! } ! else ! { ! selectedCriterion = helper.getSelectedCommunCriterion(selectedCriterionName); ! } } catch (Exception e) { ! JOptionPane.showMessageDialog(null, selectedCriterionName + " " + messageBundle.getString("SELECTED_CRITERION"), "Error", 0); } List<AnalysisCriterion> additionalCriteria = new ArrayList<AnalysisCriterion>(); ! for (Component panelComponent : criterionPanel.getComponents()) ! { ! if (panelComponent instanceof JPanel) { ! JPanel panel = (JPanel)panelComponent; ! if (panel.getBorder() instanceof EmptyBorder) ! { ! for (Component component : panel.getComponents()) ! { ! if (component instanceof JCheckBox) ! { ! JCheckBox checkBox = (JCheckBox) component; ! if (checkBox.isSelected()) ! { ! AnalysisCriterion criterion = null; ! try { ! criterion = helper.getSelectedCommunCriterion(checkBox.getText()); ! } catch (Exception e) { ! JOptionPane.showMessageDialog(null, checkBox.getText() + " " + messageBundle.getString("SELECTED_CRITERIA"), "Error", 2); ! } ! ! if (criterion != null) ! { ! additionalCriteria.add(criterion); ! } ! } ! } ! } ! } ! else ! { ! for (Component component : panel.getComponents()) ! { ! if (component instanceof JCheckBox) ! { ! JCheckBox checkBox = (JCheckBox) component; ! if (checkBox.isSelected()) ! { ! AnalysisCriterion criterion = null; ! try { ! criterion = helper.getSelectedGenericCriterion(((TitledBorder)panel.getBorder()).getTitle(), checkBox.getText()); ! } catch (Exception e) { ! JOptionPane.showMessageDialog(null, checkBox.getText() + " " + messageBundle.getString("SELECTED_CRITERIA"), "Error", 2); ! } ! ! if (criterion != null) ! { ! additionalCriteria.add(criterion); ! } ! } ! } ! } ! } ! } ! } if (selectedCriterion == null) { Index: NewStockAnalysis.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NewStockAnalysis.java 8 Oct 2007 20:00:25 -0000 1.5 --- NewStockAnalysis.java 10 Oct 2007 21:28:10 -0000 1.6 *************** *** 55,58 **** --- 55,59 ---- private javax.swing.JPanel stockPanel; private Index index; + private FrameHelper helper; public NewStockAnalysis(Index index) { *************** *** 66,69 **** --- 67,71 ---- private void initComponents() { + helper = new FrameHelper(); stockFileChooser = new javax.swing.JFileChooser(); stockButtonGroup = new javax.swing.ButtonGroup(); *************** *** 139,143 **** seriesFormatLabel.setText("Series Format: "); ! seriesFormatComboBox.setModel(new javax.swing.DefaultComboBoxModel(FrameHelper.getLoaderFiles())); javax.swing.GroupLayout stockPanelLayout = new javax.swing.GroupLayout(stockPanel); --- 141,145 ---- seriesFormatLabel.setText("Series Format: "); ! seriesFormatComboBox.setModel(new javax.swing.DefaultComboBoxModel(helper.getLoaders())); javax.swing.GroupLayout stockPanelLayout = new javax.swing.GroupLayout(stockPanel); *************** *** 289,294 **** { try { ! FrameHelper.generateFolders(folderBundle.getString("STOCK_DIR")); ! stock = new Stock(stockNameField.getText(), seriesField.getText(), FrameHelper.getSelectedLoader(seriesFormatComboBox.getSelectedItem().toString())); String xmlFile = stockSerializer.toXML(stock); String filePath = folderBundle.getString("STOCK_DIR") + "/" + stockNameField.getText(); --- 291,296 ---- { try { ! helper.generateFolders(folderBundle.getString("STOCK_DIR")); ! stock = new Stock(stockNameField.getText(), seriesField.getText(), helper.getSelectedLoader(seriesFormatComboBox.getSelectedItem().toString())); String xmlFile = stockSerializer.toXML(stock); String filePath = folderBundle.getString("STOCK_DIR") + "/" + stockNameField.getText(); *************** *** 320,324 **** { try { ! stock = stockSerializer.fromXML(FrameHelper.readFile(stockField.getText())); new NewStockAnalysis2(index, stock).setVisible(true); --- 322,326 ---- { try { ! stock = stockSerializer.fromXML(helper.readFile(stockField.getText())); new NewStockAnalysis2(index, stock).setVisible(true); Index: NewStockAnalysis3.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/stockAnalysis/NewStockAnalysis3.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NewStockAnalysis3.java 8 Oct 2007 19:55:29 -0000 1.5 --- NewStockAnalysis3.java 10 Oct 2007 21:28:10 -0000 1.6 *************** *** 61,65 **** private javax.swing.JTextField slicesNumberField; private javax.swing.JLabel slicesNumberLabel; ! private Index index; public NewStockAnalysis3(Index index, Stock stock, AnalysisCriterion selectedCriterion, List<AnalysisCriterion> additionalCriteria) { --- 61,66 ---- private javax.swing.JTextField slicesNumberField; private javax.swing.JLabel slicesNumberLabel; ! private Index index; ! private FrameHelper helper; public NewStockAnalysis3(Index index, Stock stock, AnalysisCriterion selectedCriterion, List<AnalysisCriterion> additionalCriteria) { *************** *** 76,79 **** --- 77,81 ---- private void initComponents() { + helper = new FrameHelper(); slicesPeriodPanel = new javax.swing.JPanel(); yearsLabel = new javax.swing.JLabel(); *************** *** 297,301 **** DateTime startDate; try { ! startDate = FrameHelper.getDate(startDateField.getText()); } catch (Exception e) { JOptionPane.showMessageDialog(null, messageBundle.getString("START_DATE"), "Error", 2); --- 299,303 ---- DateTime startDate; try { ! startDate = helper.getDate(startDateField.getText()); } catch (Exception e) { JOptionPane.showMessageDialog(null, messageBundle.getString("START_DATE"), "Error", 2); |