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: Márcio V. d. S. <mv...@us...> - 2007-10-24 21:30:08
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26011/src/java/net/sf/tails/swing/frame/report Modified Files: NewReportFrame.java Log Message: dsl improving Index: NewReportFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/report/NewReportFrame.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NewReportFrame.java 22 Oct 2007 18:10:46 -0000 1.23 --- NewReportFrame.java 24 Oct 2007 21:30:09 -0000 1.24 *************** *** 2,7 **** import java.awt.Dimension; ! import java.awt.event.KeyEvent; ! import java.awt.event.KeyListener; import java.util.ResourceBundle; import java.util.Scanner; --- 2,12 ---- import java.awt.Dimension; ! import java.awt.event.ActionEvent; ! import java.io.BufferedOutputStream; ! import java.io.File; ! import java.io.FileNotFoundException; ! import java.io.FileOutputStream; ! import java.io.OutputStream; ! import java.io.PrintWriter; import java.util.ResourceBundle; import java.util.Scanner; *************** *** 9,14 **** --- 14,22 ---- import javax.script.ScriptException; + import javax.swing.ImageIcon; + import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; + import javax.swing.ScrollPaneConstants; import net.sf.tail.Strategy; *************** *** 17,23 **** --- 25,33 ---- import net.sf.tail.dsl.ruby.RubyDSL; import net.sf.tails.dsl.TailSTokenMarker; + import net.sf.tails.swing.component.TailButton; import net.sf.tails.swing.frame.Index; import net.sf.tails.swing.helper.DefaultStrategiesGenerator; import net.sf.tails.swing.helper.EnumIndicator; + import net.sf.tails.swing.helper.FrameHelper; import org.gjt.sp.jedit.syntax.JEditTextArea; *************** *** 28,37 **** */ public class NewReportFrame extends javax.swing.JFrame { ! 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; private javax.swing.ButtonGroup indicatorsButtonGroup; private javax.swing.JButton customStrategyCreateButton; --- 38,48 ---- */ public class NewReportFrame extends javax.swing.JFrame { ! 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 indicatorBundle = ResourceBundle.getBundle("net.sf.tails.i18n.IndicatorDescription"); private static final long serialVersionUID = 4704921929974302846L; + private FrameHelper helper; + private javax.swing.JFileChooser directoryFileChooser; private javax.swing.ButtonGroup indicatorsButtonGroup; private javax.swing.JButton customStrategyCreateButton; *************** *** 39,42 **** --- 50,55 ---- private javax.swing.JButton createButtonDefaultPanel; private javax.swing.JButton cancelButtonDefaultPanel; + private TailButton openScriptButton; + private TailButton saveScriptButton; private javax.swing.JPanel customReportPanel; private javax.swing.JPanel defaultReportPanel; *************** *** 63,66 **** --- 76,80 ---- initComponents(); this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.setSize(800, 600); this.setResizable(false); this.setLocationByPlatform(true); *************** *** 69,72 **** --- 83,89 ---- private void initComponents() { + ResourceBundle iconBundle = ResourceBundle.getBundle("net.sf.tails.i18n.icons"); + + helper = new FrameHelper(); indicatorsButtonGroup = new javax.swing.ButtonGroup(); newReportTabbedPane = new javax.swing.JTabbedPane(); *************** *** 88,91 **** --- 105,134 ---- reportNameField = new javax.swing.JTextField(); reportNameLabel = new javax.swing.JLabel(); + saveScriptButton = new TailButton(new ImageIcon(iconBundle.getString("SAVE"))); + openScriptButton = new TailButton(new ImageIcon(iconBundle.getString("OPEN"))); + directoryFileChooser = new javax.swing.JFileChooser(); + + saveScriptButton.setToolTipText("Save Script as..."); + saveScriptButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + saveScriptButtonItemActionPerformed(evt); + } + }); + + openScriptButton.setToolTipText("Open Script..."); + openScriptButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + openScriptButtonItemActionPerformed(evt); + } + }); + + customStrategyTextArea.getPainter().setInvalidLinesPainted(false); + customStrategyTextArea.getPainter().setEOLMarkersPainted(false); + + directoryFileChooser.setFileSelectionMode(javax.swing.JFileChooser.FILES_ONLY); + + + helper.generateFolders(folderBundle.getString("SCRIPTS_DIR")); + directoryFileChooser.setCurrentDirectory(new File(folderBundle.getString("SCRIPTS_DIR"))); reportNameLabel.setText("Report Name: "); *************** *** 94,114 **** createButtonDefaultPanel.setText("Create"); ! createButtonDefaultPanel ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCreateButtonActionPerformed(evt); ! } ! }); cancelButtonDefaultPanel.setText("Cancel"); ! cancelButtonDefaultPanel ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCancelButtonActionPerformed(evt); ! } ! }); ! radioGroupScrollPane ! .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); indicatorsButtonGroup.add(radioButtonSMA); indicatorsButtonGroup.add(radioButtonEMA); --- 137,154 ---- createButtonDefaultPanel.setText("Create"); ! createButtonDefaultPanel.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCreateButtonActionPerformed(evt); ! } ! }); cancelButtonDefaultPanel.setText("Cancel"); ! cancelButtonDefaultPanel.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! defaultPanelCancelButtonActionPerformed(evt); ! } ! }); ! radioGroupScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); indicatorsButtonGroup.add(radioButtonSMA); indicatorsButtonGroup.add(radioButtonEMA); *************** *** 116,120 **** indicatorsButtonGroup.add(radioButtonBollingerBands); indicatorsButtonGroup.add(radioButtonParabolicSAR); ! radioButtonSMA.setText("SMA - " + indicatorBundle.getString("SMAIndicator")); radioButtonSMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); --- 156,160 ---- indicatorsButtonGroup.add(radioButtonBollingerBands); indicatorsButtonGroup.add(radioButtonParabolicSAR); ! radioButtonSMA.setText("SMA - " + indicatorBundle.getString("SMAIndicator")); radioButtonSMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); *************** *** 124,128 **** } }); ! radioButtonEMA.setText("EMA - " + indicatorBundle.getString("EMAIndicator")); radioButtonEMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); --- 164,168 ---- } }); ! radioButtonEMA.setText("EMA - " + indicatorBundle.getString("EMAIndicator")); radioButtonEMA.setMargin(new java.awt.Insets(0, 0, 0, 0)); *************** *** 132,136 **** } }); ! radioButtonRSI.setText("RSI - " + indicatorBundle.getString("RSIIndicator")); radioButtonRSI.setMargin(new java.awt.Insets(0, 0, 0, 0)); --- 172,176 ---- } }); ! radioButtonRSI.setText("RSI - " + indicatorBundle.getString("RSIIndicator")); radioButtonRSI.setMargin(new java.awt.Insets(0, 0, 0, 0)); *************** *** 140,144 **** } }); ! radioButtonBollingerBands.setText("Bollinger Bands - " + indicatorBundle.getString("BollingerBandsIndicator")); radioButtonBollingerBands.setMargin(new java.awt.Insets(0, 0, 0, 0)); --- 180,184 ---- } }); ! radioButtonBollingerBands.setText("Bollinger Bands - " + indicatorBundle.getString("BollingerBandsIndicator")); radioButtonBollingerBands.setMargin(new java.awt.Insets(0, 0, 0, 0)); *************** *** 148,152 **** } }); ! radioButtonParabolicSAR.setText("Parabolic SAR - " + indicatorBundle.getString("ParabolicSarIndicator")); radioButtonParabolicSAR.setMargin(new java.awt.Insets(0, 0, 0, 0)); --- 188,192 ---- } }); ! radioButtonParabolicSAR.setText("Parabolic SAR - " + indicatorBundle.getString("ParabolicSarIndicator")); radioButtonParabolicSAR.setMargin(new java.awt.Insets(0, 0, 0, 0)); *************** *** 156,424 **** } }); ! ! javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout( ! radioGroupPanel); radioGroupPanel.setLayout(radioGroupPanelLayout); ! radioGroupPanelLayout ! .setHorizontalGroup(radioGroupPanelLayout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! radioGroupPanelLayout ! .createParallelGroup( ! 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 ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! 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, ! 82, Short.MAX_VALUE) ! .addContainerGap())); radioGroupScrollPane.setViewportView(radioGroupPanel); ! javax.swing.GroupLayout defaultTabPanel = new javax.swing.GroupLayout( ! defaultReportPanel); defaultReportPanel.setLayout(defaultTabPanel); ! defaultTabPanel ! .setHorizontalGroup(defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! defaultTabPanel ! .createSequentialGroup() ! .addGap(12) ! .addGroup( ! defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel ! .createSequentialGroup() ! .addComponent( ! cancelButtonDefaultPanel) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent( ! createButtonDefaultPanel)) ! .addComponent( ! radioGroupScrollPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 385, ! Short.MAX_VALUE)) ! .addContainerGap())); defaultTabPanel.linkSize(javax.swing.SwingConstants.HORIZONTAL, ! new java.awt.Component[] { createButtonDefaultPanel, ! cancelButtonDefaultPanel }); ! defaultTabPanel ! .setVerticalGroup(defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel ! .createSequentialGroup() ! .addGap(12) ! .addComponent( ! radioGroupScrollPane, ! javax.swing.GroupLayout.PREFERRED_SIZE, ! 251, ! javax.swing.GroupLayout.PREFERRED_SIZE) ! .addGap(6) ! .addGroup( ! defaultTabPanel ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent( ! createButtonDefaultPanel) ! .addComponent( ! cancelButtonDefaultPanel)))); newReportTabbedPane.addTab("Default Report", defaultReportPanel); customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); ! customStrategyTextArea.addKeyListener(new KeyListener() { ! @Override ! public void keyPressed(KeyEvent e) { ! textAreaTextChanged(e); ! } ! ! @Override ! public void keyReleased(KeyEvent e) { ! } ! ! @Override ! public void keyTyped(KeyEvent e) { ! } ! }); customStrategyPane.setViewportView(customStrategyTextArea); customStrategyCreateButton.setText("Create"); ! customStrategyCreateButton ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCreateButtonActionPerformed(evt); ! } ! }); customStrategyCancelButton.setText("Cancel"); ! customStrategyCancelButton ! .addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCancelButtonActionPerformed(evt); ! } ! }); ! javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout( ! customReportPanel); customReportPanel.setLayout(jPanel1Layout); ! jPanel1Layout ! .setHorizontalGroup(jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! jPanel1Layout ! .createSequentialGroup() ! .addContainerGap() .addGroup( ! jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addComponent( ! customStrategyPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 375, ! Short.MAX_VALUE) ! .addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! jPanel1Layout ! .createSequentialGroup() ! .addComponent( ! customStrategyCancelButton) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addComponent( ! customStrategyCreateButton))) ! .addContainerGap())); ! jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, ! new java.awt.Component[] { customStrategyCreateButton, ! customStrategyCancelButton }); ! jPanel1Layout ! .setVerticalGroup(jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING) ! .addGroup( ! jPanel1Layout ! .createSequentialGroup() ! .addContainerGap() ! .addComponent( ! customStrategyPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, ! 251, Short.MAX_VALUE) ! .addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED) ! .addGroup( ! jPanel1Layout ! .createParallelGroup( ! javax.swing.GroupLayout.Alignment.BASELINE) ! .addComponent( ! customStrategyCreateButton) ! .addComponent( ! customStrategyCancelButton)) ! .addGap(18))); newReportTabbedPane.addTab("Custom Report", customReportPanel); ! newReportTabbedPane.getAccessibleContext().setAccessibleName( ! "Default Report"); ! javax.swing.GroupLayout layout = new javax.swing.GroupLayout( ! getContentPane()); getContentPane().setLayout(layout); ! layout.setHorizontalGroup(layout.createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameLabel).addComponent(reportNameField)) ! .addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! newReportTabbedPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, 400, ! Short.MAX_VALUE).addGap(10))); ! layout.setVerticalGroup(layout.createParallelGroup( ! javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameLabel).addGap(10).addContainerGap() ! .addComponent(newReportTabbedPane, ! javax.swing.GroupLayout.DEFAULT_SIZE, 327, ! Short.MAX_VALUE).addGap(10)).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent( ! reportNameField))); pack(); } ! private void textAreaTextChanged(KeyEvent keyEvent) { ! if(keyEvent.isControlDown() == true){ ! switch (keyEvent.getKeyCode()) { ! case KeyEvent.VK_SPACE: ! ! //new AutoCompleteForm(customStrategyTextArea).setVisible(true); ! break; ! default: ! break; } } ! //customStrategyTextArea.paste(); } ! private void defaultPanelCreateButtonActionPerformed( ! java.awt.event.ActionEvent evt) { DefaultStrategiesGenerator defaulStrategies = new DefaultStrategiesGenerator(); ! Set<Strategy> strategies = defaulStrategies.generate(stockAnalysis ! .getStock(), selectedEnum, 4, 60); // TODO: Acertas os parametros assim que a tela for finalizada stockAnalysis.addReport(reportNameField.getText(), strategies); --- 196,383 ---- } }); ! ! javax.swing.GroupLayout radioGroupPanelLayout = new javax.swing.GroupLayout(radioGroupPanel); radioGroupPanel.setLayout(radioGroupPanelLayout); ! radioGroupPanelLayout.setHorizontalGroup(radioGroupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! radioGroupPanelLayout.createParallelGroup(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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! 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, 82, ! Short.MAX_VALUE).addContainerGap())); radioGroupScrollPane.setViewportView(radioGroupPanel); ! javax.swing.GroupLayout defaultTabPanel = new javax.swing.GroupLayout(defaultReportPanel); defaultReportPanel.setLayout(defaultTabPanel); ! defaultTabPanel.setHorizontalGroup(defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! defaultTabPanel.createSequentialGroup().addGap(12).addGroup( ! defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel.createSequentialGroup().addComponent(cancelButtonDefaultPanel).addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(createButtonDefaultPanel)).addComponent( ! radioGroupScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 385, Short.MAX_VALUE)).addContainerGap())); defaultTabPanel.linkSize(javax.swing.SwingConstants.HORIZONTAL, ! new java.awt.Component[] { createButtonDefaultPanel, cancelButtonDefaultPanel }); ! defaultTabPanel.setVerticalGroup(defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! defaultTabPanel.createSequentialGroup().addGap(12).addComponent(radioGroupScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 251, ! javax.swing.GroupLayout.PREFERRED_SIZE).addGap(6).addGroup( ! defaultTabPanel.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(createButtonDefaultPanel) ! .addComponent(cancelButtonDefaultPanel)))); newReportTabbedPane.addTab("Default Report", defaultReportPanel); customStrategyTextArea.setTokenMarker(new TailSTokenMarker()); ! // customStrategyTextArea.addKeyListener(new KeyListener() { ! // @Override ! // public void keyPressed(KeyEvent e) { ! // textAreaTextChanged(e); ! // } ! // ! // @Override ! // public void keyReleased(KeyEvent e) { ! // } ! // ! // @Override ! // public void keyTyped(KeyEvent e) { ! // } ! // }); customStrategyPane.setViewportView(customStrategyTextArea); + customStrategyPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + customStrategyPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); customStrategyCreateButton.setText("Create"); ! customStrategyCreateButton.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCreateButtonActionPerformed(evt); ! } ! }); customStrategyCancelButton.setText("Cancel"); ! customStrategyCancelButton.addActionListener(new java.awt.event.ActionListener() { ! public void actionPerformed(java.awt.event.ActionEvent evt) { ! customStrategyCancelButtonActionPerformed(evt); ! } ! }); ! javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(customReportPanel); customReportPanel.setLayout(jPanel1Layout); ! jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! jPanel1Layout.createSequentialGroup().addContainerGap().addGroup( ! jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! jPanel1Layout.createParallelGroup().addComponent(customStrategyPane, javax.swing.GroupLayout.DEFAULT_SIZE, 375, ! Short.MAX_VALUE) .addGroup( ! jPanel1Layout.createSequentialGroup().addComponent(saveScriptButton).addGap(4).addComponent( ! openScriptButton))).addGroup( ! javax.swing.GroupLayout.Alignment.TRAILING, ! jPanel1Layout.createSequentialGroup().addComponent(customStrategyCancelButton).addPreferredGap( ! javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(customStrategyCreateButton))) ! .addContainerGap())); ! jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] { customStrategyCreateButton, ! customStrategyCancelButton }); ! jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup().addGap(10).addGroup( ! jPanel1Layout.createParallelGroup().addComponent(openScriptButton).addComponent(saveScriptButton)).addGap(7).addGroup( ! jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(customStrategyPane, javax.swing.GroupLayout.DEFAULT_SIZE, 251, ! Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup( ! jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(customStrategyCreateButton) ! .addComponent(customStrategyCancelButton)).addGap(18))); newReportTabbedPane.addTab("Custom Report", customReportPanel); ! newReportTabbedPane.getAccessibleContext().setAccessibleName("Default Report"); ! javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); ! layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent(reportNameLabel).addComponent(reportNameField)).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent(newReportTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, ! Short.MAX_VALUE).addGap(10))); ! layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent(reportNameLabel).addGap(10).addContainerGap().addComponent( ! newReportTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE).addGap(10)).addGroup( ! layout.createSequentialGroup().addGap(10).addComponent(reportNameField))); pack(); } ! protected void openScriptButtonItemActionPerformed(ActionEvent evt) { ! int value = directoryFileChooser.showOpenDialog(this); ! switch (value) { ! case JFileChooser.APPROVE_OPTION: ! String filePath = directoryFileChooser.getSelectedFile().getAbsolutePath(); ! try { ! String script = helper.readLinedFile(filePath); ! ! customStrategyTextArea.setText(script); ! ! ! } catch (Exception e) { ! e.printStackTrace(); ! System.out.println(e.getMessage()); ! return; } + break; } ! } ! protected void saveScriptButtonItemActionPerformed(ActionEvent evt) { ! int value = directoryFileChooser.showSaveDialog(this); ! switch(value) ! { ! case JFileChooser.APPROVE_OPTION: ! String filePath = directoryFileChooser.getSelectedFile().getAbsolutePath(); ! if(!filePath.endsWith(".rb")) ! { ! filePath += ".rb"; ! } ! File scriptFile = new File(filePath); ! OutputStream out; ! try { ! out = new BufferedOutputStream(new FileOutputStream(scriptFile)); ! } catch (FileNotFoundException e) { ! return; ! } ! PrintWriter write = new PrintWriter(out); ! for (int i = 0; i < customStrategyTextArea.getLineCount(); i++) { ! write.println(customStrategyTextArea.getLineText(i)); ! } ! write.close(); ! break; ! } ! ! ! } ! ! // private void textAreaTextChanged(KeyEvent keyEvent) { ! // if (keyEvent.isControlDown() == true) { ! // switch (keyEvent.getKeyCode()) { ! // case KeyEvent.VK_SPACE: ! // ! // // new ! // // AutoCompleteForm(customStrategyTextArea).setVisible(true); ! // break; ! // ! // default: ! // break; ! // } ! // } ! // // customStrategyTextArea.paste(); ! // } ! ! private void defaultPanelCreateButtonActionPerformed(java.awt.event.ActionEvent evt) { DefaultStrategiesGenerator defaulStrategies = new DefaultStrategiesGenerator(); ! Set<Strategy> strategies = defaulStrategies.generate(stockAnalysis.getStock(), selectedEnum, 4, 60); // TODO: Acertas os parametros assim que a tela for finalizada stockAnalysis.addReport(reportNameField.getText(), strategies); *************** *** 428,438 **** } ! private void defaultPanelCancelButtonActionPerformed( ! java.awt.event.ActionEvent evt) { this.dispose(); } ! private void customStrategyCreateButtonActionPerformed( ! java.awt.event.ActionEvent evt) { try { --- 387,395 ---- } ! private void defaultPanelCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } ! private void customStrategyCreateButtonActionPerformed(java.awt.event.ActionEvent evt) { try { *************** *** 442,447 **** dsl = new RubyDSL(dslHeader, stockAnalysis.getStock()); } catch (Exception e) { ! JOptionPane.showMessageDialog(null, ! "File not found: rubyDSLutils.rb .", "Error", 2); } Set<Strategy> strategies; --- 399,403 ---- dsl = new RubyDSL(dslHeader, stockAnalysis.getStock()); } catch (Exception e) { ! JOptionPane.showMessageDialog(null, "File not found: rubyDSLutils.rb .", "Error", 2); } Set<Strategy> strategies; *************** *** 459,464 **** private static String read(String name) { String text = ""; ! Scanner scanner = new Scanner(NewReportFrame.class ! .getResourceAsStream(name)); while (scanner.hasNextLine()) { text += scanner.nextLine() + "\n"; --- 415,419 ---- private static String read(String name) { String text = ""; ! Scanner scanner = new Scanner(NewReportFrame.class.getResourceAsStream(name)); while (scanner.hasNextLine()) { text += scanner.nextLine() + "\n"; *************** *** 467,472 **** } ! private void customStrategyCancelButtonActionPerformed( ! java.awt.event.ActionEvent evt) { this.dispose(); } --- 422,426 ---- } ! private void customStrategyCancelButtonActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 21:30:08
|
Update of /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit/syntax In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26011/src/java/org/gjt/sp/jedit/syntax Modified Files: JEditTextArea.java Log Message: dsl improving Index: JEditTextArea.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/org/gjt/sp/jedit/syntax/JEditTextArea.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JEditTextArea.java 10 Oct 2007 22:00:48 -0000 1.1 --- JEditTextArea.java 24 Oct 2007 21:30:09 -0000 1.2 *************** *** 32,36 **** import java.awt.event.InputEvent; import java.awt.event.KeyEvent; - import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; --- 32,35 ---- *************** *** 127,135 **** blink = true; // Initialize the GUI setLayout(new ScrollLayout()); add(CENTER,painter); ! add(RIGHT,vertical = new JScrollBar(JScrollBar.VERTICAL)); ! add(BOTTOM,horizontal = new JScrollBar(JScrollBar.HORIZONTAL)); // Add some event listeners --- 126,138 ---- blink = true; + vertical = new JScrollBar(JScrollBar.VERTICAL); + horizontal = new JScrollBar(JScrollBar.HORIZONTAL); + // Initialize the GUI setLayout(new ScrollLayout()); add(CENTER,painter); ! //add(RIGHT,vertical); ! //add(BOTTOM,horizontal); ! // Add some event listeners *************** *** 139,158 **** painter.addMouseListener(new MouseHandler()); painter.addMouseMotionListener(new DragHandler()); - painter.addKeyListener(new KeyListener(){ - public void keyPressed(KeyEvent e) { - System.out.println("cfoemvoemvo"); - - } - public void keyReleased(KeyEvent e) { - System.out.println("cfoemvoemvo"); - - } - - public void keyTyped(KeyEvent e) { - System.out.println("cfoemvoemvo"); - - } - - }); addFocusListener(new FocusHandler()); --- 142,145 ---- *************** *** 300,304 **** horizontal.setValues(-horizontalOffset,width,0,width * 5); horizontal.setUnitIncrement(painter.getFontMetrics() ! .charWidth('w')); horizontal.setBlockIncrement(width / 2); } --- 287,291 ---- horizontal.setValues(-horizontalOffset,width,0,width * 5); horizontal.setUnitIncrement(painter.getFontMetrics() ! .charWidth('w')); horizontal.setBlockIncrement(width / 2); } *************** *** 421,425 **** int lineStart = getLineStartOffset(line); int offset = Math.max(0,Math.min(getLineLength(line) - 1, ! getCaretPosition() - lineStart)); return scrollTo(line,offset); --- 408,412 ---- int lineStart = getLineStartOffset(line); int offset = Math.max(0,Math.min(getLineLength(line) - 1, ! getCaretPosition() - lineStart)); return scrollTo(line,offset); *************** *** 467,476 **** { newHorizontalOffset = Math.min(0,horizontalOffset ! - x + width + 5); } else if(x + width >= painter.getWidth()) { newHorizontalOffset = horizontalOffset + ! (painter.getWidth() - x) - width - 5; } --- 454,463 ---- { newHorizontalOffset = Math.min(0,horizontalOffset ! - x + width + 5); } else if(x + width >= painter.getWidth()) { newHorizontalOffset = horizontalOffset + ! (painter.getWidth() - x) - width - 5; } *************** *** 486,490 **** FontMetrics fm = painter.getFontMetrics(); return (line - firstLine) * fm.getHeight() ! - (fm.getLeading() + fm.getMaxDescent()); } --- 473,477 ---- FontMetrics fm = painter.getFontMetrics(); return (line - firstLine) * fm.getHeight() ! - (fm.getLeading() + fm.getMaxDescent()); } *************** *** 498,502 **** int height = fm.getHeight(); return Math.max(0,Math.min(getLineCount() - 1, ! y / height + firstLine)); } --- 485,489 ---- int height = fm.getHeight(); return Math.max(0,Math.min(getLineCount() - 1, ! y / height + firstLine)); } *************** *** 538,542 **** lineSegment.count = offset; return x + Utilities.getTabbedTextWidth(lineSegment, ! fm,x,painter,0); } /* If syntax coloring is enabled, we have to do this because --- 525,529 ---- lineSegment.count = offset; return x + Utilities.getTabbedTextWidth(lineSegment, ! fm,x,painter,0); } /* If syntax coloring is enabled, we have to do this because *************** *** 546,550 **** Token tokens; if(painter.currentLineIndex == line ! && painter.currentLineTokens != null) tokens = painter.currentLineTokens; else --- 533,537 ---- Token tokens; if(painter.currentLineIndex == line ! && painter.currentLineTokens != null) tokens = painter.currentLineTokens; else *************** *** 552,556 **** painter.currentLineIndex = line; tokens = painter.currentLineTokens ! = tokenMarker.markTokens(lineSegment,line); } --- 539,543 ---- painter.currentLineIndex = line; tokens = painter.currentLineTokens ! = tokenMarker.markTokens(lineSegment,line); } *************** *** 579,583 **** lineSegment.count = offset - (lineSegment.offset - segmentOffset); return x + Utilities.getTabbedTextWidth( ! lineSegment,fm,x,painter,0); } else --- 566,570 ---- lineSegment.count = offset - (lineSegment.offset - segmentOffset); return x + Utilities.getTabbedTextWidth( ! lineSegment,fm,x,painter,0); } else *************** *** 585,589 **** lineSegment.count = length; x += Utilities.getTabbedTextWidth( ! lineSegment,fm,x,painter,0); lineSegment.offset += length; } --- 572,576 ---- lineSegment.count = length; x += Utilities.getTabbedTextWidth( ! lineSegment,fm,x,painter,0); lineSegment.offset += length; } *************** *** 621,625 **** if(c == '\t') charWidth = (int)painter.nextTabStop(width,i) ! - width; else charWidth = fm.charWidth(c); --- 608,612 ---- if(c == '\t') charWidth = (int)painter.nextTabStop(width,i) ! - width; else charWidth = fm.charWidth(c); *************** *** 645,649 **** Token tokens; if(painter.currentLineIndex == line && painter ! .currentLineTokens != null) tokens = painter.currentLineTokens; else --- 632,636 ---- Token tokens; if(painter.currentLineIndex == line && painter ! .currentLineTokens != null) tokens = painter.currentLineTokens; else *************** *** 651,655 **** painter.currentLineIndex = line; tokens = painter.currentLineTokens ! = tokenMarker.markTokens(lineSegment,line); } --- 638,642 ---- painter.currentLineIndex = line; tokens = painter.currentLineTokens ! = tokenMarker.markTokens(lineSegment,line); } *************** *** 679,683 **** if(c == '\t') charWidth = (int)painter.nextTabStop(width,offset + i) ! - width; else charWidth = fm.charWidth(c); --- 666,670 ---- if(c == '\t') charWidth = (int)painter.nextTabStop(width,offset + i) ! - width; else charWidth = fm.charWidth(c); *************** *** 796,800 **** { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; --- 783,787 ---- { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; *************** *** 812,816 **** { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; --- 799,803 ---- { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; *************** *** 826,835 **** { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; else return lineElement.getEndOffset() ! - lineElement.getStartOffset() - 1; } --- 813,822 ---- { Element lineElement = document.getDefaultRootElement() ! .getElement(line); if(lineElement == null) return -1; else return lineElement.getEndOffset() ! - lineElement.getStartOffset() - 1; } *************** *** 952,956 **** Element map = document.getDefaultRootElement(); int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); Element lineElement = map.getElement(line); --- 939,943 ---- Element map = document.getDefaultRootElement(); int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); Element lineElement = map.getElement(line); *************** *** 1002,1006 **** Element map = document.getDefaultRootElement(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); Element lineElement = map.getElement(line); --- 989,993 ---- Element map = document.getDefaultRootElement(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); Element lineElement = map.getElement(line); *************** *** 1123,1128 **** { throw new IllegalArgumentException("Bounds out of" ! + " range: " + newStart + "," + ! newEnd); } --- 1110,1115 ---- { throw new IllegalArgumentException("Bounds out of" ! + " range: " + newStart + "," + ! newEnd); } *************** *** 1131,1135 **** // the end (clearing magic position, scrolling) if(newStart != selectionStart || newEnd != selectionEnd ! || newBias != biasLeft) { int newStartLine = getLineOfOffset(newStart); --- 1118,1122 ---- // the end (clearing magic position, scrolling) if(newStart != selectionStart || newEnd != selectionEnd ! || newBias != biasLeft) { int newStartLine = getLineOfOffset(newStart); *************** *** 1149,1153 **** document.addUndoableEdit(new CaretUndo( ! selectionStart,selectionEnd)); selectionStart = newStart; --- 1136,1140 ---- document.addUndoableEdit(new CaretUndo( ! selectionStart,selectionEnd)); selectionStart = newStart; *************** *** 1190,1196 **** int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); // Certain rectangles satisfy this condition... --- 1177,1183 ---- int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); // Certain rectangles satisfy this condition... *************** *** 1227,1231 **** { return getText(selectionStart, ! selectionEnd - selectionStart); } } --- 1214,1218 ---- { return getText(selectionStart, ! selectionEnd - selectionStart); } } *************** *** 1240,1244 **** { throw new InternalError("Text component" ! + " read only"); } --- 1227,1231 ---- { throw new InternalError("Text component" ! + " read only"); } *************** *** 1252,1258 **** int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); // Certain rectangles satisfy this condition... --- 1239,1245 ---- int start = selectionStart - map.getElement(selectionStartLine) ! .getStartOffset(); int end = selectionEnd - map.getElement(selectionEndLine) ! .getStartOffset(); // Certain rectangles satisfy this condition... *************** *** 1275,1279 **** document.remove(rectStart,Math.min(lineEnd - rectStart, ! end - start)); if(selectedText == null) --- 1262,1266 ---- document.remove(rectStart,Math.min(lineEnd - rectStart, ! end - start)); if(selectedText == null) *************** *** 1285,1302 **** document.insertString(rectStart,selectedText ! .substring(lastNewline,currNewline),null); lastNewline = Math.min(selectedText.length(), ! currNewline + 1); } if(selectedText != null && ! currNewline != selectedText.length()) { int offset = map.getElement(selectionEndLine) ! .getEndOffset() - 1; document.insertString(offset,"\n",null); document.insertString(offset + 1,selectedText ! .substring(currNewline + 1),null); } } --- 1272,1289 ---- document.insertString(rectStart,selectedText ! .substring(lastNewline,currNewline),null); lastNewline = Math.min(selectedText.length(), ! currNewline + 1); } if(selectedText != null && ! currNewline != selectedText.length()) { int offset = map.getElement(selectionEndLine) ! .getEndOffset() - 1; document.insertString(offset,"\n",null); document.insertString(offset + 1,selectedText ! .substring(currNewline + 1),null); } } *************** *** 1304,1312 **** { document.remove(selectionStart, ! selectionEnd - selectionStart); if(selectedText != null) { document.insertString(selectionStart, ! selectedText,null); } } --- 1291,1299 ---- { document.remove(selectionStart, ! selectionEnd - selectionStart); if(selectedText != null) { document.insertString(selectionStart, ! selectedText,null); } } *************** *** 1316,1320 **** bl.printStackTrace(); throw new InternalError("Cannot replace" ! + " selection"); } // No matter what happends... stops us from leaving document --- 1303,1307 ---- bl.printStackTrace(); throw new InternalError("Cannot replace" ! + " selection"); } // No matter what happends... stops us from leaving document *************** *** 1545,1551 **** // so do it here String selection = ((String)clipboard ! .getContents(this).getTransferData( ! DataFlavor.stringFlavor)) ! .replace('\r','\n'); int repeatCount = inputHandler.getRepeatCount(); --- 1532,1538 ---- // so do it here String selection = ((String)clipboard ! .getContents(this).getTransferData( ! DataFlavor.stringFlavor)) ! .replace('\r','\n'); int repeatCount = inputHandler.getRepeatCount(); *************** *** 1560,1564 **** getToolkit().beep(); System.err.println("Clipboard does not" ! + " contain a string"); } } --- 1547,1551 ---- getToolkit().beep(); System.err.println("Clipboard does not" ! + " contain a string"); } } *************** *** 1606,1610 **** protected static JEditTextArea focusedComponent; protected static Timer caretTimer; ! protected TextAreaPainter painter; --- 1593,1597 ---- protected static JEditTextArea focusedComponent; protected static Timer caretTimer; ! protected TextAreaPainter painter; *************** *** 1625,1629 **** protected int horizontalOffset; ! protected JScrollBar vertical; protected JScrollBar horizontal; --- 1612,1616 ---- protected int horizontalOffset; ! protected JScrollBar vertical; protected JScrollBar horizontal; *************** *** 1672,1676 **** { int offset = TextUtilities.findMatchingBracket( ! document,newCaretPosition - 1); if(offset != -1) { --- 1659,1663 ---- { int offset = TextUtilities.findMatchingBracket( ! document,newCaretPosition - 1); if(offset != -1) { *************** *** 1691,1695 **** { DocumentEvent.ElementChange ch = evt.getChange( ! document.getDefaultRootElement()); int count; --- 1678,1682 ---- { DocumentEvent.ElementChange ch = evt.getChange( ! document.getDefaultRootElement()); int count; *************** *** 1698,1702 **** else count = ch.getChildrenAdded().length - ! ch.getChildrenRemoved().length; int line = getLineOfOffset(evt.getOffset()); --- 1685,1689 ---- else count = ch.getChildrenAdded().length - ! ch.getChildrenRemoved().length; int line = getLineOfOffset(evt.getOffset()); *************** *** 1755,1762 **** dim.width += centerPref.width; dim.height += centerPref.height; ! Dimension rightPref = right.getPreferredSize(); ! dim.width += rightPref.width; ! Dimension bottomPref = bottom.getPreferredSize(); ! dim.height += bottomPref.height; return dim; --- 1742,1753 ---- dim.width += centerPref.width; dim.height += centerPref.height; ! if(right != null){ ! Dimension rightPref = right.getPreferredSize(); ! dim.width += rightPref.width; ! } ! if(bottom != null){ ! Dimension bottomPref = bottom.getPreferredSize(); ! dim.height += bottomPref.height; ! } return dim; *************** *** 1773,1781 **** dim.width += centerPref.width; dim.height += centerPref.height; ! Dimension rightPref = right.getMinimumSize(); ! dim.width += rightPref.width; ! Dimension bottomPref = bottom.getMinimumSize(); ! dim.height += bottomPref.height; ! return dim; } --- 1764,1775 ---- dim.width += centerPref.width; dim.height += centerPref.height; ! if(right != null){ ! Dimension rightPref = right.getMinimumSize(); ! dim.width += rightPref.width; ! } ! if(bottom != null){ ! Dimension bottomPref = bottom.getMinimumSize(); ! dim.height += bottomPref.height; ! } return dim; } *************** *** 1790,1810 **** int ibottom = insets.bottom; int iright = insets.right; ! int rightWidth = right.getPreferredSize().width; ! int bottomHeight = bottom.getPreferredSize().height; int centerWidth = size.width - rightWidth - ileft - iright; int centerHeight = size.height - bottomHeight - itop - ibottom; center.setBounds( ! ileft, ! itop, ! centerWidth, ! centerHeight); ! right.setBounds( ! ileft + centerWidth, ! itop, ! rightWidth, ! centerHeight); // Lay out all status components, in order --- 1784,1811 ---- int ibottom = insets.bottom; int iright = insets.right; + int rightWidth = 0; + if(right != null){ + rightWidth = right.getPreferredSize().width; + } ! int bottomHeight = 0; ! if(bottom != null){ ! bottomHeight = bottom.getPreferredSize().height; ! } int centerWidth = size.width - rightWidth - ileft - iright; int centerHeight = size.height - bottomHeight - itop - ibottom; center.setBounds( ! ileft, ! itop, ! centerWidth, ! centerHeight); ! if(right != null) ! right.setBounds( ! ileft + centerWidth, ! itop, ! rightWidth, ! centerHeight); // Lay out all status components, in order *************** *** 1815,1829 **** Dimension dim = comp.getPreferredSize(); comp.setBounds(ileft, ! itop + centerHeight, ! dim.width, ! bottomHeight); ileft += dim.width; } ! bottom.setBounds( ! ileft, ! itop + centerHeight, ! size.width - rightWidth - ileft - iright, ! bottomHeight); } --- 1816,1831 ---- Dimension dim = comp.getPreferredSize(); comp.setBounds(ileft, ! itop + centerHeight, ! dim.width, ! bottomHeight); ileft += dim.width; } ! if(bottom != null) ! bottom.setBounds( ! ileft, ! itop + centerHeight, ! size.width - rightWidth - ileft - iright, ! bottomHeight); } *************** *** 1841,1845 **** { if(focusedComponent != null ! && focusedComponent.hasFocus()) focusedComponent.blinkCaret(); } --- 1843,1847 ---- { if(focusedComponent != null ! && focusedComponent.hasFocus()) focusedComponent.blinkCaret(); } *************** *** 1913,1917 **** if(selectionStart > offset || (selectionStart ! == selectionEnd && selectionStart == offset)) newStart = selectionStart + length; else --- 1915,1919 ---- if(selectionStart > offset || (selectionStart ! == selectionEnd && selectionStart == offset)) newStart = selectionStart + length; else *************** *** 1925,1929 **** select(newStart,newEnd); } ! public void removeUpdate(DocumentEvent evt) { --- 1927,1931 ---- select(newStart,newEnd); } ! public void removeUpdate(DocumentEvent evt) { *************** *** 1972,1976 **** setSelectionRectangular((evt.getModifiers() ! & InputEvent.CTRL_MASK) != 0); select(getMarkPosition(),xyToOffset(evt.getX(),evt.getY())); } --- 1974,1978 ---- setSelectionRectangular((evt.getModifiers() ! & InputEvent.CTRL_MASK) != 0); select(getMarkPosition(),xyToOffset(evt.getX(),evt.getY())); } *************** *** 1993,1997 **** } } ! class MouseHandler extends MouseAdapter { --- 1995,1999 ---- } } ! class MouseHandler extends MouseAdapter { *************** *** 2005,2009 **** if((evt.getModifiers() & InputEvent.BUTTON3_MASK) != 0 ! && popup != null) { popup.show(painter,evt.getX(),evt.getY()); --- 2007,2011 ---- if((evt.getModifiers() & InputEvent.BUTTON3_MASK) != 0 ! && popup != null) { popup.show(painter,evt.getX(),evt.getY()); *************** *** 2039,2043 **** private void doSingleClick(MouseEvent evt, int line, ! int offset, int dot) { if((evt.getModifiers() & InputEvent.SHIFT_MASK) != 0) --- 2041,2045 ---- private void doSingleClick(MouseEvent evt, int line, ! int offset, int dot) { if((evt.getModifiers() & InputEvent.SHIFT_MASK) != 0) *************** *** 2051,2056 **** private void doDoubleClick(MouseEvent evt, int line, ! int offset, int dot) throws BadLocationException ! { // Ignore empty lines if(getLineLength(line) == 0) --- 2053,2058 ---- private void doDoubleClick(MouseEvent evt, int line, ! int offset, int dot) throws BadLocationException ! { // Ignore empty lines if(getLineLength(line) == 0) *************** *** 2060,2064 **** { int bracket = TextUtilities.findMatchingBracket( ! document,Math.max(0,dot - 1)); if(bracket != -1) { --- 2062,2066 ---- { int bracket = TextUtilities.findMatchingBracket( ! document,Math.max(0,dot - 1)); if(bracket != -1) { *************** *** 2090,2095 **** // we select the surrounding non-letters boolean selectNoLetter = (!Character ! .isLetterOrDigit(ch) ! && noWordSep.indexOf(ch) == -1); int wordStart = 0; --- 2092,2097 ---- // we select the surrounding non-letters boolean selectNoLetter = (!Character ! .isLetterOrDigit(ch) ! && noWordSep.indexOf(ch) == -1); int wordStart = 0; *************** *** 2099,2104 **** ch = lineText.charAt(i); if(selectNoLetter ^ (!Character ! .isLetterOrDigit(ch) && ! noWordSep.indexOf(ch) == -1)) { wordStart = i + 1; --- 2101,2106 ---- ch = lineText.charAt(i); if(selectNoLetter ^ (!Character ! .isLetterOrDigit(ch) && ! noWordSep.indexOf(ch) == -1)) { wordStart = i + 1; *************** *** 2112,2117 **** ch = lineText.charAt(i); if(selectNoLetter ^ (!Character ! .isLetterOrDigit(ch) && ! noWordSep.indexOf(ch) == -1)) { wordEnd = i; --- 2114,2119 ---- ch = lineText.charAt(i); if(selectNoLetter ^ (!Character ! .isLetterOrDigit(ch) && ! noWordSep.indexOf(ch) == -1)) { wordEnd = i; *************** *** 2131,2139 **** int lineStart = getLineStartOffset(line); select(lineStart + wordStart,lineStart + wordEnd); ! */ ! } private void doTripleClick(MouseEvent evt, int line, ! int offset, int dot) { select(getLineStartOffset(line),getLineEndOffset(line)-1); --- 2133,2141 ---- int lineStart = getLineStartOffset(line); select(lineStart + wordStart,lineStart + wordEnd); ! */ ! } private void doTripleClick(MouseEvent evt, int line, ! int offset, int dot) { select(getLineStartOffset(line),getLineEndOffset(line)-1); |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 21:30:07
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26011/src/java/net/sf/tails/swing/helper Modified Files: FrameHelper.java Log Message: dsl improving Index: FrameHelper.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/helper/FrameHelper.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FrameHelper.java 22 Oct 2007 21:28:17 -0000 1.20 --- FrameHelper.java 24 Oct 2007 21:30:09 -0000 1.21 *************** *** 115,118 **** --- 115,128 ---- } + public String readLinedFile(String name) throws Exception { + BufferedReader in = new BufferedReader(new FileReader(name)); + String text = ""; + while (in.ready()) + { + text += in.readLine() + "\n"; + } + return text; + } + private Object[][] getReportMatrix(StockAnalysis stockAnalysis) { |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 21:30:07
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/component In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26011/src/java/net/sf/tails/swing/component Modified Files: TailButton.java Log Message: dsl improving Index: TailButton.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/component/TailButton.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TailButton.java 24 Oct 2007 17:53:03 -0000 1.1 --- TailButton.java 24 Oct 2007 21:30:09 -0000 1.2 *************** *** 13,23 **** this.setBorder(BorderFactory.createEmptyBorder()); this.addMouseListener(new java.awt.event.MouseAdapter() { ! public void mouseEntered(java.awt.event.MouseEvent evt) { ! notifyMouseEntered(evt); ! } public void mouseExited(java.awt.event.MouseEvent evt) { ! notifyMouseExited(evt); ! } ! }); } --- 13,26 ---- this.setBorder(BorderFactory.createEmptyBorder()); this.addMouseListener(new java.awt.event.MouseAdapter() { ! public void mouseEntered(java.awt.event.MouseEvent evt) { ! notifyMouseEntered(evt); ! } public void mouseExited(java.awt.event.MouseEvent evt) { ! notifyMouseExited(evt); ! } ! }); ! ! this.setMaximumSize(new java.awt.Dimension(25, 25)); ! this.setMinimumSize(new java.awt.Dimension(25, 25)); } *************** *** 25,39 **** * */ ! private static final long serialVersionUID = -8268119481036857234L; ! ! private void notifyMouseEntered(MouseEvent evt) { ! if(this.isEnabled()) ! ((TailButton) evt.getSource()).setBorder(BorderFactory.createEtchedBorder()); ! ! } ! ! private void notifyMouseExited(MouseEvent evt) { ! ((TailButton) evt.getSource()).setBorder(BorderFactory.createEmptyBorder()); ! } } --- 28,42 ---- * */ ! private static final long serialVersionUID = -8268119481036857234L; ! ! private void notifyMouseEntered(MouseEvent evt) { ! if(this.isEnabled()) ! ((TailButton) evt.getSource()).setBorder(BorderFactory.createEtchedBorder()); ! ! } ! ! private void notifyMouseExited(MouseEvent evt) { ! ((TailButton) evt.getSource()).setBorder(BorderFactory.createEmptyBorder()); ! } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 21:30:07
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv26011/src/java/net/sf/tails/i18n Modified Files: Folders.properties Log Message: dsl improving Index: Folders.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/Folders.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Folders.properties 22 Oct 2007 18:10:46 -0000 1.4 --- Folders.properties 24 Oct 2007 21:30:09 -0000 1.5 *************** *** 6,8 **** XLS_DIR =Data/Xls HTML_DIR =Data/Html ! STYLE_DIR =Data/Style \ No newline at end of file --- 6,9 ---- XLS_DIR =Data/Xls HTML_DIR =Data/Html ! STYLE_DIR =Data/Style ! SCRIPTS_DIR =Data/Scripts \ No newline at end of file |
|
From: Carlos <ma...@us...> - 2007-10-24 20:56:48
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11828/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: Update de zoom in e zoom out. Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Index.java 24 Oct 2007 19:22:52 -0000 1.34 --- Index.java 24 Oct 2007 20:56:49 -0000 1.35 *************** *** 42,45 **** --- 42,46 ---- import net.sf.tail.graphics.CriteriaChart; import net.sf.tail.graphics.CriteriaDataset; + import net.sf.tail.graphics.FasterDataset; import net.sf.tail.graphics.SeriesChart; import net.sf.tail.graphics.SeriesDataset; *************** *** 109,112 **** --- 110,114 ---- private SeriesChart seriesChart; private SeriesDataset seriesDataset; + private FasterDataset fasterSeriesDataset; private CriteriaChart criteriaChart; private CriteriaDataset criteriaDataset; *************** *** 245,252 **** reportTable.setEnabled(true); ! //TODO ! seriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); ! seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", true)); chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); --- 247,253 ---- reportTable.setEnabled(true); ! fasterSeriesDataset = new FasterDataset(stockAnalysis.getSlicer().getSeries()); ! seriesChart = new SeriesChart(fasterSeriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", false)); chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); *************** *** 312,317 **** newStockAnalysisButton.setToolTipText("New Stock Analysis..."); - newStockAnalysisButton.setMaximumSize(new java.awt.Dimension(25, 25)); - newStockAnalysisButton.setMinimumSize(new java.awt.Dimension(25, 25)); newStockAnalysisButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 313,316 ---- *************** *** 321,326 **** newReportButton.setToolTipText("New Report..."); - newReportButton.setMaximumSize(new java.awt.Dimension(25, 25)); - newReportButton.setMinimumSize(new java.awt.Dimension(25, 25)); newReportButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 320,323 ---- *************** *** 330,335 **** openStockAnalysisButton.setToolTipText("Open..."); - openStockAnalysisButton.setMaximumSize(new java.awt.Dimension(25, 25)); - openStockAnalysisButton.setMinimumSize(new java.awt.Dimension(25, 25)); openStockAnalysisButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 327,330 ---- *************** *** 339,344 **** saveStockAnalysisButton.setToolTipText("Save"); - saveStockAnalysisButton.setMaximumSize(new java.awt.Dimension(25, 25)); - saveStockAnalysisButton.setMinimumSize(new java.awt.Dimension(25, 25)); saveStockAnalysisButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 334,337 ---- *************** *** 348,353 **** saveAsStockAnalysisButton.setToolTipText("Save as..."); - saveAsStockAnalysisButton.setMaximumSize(new java.awt.Dimension(25, 25)); - saveAsStockAnalysisButton.setMinimumSize(new java.awt.Dimension(25, 25)); saveAsStockAnalysisButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 341,344 ---- *************** *** 357,362 **** exportHTMLButton.setToolTipText("Export to HTML..."); - exportHTMLButton.setMaximumSize(new java.awt.Dimension(25, 25)); - exportHTMLButton.setMinimumSize(new java.awt.Dimension(25, 25)); exportHTMLButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 348,351 ---- *************** *** 366,371 **** exportXLSButton.setToolTipText("Export to XLS..."); - exportXLSButton.setMaximumSize(new java.awt.Dimension(25, 25)); - exportXLSButton.setMinimumSize(new java.awt.Dimension(25, 25)); exportXLSButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 355,358 ---- *************** *** 375,380 **** cleanConsoleButton.setToolTipText("Clean Console"); - cleanConsoleButton.setMaximumSize(new java.awt.Dimension(25, 25)); - cleanConsoleButton.setMinimumSize(new java.awt.Dimension(25, 25)); cleanConsoleButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 362,365 ---- *************** *** 384,389 **** completeGraphButton.setToolTipText("Generate Detailed Graphics"); - completeGraphButton.setMaximumSize(new java.awt.Dimension(25, 25)); - completeGraphButton.setMinimumSize(new java.awt.Dimension(25, 25)); completeGraphButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 369,372 ---- *************** *** 393,398 **** moveLeftButton.setToolTipText("Move Left"); - moveLeftButton.setMaximumSize(new java.awt.Dimension(25, 25)); - moveLeftButton.setMinimumSize(new java.awt.Dimension(25, 25)); moveLeftButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 376,379 ---- *************** *** 402,407 **** moveRightButton.setToolTipText("Move Right"); - moveRightButton.setMaximumSize(new java.awt.Dimension(25, 25)); - moveRightButton.setMinimumSize(new java.awt.Dimension(25, 25)); moveRightButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 383,386 ---- *************** *** 411,416 **** jumpLeftButton.setToolTipText("Jump Left"); - jumpLeftButton.setMaximumSize(new java.awt.Dimension(25, 25)); - jumpLeftButton.setMinimumSize(new java.awt.Dimension(25, 25)); jumpLeftButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 390,393 ---- *************** *** 420,425 **** jumpRightButton.setToolTipText("Jump Right"); - jumpRightButton.setMaximumSize(new java.awt.Dimension(25, 25)); - jumpRightButton.setMinimumSize(new java.awt.Dimension(25, 25)); jumpRightButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 397,400 ---- *************** *** 429,434 **** zoomInButton.setToolTipText("Zoom In"); - zoomInButton.setMaximumSize(new java.awt.Dimension(25, 25)); - zoomInButton.setMinimumSize(new java.awt.Dimension(25, 25)); zoomInButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 404,407 ---- *************** *** 438,443 **** zoomOutButton.setToolTipText("Zoom Out"); - zoomOutButton.setMaximumSize(new java.awt.Dimension(25, 25)); - zoomOutButton.setMinimumSize(new java.awt.Dimension(25, 25)); zoomOutButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 411,414 ---- *************** *** 447,452 **** helpButton.setToolTipText("Help"); - helpButton.setMaximumSize(new java.awt.Dimension(25, 25)); - helpButton.setMinimumSize(new java.awt.Dimension(25, 25)); helpButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { --- 418,421 ---- *************** *** 626,632 **** protected void zoomOutButtonActionPerformed(ActionEvent evt) { ! //TODO zoomInButton.setEnabled(true); zoomOutButton.setEnabled(false); } --- 595,616 ---- protected void zoomOutButtonActionPerformed(ActionEvent evt) { ! fasterSeriesDataset = new FasterDataset(stockAnalysis.getSlicer().getSeries()); ! seriesChart = new SeriesChart(fasterSeriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", false)); ! ! chartsPane.removeAll(); ! chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); ! ! if (stockAnalysis.getReports().size() > 0) ! { ! //TODO ! } ! zoomInButton.setEnabled(true); zoomOutButton.setEnabled(false); + moveRightButton.setEnabled(false); + moveLeftButton.setEnabled(false); + jumpRightButton.setEnabled(false); + jumpLeftButton.setEnabled(false); } *************** *** 635,638 **** --- 619,626 ---- seriesChart = new SeriesChart(seriesDataset); seriesPanel = new ChartPanel(seriesChart.createChart("", true)); + + chartsPane.removeAll(); + chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); + if (stockAnalysis.getReports().size() > 0) { *************** *** 641,646 **** --- 629,639 ---- criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); } + zoomInButton.setEnabled(false); zoomOutButton.setEnabled(true); + moveRightButton.setEnabled(true); + moveLeftButton.setEnabled(true); + jumpRightButton.setEnabled(true); + jumpLeftButton.setEnabled(true); } *************** *** 775,780 **** complete.generateHTMLFile(stockAnalysis.getReports().get(reportTable.getSelectedRow()), stockAnalysis.getAdditionalCriteria(), stockAnalysis.getSlicer().getPeriod(), directoryPath, directoryName); } catch (IOException e) { ! // TODO Auto-generated catch block ! e.printStackTrace(); } } --- 768,772 ---- 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); } } *************** *** 819,822 **** --- 811,837 ---- } + public void loadReport(StockAnalysis analysis) { + + reportTable.setModel(helper.getTableModel(analysis)); + + if (zoomInButton.isEnabled()) + { + + } + else + { + criteriaDataset = new CriteriaDataset(analysis.getReports(), analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); + criteriaChart = new CriteriaChart(criteriaDataset); + criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); + } + chartsPane.removeAll(); + chartsPane.addTab(analysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); + + chartsPane.addTab("Reports", new ImageIcon(iconBundle.getString("REPORTS_TAB")), criteriaPanel); + + exportHTMLButton.setEnabled(true); + exportXLSButton.setEnabled(true); + } + public void loadStockAnalysis(StockAnalysis analysis) { *************** *** 842,848 **** reportScrollPane.setViewportView(reportTable); ! seriesDataset = new SeriesDataset(analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); ! seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", true)); chartsPane.removeAll(); --- 857,863 ---- reportScrollPane.setViewportView(reportTable); ! fasterSeriesDataset = new FasterDataset(analysis.getSlicer().getSeries()); ! seriesChart = new SeriesChart(fasterSeriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", false)); chartsPane.removeAll(); *************** *** 861,874 **** if (analysis.getReports().size() > 0) { ! if (zoomInButton.isEnabled()) ! { ! //TODO ! } ! else ! { ! criteriaDataset = new CriteriaDataset(analysis.getReports(), analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); ! criteriaChart = new CriteriaChart(criteriaDataset); ! criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); ! } chartsPane.addTab("Reports", new ImageIcon(iconBundle.getString("REPORTS_TAB")), criteriaPanel); --- 876,881 ---- if (analysis.getReports().size() > 0) { ! //TODO ! chartsPane.addTab("Reports", new ImageIcon(iconBundle.getString("REPORTS_TAB")), criteriaPanel); |
|
From: Carlos <ma...@us...> - 2007-10-24 20:56:48
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11828/src/java/net/sf/tails/i18n Modified Files: Messages.properties Log Message: Update de zoom in e zoom out. Index: Messages.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/Messages.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Messages.properties 8 Oct 2007 19:56:56 -0000 1.3 --- Messages.properties 24 Oct 2007 20:56:49 -0000 1.4 *************** *** 19,21 **** EMPTY_SLICESNUMBER_FIELD =Please fill Number of Slices field. INVALID_SLICESNUMBER_FIELD =Please enter only numbers on Number of Slices field. ! NEGATIVE_SLICESNUMBER_FIELD =Number of Slices field must be greater than zero. \ No newline at end of file --- 19,22 ---- EMPTY_SLICESNUMBER_FIELD =Please fill Number of Slices field. INVALID_SLICESNUMBER_FIELD =Please enter only numbers on Number of Slices field. ! NEGATIVE_SLICESNUMBER_FIELD =Number of Slices field must be greater than zero. ! REPORT_HTML_ERROR =Exportation error, please restart the application. \ No newline at end of file |
|
From: Thies <tg...@us...> - 2007-10-24 20:53:27
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9694/src/test/net/sf/tail/graphics Modified Files: SeriesDatasetTest.java Log Message: Acertado testes Index: SeriesDatasetTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/graphics/SeriesDatasetTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SeriesDatasetTest.java 22 Oct 2007 22:22:32 -0000 1.8 --- SeriesDatasetTest.java 24 Oct 2007 20:51:58 -0000 1.9 *************** *** 3,6 **** --- 3,7 ---- import static junit.framework.Assert.assertEquals; + import java.util.ArrayList; import java.util.LinkedList; import java.util.List; *************** *** 13,16 **** --- 14,18 ---- import net.sf.tail.Trade; import net.sf.tail.sample.SampleIndicator; + import net.sf.tail.sample.SampleTimeSeries; import net.sf.tail.series.DefaultTimeSeries; *************** *** 41,44 **** --- 43,47 ---- ticks.add(new Tick(new DateTime().withDate(2007, 6, 8), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 6, 9), 4d)); + series = new DefaultTimeSeries(ticks); *************** *** 46,50 **** trades = new LinkedList<Trade>(); ! indicator1 = new SampleIndicator(new double[] { 2d, 3d, 4d, 5d }); indicator2 = new SampleIndicator(new double[] { 5d, 4d, 3d, 2d }); --- 49,53 ---- trades = new LinkedList<Trade>(); ! indicator1 = new SampleIndicator(new double[] { 2d, 3d, 4d, 5d}); indicator2 = new SampleIndicator(new double[] { 5d, 4d, 3d, 2d }); *************** *** 97,123 **** @Test public void testMoveRight() { ! SeriesDataset dataset = new SeriesDataset(series, indicators, 0, 3, trades); ticks.add(new Tick(new DateTime().withDate(2007, 6, 10), 4d)); ! indicator1.addValue(15d); ! indicator2.addValue(30d); ! dataset.moveRight(1); - assertEquals(indicators.size() + trades.size(), dataset.getRowCount()); assertEquals(series.getSize() - 1, dataset.getColumnCount()); ! assertEquals(3d, dataset.getValue(1, 1)); } @Test public void testMoveLeft() { ! SeriesDataset dataset = new SeriesDataset(series, indicators, 0, 3, trades); ticks.add(new Tick(new DateTime().withDate(2007, 6, 10), 4d)); ! indicator1.addValue(15d); ! indicator2.addValue(30d); - dataset.moveRight(1); dataset.moveLeft(1); ! assertEquals(indicators.size() + trades.size(), dataset.getRowCount()); ! assertEquals(series.getSize() - 1, dataset.getColumnCount()); ! assertEquals(4d, dataset.getValue(1, 1)); } } --- 100,136 ---- @Test public void testMoveRight() { ! List<Tick> ticks = new ArrayList<Tick>(); ! ticks = this.ticks; ticks.add(new Tick(new DateTime().withDate(2007, 6, 10), 4d)); ! SampleTimeSeries series = new SampleTimeSeries(ticks); ! List<Indicator<? extends Number>> indicators = new ArrayList<Indicator<? extends Number>>(); ! SampleIndicator indicator1 = new SampleIndicator(new double[] { 2d, 3d, 4d, 5d, 14d }); ! SampleIndicator indicator2 = new SampleIndicator(new double[] { 5d, 4d, 3d, 2d, 15d }); ! indicators.add(indicator1); ! indicators.add(indicator2); ! SeriesDataset dataset = new SeriesDataset(series, indicators, 0, 3, trades); ! dataset.moveRight(1); assertEquals(series.getSize() - 1, dataset.getColumnCount()); ! assertEquals(3d, dataset.getValue(0, 0)); } @Test public void testMoveLeft() { ! List<Tick> ticks = this.ticks; ticks.add(new Tick(new DateTime().withDate(2007, 6, 10), 4d)); ! SampleTimeSeries series = new SampleTimeSeries(ticks); ! List<Indicator<? extends Number>> indicators = new ArrayList<Indicator<? extends Number>>(); ! SampleIndicator indicator1 = new SampleIndicator(new double[] { 2d, 3d, 4d, 5d, 14d }); ! SampleIndicator indicator2 = new SampleIndicator(new double[] { 5d, 4d, 3d, 2d, 15d }); ! indicators.add(indicator1); ! indicators.add(indicator2); ! SeriesDataset dataset = new SeriesDataset(series, indicators, 2, 4, trades); ! dataset.moveLeft(1); ! ! assertEquals(series.getSize() - 2, dataset.getColumnCount()); ! assertEquals(3d, dataset.getValue(0, 0)); } } |
|
From: Thies <tg...@us...> - 2007-10-24 20:31:27
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1301/src/test/net/sf/tail/graphics Modified Files: FasterDatasetTest.java Log Message: Refatoracao Index: FasterDatasetTest.java =================================================================== RCS file: /cvsroot/tail/Tail/src/test/net/sf/tail/graphics/FasterDatasetTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FasterDatasetTest.java 24 Oct 2007 19:42:43 -0000 1.1 --- FasterDatasetTest.java 24 Oct 2007 20:31:29 -0000 1.2 *************** *** 28,32 **** ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, series.getSize(), true); assertEquals(6, dataset.getColumnCount()); } --- 28,32 ---- ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, true); assertEquals(6, dataset.getColumnCount()); } *************** *** 44,48 **** ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 8d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, series.getSize(), true); assertEquals(4, dataset.getColumnCount()); } --- 44,48 ---- ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 8d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, true); assertEquals(4, dataset.getColumnCount()); } *************** *** 60,64 **** ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, series.getSize(), false); assertEquals(8, dataset.getColumnCount()); } --- 60,64 ---- ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); ! FasterDataset dataset = new FasterDataset(series, false); assertEquals(8, dataset.getColumnCount()); } |
|
From: Thies <tg...@us...> - 2007-10-24 20:31:27
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1301/src/java/net/sf/tail/graphics Modified Files: FasterDataset.java Log Message: Refatoracao Index: FasterDataset.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/graphics/FasterDataset.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FasterDataset.java 24 Oct 2007 19:42:43 -0000 1.2 --- FasterDataset.java 24 Oct 2007 20:31:29 -0000 1.3 *************** *** 25,50 **** private TimeSeries series; ! public FasterDataset(TimeSeries series, List<Indicator<? extends Number>> indicators, int firstIndex, int lastIndex) { this.data = new DefaultKeyedValues2D(); this.indicators = indicators; this.series = series; ! if(lastIndex - firstIndex > 800) ! loadValuesFaster(firstIndex, lastIndex); else ! loadValues(firstIndex, lastIndex); } ! public FasterDataset(TimeSeries timeSeries, int seriesSize) { ! this(timeSeries, Collections.nCopies(1, new ClosePriceIndicator(timeSeries)), timeSeries.getBegin(), timeSeries.getBegin() + seriesSize - 1); } ! public FasterDataset(TimeSeries series, int seriesSize, boolean doFast) { this.data = new DefaultKeyedValues2D(); this.indicators = Collections.nCopies(1, new ClosePriceIndicator(series)); this.series = series; if(doFast) ! loadValuesFaster(series.getBegin(), series.getBegin() + seriesSize - 1); else ! loadValues(series.getBegin(), series.getBegin() + seriesSize - 1); } --- 25,50 ---- private TimeSeries series; ! public FasterDataset(TimeSeries series, List<Indicator<? extends Number>> indicators) { this.data = new DefaultKeyedValues2D(); this.indicators = indicators; this.series = series; ! if(series.getSize() > 800) ! loadValuesFaster(series.getBegin(), series.getEnd()); else ! loadValues(series.getBegin(), series.getEnd()); } ! public FasterDataset(TimeSeries timeSeries) { ! this(timeSeries, Collections.nCopies(1, new ClosePriceIndicator(timeSeries))); } ! public FasterDataset(TimeSeries series, boolean doFast) { this.data = new DefaultKeyedValues2D(); this.indicators = Collections.nCopies(1, new ClosePriceIndicator(series)); this.series = series; if(doFast) ! loadValuesFaster(series.getBegin(), series.getEnd()); else ! loadValues(series.getBegin(), series.getEnd()); } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 19:52:04
|
Update of /cvsroot/tail/TailS/Data/icons In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17206/Data/icons Added Files: backward_nav.gif forward_nav.gif shift_r_edit.gif info.gif redo_edit.gif ew_report.gif undo_edit.gif writeout_co.gif graph.gif focus.gif inst_ptr.gif inst_ptr_top.gif shift_l_edit.gif Log Message: novos icones --- NEW FILE: shift_r_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: writeout_co.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: shift_l_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: graph.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: forward_nav.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: info.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: undo_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: backward_nav.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ew_report.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: inst_ptr.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: focus.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: redo_edit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: inst_ptr_top.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Thies <tg...@us...> - 2007-10-24 19:42:44
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13230/src/java/net/sf/tail/graphics Modified Files: FasterDataset.java Log Message: Novo construtor e teste Index: FasterDataset.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/graphics/FasterDataset.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FasterDataset.java 24 Oct 2007 19:02:10 -0000 1.1 --- FasterDataset.java 24 Oct 2007 19:42:43 -0000 1.2 *************** *** 39,42 **** --- 39,51 ---- this(timeSeries, Collections.nCopies(1, new ClosePriceIndicator(timeSeries)), timeSeries.getBegin(), timeSeries.getBegin() + seriesSize - 1); } + public FasterDataset(TimeSeries series, int seriesSize, boolean doFast) { + this.data = new DefaultKeyedValues2D(); + this.indicators = Collections.nCopies(1, new ClosePriceIndicator(series)); + this.series = series; + if(doFast) + loadValuesFaster(series.getBegin(), series.getBegin() + seriesSize - 1); + else + loadValues(series.getBegin(), series.getBegin() + seriesSize - 1); + } |
|
From: Thies <tg...@us...> - 2007-10-24 19:42:44
|
Update of /cvsroot/tail/Tail/src/test/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13230/src/test/net/sf/tail/graphics Added Files: FasterDatasetTest.java Log Message: Novo construtor e teste --- NEW FILE: FasterDatasetTest.java --- package net.sf.tail.graphics; 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.joda.time.DateTime; import org.junit.Test; public class FasterDatasetTest { @Test public void testFasterDataset() { List<Tick> ticks = new ArrayList<Tick>(); ticks.add(new Tick(new DateTime().withDate(2007, 5, 6), 1d)); ticks.add(new Tick(new DateTime().withDate(2007, 6, 7), 2d)); ticks.add(new Tick(new DateTime().withDate(2007, 7, 8), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 8, 9), 4d)); ticks.add(new Tick(new DateTime().withDate(2007, 9, 10), 5d)); ticks.add(new Tick(new DateTime().withDate(2007, 10, 11), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 11, 12), 6d)); ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); FasterDataset dataset = new FasterDataset(series, series.getSize(), true); assertEquals(6, dataset.getColumnCount()); } @Test public void testFasterDatasetOnlyWithGains() { List<Tick> ticks = new ArrayList<Tick>(); ticks.add(new Tick(new DateTime().withDate(2007, 5, 6), 1d)); ticks.add(new Tick(new DateTime().withDate(2007, 6, 7), 2d)); ticks.add(new Tick(new DateTime().withDate(2007, 7, 8), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 8, 9), 4d)); ticks.add(new Tick(new DateTime().withDate(2007, 9, 10), 5d)); ticks.add(new Tick(new DateTime().withDate(2007, 10, 11), 6d)); ticks.add(new Tick(new DateTime().withDate(2007, 11, 12), 7d)); ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 8d)); SampleTimeSeries series = new SampleTimeSeries(ticks); FasterDataset dataset = new FasterDataset(series, series.getSize(), true); assertEquals(4, dataset.getColumnCount()); } @Test public void testFasterDatasetNotSoFast() { List<Tick> ticks = new ArrayList<Tick>(); ticks.add(new Tick(new DateTime().withDate(2007, 5, 6), 1d)); ticks.add(new Tick(new DateTime().withDate(2007, 6, 7), 2d)); ticks.add(new Tick(new DateTime().withDate(2007, 7, 8), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 8, 9), 4d)); ticks.add(new Tick(new DateTime().withDate(2007, 9, 10), 5d)); ticks.add(new Tick(new DateTime().withDate(2007, 10, 11), 3d)); ticks.add(new Tick(new DateTime().withDate(2007, 11, 12), 6d)); ticks.add(new Tick(new DateTime().withDate(2007, 12, 13), 7d)); SampleTimeSeries series = new SampleTimeSeries(ticks); FasterDataset dataset = new FasterDataset(series, series.getSize(), false); assertEquals(8, dataset.getColumnCount()); } } |
|
From: Carlos <ma...@us...> - 2007-10-24 19:22:51
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4390/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: Adicionada uma Thread no complete graph, adicionado novos botoes de zoom in e zoom out e está sendo feita a lógica doa gráficos para estes botoes. Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Index.java 24 Oct 2007 17:53:03 -0000 1.33 --- Index.java 24 Oct 2007 19:22:52 -0000 1.34 *************** *** 25,28 **** --- 25,29 ---- import java.util.ResourceBundle; + import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JFileChooser; *************** *** 95,98 **** --- 96,101 ---- private TailButton jumpLeftButton; private TailButton jumpRightButton; + private TailButton zoomInButton; + private TailButton zoomOutButton; private TailButton helpButton; private javax.swing.JScrollPane reportScrollPane; *************** *** 177,180 **** --- 180,185 ---- jumpLeftButton = new TailButton(new ImageIcon(iconBundle.getString("JUMP_LEFT"))); jumpRightButton = new TailButton(new ImageIcon(iconBundle.getString("JUMP_RIGHT"))); + zoomInButton = new TailButton(new ImageIcon(iconBundle.getString("ZOOM_IN"))); + zoomOutButton = new TailButton(new ImageIcon(iconBundle.getString("ZOOM_OUT"))); helpButton = new TailButton(new ImageIcon(iconBundle.getString("HELP"))); *************** *** 223,234 **** if (stockAnalysis != null) ! { ! informationTextArea.setText(helper.getInfo(stockAnalysis)); ! infoScrollPane.setBorder(javax.swing.BorderFactory.createEmptyBorder()); infoScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); infoScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); ! infoScrollPane.setViewportBorder(javax.swing.BorderFactory.createEtchedBorder()); infoScrollPane.setViewportView(informationTextArea); infoScrollPane.setWheelScrollingEnabled(true); --- 228,238 ---- if (stockAnalysis != null) ! { informationTextArea.setText(helper.getInfo(stockAnalysis)); ! infoScrollPane.setBorder(BorderFactory.createEmptyBorder()); infoScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); infoScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); ! infoScrollPane.setViewportBorder(BorderFactory.createEtchedBorder()); infoScrollPane.setViewportView(informationTextArea); infoScrollPane.setWheelScrollingEnabled(true); *************** *** 238,247 **** reportTable.setModel(helper.getTableModel(stockAnalysis)); ! reportTable.setGridColor(new java.awt.Color(255, 255, 255)); reportTable.setEnabled(true); seriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new org.jfree.chart.ChartPanel(seriesChart.createChart("", true)); chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); --- 242,252 ---- reportTable.setModel(helper.getTableModel(stockAnalysis)); ! reportTable.setGridColor(new Color(255, 255, 255)); reportTable.setEnabled(true); + //TODO seriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", true)); chartsPane.addTab(stockAnalysis.getStock().getName(), new ImageIcon(iconBundle.getString("SERIES_TAB")), seriesPanel); *************** *** 249,252 **** --- 254,258 ---- if (stockAnalysis.getReports().size() > 0) { + //TODO criteriaDataset = new CriteriaDataset(stockAnalysis.getReports(), stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); criteriaChart = new CriteriaChart(criteriaDataset); *************** *** 278,286 **** --- 284,297 ---- jumpRightButton.setEnabled(false); jumpLeftButton.setEnabled(false); + zoomInButton.setEnabled(false); exportHTMLButton.setEnabled(false); exportXLSButton.setEnabled(false); newReportButton.setEnabled(false); + saveStockAnalysisButton.setEnabled(false); + saveAsStockAnalysisButton.setEnabled(false); } + zoomOutButton.setEnabled(false); + separator3.setMinimumSize(new Dimension(1, 25)); separator4.setMinimumSize(new Dimension(1, 25)); *************** *** 417,420 **** --- 428,449 ---- }); + zoomInButton.setToolTipText("Zoom In"); + zoomInButton.setMaximumSize(new java.awt.Dimension(25, 25)); + zoomInButton.setMinimumSize(new java.awt.Dimension(25, 25)); + zoomInButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + zoomInButtonActionPerformed(evt); + } + }); + + zoomOutButton.setToolTipText("Zoom Out"); + zoomOutButton.setMaximumSize(new java.awt.Dimension(25, 25)); + zoomOutButton.setMinimumSize(new java.awt.Dimension(25, 25)); + zoomOutButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + zoomOutButtonActionPerformed(evt); + } + }); + helpButton.setToolTipText("Help"); helpButton.setMaximumSize(new java.awt.Dimension(25, 25)); *************** *** 539,542 **** --- 568,575 ---- .addGap(2) .addComponent(jumpRightButton) + .addGap(2) + .addComponent(zoomInButton) + .addGap(2) + .addComponent(zoomOutButton) .addGap(4) .addComponent(separator6) *************** *** 573,576 **** --- 606,611 ---- .addComponent(moveRightButton) .addComponent(jumpRightButton) + .addComponent(zoomInButton) + .addComponent(zoomOutButton) .addComponent(separator7) .addComponent(helpButton) *************** *** 590,593 **** --- 625,648 ---- } + protected void zoomOutButtonActionPerformed(ActionEvent evt) { + //TODO + zoomInButton.setEnabled(true); + zoomOutButton.setEnabled(false); + } + + protected void zoomInButtonActionPerformed(ActionEvent evt) { + seriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); + seriesChart = new SeriesChart(seriesDataset); + seriesPanel = new ChartPanel(seriesChart.createChart("", true)); + if (stockAnalysis.getReports().size() > 0) + { + criteriaDataset = new CriteriaDataset(stockAnalysis.getReports(), stockAnalysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); + criteriaChart = new CriteriaChart(criteriaDataset); + criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); + } + zoomInButton.setEnabled(false); + zoomOutButton.setEnabled(true); + } + protected void jumpLeftButtonActionPerformed(ActionEvent evt) { seriesDataset.moveLeft(stockAnalysis.getSlicer().getSlice(0).getSize()); *************** *** 648,673 **** protected void completeGraphButtonActionPerformed(ActionEvent evt) { ! JTabbedPane charts = new JTabbedPane(); ! JFrame graph = new JFrame("Complete Graphic"); ! JPanel seriesPanel = new JPanel(); ! SeriesDataset completeSeriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), stockAnalysis.getSlicer().getSeries().getSize()); ! SeriesChart completeSeriesChart = new SeriesChart(completeSeriesDataset); ! seriesPanel = new org.jfree.chart.ChartPanel(completeSeriesChart.createChart("", false)); ! charts.addTab(stockAnalysis.getStock().getName(), seriesPanel); ! ! if(chartsPane.getComponentCount() > 1) ! { ! JPanel reportPanel = new JPanel(); ! CriteriaDataset completeCriteriaDataset = new CriteriaDataset(stockAnalysis.getReports(), stockAnalysis.getSlicer().getSeries(), stockAnalysis.getSlicer().getSeries().getSize()); ! CriteriaChart completeCriteriaChart = new CriteriaChart(completeCriteriaDataset); ! reportPanel = new org.jfree.chart.ChartPanel(completeCriteriaChart.createChart("", false)); ! charts.addTab("Reports Comparision", reportPanel); ! } ! ! graph.add(charts); ! graph.setMinimumSize(new Dimension(800, 500)); ! graph.setLocationByPlatform(true); ! graph.setVisible(true); ! } --- 703,730 ---- protected void completeGraphButtonActionPerformed(ActionEvent evt) { ! new Thread(new Runnable() { ! public void run() { ! JFrame graph = new JFrame("Complete Graphic"); ! JTabbedPane charts = new JTabbedPane(); ! JPanel seriesPanel = new JPanel(); ! SeriesDataset completeSeriesDataset = new SeriesDataset(stockAnalysis.getSlicer().getSeries(), stockAnalysis.getSlicer().getSeries().getSize()); ! SeriesChart completeSeriesChart = new SeriesChart(completeSeriesDataset); ! seriesPanel = new ChartPanel(completeSeriesChart.createChart("", false)); ! charts.addTab(stockAnalysis.getStock().getName(), seriesPanel); ! ! if(chartsPane.getComponentCount() > 1) ! { ! JPanel reportPanel = new JPanel(); ! CriteriaDataset completeCriteriaDataset = new CriteriaDataset(stockAnalysis.getReports(), stockAnalysis.getSlicer().getSeries(), stockAnalysis.getSlicer().getSeries().getSize()); ! CriteriaChart completeCriteriaChart = new CriteriaChart(completeCriteriaDataset); ! reportPanel = new ChartPanel(completeCriteriaChart.createChart("", false)); ! charts.addTab("Reports Comparision", reportPanel); ! } ! ! graph.add(charts); ! graph.setMinimumSize(new Dimension(800, 500)); ! graph.setLocationByPlatform(true); ! graph.setVisible(true); ! }}).start(); } *************** *** 732,736 **** else { ! new NewReportFrame(this, stockAnalysis).setVisible(true); } } --- 789,793 ---- else { ! new NewReportFrame(this, stockAnalysis).setVisible(true); } } *************** *** 766,773 **** informationTextArea.setText(helper.getInfo(analysis)); ! infoScrollPane.setBorder(javax.swing.BorderFactory.createEmptyBorder()); ! infoScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); infoScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); ! infoScrollPane.setViewportBorder(javax.swing.BorderFactory.createEtchedBorder()); infoScrollPane.setViewportView(informationTextArea); infoScrollPane.setWheelScrollingEnabled(true); --- 823,830 ---- informationTextArea.setText(helper.getInfo(analysis)); ! infoScrollPane.setBorder(BorderFactory.createEmptyBorder()); ! infoScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); infoScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); ! infoScrollPane.setViewportBorder(BorderFactory.createEtchedBorder()); infoScrollPane.setViewportView(informationTextArea); infoScrollPane.setWheelScrollingEnabled(true); *************** *** 776,780 **** reportTable.setAutoCreateRowSorter(true); - reportTable.setVisible(true); reportTable.setAutoCreateRowSorter(true); --- 833,836 ---- *************** *** 788,792 **** seriesDataset = new SeriesDataset(analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new org.jfree.chart.ChartPanel(seriesChart.createChart("", true)); chartsPane.removeAll(); --- 844,848 ---- seriesDataset = new SeriesDataset(analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); seriesChart = new SeriesChart(seriesDataset); ! seriesPanel = new ChartPanel(seriesChart.createChart("", true)); chartsPane.removeAll(); *************** *** 799,809 **** jumpLeftButton.setEnabled(true); newReportButton.setEnabled(true); if (analysis.getReports().size() > 0) { ! criteriaDataset = new CriteriaDataset(analysis.getReports(), analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); ! criteriaChart = new CriteriaChart(criteriaDataset); ! criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); ! chartsPane.addTab("Reports", new ImageIcon(iconBundle.getString("REPORTS_TAB")), criteriaPanel); --- 855,874 ---- jumpLeftButton.setEnabled(true); newReportButton.setEnabled(true); + zoomInButton.setEnabled(true); + saveStockAnalysisButton.setEnabled(true); + saveAsStockAnalysisButton.setEnabled(true); if (analysis.getReports().size() > 0) { ! if (zoomInButton.isEnabled()) ! { ! //TODO ! } ! else ! { ! criteriaDataset = new CriteriaDataset(analysis.getReports(), analysis.getSlicer().getSeries(), DEFAULT_CHART_SIZE); ! criteriaChart = new CriteriaChart(criteriaDataset); ! criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); ! } chartsPane.addTab("Reports", new ImageIcon(iconBundle.getString("REPORTS_TAB")), criteriaPanel); |
|
From: Carlos <ma...@us...> - 2007-10-24 19:22:50
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/i18n In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4390/src/java/net/sf/tails/i18n Modified Files: icons.properties Log Message: Adicionada uma Thread no complete graph, adicionado novos botoes de zoom in e zoom out e está sendo feita a lógica doa gráficos para estes botoes. Index: icons.properties =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/i18n/icons.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** icons.properties 22 Oct 2007 22:22:27 -0000 1.5 --- icons.properties 24 Oct 2007 19:22:52 -0000 1.6 *************** *** 14,16 **** MOVE_RIGHT=Data/icons/move_right.gif JUMP_LEFT=Data/icons/open.gif ! JUMP_RIGHT=Data/icons/open.gif \ No newline at end of file --- 14,18 ---- MOVE_RIGHT=Data/icons/move_right.gif JUMP_LEFT=Data/icons/open.gif ! JUMP_RIGHT=Data/icons/open.gif ! ZOOM_IN=Data/icons/open.gif ! ZOOM_OUT=Data/icons/open.gif \ No newline at end of file |
|
From: Thies <tg...@us...> - 2007-10-24 19:02:14
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28239/src/java/net/sf/tail/graphics Added Files: FasterDataset.java Log Message: Novo dataset para plotar mais rapido --- NEW FILE: FasterDataset.java --- package net.sf.tail.graphics; import java.util.List; import net.sf.tail.Indicator; import net.sf.tail.TimeSeries; import net.sf.tail.indicator.simple.ClosePriceIndicator; import org.jfree.data.DefaultKeyedValues2D; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.AbstractDataset; import edu.emory.mathcs.backport.java.util.Collections; @SuppressWarnings("unchecked") public class FasterDataset extends AbstractDataset implements CategoryDataset { private static final long serialVersionUID = -7204964027452086107L; private DefaultKeyedValues2D data; private List<Indicator<? extends Number>> indicators; private TimeSeries series; public FasterDataset(TimeSeries series, List<Indicator<? extends Number>> indicators, int firstIndex, int lastIndex) { this.data = new DefaultKeyedValues2D(); this.indicators = indicators; this.series = series; if(lastIndex - firstIndex > 800) loadValuesFaster(firstIndex, lastIndex); else loadValues(firstIndex, lastIndex); } public FasterDataset(TimeSeries timeSeries, int seriesSize) { this(timeSeries, Collections.nCopies(1, new ClosePriceIndicator(timeSeries)), timeSeries.getBegin(), timeSeries.getBegin() + seriesSize - 1); } private void loadValues(int firstIndex, int lastIndex) { for (Indicator<? extends Number> indicator : indicators) { for (int j = firstIndex; j <= lastIndex; j++) { data.addValue(indicator.getValue(j), indicator.getName() + ": "+ series.getTick(series.getBegin()).getDateName() + " - " + series.getTick(series.getEnd()).getDateName(), series.getTick(j).getDate() .toString("hh:mm d/M/yyyy")); } } } private void loadValuesFaster(int firstIndex, int lastIndex) { double firstValue; double secondValue; double thirdValue; int counter = 0; for (Indicator<? extends Number> indicator : indicators){ for (int j = firstIndex; j <= firstIndex + 2; j++) { data.addValue(indicator.getValue(j), indicator.getName() + ": " + series.getTick(series.getBegin()).getDateName() + " - " + series.getTick(series.getEnd()).getDateName(), series.getTick(j).getDate().toString( "hh:mm d/M/yyyy")); } } for (Indicator<? extends Number> indicator : indicators) { for (int j = firstIndex + 3; j < lastIndex; j++) { firstValue = indicator.getValue(j - 2).doubleValue(); secondValue = indicator.getValue(j - 1).doubleValue(); thirdValue = indicator.getValue(j).doubleValue(); if((firstValue > secondValue && thirdValue > secondValue) || (firstValue < secondValue && thirdValue < secondValue) || counter > 10){ data.addValue(secondValue, indicator.getName() + ": "+ series.getTick(series.getBegin()).getDateName() + " - " + series.getTick(series.getEnd()).getDateName(), series.getTick(j-1).getDate() .toString("hh:mm d/M/yyyy")); counter = 0; } } } for (Indicator<? extends Number> indicator : indicators) { data.addValue(indicator.getValue(lastIndex), indicator.getName() + ": "+ series.getTick(series.getBegin()).getDateName() + " - " + series.getTick(series.getEnd()).getDateName(), series.getTick(lastIndex).getDate() .toString("hh:mm d/M/yyyy")); } } public int getColumnIndex(Comparable key) { return this.data.getColumnIndex(key); } public Comparable getColumnKey(int column) { return this.data.getColumnKey(column); } public List getColumnKeys() { return this.data.getColumnKeys(); } public int getRowIndex(Comparable key) { return this.data.getRowIndex(key); } public Comparable getRowKey(int row) { return this.data.getRowKey(row); } public List getRowKeys() { return this.data.getRowKeys(); } public Number getValue(Comparable rowKey, Comparable columnKey) { return this.data.getValue(rowKey, columnKey); } public int getColumnCount() { return this.data.getColumnCount(); } public int getRowCount() { return this.data.getRowCount(); } public Number getValue(int row, int column) { return this.data.getValue(row, column); } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 17:53:01
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30908/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.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Index.java 22 Oct 2007 22:48:25 -0000 1.32 --- Index.java 24 Oct 2007 17:53:03 -0000 1.33 *************** *** 44,47 **** --- 44,48 ---- import net.sf.tail.graphics.SeriesDataset; import net.sf.tail.io.StockAnalysisSerializer; + import net.sf.tails.swing.component.TailButton; import net.sf.tails.swing.frame.report.NewReportFrame; import net.sf.tails.swing.frame.stockAnalysis.NewStockAnalysis; *************** *** 57,61 **** private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); ! final int DEFAULT_CHART_SIZE = 30; private static final long serialVersionUID = 1L; private StockAnalysis stockAnalysis; --- 58,62 ---- private static final ResourceBundle folderBundle = ResourceBundle.getBundle("net.sf.tails.i18n.Folders"); ! private final int DEFAULT_CHART_SIZE = 30; private static final long serialVersionUID = 1L; private StockAnalysis stockAnalysis; *************** *** 81,98 **** private javax.swing.JSeparator separator6; private javax.swing.JSeparator separator7; ! private javax.swing.JButton newStockAnalysisButton; ! private javax.swing.JButton newReportButton; ! private javax.swing.JButton openStockAnalysisButton; ! private javax.swing.JButton saveStockAnalysisButton; ! private javax.swing.JButton saveAsStockAnalysisButton; ! private javax.swing.JButton exportHTMLButton; ! private javax.swing.JButton exportXLSButton; ! private javax.swing.JButton cleanConsoleButton; ! private javax.swing.JButton completeGraphButton; ! private javax.swing.JButton moveLeftButton; ! private javax.swing.JButton moveRightButton; ! private javax.swing.JButton jumpLeftButton; ! private javax.swing.JButton jumpRightButton; ! private javax.swing.JButton helpButton; private javax.swing.JScrollPane reportScrollPane; private javax.swing.JTable reportTable; --- 82,99 ---- private javax.swing.JSeparator separator6; private javax.swing.JSeparator separator7; ! private TailButton newStockAnalysisButton; ! private TailButton newReportButton; ! private TailButton openStockAnalysisButton; ! private TailButton saveStockAnalysisButton; ! private TailButton saveAsStockAnalysisButton; ! private TailButton exportHTMLButton; ! private TailButton exportXLSButton; ! private TailButton cleanConsoleButton; ! private TailButton completeGraphButton; ! private TailButton moveLeftButton; ! private TailButton moveRightButton; ! private TailButton jumpLeftButton; ! private TailButton jumpRightButton; ! private TailButton helpButton; private javax.swing.JScrollPane reportScrollPane; private javax.swing.JTable reportTable; *************** *** 163,180 **** separator6 = new javax.swing.JSeparator(SwingConstants.VERTICAL); separator7 = new javax.swing.JSeparator(SwingConstants.VERTICAL); ! newStockAnalysisButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("NEW_STOCKANALYSIS"))); ! newReportButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("NEW_REPORT"))); ! openStockAnalysisButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("OPEN"))); ! saveStockAnalysisButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("SAVE"))); ! saveAsStockAnalysisButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("SAVE_AS"))); ! exportHTMLButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("HTML"))); ! exportXLSButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("XLS"))); ! cleanConsoleButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("CONSOLE"))); ! completeGraphButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("GRAPH"))); ! moveLeftButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("MOVE_LEFT"))); ! moveRightButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("MOVE_RIGHT"))); ! jumpLeftButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("JUMP_LEFT"))); ! jumpRightButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("JUMP_RIGHT"))); ! helpButton = new javax.swing.JButton(new ImageIcon(iconBundle.getString("HELP"))); reportScrollPane = new javax.swing.JScrollPane(); --- 164,181 ---- separator6 = new javax.swing.JSeparator(SwingConstants.VERTICAL); separator7 = new javax.swing.JSeparator(SwingConstants.VERTICAL); ! newStockAnalysisButton = new TailButton(new ImageIcon(iconBundle.getString("NEW_STOCKANALYSIS"))); ! newReportButton = new TailButton(new ImageIcon(iconBundle.getString("NEW_REPORT"))); ! openStockAnalysisButton = new TailButton(new ImageIcon(iconBundle.getString("OPEN"))); ! saveStockAnalysisButton = new TailButton(new ImageIcon(iconBundle.getString("SAVE"))); ! saveAsStockAnalysisButton = new TailButton(new ImageIcon(iconBundle.getString("SAVE_AS"))); ! exportHTMLButton = new TailButton(new ImageIcon(iconBundle.getString("HTML"))); ! exportXLSButton = new TailButton(new ImageIcon(iconBundle.getString("XLS"))); ! cleanConsoleButton = new TailButton(new ImageIcon(iconBundle.getString("CONSOLE"))); ! completeGraphButton = new TailButton(new ImageIcon(iconBundle.getString("GRAPH"))); ! moveLeftButton = new TailButton(new ImageIcon(iconBundle.getString("MOVE_LEFT"))); ! moveRightButton = new TailButton(new ImageIcon(iconBundle.getString("MOVE_RIGHT"))); ! jumpLeftButton = new TailButton(new ImageIcon(iconBundle.getString("JUMP_LEFT"))); ! jumpRightButton = new TailButton(new ImageIcon(iconBundle.getString("JUMP_RIGHT"))); ! helpButton = new TailButton(new ImageIcon(iconBundle.getString("HELP"))); reportScrollPane = new javax.swing.JScrollPane(); |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 17:53:00
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/component In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30908/src/java/net/sf/tails/swing/component Added Files: TailButton.java Log Message: --- NEW FILE: TailButton.java --- package net.sf.tails.swing.component; import java.awt.event.MouseEvent; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; public class TailButton extends JButton{ public TailButton(ImageIcon imageIcon) { super(imageIcon); this.setBorder(BorderFactory.createEmptyBorder()); this.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { notifyMouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { notifyMouseExited(evt); } }); } /** * */ private static final long serialVersionUID = -8268119481036857234L; private void notifyMouseEntered(MouseEvent evt) { if(this.isEnabled()) ((TailButton) evt.getSource()).setBorder(BorderFactory.createEtchedBorder()); } private void notifyMouseExited(MouseEvent evt) { ((TailButton) evt.getSource()).setBorder(BorderFactory.createEmptyBorder()); } } |
|
From: Márcio V. d. S. <mv...@us...> - 2007-10-24 17:52:54
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/component In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30886/src/java/net/sf/tails/swing/component Log Message: Directory /cvsroot/tail/TailS/src/java/net/sf/tails/swing/component added to the repository |
|
From: xanaot <xa...@us...> - 2007-10-22 22:56:24
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/report/html In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22630/src/java/net/sf/tail/report/html Modified Files: ReportHTMLGenerator.java Log Message: Refatoração do reportHTML Index: ReportHTMLGenerator.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/report/html/ReportHTMLGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReportHTMLGenerator.java 10 Oct 2007 19:04:11 -0000 1.1 --- ReportHTMLGenerator.java 22 Oct 2007 22:56:25 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- import java.io.File; import java.io.IOException; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; *************** *** 43,48 **** map.put("report", report); map.put("criterions", criterion); ! map.put("urls", urls); ! map.put("image", imagePath); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); --- 44,55 ---- map.put("report", report); map.put("criterions", criterion); ! ! List<String> stringUrl = new ArrayList<String>(); ! for (String string : urls) { ! stringUrl.add(string.replace(" ", "%20")); ! } ! ! map.put("urls", stringUrl); ! map.put("image", imagePath.replace(" ", "%20")); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); *************** *** 58,62 **** map.put("decision", decision); map.put("criteria", criteria); ! map.put("image", imagePath); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); --- 65,69 ---- map.put("decision", decision); map.put("criteria", criteria); ! map.put("image", imagePath.replace(" ", "%20")); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); *************** *** 71,75 **** map.put("report", report); map.put("criterions", criterion); ! map.put("image", imagePath); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); --- 78,82 ---- map.put("report", report); map.put("criterions", criterion); ! map.put("image", imagePath.replace(" ", "%20")); FreemarkerProcessor processor = new FreemarkerProcessor(cfg); |
|
From: Carlos <ma...@us...> - 2007-10-22 22:48:22
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19319/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: new report button disabilitado quando nao tem stock Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Index.java 22 Oct 2007 22:46:10 -0000 1.31 --- Index.java 22 Oct 2007 22:48:25 -0000 1.32 *************** *** 279,282 **** --- 279,283 ---- exportHTMLButton.setEnabled(false); exportXLSButton.setEnabled(false); + newReportButton.setEnabled(false); } *************** *** 796,799 **** --- 797,801 ---- jumpRightButton.setEnabled(true); jumpLeftButton.setEnabled(true); + newReportButton.setEnabled(true); if (analysis.getReports().size() > 0) |
|
From: Carlos <ma...@us...> - 2007-10-22 22:46:09
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18440/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: fullscreen e help funcionando Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Index.java 22 Oct 2007 22:37:09 -0000 1.30 --- Index.java 22 Oct 2007 22:46:10 -0000 1.31 *************** *** 14,17 **** --- 14,18 ---- import java.awt.Color; import java.awt.Dimension; + import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.io.BufferedOutputStream; *************** *** 45,48 **** --- 46,50 ---- import net.sf.tails.swing.frame.report.NewReportFrame; import net.sf.tails.swing.frame.stockAnalysis.NewStockAnalysis; + import net.sf.tails.swing.help.HelpFrame; import net.sf.tails.swing.helper.CompleteReportGenerator; import net.sf.tails.swing.helper.FrameHelper; *************** *** 114,123 **** * @param stockAnalysis */ public Index(StockAnalysis stockAnalysis) { this.stockAnalysis = stockAnalysis; - initComponents(); - this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - this.setLocationByPlatform(true); - this.setMinimumSize(new java.awt.Dimension(800, 600)); - this.setTitle(messageBundle.getString("DEFAULT_TITLE")); } --- 116,121 ---- * @param stockAnalysis */ public Index(StockAnalysis stockAnalysis) { + this(); this.stockAnalysis = stockAnalysis; } *************** *** 127,132 **** this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationByPlatform(true); - this.setMinimumSize(new java.awt.Dimension(800, 600)); this.setTitle(messageBundle.getString("DEFAULT_TITLE")); } --- 125,130 ---- this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationByPlatform(true); this.setTitle(messageBundle.getString("DEFAULT_TITLE")); + this.setSize(Toolkit.getDefaultToolkit().getScreenSize()); } *************** *** 277,280 **** --- 275,280 ---- moveRightButton.setEnabled(false); moveLeftButton.setEnabled(false); + jumpRightButton.setEnabled(false); + jumpLeftButton.setEnabled(false); exportHTMLButton.setEnabled(false); exportXLSButton.setEnabled(false); *************** *** 641,645 **** protected void helpButtonActionPerformed(ActionEvent evt) { ! // TODO AQUI } --- 641,645 ---- protected void helpButtonActionPerformed(ActionEvent evt) { ! new HelpFrame().setVisible(true); } *************** *** 794,797 **** --- 794,799 ---- moveRightButton.setEnabled(true); moveLeftButton.setEnabled(true); + jumpRightButton.setEnabled(true); + jumpLeftButton.setEnabled(true); if (analysis.getReports().size() > 0) |
|
From: Carlos <ma...@us...> - 2007-10-22 22:46:08
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/help In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18440/src/java/net/sf/tails/swing/help Modified Files: HelpFrame.java Log Message: fullscreen e help funcionando Index: HelpFrame.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/help/HelpFrame.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HelpFrame.java 22 Oct 2007 22:28:09 -0000 1.1 --- HelpFrame.java 22 Oct 2007 22:46:10 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- package net.sf.tails.swing.help; + import java.awt.Toolkit; import java.io.File; import java.util.ResourceBundle; *************** *** 34,37 **** --- 35,39 ---- e.printStackTrace(); } + setSize(Toolkit.getDefaultToolkit().getScreenSize()); } *************** *** 41,45 **** * always regenerated by the Form Editor. */ ! // <editor-fold defaultstate="collapsed" desc=" Código Gerado "> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); --- 43,47 ---- * always regenerated by the Form Editor. */ ! // <editor-fold defaultstate="collapsed" desc=" C�digo Gerado "> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); *************** *** 61,74 **** pack(); }// </editor-fold> - - /** - * @param args the command line arguments - */ - public static void main(String args[]) { - java.awt.EventQueue.invokeLater(new Runnable() { - public void run() { - new HelpFrame().setVisible(true); - } - }); - } } --- 63,65 ---- |
|
From: Carlos <ma...@us...> - 2007-10-22 22:37:06
|
Update of /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15031/src/java/net/sf/tails/swing/frame Modified Files: Index.java Log Message: novos botoes jumpleft e jumpright Index: Index.java =================================================================== RCS file: /cvsroot/tail/TailS/src/java/net/sf/tails/swing/frame/Index.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Index.java 22 Oct 2007 22:22:27 -0000 1.29 --- Index.java 22 Oct 2007 22:37:09 -0000 1.30 *************** *** 594,598 **** if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveLeft(); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); --- 594,598 ---- if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveLeft(stockAnalysis.getSlicer().getSlice(0).getSize()); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); *************** *** 606,610 **** if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveLeft(); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); --- 606,610 ---- if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveLeft(1); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); *************** *** 618,622 **** if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveRight(); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); --- 618,622 ---- if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveRight(stockAnalysis.getSlicer().getSlice(0).getSize()); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); *************** *** 630,634 **** if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveRight(); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); --- 630,634 ---- if(chartsPane.getComponentCount() > 1) { ! criteriaDataset.moveRight(1); criteriaChart = new CriteriaChart(criteriaDataset); criteriaPanel = new ChartPanel(criteriaChart.createChart("", true)); |
|
From: Carlos <ma...@us...> - 2007-10-22 22:36:31
|
Update of /cvsroot/tail/Tail/src/java/net/sf/tail/graphics In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14658/src/java/net/sf/tail/graphics Modified Files: CriteriaChart.java CriteriaDataset.java Log Message: refatoracao do jumpleft e jumpright Index: CriteriaDataset.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/graphics/CriteriaDataset.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CriteriaDataset.java 22 Oct 2007 20:11:53 -0000 1.2 --- CriteriaDataset.java 22 Oct 2007 22:36:31 -0000 1.3 *************** *** 88,114 **** } - public void moveRight() { if (lastIndex + 1 < series.getSize()) { ! lastIndex++; ! for (Report report : reports) { ! data.addValue(report.getApplyedCriterion().calculate(series, report.getTradesUntilIndex(lastIndex)), report.getName(), series.getTick(lastIndex).getDate() ! .toString("hh:mm d/M/yyyy")); } if (data.getColumnCount() >= DATASET_SIZE) { ! firstIndex++; ! data.removeColumn(0); } fireDatasetChanged(); } } ! public void moveLeft() { if (firstIndex > 1) { ! firstIndex--; ! lastIndex--; loadValues(firstIndex, lastIndex); fireDatasetChanged(); --- 88,133 ---- } + public void moveRight(int size) { if (lastIndex + 1 < series.getSize()) { ! int steps = series.getSize() - lastIndex - 1; ! if (steps > size) ! { ! steps = size; ! } ! ! for (int i = 0; i < steps; i++) ! { ! lastIndex ++; ! for (Report report : reports) { ! data.addValue(report.getApplyedCriterion().calculate(series, report.getTradesUntilIndex(lastIndex)), report.getName(), series.getTick(lastIndex).getDate() ! .toString("hh:mm d/M/yyyy")); ! } } if (data.getColumnCount() >= DATASET_SIZE) { ! firstIndex += steps; ! for (int i = 0; i < steps; i++) ! { ! data.removeColumn(0); ! } } + fireDatasetChanged(); } } ! public void moveLeft(int size) { if (firstIndex > 1) { ! int steps = firstIndex - 1; ! if (steps > size) ! { ! steps = size; ! } ! firstIndex -= steps; ! lastIndex -= steps; loadValues(firstIndex, lastIndex); + fireDatasetChanged(); Index: CriteriaChart.java =================================================================== RCS file: /cvsroot/tail/Tail/src/java/net/sf/tail/graphics/CriteriaChart.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CriteriaChart.java 22 Oct 2007 21:45:04 -0000 1.3 --- CriteriaChart.java 22 Oct 2007 22:36:31 -0000 1.4 *************** *** 52,56 **** // Setando tamanho do label de cada tick ! categoryAxis.setTickLabelFont(new Font("SansSerif", 0, 10)); if(dateText) { --- 52,56 ---- // Setando tamanho do label de cada tick ! categoryAxis.setTickLabelFont(new Font("SansSerif", 0, 8)); if(dateText) { |