Compare commits

..

No commits in common. "master" and "v0.01-pre-alpha" have entirely different histories.

242 changed files with 3408 additions and 13715 deletions

3
.gitignore vendored
View File

@ -15,6 +15,3 @@ hs_err_pid*
/target/
/store/
/nbproject/private
# Backup files
*~

View File

@ -1,3 +1,3 @@
# OpenSeSim
# SeSim
OpenSeSim - Open Source Sock Exchange Simulator
SeSim - Sock Exchange Simulator

View File

@ -109,30 +109,30 @@
-->
<target name="single-jar" depends="jar">
<property name="store.jar.name" value="OpenSeSim"/>
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<zip destfile="${store.jar}">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
</target>
<target name="single-jar" depends="jar">
<property name="store.jar.name" value="SeSim"/>
<property name="store.dir" value="store"/>
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
<delete dir="${store.dir}"/>
<mkdir dir="${store.dir}"/>
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
<zipgroupfileset dir="dist" includes="*.jar"/>
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<zip destfile="${store.jar}">
<zipfileset src="${store.dir}/temp_final.jar"
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
</zip>
<delete file="${store.dir}/temp_final.jar"/>
</target>
<property name="ivy.install.version" value="2.5.0" />
<property name="ivy.install.version" value="2.1.0-rc2" />
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME" />
<isset property="env.IVY_HOME" />
</condition>
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
@ -142,15 +142,15 @@
<mkdir dir="${ivy.jar.dir}"/>
<!-- download Ivy from web site so that it can be used even without any special installation -->
<get src="https://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="init-ivy" depends="download-ivy">
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<!-- try to load ivy here from ivy home, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as local lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the local lib dir. -->
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>

View File

@ -1,9 +1,9 @@
<ivy-module version="2.0">
<info organisation="opensesim" module="NewMDIApplication"/>
<info organisation="sesim" module="NewMDIApplication"/>
<dependencies>
<!-- <dependency org="commons-lang" name="commons-lang" rev="2.0"/> -->
<!-- <dependency org="commons-cli" name="commons-cli" rev="1.0"/>-->
<dependency org="commons-lang" name="commons-lang" rev="2.0"/>
<dependency org="commons-cli" name="commons-cli" rev="1.0"/>
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency org="org.json" name="json" rev="20160810"/>
@ -11,8 +11,6 @@
<!-- https://mvnrepository.com/artifact/javax.help/javahelp -->
<dependency org="javax.help" name="javahelp" rev="2.0.05"/>
</dependencies>
</ivy-module>

22
master-application.jnlp Normal file
View File

@ -0,0 +1,22 @@
<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp">
<information>
<title>${APPLICATION.TITLE}</title>
<vendor>${APPLICATION.VENDOR}</vendor>
<homepage href="${APPLICATION.HOMEPAGE}"/>
<description>${APPLICATION.DESC}</description>
<description kind="short">${APPLICATION.DESC.SHORT}</description>
<!--${JNLP.ICONS}-->
<!--${JNLP.OFFLINE.ALLOWED}-->
</information>
<!--${JNLP.UPDATE}-->
<!--${JNLP.SECURITY}-->
<resources>
<!--${JNLP.RESOURCES.RUNTIME}-->
<!--${JNLP.RESOURCES.MAIN.JAR}-->
<!--${JNLP.RESOURCES.JARS}-->
<!--${JNLP.RESOURCES.EXTENSIONS}-->
</resources>
<application-desc main-class="${jnlp.main.class}">
<!--${JNLP.APPLICATION.ARGS}-->
</application-desc>
</jnlp>

20
master-component.jnlp Normal file
View File

@ -0,0 +1,20 @@
<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp">
<information>
<title>${APPLICATION.TITLE}</title>
<vendor>${APPLICATION.VENDOR}</vendor>
<homepage href="${APPLICATION.HOMEPAGE}"/>
<description>${APPLICATION.DESC}</description>
<description kind="short">${APPLICATION.DESC.SHORT}</description>
<!--${JNLP.ICONS}-->
<!--${JNLP.OFFLINE.ALLOWED}-->
</information>
<!--${JNLP.UPDATE}-->
<!--${JNLP.SECURITY}-->
<resources>
<!--${JNLP.RESOURCES.RUNTIME}-->
<!--${JNLP.RESOURCES.MAIN.JAR}-->
<!--${JNLP.RESOURCES.JARS}-->
<!--${JNLP.RESOURCES.EXTENSIONS}-->
</resources>
<component-desc/>
</jnlp>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
$label=Web Start
$target.debug=jws-debug
$target.run=jws-run
compile.on.save.unsupported.javawebstart=true

View File

View File

@ -3,6 +3,6 @@ build.xml.script.CRC32=72406d8f
build.xml.stylesheet.CRC32=8064a381@1.79.1.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=65c6cbee
nbproject/build-impl.xml.script.CRC32=afd0a16a
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.95.0.48
nbproject/build-impl.xml.data.CRC32=56c4c4cc
nbproject/build-impl.xml.script.CRC32=5f99364f
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

View File

@ -1,23 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Copyright 1997-2013 Oracle and/or its affiliates. All rights reserved.
http://www.apache.org/licenses/LICENSE-2.0
Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://www.netbeans.org/cddl-gplv2.html
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License file at
nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the GPL Version 2 section of the License file that
accompanied this code. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
Contributor(s):
The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Microsystems, Inc. All Rights Reserved.
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 2, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 2] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 2 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 2 code and therefore, elected the GPL
Version 2 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
-->
<project name="jnlp-impl" default="default" basedir=".." xmlns:jnlp="http://www.netbeans.org/ns/j2se-project/jnlp" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3">
@ -237,7 +261,7 @@
<macrodef name="extend-manifest" uri="http://www.netbeans.org/ns/j2se-project/jnlp">
<element name="customize"/>
<sequential>
<manifest file="${tmp.manifest.file}" mode="update" encoding="UTF-8">
<manifest file="${tmp.manifest.file}" mode="update">
<customize/>
</manifest>
</sequential>
@ -282,7 +306,7 @@
<target name="-copy-tmp-manifest" if="manifest.file">
<property name="tmp.manifest.file" value="${build.dir}/manifest.mf"/>
<copy file="${manifest.file}" tofile="${build.dir}/manifest.mf" encoding="${manifest.encoding}" outputencoding="UTF-8"/>
<copy file="${manifest.file}" tofile="${build.dir}/manifest.mf"/>
</target>
<target name="-set-mixed-code-properties" depends="-check-signing-possible" if="jnlp.signed.true+signjars.task.available">
@ -842,6 +866,18 @@
description="Debug javaws project in IDE"/>
<target name="-init-debug-args">
<property name="version-output" value="java version &quot;${ant.java.version}"/>
<condition property="have-jdk-older-than-1.4">
<or>
<contains string="${version-output}" substring="java version &quot;1.0"/>
<contains string="${version-output}" substring="java version &quot;1.1"/>
<contains string="${version-output}" substring="java version &quot;1.2"/>
<contains string="${version-output}" substring="java version &quot;1.3"/>
</or>
</condition>
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
<istrue value="${have-jdk-older-than-1.4}"/>
</condition>
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
<os family="windows"/>
</condition>
@ -853,7 +889,7 @@
<target name="-debug-javaws-debuggee" depends="-init-debug-args,-init-platform,-check-webstart">
<echo message="Executing ${jnlp.dest.dir}${file.separator}${jnlp.file} in debug mode using ${active.webstart.executable}"/>
<exec executable="${active.webstart.executable}">
<env key="JAVAWS_VM_ARGS" value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
<env key="JAVAWS_VM_ARGS" value="${debug-args-line} -Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
<arg value="-wait"/>
<arg file="${jnlp.dest.dir}${file.separator}${jnlp.file}"/>
</exec>

View File

