more
This commit is contained in:
parent
0a1a44e06a
commit
bd10e72756
12
pom.xml
12
pom.xml
@ -23,11 +23,6 @@
|
|||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>20160810</version>
|
<version>20160810</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.seaglasslookandfeel</groupId>
|
|
||||||
<artifactId>seaglasslookandfeel</artifactId>
|
|
||||||
<version>0.2.1</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
@ -35,4 +30,11 @@
|
|||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
<name>SeSim</name>
|
<name>SeSim</name>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>unknown-jars-temp-repo</id>
|
||||||
|
<name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>
|
||||||
|
<url>file:${project.basedir}/lib</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
</project>
|
</project>
|
@ -16,7 +16,7 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jScrollPane1" pref="844" max="32767" attributes="0"/>
|
<Component id="jScrollPane1" pref="844" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
@ -24,18 +24,15 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Component id="guiPanel" alignment="1" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="99" max="-2" attributes="0"/>
|
|
||||||
<Component id="jComboBox1" pref="411" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="jToggleButton1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jComboBox1" alignment="1" min="-2" pref="361" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
@ -44,13 +41,13 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
|
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
<Component id="guiPanel" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<Component id="jToggleButton1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -75,32 +72,52 @@
|
|||||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
||||||
</AuxValues>
|
</AuxValues>
|
||||||
</Component>
|
</Component>
|
||||||
<Container class="javax.swing.JPanel" name="jPanel1">
|
<Component class="javax.swing.JToggleButton" name="jToggleButton1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
<Property name="text" type="java.lang.String" value="jToggleButton1"/>
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
|
|
||||||
<BevelBorder/>
|
|
||||||
</Border>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="270" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
</Container>
|
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="jButton1"/>
|
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="guiPanel">
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="defaultGuiPanel">
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
|
||||||
|
<BorderConstraints direction="Center"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" pref="492" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel1" pref="262" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="No config available"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import javax.swing.JPanel;
|
||||||
import sesim.AutoTraderConfig;
|
import sesim.AutoTraderConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,21 +43,19 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
this.jComboBox1.removeAllItems();
|
this.jComboBox1.removeAllItems();
|
||||||
ArrayList <String> sn = Globals.tloader.getDefaultStrategyNames();
|
ArrayList<String> sn = Globals.tloader.getDefaultStrategyNames();
|
||||||
for(int i=0; i<sn.size(); i++){
|
for (int i = 0; i < sn.size(); i++) {
|
||||||
this.jComboBox1.addItem(sn.get(i));
|
this.jComboBox1.addItem(sn.get(i));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setStrategy(String strategy){
|
void setStrategy(String strategy) {
|
||||||
ArrayList <Class<AutoTraderConfig>> s = Globals.tloader.getTraders();
|
ArrayList<Class<AutoTraderConfig>> s = Globals.tloader.getTraders();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
@ -67,8 +66,10 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
jComboBox1 = new javax.swing.JComboBox<>();
|
jComboBox1 = new javax.swing.JComboBox<>();
|
||||||
jPanel1 = new javax.swing.JPanel();
|
jToggleButton1 = new javax.swing.JToggleButton();
|
||||||
jButton1 = new javax.swing.JButton();
|
guiPanel = new javax.swing.JPanel();
|
||||||
|
defaultGuiPanel = new javax.swing.JPanel();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
@ -79,36 +80,45 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
jToggleButton1.setText("jToggleButton1");
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
guiPanel.setLayout(new java.awt.BorderLayout());
|
||||||
jPanel1.setLayout(jPanel1Layout);
|
|
||||||
jPanel1Layout.setHorizontalGroup(
|
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
jLabel1.setText("No config available");
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
|
||||||
|
javax.swing.GroupLayout defaultGuiPanelLayout = new javax.swing.GroupLayout(defaultGuiPanel);
|
||||||
|
defaultGuiPanel.setLayout(defaultGuiPanelLayout);
|
||||||
|
defaultGuiPanelLayout.setHorizontalGroup(
|
||||||
|
defaultGuiPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(defaultGuiPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
jPanel1Layout.setVerticalGroup(
|
defaultGuiPanelLayout.setVerticalGroup(
|
||||||
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
defaultGuiPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGap(0, 270, Short.MAX_VALUE)
|
.addGroup(defaultGuiPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
|
||||||
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
jButton1.setText("jButton1");
|
guiPanel.add(defaultGuiPanel, java.awt.BorderLayout.CENTER);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addComponent(guiPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGap(99, 99, 99)
|
|
||||||
.addComponent(jComboBox1, 0, 411, Short.MAX_VALUE))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addContainerGap()
|
|
||||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
.addGap(0, 0, Short.MAX_VALUE)
|
||||||
.addComponent(jButton1)))
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(jToggleButton1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
@ -117,9 +127,9 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(guiPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jButton1)
|
.addComponent(jToggleButton1)
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -128,6 +138,26 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
|
|
||||||
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
|
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
|
||||||
System.out.printf("Now Strategie Dialog to open\n");
|
System.out.printf("Now Strategie Dialog to open\n");
|
||||||
|
AutoTraderConfig ac = Globals.tloader.getStrategy((String) this.jComboBox1.getSelectedItem());
|
||||||
|
if (ac == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
JPanel gui = ac.getGui();
|
||||||
|
guiPanel.removeAll();
|
||||||
|
if (gui != null) {
|
||||||
|
// javax.swing.GroupLayout guil = (javax.swing.GroupLayout) this.guiPanel.getLayout();
|
||||||
|
|
||||||
|
guiPanel.add(gui, java.awt.BorderLayout.CENTER);
|
||||||
|
|
||||||
|
// this.guiPanel;
|
||||||
|
gui.setVisible(true);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
guiPanel.add(this.defaultGuiPanel, java.awt.BorderLayout.CENTER);
|
||||||
|
}
|
||||||
|
this.revalidate();
|
||||||
|
System.out.printf("Setted the dings\n", "");
|
||||||
|
this.repaint();
|
||||||
}//GEN-LAST:event_jComboBox1ActionPerformed
|
}//GEN-LAST:event_jComboBox1ActionPerformed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -173,8 +203,10 @@ public class EditTradingStrategies extends javax.swing.JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton jButton1;
|
private javax.swing.JPanel defaultGuiPanel;
|
||||||
|
private javax.swing.JPanel guiPanel;
|
||||||
private javax.swing.JComboBox<String> jComboBox1;
|
private javax.swing.JComboBox<String> jComboBox1;
|
||||||
private javax.swing.JPanel jPanel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
|
private javax.swing.JToggleButton jToggleButton1;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,6 @@ import javax.swing.JPanel;
|
|||||||
public abstract interface AutoTraderConfig {
|
public abstract interface AutoTraderConfig {
|
||||||
public abstract AutoTrader createTrader(Exchange se, double money, double shares);
|
public abstract AutoTrader createTrader(Exchange se, double money, double shares);
|
||||||
public abstract String getName();
|
public abstract String getName();
|
||||||
public abstract JPanel getConfigEditor();
|
public abstract JPanel getGui();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -202,12 +202,25 @@ public class AutoTraderLoader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AutoTraderConfig getStrategy(String name) {
|
||||||
|
ArrayList<Class<AutoTraderConfig>> traders = this.getTraders();
|
||||||
|
for (int i = 0; i < traders.size(); i++) {
|
||||||
|
try {
|
||||||
|
AutoTraderConfig ac = traders.get(i).newInstance();
|
||||||
|
if (ac.getName().endsWith(name)) {
|
||||||
|
return ac;
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList getTraders(String dir) {
|
public ArrayList getTraders(String dir) {
|
||||||
File f = new File(dir);
|
File f = new File(dir);
|
||||||
File[] ff = f.listFiles();
|
File[] ff = f.listFiles();
|
||||||
|
@ -57,7 +57,7 @@ public class RandomTraderConfig implements AutoTraderConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JPanel getConfigEditor() {
|
public JPanel getGui() {
|
||||||
return new RandomTraderConfigForm();
|
return new RandomTraderConfigForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
@ -16,60 +16,31 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Component id="jTextField1" min="-2" pref="197" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="-2" pref="83" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="115" max="-2" attributes="0"/>
|
||||||
<Component id="jRadioButton1" min="-2" max="-2" attributes="0"/>
|
<Component id="jFormattedTextField1" min="-2" pref="94" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
|
<EmptySpace pref="197" max="32767" attributes="0"/>
|
||||||
<Component id="jComboBox1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace pref="98" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
<Component id="jTextField1" min="-2" max="-2" attributes="0"/>
|
<Component id="jFormattedTextField1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
|
<EmptySpace pref="249" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="jRadioButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace pref="202" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JTextField" name="jTextField1">
|
<Component class="javax.swing.JFormattedTextField" name="jFormattedTextField1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="jTextField1"/>
|
<Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor">
|
||||||
</Properties>
|
<Format format="#0.00%" subtype="-1" type="3"/>
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JRadioButton" name="jRadioButton1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="jRadioButton1"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JComboBox" name="jComboBox1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
|
|
||||||
<StringArray count="4">
|
|
||||||
<StringItem index="0" value="Item 1"/>
|
|
||||||
<StringItem index="1" value="Item 2"/>
|
|
||||||
<StringItem index="2" value="Item 3"/>
|
|
||||||
<StringItem index="3" value="Item 4"/>
|
|
||||||
</StringArray>
|
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -47,48 +47,31 @@ public class RandomTraderConfigForm extends javax.swing.JPanel {
|
|||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
jTextField1 = new javax.swing.JTextField();
|
jFormattedTextField1 = new javax.swing.JFormattedTextField();
|
||||||
jRadioButton1 = new javax.swing.JRadioButton();
|
|
||||||
jComboBox1 = new javax.swing.JComboBox<>();
|
|
||||||
|
|
||||||
jTextField1.setText("jTextField1");
|
jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00%"))));
|
||||||
|
jFormattedTextField1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
|
||||||
jRadioButton1.setText("jRadioButton1");
|
|
||||||
|
|
||||||
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
||||||
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap())
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(83, 83, 83)
|
.addGap(115, 115, 115)
|
||||||
.addComponent(jRadioButton1)
|
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(37, 37, 37)
|
.addContainerGap(197, Short.MAX_VALUE))
|
||||||
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addContainerGap(98, Short.MAX_VALUE))
|
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addGap(24, 24, 24)
|
||||||
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(40, 40, 40)
|
.addContainerGap(249, Short.MAX_VALUE))
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(jRadioButton1)
|
|
||||||
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addContainerGap(202, Short.MAX_VALUE))
|
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JComboBox<String> jComboBox1;
|
private javax.swing.JFormattedTextField jFormattedTextField1;
|
||||||
private javax.swing.JRadioButton jRadioButton1;
|
|
||||||
private javax.swing.JTextField jTextField1;
|
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class SuperTraderConfig implements AutoTraderConfig{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JPanel getConfigEditor() {
|
public JPanel getGui() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user