package mySplitProva;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter;
import java.io.*;
public class SplitJFrame extends javax.swing.JFrame {
/** Creates new form SplitJFrame */
public SplitJFrame() {
initComponents();
jSplitPane1.setOneTouchExpandable(true);
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jColumnsDelimButtonGroup = new javax.swing.ButtonGroup();
jPlotButtonGroup = new javax.swing.ButtonGroup();
jSplitPane1 = new javax.swing.JSplitPane();
jDataManager = new javax.swing.JPanel();
jDataFormat = new javax.swing.JPanel();
jDate = new javax.swing.JComboBox();
jOpen = new javax.swing.JComboBox();
jHigh = new javax.swing.JComboBox();
jLow = new javax.swing.JComboBox();
jClose = new javax.swing.JComboBox();
jVolume = new javax.swing.JComboBox();
jOther = new javax.swing.JComboBox();
jColumnDelimiter = new javax.swing.JPanel();
jCommaRadioButton = new javax.swing.JRadioButton();
jSemiColonRadioButton = new javax.swing.JRadioButton();
jTabRadioButton = new javax.swing.JRadioButton();
jSpaceRadioButton = new javax.swing.JRadioButton();
jDateFormat = new javax.swing.JPanel();
jComboDateFormat = new javax.swing.JComboBox();
jDateLabel = new javax.swing.JLabel();
jDataPreview = new javax.swing.JPanel();
jScrollDataPreview = new javax.swing.JScrollPane();
jDataPreviewTextArea = new javax.swing.JTextArea();
jFileReader = new javax.swing.JButton();
jVerify = new javax.swing.JButton();
jWarningsPanel = new javax.swing.JPanel();
jScrollWarnings = new javax.swing.JScrollPane();
jWarningsTextArea = new javax.swing.JTextArea();
jCheckLabel = new javax.swing.JLabel();
jDataInterpCheckBox = new javax.swing.JCheckBox();
jMiddleDataManSeparator = new javax.swing.JSeparator();
jDataOutputPanel = new javax.swing.JPanel();
jDataRangePanel = new javax.swing.JPanel();
jEndRowField = new javax.swing.JTextField();
jRowsBackField = new javax.swing.JTextField();
jStartRowField = new javax.swing.JTextField();
jStartRowLabel = new javax.swing.JLabel();
jEndRowLabel = new javax.swing.JLabel();
jRowsBackLabel = new javax.swing.JLabel();
jTotalRowsTextField = new javax.swing.JTextField();
jTotalRowsLabel = new javax.swing.JLabel();
jPlotPanel = new javax.swing.JPanel();
jHeikinRadioButton = new javax.swing.JRadioButton();
jLineRadioButton = new javax.swing.JRadioButton();
jBarsRadioButton = new javax.swing.JRadioButton();
jCandlestickRadioButton = new javax.swing.JRadioButton();
jPlotSelectComboBox = new javax.swing.JComboBox();
jPlotDataButton = new javax.swing.JButton();
jCycleAnalysisPanel = new javax.swing.JPanel();
jLowerDataManSeparator = new javax.swing.JSeparator();
jGraphPlot = new javax.swing.JPanel();
jTopSeparator = new javax.swing.JSeparator();
jToolBar = new javax.swing.JToolBar();
jSeparator3 = new javax.swing.JSeparator();
jMainMenuBar = new javax.swing.JMenuBar();
jFile = new javax.swing.JMenu();
jEdit = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBounds(new java.awt.Rectangle(1200, 850, 0, 0));
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jSplitPane1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jSplitPane1.setDividerLocation(550);
jSplitPane1.setDividerSize(6);
jSplitPane1.setToolTipText("Click the left-right arrows to collapse or full screen magnify left pane");
jSplitPane1.setLastDividerLocation(545);
jSplitPane1.setPreferredSize(new java.awt.Dimension(1300, 850));
jDataManager.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Data Manager", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
jDataManager.setPreferredSize(new java.awt.Dimension(545, 846));
jDataFormat.setBorder(javax.swing.BorderFactory.createTitledBorder("Set Data Format"));
jDataFormat.setToolTipText("Set proper file data format: select skip will ignore current column");
jDataFormat.setPreferredSize(new java.awt.Dimension(530, 61));
jDate.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Date", "Open", "High", "Low", "Close", "Volume", "Open Int", "Skip" }));
jOpen.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Open", "High", "Low", "Close", "Volume", "Open Int", "Skip", "Date" }));
jHigh.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "High", "Low", "Close", "Volume", "Open Int", "Skip", "Date", "Open" }));
jLow.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Low", "Close", "Volume", "Open Int", "Skip", "Date", "Open", "High" }));
jClose.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Close", "Volume", "Open Int", "Skip", "Date", "Open", "High", "Low" }));
jVolume.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Volume", "Open Int", "Skip", "Date", "Open", "High", "Low", "Close" }));
jOther.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Skip", "Open Int", "Date", "Open", "High", "Low", "Close", "Volume" }));
javax.swing.GroupLayout jDataFormatLayout = new javax.swing.GroupLayout(jDataFormat);
jDataFormat.setLayout(jDataFormatLayout);
jDataFormatLayout.setHorizontalGroup(
jDataFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataFormatLayout.createSequentialGroup()
.addComponent(jDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jOpen, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jClose, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jVolume, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jOther, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jDataFormatLayout.setVerticalGroup(
jDataFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataFormatLayout.createSequentialGroup()
.addGroup(jDataFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jOpen, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jHigh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLow, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jClose, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jVolume, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jOther, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jDataFormatLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jClose, jDate, jHigh, jLow, jOther, jVolume});
jColumnDelimiter.setBorder(javax.swing.BorderFactory.createTitledBorder("Columns Delimiter"));
jColumnDelimiter.setToolTipText("Select file columns delimiter");
jColumnsDelimButtonGroup.add(jCommaRadioButton);
jCommaRadioButton.setText("Comma");
jColumnsDelimButtonGroup.add(jSemiColonRadioButton);
jSemiColonRadioButton.setText("Semi Colon");
jColumnsDelimButtonGroup.add(jTabRadioButton);
jTabRadioButton.setText("Tab");
jColumnsDelimButtonGroup.add(jSpaceRadioButton);
jSpaceRadioButton.setText("Space");
javax.swing.GroupLayout jColumnDelimiterLayout = new javax.swing.GroupLayout(jColumnDelimiter);
jColumnDelimiter.setLayout(jColumnDelimiterLayout);
jColumnDelimiterLayout.setHorizontalGroup(
jColumnDelimiterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jColumnDelimiterLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jCommaRadioButton)
.addGap(18, 18, 18)
.addComponent(jSemiColonRadioButton)
.addGap(18, 18, 18)
.addComponent(jTabRadioButton)
.addGap(18, 18, 18)
.addComponent(jSpaceRadioButton)
.addContainerGap(14, Short.MAX_VALUE))
);
jColumnDelimiterLayout.setVerticalGroup(
jColumnDelimiterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jColumnDelimiterLayout.createSequentialGroup()
.addGroup(jColumnDelimiterLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCommaRadioButton)
.addComponent(jSemiColonRadioButton)
.addComponent(jTabRadioButton)
.addComponent(jSpaceRadioButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jDateFormat.setBorder(javax.swing.BorderFactory.createTitledBorder("Date Format"));
jDateFormat.setToolTipText("Select file date format");
jComboDateFormat.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "yyyyMMdd", "yyyyMM", "MMyyyy", "ddMMyyyy" }));
jDateLabel.setText("Date");
javax.swing.GroupLayout jDateFormatLayout = new javax.swing.GroupLayout(jDateFormat);
jDateFormat.setLayout(jDateFormatLayout);
jDateFormatLayout.setHorizontalGroup(
jDateFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDateFormatLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jDateLabel)
.addGap(18, 18, 18)
.addComponent(jComboDateFormat, 0, 117, Short.MAX_VALUE)
.addContainerGap())
);
jDateFormatLayout.setVerticalGroup(
jDateFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDateFormatLayout.createSequentialGroup()
.addGroup(jDateFormatLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboDateFormat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDateLabel))
.addContainerGap(10, Short.MAX_VALUE))
);
jDataPreview.setBorder(javax.swing.BorderFactory.createTitledBorder("Data Preview"));
jDataPreview.setPreferredSize(new java.awt.Dimension(280, 110));
jDataPreviewTextArea.setColumns(20);
jDataPreviewTextArea.setRows(5);
jDataPreviewTextArea.setToolTipText("Display first and last rows in file");
jScrollDataPreview.setViewportView(jDataPreviewTextArea);
javax.swing.GroupLayout jDataPreviewLayout = new javax.swing.GroupLayout(jDataPreview);
jDataPreview.setLayout(jDataPreviewLayout);
jDataPreviewLayout.setHorizontalGroup(
jDataPreviewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollDataPreview, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
);
jDataPreviewLayout.setVerticalGroup(
jDataPreviewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataPreviewLayout.createSequentialGroup()
.addComponent(jScrollDataPreview, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jFileReader.setText("File Import");
jFileReader.setToolTipText("Click to select file to import");
jFileReader.setPreferredSize(new java.awt.Dimension(83, 20));
jFileReader.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jFileReaderActionPerformed(evt);
}
});
jVerify.setText("Verify");
jVerify.setToolTipText("Verify if file contains invalid or missing data");
jWarningsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Warnings"));
jWarningsPanel.setPreferredSize(new java.awt.Dimension(280, 110));
jWarningsTextArea.setColumns(20);
jWarningsTextArea.setRows(5);
jWarningsTextArea.setToolTipText("Display warnings for missing or invalid data if found");
jScrollWarnings.setViewportView(jWarningsTextArea);
javax.swing.GroupLayout jWarningsPanelLayout = new javax.swing.GroupLayout(jWarningsPanel);
jWarningsPanel.setLayout(jWarningsPanelLayout);
jWarningsPanelLayout.setHorizontalGroup(
jWarningsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollWarnings, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
);
jWarningsPanelLayout.setVerticalGroup(
jWarningsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollWarnings, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
);
jCheckLabel.setText("Check for invalid or missing data");
jDataInterpCheckBox.setText("Data Interpolation");
jDataInterpCheckBox.setToolTipText("Flag to interpolate file for missing data");
jDataOutputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Data Output", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
jDataRangePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Data Range"));
jEndRowField.setToolTipText("Type last data (row) to plot");
jRowsBackField.setToolTipText("Type how many data to plot counting \nbackward from last data in file");
jStartRowField.setToolTipText("Type first data (row) to plot");
jStartRowLabel.setText("Start Row");
jEndRowLabel.setText("End Row");
jRowsBackLabel.setText("Rows Back");
jTotalRowsTextField.setToolTipText("Display total number of data (rows) in file");
jTotalRowsTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTotalRowsTextFieldActionPerformed(evt);
}
});
jTotalRowsLabel.setText("Total Rows");
javax.swing.GroupLayout jDataRangePanelLayout = new javax.swing.GroupLayout(jDataRangePanel);
jDataRangePanel.setLayout(jDataRangePanelLayout);
jDataRangePanelLayout.setHorizontalGroup(
jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataRangePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jStartRowLabel)
.addComponent(jTotalRowsLabel)
.addComponent(jEndRowLabel)
.addComponent(jRowsBackLabel))
.addGap(18, 18, 18)
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jStartRowField, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(jTotalRowsTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(jEndRowField, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
.addComponent(jRowsBackField, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE))
.addContainerGap())
);
jDataRangePanelLayout.setVerticalGroup(
jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDataRangePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTotalRowsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTotalRowsLabel))
.addGap(8, 8, 8)
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jStartRowField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jStartRowLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jEndRowField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jEndRowLabel))
.addGap(8, 8, 8)
.addGroup(jDataRangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jRowsBackField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jRowsBackLabel))
.addGap(19, 19, 19))
);
jPlotPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Plot"));
jPlotButtonGroup.add(jHeikinRadioButton);
jHeikinRadioButton.setText("Heikin-Ashi");
jPlotButtonGroup.add(jLineRadioButton);
jLineRadioButton.setText("Line on");
jPlotButtonGroup.add(jBarsRadioButton);
jBarsRadioButton.setText("Bars");
jPlotButtonGroup.add(jCandlestickRadioButton);
jCandlestickRadioButton.setText("Candlestick");
jPlotSelectComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Close", "Open", "High", "Low", "(High+Low)/2", "(Open+Close)/2", "(High+Low+Close)/3" }));
jPlotDataButton.setText("Plot Data");
javax.swing.GroupLayout jPlotPanelLayout = new javax.swing.GroupLayout(jPlotPanel);
jPlotPanel.setLayout(jPlotPanelLayout);
jPlotPanelLayout.setHorizontalGroup(
jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPlotPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jBarsRadioButton)
.addGroup(jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(jPlotPanelLayout.createSequentialGroup()
.addGroup(jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCandlestickRadioButton)
.addComponent(jHeikinRadioButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPlotDataButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPlotPanelLayout.createSequentialGroup()
.addComponent(jLineRadioButton)
.addGap(43, 43, 43)
.addComponent(jPlotSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(63, Short.MAX_VALUE))
);
jPlotPanelLayout.setVerticalGroup(
jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPlotPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLineRadioButton)
.addComponent(jPlotSelectComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPlotPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPlotPanelLayout.createSequentialGroup()
.addComponent(jBarsRadioButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCandlestickRadioButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jHeikinRadioButton))
.addComponent(jPlotDataButton, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(22, Short.MAX_VALUE))
);
javax.swing.GroupLayout jDataOutputPanelLayout = new javax.swing.GroupLayout(jDataOutputPanel);
jDataOutputPanel.setLayout(jDataOutputPanelLayout);
jDataOutputPanelLayout.setHorizontalGroup(
jDataOutputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataOutputPanelLayout.createSequentialGroup()
.addComponent(jDataRangePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(32, 32, 32)
.addComponent(jPlotPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jDataOutputPanelLayout.setVerticalGroup(
jDataOutputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataOutputPanelLayout.createSequentialGroup()
.addGroup(jDataOutputPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jPlotPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jDataRangePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE))
.addContainerGap(21, Short.MAX_VALUE))
);
jCycleAnalysisPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Cycle Analysis ", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 12))); // NOI18N
javax.swing.GroupLayout jCycleAnalysisPanelLayout = new javax.swing.GroupLayout(jCycleAnalysisPanel);
jCycleAnalysisPanel.setLayout(jCycleAnalysisPanelLayout);
jCycleAnalysisPanelLayout.setHorizontalGroup(
jCycleAnalysisPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 514, Short.MAX_VALUE)
);
jCycleAnalysisPanelLayout.setVerticalGroup(
jCycleAnalysisPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 213, Short.MAX_VALUE)
);
javax.swing.GroupLayout jDataManagerLayout = new javax.swing.GroupLayout(jDataManager);
jDataManager.setLayout(jDataManagerLayout);
jDataManagerLayout.setHorizontalGroup(
jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDataManagerLayout.createSequentialGroup()
.addGroup(jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jCycleAnalysisPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLowerDataManSeparator, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
.addComponent(jDataOutputPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jMiddleDataManSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDataManagerLayout.createSequentialGroup()
.addComponent(jFileReader, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCheckLabel)
.addGap(18, 18, 18)
.addComponent(jVerify, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 55, Short.MAX_VALUE)
.addComponent(jDataInterpCheckBox))
.addComponent(jDataFormat, javax.swing.GroupLayout.Alignment.LEADING, 0, 530, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDataManagerLayout.createSequentialGroup()
.addComponent(jDateFormat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jColumnDelimiter, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDataManagerLayout.createSequentialGroup()
.addComponent(jDataPreview, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jWarningsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jDataManagerLayout.setVerticalGroup(
jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDataManagerLayout.createSequentialGroup()
.addComponent(jDataFormat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDateFormat, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jColumnDelimiter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jFileReader, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jVerify, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jDataInterpCheckBox)
.addComponent(jCheckLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jDataManagerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDataPreview, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jWarningsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jMiddleDataManSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDataOutputPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLowerDataManSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCycleAnalysisPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(20, 20, 20))
);
jSplitPane1.setLeftComponent(jDataManager);
jGraphPlot.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
javax.swing.GroupLayout jGraphPlotLayout = new javax.swing.GroupLayout(jGraphPlot);
jGraphPlot.setLayout(jGraphPlotLayout);
jGraphPlotLayout.setHorizontalGroup(
jGraphPlotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 758, Short.MAX_VALUE)
);
jGraphPlotLayout.setVerticalGroup(
jGraphPlotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 825, Short.MAX_VALUE)
);
jSplitPane1.setRightComponent(jGraphPlot);
jToolBar.setRollover(true);
jFile.setText("File");
jMainMenuBar.add(jFile);
jEdit.setText("Edit");
jMainMenuBar.add(jEdit);
setJMenuBar(jMainMenuBar);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTopSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1340, Short.MAX_VALUE)
.addComponent(jToolBar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1340, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1322, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(8, 8, 8))
.addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 1340, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTopSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 835, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(49, 49, 49))
);
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((screenSize.width-1348)/2, (screenSize.height-994)/2, 1348, 994);
}// </editor-fold>
private void jFileReaderActionPerformed(java.awt.event.ActionEvent evt) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileFilter(new TxtFileFilter());
int returnVal = fileChooser.showOpenDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION){
File myFile = fileChooser.getSelectedFile();
FileImport obj1 = new FileImport(myFile);
jTotalRowsTextField.setText(String.valueOf(obj1.numberOfLines()));
System.out.println(obj1.checkIsFile());
System.out.println(obj1.numberOfLines());
obj1.importToArray();
obj1.printArray();
System.out.println("--------------------------------------");
obj1.buildDataArray(obj1.getArray());
obj1.printDataArray();
}
}
private void jTotalRowsTextFieldActionPerformed(java.awt.event.ActionEvent evt) {
}
private class TxtFileFilter extends FileFilter{
public boolean accept(File file){
if(file.isDirectory()) return true;
String fname = file.getName();
return fname.endsWith("txt");
}
public String getDescription(){
return "txt file";
}
}
public static void main(String args[]) {
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(UnsupportedLookAndFeelException e){
//handle exception
}
catch(ClassNotFoundException e){
//handle exception
}
catch(InstantiationException e){
//handle exception
}
catch(IllegalAccessException e){
//handle exception
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SplitJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JRadioButton jBarsRadioButton;
private javax.swing.JRadioButton jCandlestickRadioButton;
private javax.swing.JLabel jCheckLabel;
private javax.swing.JComboBox jClose;
private javax.swing.JPanel jColumnDelimiter;
private javax.swing.ButtonGroup jColumnsDelimButtonGroup;
private javax.swing.JComboBox jComboDateFormat;
private javax.swing.JRadioButton jCommaRadioButton;
private javax.swing.JPanel jCycleAnalysisPanel;
private javax.swing.JPanel jDataFormat;
private javax.swing.JCheckBox jDataInterpCheckBox;
private javax.swing.JPanel jDataManager;
private javax.swing.JPanel jDataOutputPanel;
private javax.swing.JPanel jDataPreview;
private javax.swing.JTextArea jDataPreviewTextArea;
private javax.swing.JPanel jDataRangePanel;
private javax.swing.JComboBox jDate;
private javax.swing.JPanel jDateFormat;
private javax.swing.JLabel jDateLabel;
private javax.swing.JMenu jEdit;
private javax.swing.JTextField jEndRowField;
private javax.swing.JLabel jEndRowLabel;
private javax.swing.JMenu jFile;
private javax.swing.JButton jFileReader;
private javax.swing.JPanel jGraphPlot;
private javax.swing.JRadioButton jHeikinRadioButton;
private javax.swing.JComboBox jHigh;
private javax.swing.JRadioButton jLineRadioButton;
private javax.swing.JComboBox jLow;
private javax.swing.JSeparator jLowerDataManSeparator;
private javax.swing.JMenuBar jMainMenuBar;
private javax.swing.JSeparator jMiddleDataManSeparator;
private javax.swing.JComboBox jOpen;
private javax.swing.JComboBox jOther;
private javax.swing.ButtonGroup jPlotButtonGroup;
private javax.swing.JButton jPlotDataButton;
private javax.swing.JPanel jPlotPanel;
private javax.swing.JComboBox jPlotSelectComboBox;
private javax.swing.JTextField jRowsBackField;
private javax.swing.JLabel jRowsBackLabel;
private javax.swing.JScrollPane jScrollDataPreview;
private javax.swing.JScrollPane jScrollWarnings;
private javax.swing.JRadioButton jSemiColonRadioButton;
private javax.swing.JSeparator jSeparator3;
private javax.swing.JRadioButton jSpaceRadioButton;
private javax.swing.JSplitPane jSplitPane1;
private javax.swing.JTextField jStartRowField;
private javax.swing.JLabel jStartRowLabel;
private javax.swing.JRadioButton jTabRadioButton;
private javax.swing.JToolBar jToolBar;
private javax.swing.JSeparator jTopSeparator;
private javax.swing.JLabel jTotalRowsLabel;
private javax.swing.JTextField jTotalRowsTextField;
private javax.swing.JButton jVerify;
private javax.swing.JComboBox jVolume;
private javax.swing.JPanel jWarningsPanel;
private javax.swing.JTextArea jWarningsTextArea;
// End of variables declaration
}