@ -1,4 +1,4 @@
#Sat, 25 Jul 2020 03:07:19 +0200
#Sat, 27 Jan 2018 22:25:12 +0100
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
@ -8,17 +8,8 @@ ant.customtasks.libs=JWSAntTasks
application.desc=SeSim - Stock Exchange Simulator
application.homepage=blog.cauwersin.com
application.splash=
application.title=OpenSeSim
application.title=SeSim
application.vendor=Cauwersin
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs=true
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width=4
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab=4
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.tab-size=8
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width=80
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap=none
auxiliary.org-netbeans-modules-editor-indent.CodeStyle.usedProfile=project
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsEnabled=true
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
@ -32,14 +23,12 @@ build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=${run.classpath}
debug.modulepath=${run.modulepath}
debug.test.classpath=${run.test.classpath}
debug.test.modulepath=${run.test.modulepath}
# Files in build.classes.dir which should be excluded from distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/OpenSeSim.jar
dist.jar=${dist.dir}/SeSim.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
@ -52,18 +41,14 @@ javac.classpath=${ivy.classpath}\:${libs.absolutelayout.classpath}
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.modulepath=
javac.processormodulepath=
javac.processorpath=${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=${javac.classpath}\:${build.classes.dir}\:${libs.junit_4.classpath}\:${libs.hamcrest.classpath}\:${libs.testng.classpath}
javac.test.modulepath=${javac.modulepath}
javac.test.classpath=${javac.classpath}\:${build.classes.dir}
javac.test.processorpath=${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.html5=false
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
@ -72,13 +57,10 @@ javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
jlink.launcher=false
jlink.launcher.name=OpenSeSim
jnlp.applet.height=300
jnlp.applet.width=300
jnlp.codebase.type=user
jnlp.codebase.url=$$$$codebase
jnlp.codebase.user=
jnlp.descriptor=component
jnlp.enabled=false
jnlp.icon=
@ -87,8 +69,7 @@ jnlp.offline-allowed=true
jnlp.signed=true
jnlp.signing=key
jnlp.signing.alias=SeSim
jnlp.signing.keystore=
main.class=opensesim.gui.SeSimApplication
main.class=gui.SeSimApplication
# Optional override of default Application-Library-Allowable-Codebase attribute identifying the locations where your signed RIA is expected to be found.
manifest.custom.application.library.allowable.codebase=
# Optional override of default Caller-Allowable-Codebase attribute identifying the domains from which JavaScript code can make calls to your RIA without security prompts.
@ -107,11 +88,9 @@ run.classpath=${javac.classpath}\:${build.classes.dir}
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.modulepath=${javac.modulepath}
run.test.classpath=${javac.test.classpath}\:${build.test.classes.dir}
run.test.modulepath=${javac.test.modulepath}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
ivy.home=/usr/share/java
ivy.classpath=lib/accessors-smart-1.1.jar\:lib/asm-5.0.3.jar\:lib/hamcrest-core-1.3.jar\:lib/javahelp-2.0.05-javadoc.jar\:lib/javahelp-2.0.05-sources.jar\:lib/javahelp-2.0.05.jar\:lib/json-20160810-javadoc.jar\:lib/json-20160810-sources.jar\:lib/json-20160810.jar\:lib/json-path-2.1.0.jar\:lib/json-smart-2.2.jar\:lib/junit-4.12.jar\:lib/mockito-core-1.9.5.jar\:lib/objenesis-1.0.jar\:lib/slf4j-api-1.7.13.jar
ivy.classpath=lib/commons-cli-1.0-javadoc.jar\:lib/commons-cli-1.0-sources.jar\:lib/commons-cli-1.0.jar\:lib/commons-lang-2.0-javadoc.jar\:lib/commons-lang-2.0-sources.jar\:lib/commons-lang-2.0.jar\:lib/commons-logging-1.0.jar\:lib/javahelp-2.0.05-javadoc.jar\:lib/javahelp-2.0.05-sources.jar\:lib/javahelp-2.0.05.jar\:lib/json-20160810-javadoc.jar\:lib/json-20160810-sources.jar\:lib/json-20160810.jar

View File

@ -9,7 +9,7 @@
</extension>
</buildExtensions>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>OpenSeSim</name>
<name>SeSim</name>
<source-roots>
<root id="src.dir"/>
</source-roots>

17
preview-application.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test page for launching the application via JNLP</title>
</head>
<body>
<h3>Test page for launching the application via JNLP</h3>
<script src="http://java.com/js/deployJava.js"></script>
<script>
deployJava.createWebStartLaunchButton("${JNLP.FILE}")
</script>
<!-- Or use the following link element to launch with the application -->
<!--
<a href="${JNLP.FILE}">Launch the application</a>
-->
</body>
</html>

View File

@ -4,19 +4,19 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package opensesim.chart;
package chart;
import opensesim.old_sesim.OHLCDataItem;
import opensesim.old_sesim.OHLCData;
import sesim.OHLCDataItem;
import sesim.OHLCData;
import java.awt.*;
import opensesim.old_sesim.Exchange.*;
import opensesim.old_sesim.Quote;
import opensesim.gui.Globals;
import sesim.Exchange.*;
import sesim.Quote;
import gui.Globals;
import java.util.ArrayList;
import javax.swing.JViewport;
import javax.swing.Scrollable;
import opensesim.old_sesim.MinMax;
import opensesim.old_sesim.Scheduler;
import sesim.MinMax;
import sesim.Scheduler;

View File

@ -25,10 +25,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="400" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="153" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" pref="123" max="-2" attributes="0"/>
<EmptySpace pref="124" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
@ -37,10 +37,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="300" max="32767" attributes="0"/>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="137" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" pref="49" max="-2" attributes="0"/>
<EmptySpace pref="114" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
import java.net.URL;
import java.util.Locale;
import javax.help.*;
@ -71,19 +71,19 @@ public class Help extends javax.swing.JDialog {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(153, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(124, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(0, 0, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(137, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(114, Short.MAX_VALUE)))
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(0, 0, Short.MAX_VALUE)))
);
pack();

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
import javax.swing.JPanel;
import javax.swing.border.Border;

View File

@ -23,15 +23,15 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
import opensesim.chart.painter.ChartCrossPainter;
import opensesim.chart.painter.ChartPainter;
import opensesim.chart.painter.OHLCChartPainter;
import opensesim.chart.painter.XLegendDetail;
import opensesim.chart.painter.XLegendPainter;
import opensesim.chart.painter.YLegendPainter;
import opensesim.gui.Globals;
import chart.painter.ChartCrossPainter;
import chart.painter.ChartPainter;
import chart.painter.OHLCChartPainter;
import chart.painter.XLegendDetail;
import chart.painter.XLegendPainter;
import chart.painter.YLegendPainter;
import gui.Globals;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
@ -42,10 +42,10 @@ import java.awt.event.MouseListener;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.border.Border;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.Stock;
import sesim.ChartDef;
import sesim.ChartPanel;
import sesim.OHLCData;
import sesim.Stock;
/**
*

View File

@ -68,7 +68,7 @@
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="old_sesim.ChartPanel" name="chart">
<Container class="sesim.ChartPanel" name="chart">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
@ -96,7 +96,7 @@
</DimensionLayout>
</Layout>
</Container>
<Container class="old_sesim.ChartPanel" name="yLegend">
<Container class="sesim.ChartPanel" name="yLegend">
<Layout>
<DimensionLayout dim="0">
@ -111,7 +111,7 @@
</DimensionLayout>
</Layout>
</Container>
<Container class="old_sesim.ChartPanel" name="xLegend">
<Container class="sesim.ChartPanel" name="xLegend">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">

View File

@ -23,25 +23,25 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
import opensesim.old_sesim.ChartDef;
import opensesim.chart.painter.CandleStickChartPainter;
import opensesim.chart.painter.ChartPainter;
import opensesim.chart.painter.XLegendPainter;
import opensesim.chart.painter.ChartCrossPainter;
import opensesim.chart.painter.LineChartPainter;
import opensesim.chart.painter.OHLCChartPainter;
import opensesim.chart.painter.YLegendPainter;
import opensesim.gui.Globals;
import sesim.ChartDef;
import chart.painter.CandleStickChartPainter;
import chart.painter.ChartPainter;
import chart.painter.XLegendPainter;
import chart.painter.ChartCrossPainter;
import chart.painter.LineChartPainter;
import chart.painter.OHLCChartPainter;
import chart.painter.YLegendPainter;
import gui.Globals;
import java.util.ArrayList;
import opensesim.old_sesim.Exchange.QuoteReceiver;
import opensesim.old_sesim.Indicator;
import opensesim.old_sesim.MinMax;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.OHLCDataItem;
import opensesim.old_sesim.Quote;
import opensesim.indicators.SMAIndicator;
import sesim.Exchange.QuoteReceiver;
import sesim.Indicator;
import sesim.MinMax;
import sesim.OHLCData;
import sesim.OHLCDataItem;
import sesim.Quote;
import indicators.SMAIndicator;
import java.util.Objects;
import javax.swing.ButtonGroup;
import javax.swing.JRadioButtonMenuItem;
@ -170,7 +170,7 @@ public class MasterChart extends javax.swing.JPanel implements QuoteReceiver {
chart.setXSCrollBar(xScrollBar);
chart.addChartPainter(new ChartCrossPainter());
sma1 = new opensesim.indicators.SMAIndicator();
sma1 = new indicators.SMAIndicator();
sma1.setParent(mydata);
JSONObject co;
@ -183,7 +183,7 @@ public class MasterChart extends javax.swing.JPanel implements QuoteReceiver {
chart.addChartPainter(p);
sma2 = new opensesim.indicators.SMAIndicator();
sma2 = new indicators.SMAIndicator();
sma2.setParent(mydata);
co = new JSONObject("{\"len\": 20}");
sma2.putConfig(co);
@ -213,9 +213,9 @@ public class MasterChart extends javax.swing.JPanel implements QuoteReceiver {
ctxMenu = new javax.swing.JPopupMenu();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
chart = new opensesim.old_sesim.ChartPanel();
yLegend = new opensesim.old_sesim.ChartPanel();
xLegend = new opensesim.old_sesim.ChartPanel();
chart = new sesim.ChartPanel();
yLegend = new sesim.ChartPanel();
xLegend = new sesim.ChartPanel();
xScrollBar = new javax.swing.JScrollBar();
jMenu1.setText("jMenu1");
@ -363,19 +363,19 @@ public class MasterChart extends javax.swing.JPanel implements QuoteReceiver {
}//GEN-LAST:event_chartMouseMoved
private void chartMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_chartMousePressed
// System.out.printf("Mauspress\n");
System.out.printf("Mauspress\n");
this.formMousePressed(evt);
}//GEN-LAST:event_chartMousePressed
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.old_sesim.ChartPanel chart;
private sesim.ChartPanel chart;
private javax.swing.JPopupMenu ctxMenu;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenuItem jMenuItem1;
private opensesim.old_sesim.ChartPanel xLegend;
private sesim.ChartPanel xLegend;
private javax.swing.JScrollBar xScrollBar;
private opensesim.old_sesim.ChartPanel yLegend;
private sesim.ChartPanel yLegend;
// End of variables declaration//GEN-END:variables
@Override

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
/**
*

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart;
package chart;
/**
*
@ -49,7 +49,7 @@ public class SuperDlg extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
masterChart1 = new opensesim.chart.MasterChart();
masterChart1 = new chart.MasterChart();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -115,6 +115,6 @@ public class SuperDlg extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.chart.MasterChart masterChart1;
private chart.MasterChart masterChart1;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,13 +23,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import java.awt.Color;
import java.awt.Graphics2D;
import javax.swing.JScrollBar;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.OHLCDataItem;
import sesim.OHLCData;
import sesim.OHLCDataItem;
/**
*

View File

@ -23,13 +23,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import sesim.ChartDef;
import sesim.ChartPanel;
import java.awt.Graphics2D;
import java.awt.Point;
import opensesim.old_sesim.OHLCDataItem;
import sesim.OHLCDataItem;
/**

View File

@ -23,15 +23,15 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import sesim.ChartDef;
import sesim.ChartPanel;
import java.awt.Dimension;
import java.awt.Graphics2D;
import opensesim.old_sesim.ChartPainterInterface;
import opensesim.old_sesim.MinMax;
import opensesim.old_sesim.OHLCData;
import sesim.ChartPainterInterface;
import sesim.MinMax;
import sesim.OHLCData;
/**
*

View File

@ -23,11 +23,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import java.awt.Color;
import java.awt.Graphics2D;
import opensesim.old_sesim.OHLCDataItem;
import sesim.OHLCDataItem;
/**
*

View File

@ -23,18 +23,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import sesim.ChartDef;
import sesim.ChartPanel;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import opensesim.old_sesim.MinMax;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.OHLCDataItem;
import sesim.MinMax;
import sesim.OHLCData;
import sesim.OHLCDataItem;
/**
*

View File

@ -23,14 +23,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import opensesim.old_sesim.Scheduler;
import sesim.ChartDef;
import sesim.ChartPanel;
import sesim.Scheduler;
/**
*

View File

@ -23,14 +23,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import sesim.ChartDef;
import sesim.ChartPanel;
import java.awt.Dimension;
import java.awt.Graphics2D;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.OHLCDataItem;
import sesim.OHLCData;
import sesim.OHLCDataItem;
/**
* Paints an x-legend for OHLC charts
@ -42,7 +42,7 @@ public class XLegendPainter extends OHLCChartPainter {
private String getTimeStrAt(OHLCData data, int unit) {
int fs = data.getFrameSize();
return opensesim.old_sesim.Scheduler.formatTimeMillis(0 + (long) unit * (long) fs);
return sesim.Scheduler.formatTimeMillis(0 + (long) unit * (long) fs);
}

View File

@ -23,18 +23,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.chart.painter;
package chart.painter;
import opensesim.chart.Chart;
import chart.Chart;
import java.awt.Color;
import opensesim.old_sesim.ChartDef;
import opensesim.old_sesim.ChartPanel;
import sesim.ChartDef;
import sesim.ChartPanel;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import opensesim.old_sesim.MinMax;
import opensesim.old_sesim.OHLCData;
import opensesim.old_sesim.OHLCDataItem;
import sesim.MinMax;
import sesim.OHLCData;
import sesim.OHLCDataItem;
/**
*

View File

@ -3,7 +3,6 @@
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="About OpenSeSim"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[400, 300]"/>
</Property>
@ -28,7 +27,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace pref="549" max="32767" attributes="0"/>
<EmptySpace pref="547" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -38,7 +37,7 @@
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane1" pref="490" max="32767" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="472" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" pref="27" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@ -62,7 +61,7 @@
<Font component="jTextPane1" property="font" relativeSize="true" size="0"/>
</FontInfo>
</Property>
<Property name="text" type="java.lang.String" value="OpenSeSim - Open Source Stock Exchange Simulator - Version 0.1&#xa;&#xa;&#xa;Copyright (c) 2017, 7u83 &lt;7u83@mail.ru&gt;&#xa;All rights reserved.&#xa;&#xa;Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:&#xa;&#xa;* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.&#xa;&#xa;* 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.&#xa;&#xa;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; 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.&#xa;"/>
<Property name="text" type="java.lang.String" value="SeSim - Stock Exchange Simulator - Version 0.1&#xa;&#xa;&#xa;Copyright (c) 2017, 7u83 &lt;7u83@mail.ru&gt;&#xa;All rights reserved.&#xa;&#xa;Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:&#xa;&#xa;* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.&#xa;&#xa;* 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.&#xa;&#xa;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; 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.&#xa;"/>
</Properties>
</Component>
</SubComponents>

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui.misc;
package gui;
/**
*
@ -54,12 +54,11 @@ public class AboutDialog extends javax.swing.JDialog {
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("About OpenSeSim");
setMinimumSize(new java.awt.Dimension(400, 300));
jTextPane1.setEditable(false);
jTextPane1.setFont(jTextPane1.getFont());
jTextPane1.setText("OpenSeSim - Open Source Stock Exchange Simulator - Version 0.1\n\n\nCopyright (c) 2017, 7u83 <7u83@mail.ru>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* 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.\n\nTHIS 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.\n");
jTextPane1.setText("SeSim - Stock Exchange Simulator - Version 0.1\n\n\nCopyright (c) 2017, 7u83 <7u83@mail.ru>\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n* 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.\n\nTHIS 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.\n");
jScrollPane1.setViewportView(jTextPane1);
jButton1.setMnemonic('c');
@ -75,7 +74,7 @@ public class AboutDialog extends javax.swing.JDialog {
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(549, Short.MAX_VALUE)
.addContainerGap(547, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
@ -83,7 +82,7 @@ public class AboutDialog extends javax.swing.JDialog {
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 472, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())

View File

@ -23,11 +23,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.ArrayList;
import opensesim.old_sesim.Order.OrderType;
import opensesim.old_sesim.Order;
import sesim.Order.OrderType;
import sesim.Order;
/**

View File

@ -23,12 +23,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.ArrayList;
import opensesim.old_sesim.Order;
import opensesim.old_sesim.Order.OrderType;
import sesim.Order;
import sesim.Order.OrderType;
/**
*

View File

@ -23,12 +23,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.Timer;
import java.util.TimerTask;
import opensesim.old_sesim.Exchange.Statistics;
import opensesim.old_sesim.Scheduler;
import sesim.Exchange.Statistics;
import sesim.Scheduler;
/**
*
@ -40,7 +40,7 @@ public class Clock extends javax.swing.JPanel {
TimerTask clockUpdater;
class ClockUpdater implements opensesim.old_sesim.Scheduler.TimerTaskRunner{
class ClockUpdater implements sesim.Scheduler.TimerTaskRunner{
@Override
public long timerTask() {

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
/**
*
@ -49,7 +49,7 @@ public class ClockDialog extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
clock1 = new opensesim.gui.Clock();
clock1 = new gui.Clock();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -138,7 +138,7 @@ public class ClockDialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.gui.Clock clock1;
private gui.Clock clock1;
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
/**
*
@ -55,7 +55,7 @@ public class EditAutoTraderListDialog extends javax.swing.JDialog {
jButton1 = new javax.swing.JButton();
jOkButton = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
editAutoTraderList1 = new opensesim.gui.EditAutoTraderList();
editAutoTraderList1 = new gui.EditAutoTraderList();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -173,7 +173,7 @@ public class EditAutoTraderListDialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.gui.EditAutoTraderList editAutoTraderList1;
private gui.EditAutoTraderList editAutoTraderList1;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jOkButton;

View File

@ -23,9 +23,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.gui.util.EscDialog;
import org.json.JSONObject;
/**

View File

@ -3,7 +3,6 @@
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Select Asset Type to create"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
@ -27,16 +26,25 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="158" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="80" max="-2" attributes="0"/>
<Component id="lafComboBox" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="201" max="32767" attributes="0"/>
<Component id="okButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="applyButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="assetTypeComboBox" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="godmodeCheckBox" min="-2" max="-2" attributes="0"/>
<Component id="jDevleopmentFeaturesCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -45,15 +53,20 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="assetTypeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lafComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="31" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="godmodeCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jDevleopmentFeaturesCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="188" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="applyButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -62,35 +75,64 @@
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JComboBox" name="lafComboBox">
<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>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="lafComboBoxActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="cancelButton">
<Properties>
<Property name="mnemonic" type="int" value="99"/>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="applyButton">
<Properties>
<Property name="mnemonic" type="int" value="97"/>
<Property name="text" type="java.lang.String" value="Apply"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="okButton">
<Properties>
<Property name="text" type="java.lang.String" value="Create ..."/>
<Property name="mnemonic" type="int" value="111"/>
<Property name="text" type="java.lang.String" value="Ok"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JComboBox" name="assetTypeComboBox">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="getComboBoxModel()" type="code"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="Type:"/>
<Property name="text" type="java.lang.String" value="Look and Feel:"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="jDevleopmentFeaturesCheckBox">
<Properties>
<Property name="text" type="java.lang.String" value="Develeopment"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="godmodeCheckBox">
<Properties>
<Property name="text" type="java.lang.String" value="Godmode"/>
</Properties>
</Component>
</SubComponents>

View File

@ -23,17 +23,12 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui.PreferencesEditor;
package gui;
import opensesim.gui.Globals;
import java.awt.Frame;
import java.awt.Window;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
@ -43,7 +38,7 @@ import javax.swing.UnsupportedLookAndFeelException;
*
* @author 7u83 <7u83@mail.ru>
*/
public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
public class EditPreferencesDialog extends javax.swing.JDialog {
UIManager.LookAndFeelInfo[] lafInfo;
@ -65,7 +60,7 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
for (UIManager.LookAndFeelInfo lafInfo1 : lafInfo) {
lafComboBox.addItem(lafInfo1.getName());
}
lafComboBox.setSelectedItem(Globals.prefs.get(Globals.PrefKeys.LAF, "Nimbus"));
lafComboBox.setSelectedItem(Globals.prefs.get("laf", "Nimbus"));
String selstr;
selstr = Globals.prefs.get(Globals.DEVELSTATUS, "false");
@ -74,7 +69,7 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
selstr = Globals.prefs.get(Globals.GODMODE, "false");
this.godmodeCheckBox.setSelected(selstr.equals("true"));
xClassPath.setText(Globals.prefs.get(Globals.PrefKeys.XCLASSPATH, ""));
}
@ -94,15 +89,8 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
jLabel1 = new javax.swing.JLabel();
jDevleopmentFeaturesCheckBox = new javax.swing.JCheckBox();
godmodeCheckBox = new javax.swing.JCheckBox();
classPathChoseButton = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
xClassPath = new javax.swing.JTextField();
jSpinner1 = new javax.swing.JSpinner();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("OpenSeSim Preferences");
setMinimumSize(new java.awt.Dimension(551, 343));
lafComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
lafComboBox.addActionListener(new java.awt.event.ActionListener() {
@ -141,19 +129,6 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
godmodeCheckBox.setText("Godmode");
classPathChoseButton.setText("Choose ...");
classPathChoseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
classPathChoseButtonActionPerformed(evt);
}
});
jLabel2.setText("Additional Path:");
jSpinner1.setModel(new javax.swing.SpinnerNumberModel(1, 1, null, 1));
jLabel3.setText("Number of threads:");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
@ -161,36 +136,22 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(80, 80, 80)
.addComponent(lafComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(418, 418, 418))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(okButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(applyButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(xClassPath)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(classPathChoseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(3, 3, 3))
.addGap(0, 201, Short.MAX_VALUE)
.addComponent(okButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(applyButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cancelButton))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(godmodeCheckBox)
.addComponent(jDevleopmentFeaturesCheckBox)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lafComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(jDevleopmentFeaturesCheckBox))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
layout.setVerticalGroup(
@ -200,30 +161,16 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lafComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(godmodeCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDevleopmentFeaturesCheckBox)
.addGap(28, 28, 28)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(classPathChoseButton)
.addComponent(xClassPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addContainerGap(42, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cancelButton)
.addComponent(applyButton)
.addComponent(okButton))
.addContainerGap())))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(godmodeCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDevleopmentFeaturesCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 188, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cancelButton)
.addComponent(applyButton)
.addComponent(okButton))
.addContainerGap())
);
pack();
@ -236,10 +183,6 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
if (old_laf != new_laf) {
try {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
UIManager.setLookAndFeel(old_laf);
} catch (UnsupportedLookAndFeelException ex) {
Logger.getLogger(EditPreferencesDialog.class.getName()).log(Level.SEVERE, null, ex);
@ -259,6 +202,7 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed
String selected = (String) this.lafComboBox.getSelectedItem();
Globals.setLookAndFeel(selected);
@ -266,6 +210,7 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
resetUI();
}//GEN-LAST:event_applyButtonActionPerformed
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
@ -277,43 +222,10 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
Globals.prefs.put(Globals.DEVELSTATUS, sel);
sel = this.godmodeCheckBox.isSelected() == true ? "true" : "false";
Globals.prefs.put(Globals.GODMODE, sel);
Globals.prefs.put(Globals.PrefKeys.XCLASSPATH, xClassPath.getText());
Globals.notifyCfgListeners();
Globals.notifyCfgListeners();
this.dispose();
}//GEN-LAST:event_okButtonActionPerformed
private void classPathChoseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_classPathChoseButtonActionPerformed
JFileChooser chooser = new JFileChooser();
File dir = null;
if (!"".equals(xClassPath.getText())) {
dir = new File(xClassPath.getText());
if (!dir.exists()) {
dir = null;
}
}
if (dir == null) {
dir = new File(System.getProperty("user.home"));
}
chooser.setCurrentDirectory(dir);
chooser.setDialogTitle("Chose Directory");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
int rc = chooser.showOpenDialog(null);
if ( rc == JFileChooser.APPROVE_OPTION){
xClassPath.setText(chooser.getSelectedFile().getAbsolutePath());
}
}//GEN-LAST:event_classPathChoseButtonActionPerformed
/**
* @param args the command line arguments
*/
@ -359,15 +271,10 @@ public class EditPreferencesDialog extends opensesim.gui.util.EscDialog {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton applyButton;
private javax.swing.JButton cancelButton;
private javax.swing.JButton classPathChoseButton;
private javax.swing.JCheckBox godmodeCheckBox;
private javax.swing.JCheckBox jDevleopmentFeaturesCheckBox;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JSpinner jSpinner1;
private javax.swing.JComboBox<String> lafComboBox;
private javax.swing.JButton okButton;
private javax.swing.JTextField xClassPath;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,9 +23,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import static opensesim.gui.Globals.LOGGER;
import static gui.Globals.LOGGER;
import java.awt.Frame;
import java.util.ArrayList;
import java.util.HashMap;
@ -36,8 +36,8 @@ import java.util.logging.Logger;
import javax.swing.JPanel;
import org.json.JSONArray;
import org.json.JSONObject;
import opensesim.old_sesim.AutoTraderGui;
import opensesim.old_sesim.AutoTraderInterface;
import sesim.AutoTraderGui;
import sesim.AutoTraderInterface;
/**
*

View File

@ -8,6 +8,9 @@
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="formKeyReleased"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>

View File

@ -23,14 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui.util;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
package gui;
/**
*
@ -38,32 +31,21 @@ import javax.swing.KeyStroke;
*/
public class EscDialog extends javax.swing.JDialog {
final void addEscListener() {
javax.swing.JDialog dialog = this;
ActionListener escListener = (ActionEvent e) -> {
dispatchEvent(new WindowEvent(
dialog, WindowEvent.WINDOW_CLOSING
));
};
getRootPane().registerKeyboardAction(escListener,
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true),
JComponent.WHEN_IN_FOCUSED_WINDOW);
}
/**
* Creates new form EscDialog
*
* @param parent
* @param modal
*/
public EscDialog(java.awt.Window parent, boolean modal) {
super(parent, modal ? ModalityType.DOCUMENT_MODAL : ModalityType.MODELESS);
public EscDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
addEscListener();
System.out.printf("Adding Key Listener\n", "");
addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
formKeyReleased(evt);
}
});
this.setLocationRelativeTo(parent);
}
/**
* 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
@ -74,6 +56,11 @@ public class EscDialog extends javax.swing.JDialog {
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
formKeyReleased(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
@ -89,6 +76,10 @@ public class EscDialog extends javax.swing.JDialog {
pack();
}// </editor-fold>//GEN-END:initComponents
private void formKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyReleased
dispose();
}//GEN-LAST:event_formKeyReleased
/**
* @param args the command line arguments
*/
@ -118,7 +109,6 @@ public class EscDialog extends javax.swing.JDialog {
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
EscDialog dialog = new EscDialog(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {

268
src/gui/Globals.java Normal file
View File

@ -0,0 +1,268 @@
/*
* 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;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.UIManager;
import org.json.JSONArray;
import org.json.JSONObject;
import sesim.AutoTraderInterface;
import sesim.AutoTraderLoader;
import sesim.Indicator;
import sesim.IndicatorLoader;
import sesim.SeSimClassLoader;
/**
*
* @author 7u83 <7u83@mail.ru>
*/
public class Globals {
public static final String SESIM_FILEEXTENSION = "sesim";
public static final Double SESIM_FILEVERSION = 0.1;
public static final String SESIM_APPTITLE = "SeSim - Stock Exchange Simulator";
public interface CfgListener {
void cfgChanged();
}
static ArrayList<CfgListener> cfg_listeners = new ArrayList<>();
public static void notifyCfgListeners() {
for (CfgListener l : cfg_listeners) {
l.cfgChanged();
}
}
public static void addCfgListener(CfgListener l) {
cfg_listeners.add(l);
}
public static JFrame frame;
// static final String STRATEGYPREFS = "Strategies";
// static final String TRADERPREFS = "Traders";
static final String DEVELSTATUS = "devel_status";
public static final String GODMODE = "godmode";
static public sesim.Exchange se;
/**
* Defines keys for preferences
*/
public static final class PrefKeys {
public static String WORKDIR = "workdir";
public static final String CURRENTFILE = "currentfile";
public static final String SESIMVERSION = "version";
public static final String STRATEGIES = "strategies";
public static final String TRADERS = "traders";
}
static public Preferences prefs;
public static class CfgStrings {
public static final String GODMODE = "godmode";
}
public static String DEFAULT_EXCHANGE_CFG
= "{"
+ " money_decimals: 2,"
+ " shares_decimals: 0"
+ "}";
//CfgStrings
static void setLookAndFeel(String selected) {
try {
String look = "com.seaglasslookandfeel.SeaGlassLookAndFeel";
Class.forName(look);
UIManager.installLookAndFeel("Sea Glass", look);
} catch (ClassNotFoundException e) {
}
UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lafInfo1 : lafInfo) {
if (lafInfo1.getName().equals(selected)) {
String lafClassName = lafInfo1.getClassName();
try {
UIManager.setLookAndFeel(lafClassName);
// UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
break;
} catch (Exception e) {
}
}
}
}
static AutoTraderLoader tloader;
static IndicatorLoader iloader;
static void initGlobals() {
ArrayList default_pathlist = new ArrayList<>();
String default_path = new java.io.File(SeSimApplication.class.getProtectionDomain()
.getCodeSource()
.getLocation()
.getPath()).toString();
default_pathlist.add(default_path);
tloader = new AutoTraderLoader(default_pathlist);
iloader = new IndicatorLoader(default_pathlist);
iloader.getNames();
// SeSimClassLoader<Indicator> il = new SeSimClassLoader<>(Indicator.class);
// il.setDefaultPathList(default_pathlist);
// ArrayList<Class<Indicator>> ires = il.getInstalledClasses();
}
static public final Logger LOGGER = Logger.getLogger("com.cauwersin.sesim");
static public final JSONArray getTraders() {
String traders_json = Globals.prefs.get(PrefKeys.TRADERS, "[]");
JSONArray traders = new JSONArray(traders_json);
return traders;
}
static public final JSONObject getStrategies() {
String cfglist = Globals.prefs.get(PrefKeys.STRATEGIES, "{}");
JSONObject cfgs = new JSONObject(cfglist);
return cfgs;
}
static public final void putStrategies(JSONObject strategies) {
Globals.prefs.put(Globals.PrefKeys.STRATEGIES, strategies.toString());
}
static public final void putTraders(JSONArray traders) {
Globals.prefs.put(Globals.PrefKeys.TRADERS, traders.toString());
}
static public JSONObject getStrategy(String name) {
return getStrategies().getJSONObject(name);
}
static public void getStrategiesIntoComboBox(JComboBox comboBox) {
TreeMap stm = getStrategiesAsTreeMap();
comboBox.removeAllItems();
Iterator<String> i = stm.keySet().iterator();
while (i.hasNext()) {
comboBox.addItem(i.next());
}
}
static public TreeMap getStrategiesAsTreeMap() {
TreeMap strategies = new TreeMap();
JSONObject cfgs = Globals.getStrategies();
Iterator<String> i = cfgs.keys();
while (i.hasNext()) {
String k = i.next();
JSONObject o = cfgs.getJSONObject(k);
strategies.put(k, o);
}
return strategies;
}
static public final void saveStrategy(String name, JSONObject cfg) {
JSONObject cfgs = getStrategies();
cfgs.put(name, cfg);
prefs.put(PrefKeys.STRATEGIES, cfgs.toString());
}
public static void saveFile(File f) throws FileNotFoundException {
JSONObject sobj = new JSONObject();
JSONArray traders = getTraders();
JSONObject strategies = getStrategies();
sobj.put(PrefKeys.SESIMVERSION, SESIM_FILEVERSION);
sobj.put(PrefKeys.STRATEGIES, strategies);
sobj.put(PrefKeys.TRADERS, traders);
PrintWriter out;
out = new PrintWriter(f.getAbsolutePath());
out.print(sobj.toString(4));
out.close();
}
public static void loadString(String s) throws IOException {
JSONObject sobj = new JSONObject(s);
Double version = sobj.getDouble(PrefKeys.SESIMVERSION);
if (version > SESIM_FILEVERSION) {
throw new IOException("File has wrong version.");
}
JSONArray traders = sobj.getJSONArray(PrefKeys.TRADERS);
JSONObject strategies = sobj.getJSONObject(PrefKeys.STRATEGIES);
putStrategies(strategies);
putTraders(traders);
}
public static void clearAll() {
putStrategies(new JSONObject());
putTraders(new JSONArray());
}
public static void loadFile(File f) throws IOException {
f.getAbsoluteFile();
String s;
s = new String(Files.readAllBytes(f.toPath()));
loadString(s);
}
}

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.logging.Handler;
import java.util.logging.LogRecord;

View File

@ -3,9 +3,9 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package opensesim.gui;
package gui;
import opensesim.chart.Chart;
import chart.Chart;
import java.awt.Color;
import java.awt.Cursor;
import java.util.ArrayList;
@ -14,14 +14,14 @@ import javax.swing.ButtonGroup;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import opensesim.old_sesim.Exchange;
import opensesim.old_sesim.OHLCData;
import sesim.Exchange;
import sesim.OHLCData;
/**
*
* @author 7u83 <7u83@mail.ru>
*/
public class MainChart extends opensesim.chart.Chart {
public class MainChart extends chart.Chart {
class MyCursor extends Cursor{

View File

@ -23,9 +23,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.gui.util.EscDialog;
import java.util.ArrayList;
/**

View File

@ -18,22 +18,48 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="filler1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="597" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="filler1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="quotePanel1" max="32767" attributes="0"/>
</Group>
<Component id="orderBookNew3" alignment="1" pref="585" max="32767" attributes="0"/>
<Component id="orderBookNew4" alignment="0" max="32767" attributes="0"/>
</Group>
<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 min="-2" pref="238" max="-2" attributes="0"/>
<Component id="filler1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="245" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="orderBookNew3" min="-2" pref="156" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
<Component id="filler1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Component id="quotePanel1" min="-2" pref="91" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="orderBookNew4" min="-2" pref="176" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="gui.QuotePanel" name="quotePanel1">
</Component>
<Component class="gui.orderbook.OrderBook" name="orderBookNew3">
</Component>
<Component class="gui.orderbook.OrderBook" name="orderBookNew4">
</Component>
<Component class="javax.swing.Box$Filler" name="filler1">
<Properties>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
/**
*
@ -47,6 +47,9 @@ public class OderBookPanelNew extends javax.swing.JPanel {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
quotePanel1 = new gui.QuotePanel();
orderBookNew3 = new gui.orderbook.OrderBook();
orderBookNew4 = new gui.orderbook.OrderBook();
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@ -55,20 +58,38 @@ public class OderBookPanelNew extends javax.swing.JPanel {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(597, Short.MAX_VALUE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(quotePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(orderBookNew3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 585, Short.MAX_VALUE)
.addComponent(orderBookNew4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(238, 238, 238)
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(245, Short.MAX_VALUE))
.addContainerGap()
.addComponent(orderBookNew3, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(70, 70, 70)
.addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(quotePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(orderBookNew4, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.Box.Filler filler1;
private gui.orderbook.OrderBook orderBookNew3;
private gui.orderbook.OrderBook orderBookNew4;
private gui.QuotePanel quotePanel1;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.awt.MouseInfo;
@ -34,10 +34,10 @@ import java.util.Map;
import javax.swing.table.DefaultTableModel;
import opensesim.old_sesim.Account;
import opensesim.old_sesim.Order;
import opensesim.old_sesim.Order.OrderType;
import opensesim.trader.ManTrader.CreateOrderDialog;
import sesim.Account;
import sesim.Order;
import sesim.Order.OrderType;
import traders.ManTrader.CreateOrderDialog;
/**
*

View File

@ -23,10 +23,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.old_sesim.Exchange;
import opensesim.old_sesim.Exchange.*;
import sesim.Exchange;
import sesim.Exchange.*;
import java.util.ArrayList;
import java.util.Formatter;
import javax.swing.table.AbstractTableModel;
@ -36,7 +36,7 @@ import java.awt.*;
import java.text.DecimalFormat;
import javax.swing.*;
import javax.swing.table.*;
import opensesim.old_sesim.Order;
import sesim.Order;
/**
*

View File

@ -22,4 +22,12 @@
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
<Component class="gui.orderbook.OrderBook" name="orderBookNew1">
</Component>
<Component class="gui.QuotePanel" name="quotePanel1">
</Component>
<Component class="gui.orderbook.OrderBook" name="orderBookNew2">
</Component>
</SubComponents>
</Form>

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
/**
*
@ -48,8 +48,15 @@ public class OrderBookDialog extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
orderBookNew1 = new gui.orderbook.OrderBook();
quotePanel1 = new gui.QuotePanel();
orderBookNew2 = new gui.orderbook.OrderBook();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(new java.awt.FlowLayout());
getContentPane().add(orderBookNew1);
getContentPane().add(quotePanel1);
getContentPane().add(orderBookNew2);
pack();
}// </editor-fold>//GEN-END:initComponents
@ -97,5 +104,8 @@ public class OrderBookDialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private gui.orderbook.OrderBook orderBookNew1;
private gui.orderbook.OrderBook orderBookNew2;
private gui.QuotePanel quotePanel1;
// End of variables declaration//GEN-END:variables
}

View File

@ -0,0 +1,459 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[220, 262]"/>
</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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,41,0,0,2,75"/>
</AuxValues>
<SubComponents>
<Component class="gui.AskBook" name="askBook1">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 200]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="gui.BidBook" name="bidBook1">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[200, 200]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="gui.QuotePanel" name="quotePanel2">
<Properties>
<Property name="opaque" type="boolean" value="false"/>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[587, 200]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.5" weightY="0.5"/>
</Constraint>
</Constraints>
<LayoutCode>
<CodeStatement>
<CodeExpression id="1_quotePanel2Layout">
<CodeVariable name="quotePanel2Layout" type="4096" declaredType="java.awt.GridBagLayout"/>
<ExpressionOrigin>
<ExpressionProvider type="CodeConstructor">
<CodeConstructor class="java.awt.GridBagLayout" parameterTypes=""/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeExpression">
<CodeExpression id="1_quotePanel2Layout"/>
</StatementProvider>
</CodeStatement>
<CodeStatement>
<CodeExpression id="1_quotePanel2Layout"/>
<StatementProvider type="CodeField">
<CodeField name="columnWidths" class="java.awt.GridBagLayout"/>
</StatementProvider>
<Parameters>
<CodeExpression id="2">
<ExpressionOrigin>
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
<PropertyValue value="[0, 5, 0, 5, 0]"/>
</Value>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="1_quotePanel2Layout"/>
<StatementProvider type="CodeField">
<CodeField name="rowHeights" class="java.awt.GridBagLayout"/>
</StatementProvider>
<Parameters>
<CodeExpression id="3">
<ExpressionOrigin>
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
<PropertyValue value="[0]"/>
</Value>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="4_quotePanel2">
<CodeVariable name="quotePanel2" type="8194" declaredType="gui.QuotePanel"/>
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="quotePanel2"/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeMethod">
<CodeMethod name="setLayout" class="java.awt.Container" parameterTypes="java.awt.LayoutManager"/>
</StatementProvider>
<Parameters>
<CodeExpression id="1_quotePanel2Layout"/>
</Parameters>
</CodeStatement>
</LayoutCode>
</Container>
</SubComponents>
<LayoutCode>
<CodeStatement>
<CodeExpression id="5_layout">
<CodeVariable name="layout" type="4096" declaredType="java.awt.GridBagLayout"/>
<ExpressionOrigin>
<ExpressionProvider type="CodeConstructor">
<CodeConstructor class="java.awt.GridBagLayout" parameterTypes=""/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeExpression">
<CodeExpression id="5_layout"/>
</StatementProvider>
</CodeStatement>
<CodeStatement>
<CodeExpression id="5_layout"/>
<StatementProvider type="CodeField">
<CodeField name="columnWidths" class="java.awt.GridBagLayout"/>
</StatementProvider>
<Parameters>
<CodeExpression id="6">
<ExpressionOrigin>
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
<PropertyValue value="[0]"/>
</Value>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="5_layout"/>
<StatementProvider type="CodeField">
<CodeField name="rowHeights" class="java.awt.GridBagLayout"/>
</StatementProvider>
<Parameters>
<CodeExpression id="7">
<ExpressionOrigin>
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor">
<PropertyValue value="[0, 5, 0, 5, 0]"/>
</Value>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="8">
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="."/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeMethod">
<CodeMethod name="setLayout" class="java.awt.Container" parameterTypes="java.awt.LayoutManager"/>
</StatementProvider>
<Parameters>
<CodeExpression id="5_layout"/>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints">
<CodeVariable name="gridBagConstraints" type="20480" declaredType="java.awt.GridBagConstraints"/>
<ExpressionOrigin>
<ExpressionProvider type="CodeConstructor">
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeExpression">
<CodeExpression id="9_gridBagConstraints"/>
</StatementProvider>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="10">
<ExpressionOrigin>
<Value type="int" value="0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridy" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="11">
<ExpressionOrigin>
<Value type="int" value="0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="fill" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="12">
<ExpressionOrigin>
<Value type="int" value="1"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weightx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="13">
<ExpressionOrigin>
<Value type="double" value="1.0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="9_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weighty" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="14">
<ExpressionOrigin>
<Value type="double" value="1.0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="8"/>
<StatementProvider type="CodeMethod">
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
</StatementProvider>
<Parameters>
<CodeExpression id="15_askBook1">
<CodeVariable name="askBook1" type="8194" declaredType="gui.AskBook"/>
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="askBook1"/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<CodeExpression id="9_gridBagConstraints"/>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints">
<CodeVariable name="gridBagConstraints"/>
<ExpressionOrigin>
<ExpressionProvider type="CodeConstructor">
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeExpression">
<CodeExpression id="16_gridBagConstraints"/>
</StatementProvider>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="17">
<ExpressionOrigin>
<Value type="int" value="0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridy" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="18">
<ExpressionOrigin>
<Value type="int" value="4"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="fill" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="19">
<ExpressionOrigin>
<Value type="int" value="1"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weightx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="20">
<ExpressionOrigin>
<Value type="double" value="1.0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="16_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weighty" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="21">
<ExpressionOrigin>
<Value type="double" value="1.0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="8"/>
<StatementProvider type="CodeMethod">
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
</StatementProvider>
<Parameters>
<CodeExpression id="22_bidBook1">
<CodeVariable name="bidBook1" type="8194" declaredType="gui.BidBook"/>
<ExpressionOrigin>
<ExpressionProvider type="ComponentRef">
<ComponentRef name="bidBook1"/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<CodeExpression id="16_gridBagConstraints"/>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints">
<CodeVariable name="gridBagConstraints"/>
<ExpressionOrigin>
<ExpressionProvider type="CodeConstructor">
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/>
</ExpressionProvider>
</ExpressionOrigin>
</CodeExpression>
<StatementProvider type="CodeExpression">
<CodeExpression id="23_gridBagConstraints"/>
</StatementProvider>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="24">
<ExpressionOrigin>
<Value type="int" value="0"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="gridy" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="25">
<ExpressionOrigin>
<Value type="int" value="2"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="fill" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="26">
<ExpressionOrigin>
<Value type="int" value="1"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weightx" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="27">
<ExpressionOrigin>
<Value type="double" value="0.5"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="23_gridBagConstraints"/>
<StatementProvider type="CodeField">
<CodeField name="weighty" class="java.awt.GridBagConstraints"/>
</StatementProvider>
<Parameters>
<CodeExpression id="28">
<ExpressionOrigin>
<Value type="double" value="0.5"/>
</ExpressionOrigin>
</CodeExpression>
</Parameters>
</CodeStatement>
<CodeStatement>
<CodeExpression id="8"/>
<StatementProvider type="CodeMethod">
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/>
</StatementProvider>
<Parameters>
<CodeExpression id="4_quotePanel2"/>
<CodeExpression id="23_gridBagConstraints"/>
</Parameters>
</CodeStatement>
</LayoutCode>
</Form>

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
//import SeSim.*;
import static java.lang.Thread.sleep;
@ -39,7 +39,7 @@ import static java.lang.Thread.sleep;
*/
public class OrderBookPanel_old extends javax.swing.JPanel {
opensesim.old_sesim.Exchange se;
sesim.Exchange se;
public OrderBookPanel_old() {
this.se = Globals.se;
@ -61,15 +61,51 @@ public class OrderBookPanel_old extends javax.swing.JPanel {
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
askBook1 = new gui.AskBook();
bidBook1 = new gui.BidBook();
quotePanel2 = new gui.QuotePanel();
setPreferredSize(new java.awt.Dimension(220, 262));
java.awt.GridBagLayout layout = new java.awt.GridBagLayout();
layout.columnWidths = new int[] {0};
layout.rowHeights = new int[] {0, 5, 0, 5, 0};
setLayout(layout);
askBook1.setPreferredSize(new java.awt.Dimension(200, 200));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
add(askBook1, gridBagConstraints);
bidBook1.setPreferredSize(new java.awt.Dimension(200, 200));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
add(bidBook1, gridBagConstraints);
quotePanel2.setOpaque(false);
quotePanel2.setPreferredSize(new java.awt.Dimension(587, 200));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 0.5;
gridBagConstraints.weighty = 0.5;
add(quotePanel2, gridBagConstraints);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private gui.AskBook askBook1;
private gui.BidBook bidBook1;
private gui.QuotePanel quotePanel2;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,9 +23,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.old_sesim.Quote;
import sesim.Quote;
import java.awt.Color;
import javax.swing.SwingUtilities;
import java.util.*;
@ -34,7 +34,7 @@ import java.util.*;
*
* @author 7u83 <7u83@mail.ru>
*/
public class QuotePanel extends javax.swing.JPanel implements opensesim.old_sesim.Exchange.QuoteReceiver{
public class QuotePanel extends javax.swing.JPanel implements sesim.Exchange.QuoteReceiver{
/**
* Creates new form QuotePanel

View File

@ -33,6 +33,15 @@
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Component class="gui.orderbook.OrderBook" name="orderBookNew1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
@ -132,42 +141,8 @@
</MenuItem>
<MenuItem class="javax.swing.JPopupMenu$Separator" name="jSeparator1">
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="assetsMenuItem">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="F2"/>
</Property>
<Property name="mnemonic" type="int" value="97"/>
<Property name="text" type="java.lang.String" value="Assets ..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="assetsMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="exchangesMenuItem">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="F3"/>
</Property>
<Property name="text" type="java.lang.String" value="Exchanges ..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="exchangesMenuItemActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem2">
<Properties>
<Property name="text" type="java.lang.String" value="Asset Pairs"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/>
</Events>
</MenuItem>
<MenuItem class="javax.swing.JMenuItem" name="pasteMenuItem">
<Properties>
<Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor">
<KeyStroke key="S"/>
</Property>
<Property name="mnemonic" type="int" value="115"/>
<Property name="text" type="java.lang.String" value="Strategies ..."/>
</Properties>
@ -296,9 +271,6 @@
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Events>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -365,7 +337,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="/opensesim/resources/icons/stop.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"/>
@ -384,7 +356,7 @@
</FontInfo>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/opensesim/resources/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"/>
@ -399,7 +371,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="/opensesim/resources/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"/>
@ -424,7 +396,7 @@
<AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="NewMDIApplication_accelSpinner"/>
</AuxValues>
</Component>
<Component class="opensesim.gui.Clock" name="clock">
<Component class="gui.Clock" name="clock">
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
@ -455,7 +427,14 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Component class="opensesim.chart.MasterChart" name="chart">
<Component class="gui.orderbook.OrderBooksHorizontal" name="orderBooksHorizontal1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="bottom"/>
</Constraint>
</Constraints>
</Component>
<Component class="chart.MasterChart" name="chart">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
@ -464,6 +443,13 @@
</Component>
</SubComponents>
</Container>
<Component class="gui.orderbook.QuoteVertical" name="quoteVertical1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="left"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JSplitPane" name="jSplitPane5">
<Properties>
<Property name="orientation" type="int" value="0"/>
@ -475,6 +461,22 @@
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
<SubComponents>
<Component class="gui.Statistics" name="statistics1">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="top"/>
</Constraint>
</Constraints>
</Component>
<Component class="chart.MMChart" name="mMChart2">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
<JSplitPaneConstraints position="right"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>

View File

@ -23,9 +23,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import chart.Help;
import chart.SuperDlg;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.GraphicsDevice;
@ -37,40 +38,22 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.prefs.Preferences;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import opensesim.gui.AssetPairEditor.NewJDialog;
import static opensesim.gui.Globals.getWorld;
import opensesim.gui.account.AccountDialog;
import opensesim.gui.exchangeeditor.ExchangeListDialog;
import opensesim.gui.history.HistoryDialog;
import org.json.JSONArray;
import org.json.JSONObject;
import opensesim.old_sesim.AutoTraderInterface;
import opensesim.old_sesim.Exchange;
import opensesim.old_sesim.Scheduler;
import opensesim.old_sesim.Scheduler.TimerTaskDef;
import opensesim.world.AbstractAsset;
import opensesim.world.AssetPair;
import opensesim.world.GodWorld;
import opensesim.world.Order;
import opensesim.world.Trader;
import opensesim.world.TradingAPI;
import opensesim.world.World;
import opensesim.util.scheduler.Event;
import opensesim.util.scheduler.FiringEvent;
import opensesim.util.scheduler.EventListener;
import opensesim.world.SimpleTrader;
import sesim.AutoTraderInterface;
import sesim.Exchange;
import sesim.Scheduler;
/**
*
@ -78,24 +61,13 @@ import opensesim.world.SimpleTrader;
*/
public class SeSimApplication extends javax.swing.JFrame {
GodWorld godworld;
/**
* Creates new form NewMDIApplication
*/
public SeSimApplication() {
Globals.setXClassLoader();
Globals.setLookAndFeel(Globals.prefs.get(Globals.PrefKeys.LAF, "Nimbus"));
// Globals.setLookAndFeel("Metal");
initComponents();
JSONObject cfg;
cfg = new JSONObject(Globals.prefs.get("world", "{}"));
godworld = new GodWorld(cfg);
godworld.addAssetPair("AAPL", "EUR");
godworld.addAssetPair("MSFT", "EUR");
// Get default screen and place our window
// to the center of this screen
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
@ -115,6 +87,7 @@ public class SeSimApplication extends javax.swing.JFrame {
}
// this.chartSrollPane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_NEVER);
}
AutoTraderInterface createTrader(Exchange se, long id, String name, double money, double shares, JSONObject cfg) {
@ -144,15 +117,7 @@ public class SeSimApplication extends javax.swing.JFrame {
for (int i = 0; i < tlist.length(); i++) {
JSONObject t = tlist.getJSONObject(i);
String strategy_name = t.getString("Strategy");
JSONObject strategy = null;
try {
strategy = Globals.getStrategy(strategy_name);
} catch (Exception ex) {
javax.swing.JOptionPane.showMessageDialog(chart, "Strategy not defined:\n\"" + strategy_name + " \"", "Error",
javax.swing.JOptionPane.ERROR_MESSAGE);
return;
}
JSONObject strategy = Globals.getStrategy(strategy_name);
String base = strategy.getString("base");
AutoTraderInterface ac = Globals.tloader.getAutoTraderInterface(base);
@ -207,17 +172,22 @@ public class SeSimApplication extends javax.swing.JFrame {
jTextArea1 = new javax.swing.JTextArea();
jSplitPane1 = new javax.swing.JSplitPane();
jSplitPane2 = new javax.swing.JSplitPane();
orderBookNew1 = new gui.orderbook.OrderBook();
jPanel2 = new javax.swing.JPanel();
stopButton = new javax.swing.JButton();
runButton = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
accelSpinner = new javax.swing.JSpinner();
clock = new opensesim.gui.Clock();
clock = new gui.Clock();
jLabel1 = new javax.swing.JLabel();
jSplitPane3 = new javax.swing.JSplitPane();
jSplitPane4 = new javax.swing.JSplitPane();
chart = new opensesim.chart.MasterChart();
orderBooksHorizontal1 = new gui.orderbook.OrderBooksHorizontal();
chart = new chart.MasterChart();
quoteVertical1 = new gui.orderbook.QuoteVertical();
jSplitPane5 = new javax.swing.JSplitPane();
statistics1 = new gui.Statistics();
mMChart2 = new chart.MMChart();
menuBar = new javax.swing.JMenuBar();
fileMenu = new javax.swing.JMenu();
openMenuItem = new javax.swing.JMenuItem();
@ -232,9 +202,6 @@ public class SeSimApplication extends javax.swing.JFrame {
editMenu = new javax.swing.JMenu();
editExchangeMenuItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JPopupMenu.Separator();
assetsMenuItem = new javax.swing.JMenuItem();
exchangesMenuItem = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
pasteMenuItem = new javax.swing.JMenuItem();
deleteMenuItem = new javax.swing.JMenuItem();
jSeparator2 = new javax.swing.JPopupMenu.Separator();
@ -256,17 +223,15 @@ public class SeSimApplication extends javax.swing.JFrame {
jScrollPane2.setViewportView(jTextArea1);
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane2.setLeftComponent(orderBookNew1);
jSplitPane1.setTopComponent(jSplitPane2);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(640, 480));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
formWindowClosing(evt);
}
});
stopButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/opensesim/resources/icons/stop.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);
@ -278,7 +243,7 @@ public class SeSimApplication extends javax.swing.JFrame {
});
runButton.setFont(runButton.getFont());
runButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/opensesim/resources/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);
@ -290,7 +255,7 @@ public class SeSimApplication extends javax.swing.JFrame {
}
});
jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/opensesim/resources/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);
@ -353,11 +318,16 @@ public class SeSimApplication extends javax.swing.JFrame {
jSplitPane4.setDividerLocation(300);
jSplitPane4.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane4.setBottomComponent(orderBooksHorizontal1);
jSplitPane4.setLeftComponent(chart);
jSplitPane3.setRightComponent(jSplitPane4);
jSplitPane3.setLeftComponent(quoteVertical1);
jSplitPane5.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane5.setTopComponent(statistics1);
jSplitPane5.setRightComponent(mMChart2);
jSplitPane3.setLeftComponent(jSplitPane5);
getContentPane().add(jSplitPane3, java.awt.BorderLayout.CENTER);
@ -447,34 +417,6 @@ public class SeSimApplication extends javax.swing.JFrame {
editMenu.add(editExchangeMenuItem);
editMenu.add(jSeparator1);
assetsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F2, 0));
assetsMenuItem.setMnemonic('a');
assetsMenuItem.setText("Assets ...");
assetsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
assetsMenuItemActionPerformed(evt);
}
});
editMenu.add(assetsMenuItem);
exchangesMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0));
exchangesMenuItem.setText("Exchanges ...");
exchangesMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exchangesMenuItemActionPerformed(evt);
}
});
editMenu.add(exchangesMenuItem);
jMenuItem2.setText("Asset Pairs");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
editMenu.add(jMenuItem2);
pasteMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, 0));
pasteMenuItem.setMnemonic('s');
pasteMenuItem.setText("Strategies ...");
pasteMenuItem.addActionListener(new java.awt.event.ActionListener() {
@ -587,12 +529,11 @@ public class SeSimApplication extends javax.swing.JFrame {
}// </editor-fold>//GEN-END:initComponents
private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
dispose();
System.exit(0);
}//GEN-LAST:event_exitMenuItemActionPerformed
private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
Dialog d = new opensesim.gui.misc.AboutDialog(this, rootPaneCheckingEnabled);
Dialog d = new gui.AboutDialog(this, rootPaneCheckingEnabled);
d.setVisible(rootPaneCheckingEnabled);
}//GEN-LAST:event_aboutMenuItemActionPerformed
@ -603,52 +544,6 @@ public class SeSimApplication extends javax.swing.JFrame {
void startSim() {
JSONObject cfg = new JSONObject("{"
+ "strategy: opensesim.world.SimpleTrader"
+ "}");
Trader t = godworld.createTrader(cfg);
t.start();
AccountDialog.runDialog(this, ((SimpleTrader)t).account_1);
AccountDialog.runDialog(this, ((SimpleTrader)t).account_b);
updateGodWorld(godworld);
AssetPair p = godworld.getDefaultAssetPair();
opensesim.world.Exchange ex = godworld.getDefaultExchange();
TradingAPI api = ex.getAPI(p);
HistoryDialog.runDialog(this, api);
opensesim.util.scheduler.Scheduler s = godworld.getScheduler();
class MyListener implements EventListener {
World world;
MyListener(World world) {
this.world = world;
}
@Override
public long receive(opensesim.util.scheduler.Event task) {
System.out.printf("Received an Event %d\n", Thread.currentThread().getId());
// e.count++;
world.schedule(this, 1000);
return -1;
}
}
// MyListener listener = new MyListener(godworld.getWorld());
// MyEvent arg = new MyEvent();
// s.startTimerTask(listener, 1000);
/*
resetSim();
JSONObject jo = new JSONObject(Globals.prefs.get("Exchange", "{}"));
Globals.se.putConfig(jo);
@ -681,7 +576,7 @@ public class SeSimApplication extends javax.swing.JFrame {
};
// Globals.se.timer.startTimerTask(tt, 0);
*/
}
void stopSim() {
@ -705,7 +600,7 @@ public class SeSimApplication extends javax.swing.JFrame {
private void editPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editPreferencesActionPerformed
Globals.LOGGER.info("Edit prefs...");
Dialog d = new opensesim.gui.PreferencesEditor.EditPreferencesDialog(this, rootPaneCheckingEnabled);
Dialog d = new gui.EditPreferencesDialog(this, rootPaneCheckingEnabled);
d.setVisible(rootPaneCheckingEnabled);
}//GEN-LAST:event_editPreferencesActionPerformed
@ -850,7 +745,7 @@ public class SeSimApplication extends javax.swing.JFrame {
}//GEN-LAST:event_editExchangeMenuItemActionPerformed
private void resetToDefaults() {
InputStream is = getClass().getResourceAsStream("/opensesim/resources/files/defaultcfg.json");
InputStream is = getClass().getResourceAsStream("/resources/files/defaultcfg.json");
String df = new Scanner(is, "UTF-8").useDelimiter("\\A").next();
try {
@ -903,39 +798,9 @@ public class SeSimApplication extends javax.swing.JFrame {
stopSim();
}//GEN-LAST:event_stopButtonActionPerformed
public class GodWorldEvent extends Event {
public GodWorld goworld;
public GodWorldEvent(GodWorld world) {
this.goworld = world;
}
}
HashSet<EventListener> gwlisteners = new HashSet<>();
void updateGodWorld(GodWorld godworld) {
GodWorldEvent e = new GodWorldEvent(null);
for (EventListener el : gwlisteners) {
el.receive(e);
}
}
private void jCheckBoxMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem1ActionPerformed
// JDialog jd = new opensesim.gui.orderbook.OrderBookDialog(this, false);
// jd.setVisible(rootPaneCheckingEnabled);
//EventListener e = opensesim.gui.orderbook.OrderBookDialog.runDialog(this, godworld);
//gwlisteners.add(e);
AssetPair ap = godworld.getDefaultAssetPair();
opensesim.world.Exchange ex = godworld.getDefaultExchange();
opensesim.gui.orderbook.OrderBookDialog.runDialog(this, godworld, ex, ap);
AbstractAsset eu = godworld.getAssetBySymbol("EUR");
AssetPair ap2 = godworld.getAssetPair(godworld.getAssetBySymbol("MSFT"), eu);
opensesim.gui.orderbook.OrderBookDialog.runDialog(this, godworld, ex, ap2);
JDialog jd = new gui.orderbook.OrderBookDialog(this, false);
jd.setVisible(rootPaneCheckingEnabled);
}//GEN-LAST:event_jCheckBoxMenuItem1ActionPerformed
TraderListDialog tld = null;
@ -983,7 +848,7 @@ public class SeSimApplication extends javax.swing.JFrame {
private void clearMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearMenuItemActionPerformed
int dialogResult = JOptionPane.showConfirmDialog(this, "Are you sure you want to clear all data?", "Warning", JOptionPane.YES_NO_OPTION);
int dialogResult = JOptionPane.showConfirmDialog(this, "Are you sure?", "Warning", JOptionPane.YES_NO_OPTION);
if (dialogResult != JOptionPane.YES_OPTION) {
return;
}
@ -996,52 +861,13 @@ public class SeSimApplication extends javax.swing.JFrame {
//Help hs = new Help(this,true);
//hs.setVisible(true);
SeSimHelp h = new SeSimHelp();
h.setVisible(true);
}//GEN-LAST:event_jMenuItem1ActionPerformed
private void assetsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assetsMenuItemActionPerformed
opensesim.gui.AssetEditor.AssetListDialog dialog;
dialog = new opensesim.gui.AssetEditor.AssetListDialog(godworld, this, true);
dialog.setLocationRelativeTo(this);
dialog.setVisible(rootPaneCheckingEnabled);
dialog.dispose();
}//GEN-LAST:event_assetsMenuItemActionPerformed
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
JDialog dialog = new NewJDialog(this, true);
dialog.setVisible(true);
dialog.dispose();
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void exchangesMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exchangesMenuItemActionPerformed
//ExchangeListDialog.runDialog(this,this.godworld);
ExchangeListDialog.runDialog(this, godworld);
}//GEN-LAST:event_exchangesMenuItemActionPerformed
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
// TODO add your handling code here:
System.out.printf("Closing Windows\n");
}//GEN-LAST:event_formWindowClosing
public static class Pojo {
public String getSymbol() {
return symbol;
}
public String getName() {
return name;
}
public String symbol = "EUR";
public String name = "Euro";
};
/**
* @param args the command line arguments
* @throws java.lang.IllegalAccessException
@ -1049,38 +875,42 @@ public class SeSimApplication extends javax.swing.JFrame {
*/
public static void main(String args[]) throws IllegalAccessException, InstantiationException {
//opensesim.world.World.MasterApi mapi = new opensesim.world.World.MasterApi();
// testing
Pojo p = new Pojo();
// Gson g = new Gson();
// String r = g.toJson(p);
// System.out.printf("GSON: %s\n", r);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
JSONObject o = new JSONObject(p, new String[]{"name", "symbol"});
System.out.printf("OJSON: %s\n", o.toString(8));
GraphicsDevice[] gs = ge.getScreenDevices();
for (GraphicsDevice d : gs) {
System.out.printf("ID %s\n", d.getIDstring());
// System.exit(0);
// end testing
// Initialize globals
Class<?> c = opensesim.gui.SeSimApplication.class;
Globals.initGlobals(c);
}
//System.exit(0);
/* String world_source = Globals.prefs.get("world", "{}");
JSONObject world = new org.json.JSONObject(world_source);
Globals.world.putConfig(world);
*/
//Globals.installLookAndFeels();
// Globals.setLookAndFeel("Metal");
//JDialog.setDefaultLookAndFeelDecorated(true);
//System.exit(0);
Globals.initGlobals();
//System.exit(0);
Globals.se = new Exchange();
Class<?> c = sesim.Exchange.class;
Globals.prefs = Preferences.userNodeForPackage(c);
Globals.prefs.put(Globals.PrefKeys.CURRENTFILE, "");
Globals.setLookAndFeel(Globals.prefs.get("laf", "Nimbus"));
JDialog.setDefaultLookAndFeelDecorated(true);
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
/* String x = new java.io.File(SeSimApplication.class.getProtectionDomain()
.getCodeSource()
.getLocation()
.getPath()).toString(); //.getName();
*/
// System.out.printf("Creating Application\n");
new SeSimApplication().setVisible(true);
}
});
@ -1089,16 +919,14 @@ public class SeSimApplication extends javax.swing.JFrame {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem aboutMenuItem;
private javax.swing.JSpinner accelSpinner;
private javax.swing.JMenuItem assetsMenuItem;
private opensesim.chart.MasterChart chart;
private chart.MasterChart chart;
private javax.swing.JMenuItem clearMenuItem;
private opensesim.gui.Clock clock;
private gui.Clock clock;
private javax.swing.JMenuItem closeMenuItem;
private javax.swing.JMenuItem deleteMenuItem;
private javax.swing.JMenuItem editExchangeMenuItem;
private javax.swing.JMenu editMenu;
private javax.swing.JMenuItem editPreferences;
private javax.swing.JMenuItem exchangesMenuItem;
private javax.swing.JMenuItem exitMenuItem;
private javax.swing.JMenu fileMenu;
private javax.swing.JMenu helpMenu;
@ -1106,7 +934,6 @@ public class SeSimApplication extends javax.swing.JFrame {
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1;
private javax.swing.JLabel jLabel1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JPopupMenu.Separator jSeparator1;
@ -1119,9 +946,13 @@ public class SeSimApplication extends javax.swing.JFrame {
private javax.swing.JSplitPane jSplitPane4;
private javax.swing.JSplitPane jSplitPane5;
private javax.swing.JTextArea jTextArea1;
private chart.MMChart mMChart2;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenuItem openMenuItem;
private gui.orderbook.OrderBook orderBookNew1;
private gui.orderbook.OrderBooksHorizontal orderBooksHorizontal1;
private javax.swing.JMenuItem pasteMenuItem;
private gui.orderbook.QuoteVertical quoteVertical1;
private javax.swing.JMenuItem resetToDefaultsMenuItem;
private javax.swing.JButton runButton;
private javax.swing.JMenuItem saveAsMenuItem;
@ -1130,6 +961,7 @@ public class SeSimApplication extends javax.swing.JFrame {
private javax.swing.JMenuItem simMenuPause;
private javax.swing.JMenuItem simMenuStart;
private javax.swing.JMenuItem simMenuStop;
private gui.Statistics statistics1;
private javax.swing.JButton stopButton;
private javax.swing.JMenu viewMenu;
private javax.swing.JCheckBoxMenuItem viewTraderListCheckBox;

View File

@ -18,7 +18,6 @@
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,125,0,0,1,-3"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>

View File

@ -23,9 +23,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.chart.Help;
import chart.Help;
import java.net.URL;
import javax.help.HelpSet;
import javax.help.JHelp;
@ -42,28 +42,30 @@ public class SeSimHelp extends javax.swing.JFrame {
*/
public SeSimHelp() {
initComponents();
String helpHS = "opensesim/resources/help/helpset.hs";
ClassLoader cl = Help.class.getClassLoader();
HelpSet hs;
JHelp helpViewer = null;
try {
URL url = HelpSet.findHelpSet(null, helpHS); //, "xml", Locale.ENGLISH);
// URL hsURL = HelpSet.findHelpSet(cl, helpHS);
hs = new HelpSet(null, url);
//helpViewer = new JHelp(new HelpSet(cl, url));
helpViewer = new javax.help.JHelp(hs);
} catch (Exception ee) {
// Say what the exception really is
// System.out.println("HelpSet " + ee.getMessage());
String helpHS = "resources/helpset.hs";
ClassLoader cl = Help.class.getClassLoader();
HelpSet hs;
JHelp helpViewer = null;
try {
URL url = HelpSet.findHelpSet(null, helpHS); //, "xml", Locale.ENGLISH);
// URL hsURL = HelpSet.findHelpSet(cl, helpHS);
//hs = new HelpSet(null, hsURL);
helpViewer = new JHelp(new HelpSet(cl, url));
} catch (Exception ee) {
// Say what the exception really is
System.out.println( "HelpSet " + ee.getMessage());
// System.out.println("HelpSet "+ helpHS +" not found")
return;
}
return;
}
setTitle("Help");
setSize(800, 600);
getContentPane().add(helpViewer);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//setVisible(true);
setTitle("Help");
setSize(800,600);
getContentPane().add(helpViewer);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
//setVisible(true);
}
/**

View File

@ -23,11 +23,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.Timer;
import java.util.TimerTask;
import opensesim.old_sesim.Exchange;
import sesim.Exchange;
/**
*

View File

@ -23,11 +23,11 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.util.Timer;
import java.util.TimerTask;
import opensesim.old_sesim.Scheduler;
import sesim.Scheduler;
/**
*

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import java.awt.event.KeyEvent;

View File

@ -3,7 +3,7 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package opensesim.gui;
package gui;
import java.awt.Cursor;
@ -32,7 +32,7 @@ public class TestChartdialog extends javax.swing.JDialog {
private void initComponents() {
jButton1 = new javax.swing.JButton();
chart1 = new opensesim.chart.Chart();
chart1 = new chart.Chart();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -118,7 +118,7 @@ public class TestChartdialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.chart.Chart chart1;
private chart.Chart chart1;
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables
}

View File

@ -1,4 +1,4 @@
package opensesim.gui;
package gui;
import java.awt.Dialog;
@ -54,7 +54,7 @@ public class TraderListDialog extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
traderListPanel22 = new opensesim.gui.TraderListPanel();
traderListPanel22 = new gui.TraderListPanel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Trader List");
@ -117,6 +117,6 @@ public class TraderListDialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.gui.TraderListPanel traderListPanel22;
private gui.TraderListPanel traderListPanel22;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,9 +23,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
import opensesim.gui.util.NummericCellRenderer;
import gui.tools.NummericCellRenderer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@ -38,9 +38,9 @@ import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableRowSorter;
import opensesim.old_sesim.AutoTraderInterface;
import opensesim.old_sesim.Exchange;
import opensesim.old_sesim.Account;
import sesim.AutoTraderInterface;
import sesim.Exchange;
import sesim.Account;
/**
*
@ -59,7 +59,7 @@ public class TraderListPanel extends javax.swing.JPanel {
return;
}
opensesim.old_sesim.Quote q = Globals.se.getLastQuoete();
sesim.Quote q = Globals.se.getLastQuoete();
double price = q == null ? 0 : q.price;

View File

@ -23,7 +23,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui;
package gui;
/**
*

View File

@ -1,13 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -23,11 +16,9 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="bidbook" min="-2" pref="293" max="-2" attributes="0"/>
<EmptySpace pref="91" max="32767" attributes="0"/>
<Component id="askbook" min="-2" pref="315" max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="388" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -36,19 +27,33 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="bidbook" pref="326" max="32767" attributes="0"/>
<Component id="askbook" max="32767" attributes="0"/>
</Group>
<Component id="jScrollPane1" pref="288" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="opensesim.gui.orderbook.OrderBookPanel" name="bidbook">
</Component>
<Component class="opensesim.gui.orderbook.OrderBookPanel" name="askbook">
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="sesim.ChartPanel" name="chart11">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="382" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="282" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>

69
src/gui/jp99.java Normal file
View File

@ -0,0 +1,69 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package gui;
/**
*
* @author 7u83 <7u83@mail.ru>
*/
public class jp99 extends javax.swing.JPanel {
/**
* Creates new form jp99
*/
public jp99() {
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() {
jScrollPane1 = new javax.swing.JScrollPane();
chart11 = new sesim.ChartPanel();
javax.swing.GroupLayout chart11Layout = new javax.swing.GroupLayout(chart11);
chart11.setLayout(chart11Layout);
chart11Layout.setHorizontalGroup(
chart11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 382, Short.MAX_VALUE)
);
chart11Layout.setVerticalGroup(
chart11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 282, Short.MAX_VALUE)
);
jScrollPane1.setViewportView(chart11);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 288, Short.MAX_VALUE)
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private sesim.ChartPanel chart11;
private javax.swing.JScrollPane jScrollPane1;
// End of variables declaration//GEN-END:variables
}

View File

@ -23,56 +23,60 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui.orderbook;
package gui.orderbook;
import opensesim.gui.Globals;
import opensesim.gui.util.NummericCellRenderer;
import java.util.Collection;
import java.util.Iterator;
import gui.Globals;
import gui.Globals.CfgListener;
import gui.tools.NummericCellRenderer;
import java.awt.Component;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import opensesim.world.AssetPair;
import opensesim.world.Exchange;
import opensesim.world.GodWorld;
import opensesim.world.Order;
import opensesim.world.TradingAPI;
import opensesim.util.scheduler.Event;
import opensesim.util.scheduler.EventListener;
import sesim.Exchange;
import sesim.Order;
import sesim.Order.OrderType;
/**
* Displays an orderbook
*
* @author 7u83 <7u83@mail.ru>
*/
public class OrderBookPanel extends javax.swing.JPanel implements EventListener {
public class OrderBook extends javax.swing.JPanel implements Exchange.BookReceiver, CfgListener {
DefaultTableModel model;
TableColumn trader_column = null;
TradingAPI api = null;
class Renderer extends DefaultTableCellRenderer {
@Override
public long receive(Event task) {
private final DecimalFormat formatter = new DecimalFormat("#.0000");
synchronized (this) {
if (oupdate) {
new_oupdate = true;
return 0;
}
oupdate = true;
Renderer() {
super();
this.setHorizontalAlignment(RIGHT);
}
SwingUtilities.invokeLater(() -> {
oupdater();
});
return 0;
@Override
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected,
boolean hasFocus, int row, int column) {
// First format the cell value as required
value = formatter.format((Number) value);
// And pass it on to parent class
return super.getTableCellRendererComponent(
table, value, isSelected, hasFocus, row, column);
}
}
OrderType type = OrderType.BUYLIMIT;
int depth = 40;
public void setGodMode(boolean on) {
@ -92,99 +96,64 @@ public class OrderBookPanel extends javax.swing.JPanel implements EventListener
}
}
GodWorld godworld;
public void setGodWorld(GodWorld godworld) {
// is our world already the godworld to set?
if (this.godworld == godworld) {
return;
}
this.godworld = godworld;
Exchange ex = godworld.getDefaultExchange();
AssetPair ap = godworld.getDefaultAssetPair();
api = ex.getAPI(ap);
api.addOrderBookListener(this);
/**
* Bla
*/
@Override
public final void cfgChanged() {
boolean gm = Globals.prefs.get(Globals.CfgStrings.GODMODE, "false").equals("true");
setGodMode(gm);
list.invalidate();
list.repaint();
}
public void init(GodWorld godworld, Exchange ex, AssetPair pair) {
api = ex.getAPI(pair);
api.addOrderBookListener(this);
model = (DefaultTableModel) this.list.getModel();
trader_column = list.getColumnModel().getColumn(0);
list.getColumnModel().getColumn(1).setCellRenderer(new NummericCellRenderer(api.getAssetPair().getCurrency().getDecimals()));
list.getColumnModel().getColumn(2).setCellRenderer(new NummericCellRenderer(api.getAssetPair().getAsset().getDecimals()));
this.setGodMode(true);
this.oupdater();
public void setType(OrderType type) {
this.type = type;
Globals.se.addBookReceiver(type, this);
}
/**
* Creates new form OrderBookNew
*/
public OrderBookPanel() {
public OrderBook() {
initComponents();
if (Globals.se == null) {
return;
}
model = (DefaultTableModel) this.list.getModel();
trader_column = list.getColumnModel().getColumn(0);
list.getColumnModel().getColumn(1).setCellRenderer(new NummericCellRenderer(3));
list.getColumnModel().getColumn(2).setCellRenderer(new NummericCellRenderer(0));
cfgChanged();
// Globals.se.addBookReceiver(Exchange.OrderType.BUYLIMIT, this);
Globals.addCfgListener(this);
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// System.out.printf("Update order book\n");
// UpdateOrderBook();
// System.out.printf("Update order book\n");
// UpdateOrderBook();
}
}, 1000, 1000);
}
long ouctr = 0;
Order.Type type;
private void drawBookSimple(Collection<Order> orderbook) {
model.setRowCount(orderbook.size());
int row = 0;
for (Order order : orderbook) {
// model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
model.setValueAt(order.getID(), row, 0);
model.setValueAt(order.getLimit(), row, 1);
model.setValueAt(order.getVolume(), row, 2);
row++;
}
}
private void drawBookCmplex(Collection<Order> orderbook){
model.setRowCount(orderbook.size());
int row = 0;
double volume = 0.0;
double limit = 0.0;
Iterator<Order> it;
for (Order order : orderbook) {
// model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
model.setValueAt(order.getLimit(), row, 1);
model.setValueAt(order.getVolume(), row, 2);
row++;
}
}
boolean oupdate = false;
boolean new_oupdate = false;
long ouctr = 0;
void oupdater() {
// get order book from API
Collection<Order> orderbook = api.getOrderBook(type);
this.drawBookSimple(orderbook);
ArrayList<Order> ob = Globals.se.getOrderBook(type, depth);
model.setRowCount(ob.size());
int row = 0;
for (Order ob1 : ob) {
model.setValueAt(ob1.getAccount().getOwner().getName(), row, 0);
model.setValueAt(ob1.getLimit(), row, 1);
model.setValueAt(ob1.getVolume(), row, 2);
row++;
}
synchronized (this) {
oupdate = new_oupdate;
@ -199,7 +168,7 @@ public class OrderBookPanel extends javax.swing.JPanel implements EventListener
}
// @Override
@Override
public void UpdateOrderBook() {
synchronized (this) {

View File

@ -23,23 +23,25 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="historyPanel1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="books" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="historyPanel1" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="books" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="opensesim.gui.history.HistoryPanel" name="historyPanel1">
<Component class="gui.orderbook.OrderBooksHorizontal" name="books">
</Component>
</SubComponents>
</Form>

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, tube
* Copyright (c) 2017, 7u83 <7u83@mail.ru>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -23,32 +23,21 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package opensesim.gui.account;
import opensesim.world.AccountImpl;
package gui.orderbook;
/**
*
* @author tube
* @author 7u83 <7u83@mail.ru>
*/
public class AccountDialog extends javax.swing.JDialog {
public class OrderBookDialog extends javax.swing.JDialog {
/**
* Creates new form AccountDialog
* Creates new form OrderBookDialog
*/
public AccountDialog(java.awt.Frame parent, boolean modal) {
public OrderBookDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
public static void runDialog(java.awt.Frame parent, AccountImpl account){
AccountDialog d;
d=new AccountDialog(parent, false);
d.accountPanel1.account=account;
d.accountPanel1.update();
account.addListener(d.accountPanel1);
d.setVisible(true);
books.setDepth(1000000);
}
/**
@ -60,7 +49,7 @@ public class AccountDialog extends javax.swing.JDialog {
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
accountPanel1 = new opensesim.gui.account.AccountPanel();
books = new gui.orderbook.OrderBooksHorizontal();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -68,11 +57,17 @@ public class AccountDialog extends javax.swing.JDialog {
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(accountPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(books, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(accountPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(books, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
@ -95,20 +90,20 @@ public class AccountDialog extends javax.swing.JDialog {
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(AccountDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(OrderBookDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(AccountDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(OrderBookDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(AccountDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(OrderBookDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(AccountDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(OrderBookDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the dialog */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
AccountDialog dialog = new AccountDialog(new javax.swing.JFrame(), true);
OrderBookDialog dialog = new OrderBookDialog(new javax.swing.JFrame(), true);
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
@ -121,6 +116,6 @@ public class AccountDialog extends javax.swing.JDialog {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private opensesim.gui.account.AccountPanel accountPanel1;
private gui.orderbook.OrderBooksHorizontal books;
// End of variables declaration//GEN-END:variables
}

View File

@ -11,7 +11,7 @@
<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"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,116,0,0,3,-60"/>
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,40,0,0,3,-60"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
@ -28,7 +28,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" pref="458" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="bidBook" pref="244" max="32767" attributes="0"/>
<Component id="jLabel2" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -38,12 +41,15 @@
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="345" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="bidBook" pref="269" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="gui.orderbook.OrderBook" name="bidBook">
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
@ -55,6 +61,8 @@
</Component>
</SubComponents>
</Container>
<Component class="gui.orderbook.QuoteVertical" name="quoteVertical2">
</Component>
<Container class="javax.swing.JPanel" name="askBookPanel">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
@ -67,7 +75,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" pref="458" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="askBook" pref="244" max="32767" attributes="0"/>
<Component id="jLabel1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@ -77,12 +88,15 @@
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="345" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="askBook" pref="269" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="gui.orderbook.OrderBook" name="askBook">
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">

Some files were not shown because too many files have changed in this diff Show More