switched to ant build
This commit is contained in:
@ -340,7 +340,7 @@
|
||||
<Component class="javax.swing.JButton" name="stopButton">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/toolbarButtonGraphics/general/Stop24.gif"/>
|
||||
<Image iconType="3" name="/resources/icons/stop.gif"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Stop"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
@ -359,7 +359,7 @@
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/icons/run.gif"/>
|
||||
<Image iconType="3" name="/resources/icons/run.gif"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Run sim!"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="Run the simmulation"/>
|
||||
@ -374,7 +374,7 @@
|
||||
<Component class="javax.swing.JButton" name="jButton2">
|
||||
<Properties>
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/icons/pause.gif"/>
|
||||
<Image iconType="3" name="/resources/icons/pause.gif"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Pause"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
@ -210,7 +210,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setMinimumSize(new java.awt.Dimension(640, 480));
|
||||
|
||||
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/toolbarButtonGraphics/general/Stop24.gif"))); // NOI18N
|
||||
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/stop.gif"))); // NOI18N
|
||||
stopButton.setText("Stop");
|
||||
stopButton.setFocusable(false);
|
||||
stopButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
@ -222,7 +222,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
|
||||
});
|
||||
|
||||
runButton.setFont(runButton.getFont());
|
||||
runButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/run.gif"))); // NOI18N
|
||||
runButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/run.gif"))); // NOI18N
|
||||
runButton.setText("Run sim!");
|
||||
runButton.setToolTipText("Run the simmulation");
|
||||
runButton.setFocusable(false);
|
||||
@ -234,7 +234,7 @@ public class NewMDIApplication extends javax.swing.JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pause.gif"))); // NOI18N
|
||||
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/icons/pause.gif"))); // NOI18N
|
||||
jButton2.setText("Pause");
|
||||
jButton2.setFocusable(false);
|
||||
jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
35
src/gui/Statistics.form
Normal file
35
src/gui/Statistics.form
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Properties>
|
||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||
<TitledBorder/>
|
||||
</Border>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="380" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="280" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
</Form>
|
67
src/gui/Statistics.java
Normal file
67
src/gui/Statistics.java
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 7u83 <7u83@mail.ru>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package gui;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class Statistics extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Creates new form Statistics
|
||||
*/
|
||||
public Statistics() {
|
||||
initComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
* regenerated by the Form Editor.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 380, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 280, Short.MAX_VALUE)
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 777 B |
@ -43,25 +43,23 @@ import java.util.jar.JarInputStream;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class AutoTraderLoader {
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given class can instaciated as AutoTrader.
|
||||
*
|
||||
* @param cls Class to check
|
||||
* @return true if it is an AutoTrader, otherwise false
|
||||
*/
|
||||
public boolean isAutoTrader(Class<?> cls){
|
||||
if (Modifier.isAbstract(cls.getModifiers()))
|
||||
public boolean isAutoTrader(Class<?> cls) {
|
||||
if (Modifier.isAbstract(cls.getModifiers())) {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
do {
|
||||
for (Class<?> i : cls.getInterfaces()) {
|
||||
if (i.equals(AutoTraderInterface.class)) {
|
||||
@ -69,11 +67,10 @@ public class AutoTraderLoader {
|
||||
}
|
||||
}
|
||||
|
||||
}while ((cls=cls.getSuperclass())!=null);
|
||||
} while ((cls = cls.getSuperclass()) != null);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Class<AutoTraderInterface> loadAutoTraderClass(String filename, String classname) {
|
||||
|
||||
String clnam = classname.substring(1, classname.length() - 6).replace('/', '.');
|
||||
@ -93,10 +90,10 @@ public class AutoTraderLoader {
|
||||
|
||||
try {
|
||||
Class<?> cls = cl.loadClass(clnam);
|
||||
System.out.printf("Check Class: %s\n",cls.getCanonicalName());
|
||||
if (isAutoTrader(cls)){
|
||||
System.out.printf("Check Class: %s\n", cls.getCanonicalName());
|
||||
if (isAutoTrader(cls)) {
|
||||
return (Class<AutoTraderInterface>) cls;
|
||||
|
||||
|
||||
}
|
||||
} catch (ClassNotFoundException ex) {
|
||||
// something wnet wrong, but we ignore it
|
||||
@ -105,12 +102,11 @@ public class AutoTraderLoader {
|
||||
|
||||
}
|
||||
|
||||
ArrayList<Class<AutoTraderInterface>> traders_cache = null;
|
||||
|
||||
ArrayList<Class<AutoTraderInterface>> traders_cache=null;
|
||||
|
||||
public ArrayList<Class<AutoTraderInterface>> getTraders() {
|
||||
|
||||
if (traders_cache!=null){
|
||||
|
||||
if (traders_cache != null) {
|
||||
return traders_cache;
|
||||
}
|
||||
|
||||
@ -141,8 +137,7 @@ public class AutoTraderLoader {
|
||||
while ((entry = is.getNextJarEntry()) != null) {
|
||||
if (entry.getName().endsWith(".class")) {
|
||||
|
||||
// System.out.printf("Entry: %s\n", entry.getDisplayName());
|
||||
|
||||
// System.out.printf("Entry: %s\n", entry.getDisplayName());
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
@ -169,7 +164,7 @@ public class AutoTraderLoader {
|
||||
}
|
||||
|
||||
}
|
||||
traders_cache=traders;
|
||||
traders_cache = traders;
|
||||
return traders;
|
||||
|
||||
}
|
||||
@ -182,9 +177,9 @@ public class AutoTraderLoader {
|
||||
|
||||
for (int i = 0; i < trclasses.size(); i++) {
|
||||
try {
|
||||
|
||||
|
||||
AutoTraderInterface ac = trclasses.get(i).newInstance();
|
||||
if (ac.getDevelStatus() && devel==false){
|
||||
if (ac.getDevelStatus() && devel == false) {
|
||||
continue;
|
||||
}
|
||||
ret.add(ac.getClass().getCanonicalName());
|
||||
@ -197,7 +192,7 @@ public class AutoTraderLoader {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<String> getDefaultStrategyNames() {
|
||||
return this.getDefaultStrategyNames(true);
|
||||
}
|
||||
@ -208,13 +203,13 @@ public class AutoTraderLoader {
|
||||
try {
|
||||
AutoTraderInterface ac = traders.get(i).newInstance();
|
||||
|
||||
System.out.printf("Looking for in %s == %s\n", ac.getClass().getCanonicalName(),name);
|
||||
|
||||
if (ac.getClass().getCanonicalName().equals(name)){
|
||||
System.out.printf("Looking for in %s == %s\n", ac.getClass().getCanonicalName(), name);
|
||||
|
||||
if (ac.getClass().getCanonicalName().equals(name)) {
|
||||
return ac;
|
||||
|
||||
// if (ac.getDisplayName().equals(name)) {
|
||||
// return ac;}
|
||||
|
||||
// if (ac.getDisplayName().equals(name)) {
|
||||
// return ac;}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user