From 0f2b0906312d777c10a126ac9e5d105e1e9b52cb Mon Sep 17 00:00:00 2001
From: MisterMustache <29614601+MisterMustache@users.noreply.github.com>
Date: Mon, 22 Mar 2021 22:11:45 +0100
Subject: [PATCH] v2021-03-20-alpha
First Commit
Alpha: UI, API, .conf file, adding currency, error handling, profiles, splash
---
.classpath | 27 +
.gitignore | 9 +
.project | 23 +
pom.xml | 81 +
.../java/me/sola/kriptomer/AddProfile.form | 279 +++
.../java/me/sola/kriptomer/AddProfile.java | 385 +++++
.../me/sola/kriptomer/BitStampWebsocket.java | 92 +
.../java/me/sola/kriptomer/META-INF/MANIFEST | 3 +
.../java/me/sola/kriptomer/MainWindow.form | 524 ++++++
.../java/me/sola/kriptomer/MainWindow.java | 1538 +++++++++++++++++
.../java/me/sola/kriptomer/RunKriptomer.java | 81 +
src/main/java/me/sola/kriptomer/Seja.java | 13 +
.../sola/kriptomer/resources/icons/ikona0.png | Bin 0 -> 31115 bytes
.../sola/kriptomer/resources/icons/ikona1.png | Bin 0 -> 42515 bytes
.../kriptomer/resources/menu_icons/add.png | Bin 0 -> 3442 bytes
.../resources/menu_icons/add_thumb.png | Bin 0 -> 502 bytes
.../kriptomer/resources/menu_icons/delete.png | Bin 0 -> 453 bytes
.../resources/menu_icons/delete_thumb.png | Bin 0 -> 341 bytes
.../kriptomer/resources/menu_icons/edit.png | Bin 0 -> 3749 bytes
.../resources/menu_icons/edit_thumb.png | Bin 0 -> 545 bytes
.../me/sola/kriptomer/resources/splash.png | Bin 0 -> 8543 bytes
.../kriptomer/resources/thumbs/bitcoin.png | Bin 0 -> 49785 bytes
.../resources/thumbs/bitcoin_cash.png | Bin 0 -> 54078 bytes
.../kriptomer/resources/thumbs/ethereum.png | Bin 0 -> 55498 bytes
.../kriptomer/resources/thumbs/litecoin.png | Bin 0 -> 35044 bytes
.../kriptomer/resources/thumbs/neznan.png | Bin 0 -> 47664 bytes
.../resources/thumbs/omg_network.png | Bin 0 -> 81264 bytes
.../kriptomer/resources/thumbs/ripple.png | Bin 0 -> 52520 bytes
.../resources/thumbs/stellar_lumens.png | Bin 0 -> 68797 bytes
.../sola/kriptomer/resources/thumbs/zerox.png | Bin 0 -> 65828 bytes
.../sola/kriptomer/resources/trend/down.png | Bin 0 -> 925 bytes
.../sola/kriptomer/resources/trend/down2.png | Bin 0 -> 1242 bytes
.../me/sola/kriptomer/resources/trend/up.png | Bin 0 -> 870 bytes
.../me/sola/kriptomer/resources/trend/up2.png | Bin 0 -> 1155 bytes
34 files changed, 3055 insertions(+)
create mode 100644 .classpath
create mode 100644 .project
create mode 100644 pom.xml
create mode 100644 src/main/java/me/sola/kriptomer/AddProfile.form
create mode 100644 src/main/java/me/sola/kriptomer/AddProfile.java
create mode 100644 src/main/java/me/sola/kriptomer/BitStampWebsocket.java
create mode 100644 src/main/java/me/sola/kriptomer/META-INF/MANIFEST
create mode 100644 src/main/java/me/sola/kriptomer/MainWindow.form
create mode 100644 src/main/java/me/sola/kriptomer/MainWindow.java
create mode 100644 src/main/java/me/sola/kriptomer/RunKriptomer.java
create mode 100644 src/main/java/me/sola/kriptomer/Seja.java
create mode 100644 src/main/java/me/sola/kriptomer/resources/icons/ikona0.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/icons/ikona1.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/add.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/add_thumb.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/delete.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/delete_thumb.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/edit.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/menu_icons/edit_thumb.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/splash.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/bitcoin.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/bitcoin_cash.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/ethereum.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/litecoin.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/neznan.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/omg_network.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/ripple.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/stellar_lumens.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/thumbs/zerox.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/trend/down.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/trend/down2.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/trend/up.png
create mode 100644 src/main/java/me/sola/kriptomer/resources/trend/up2.png
diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..b6e3819
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
index 0e13eeb..919d986 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,12 @@ buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
+.settings/org.eclipse.jdt.core.prefs
+.settings/org.eclipse.core.resources.prefs
+releases/*
+bin/*
+kriptomer.conf
+kriptomer_profile.conf
+nb-configuration.xml
+nbactions-release-profile.xml
+nbactions.xml
diff --git a/.project b/.project
new file mode 100644
index 0000000..964bf9b
--- /dev/null
+++ b/.project
@@ -0,0 +1,23 @@
+
+
+ Kriptomer
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.m2e.core.maven2Builder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+ org.eclipse.m2e.core.maven2Nature
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..d2d27b4
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,81 @@
+
+
+ 4.0.0
+ me.sola
+ Kriptomer
+ 1.0-SNAPSHOT
+ jar
+
+
+
+
+ com.googlecode.json-simple
+ json-simple
+ 1.1.1
+ jar
+
+
+
+ com.google.code.gson
+ gson
+ 2.8.6
+
+
+
+ org.java-websocket
+ Java-WebSocket
+ 1.5.1
+
+
+ org.slf4j
+ slf4j-api
+ 1.7.5
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.7.5
+
+
+
+
+
+ UTF-8
+ 14
+ 14
+
+
+
+ Kriptomer
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.1.0
+
+
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.1.0
+
+
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 3.1.0
+
+
+ 1.8
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/me/sola/kriptomer/AddProfile.form b/src/main/java/me/sola/kriptomer/AddProfile.form
new file mode 100644
index 0000000..17dd6f1
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/AddProfile.form
@@ -0,0 +1,279 @@
+
+
+
diff --git a/src/main/java/me/sola/kriptomer/AddProfile.java b/src/main/java/me/sola/kriptomer/AddProfile.java
new file mode 100644
index 0000000..c0b4522
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/AddProfile.java
@@ -0,0 +1,385 @@
+/*
+ * 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 me.sola.kriptomer;
+
+import java.awt.Dimension;
+import java.awt.Point;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+/**
+ *
+ * @author TheGoodSpice
+ */
+public class AddProfile extends javax.swing.JFrame {
+
+ /**
+ * Creates new form AddProfile
+ */
+ public AddProfile() {
+ 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")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel3 = new javax.swing.JPanel();
+ naslov = new javax.swing.JLabel();
+ jPanel4 = new javax.swing.JPanel();
+ shrani = new javax.swing.JButton();
+ preklici = new javax.swing.JButton();
+ jPanel5 = new javax.swing.JPanel();
+ ime_tekst = new javax.swing.JLabel();
+ fiat_tekst = new javax.swing.JLabel();
+ jPanel6 = new javax.swing.JPanel();
+ ime_profila = new javax.swing.JTextField();
+ fiat_valuta = new javax.swing.JComboBox<>();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+
+ naslov.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
+ naslov.setText("Dodajanje novega profila");
+
+ javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+ jPanel3.setLayout(jPanel3Layout);
+ jPanel3Layout.setHorizontalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel3Layout.createSequentialGroup()
+ .addGap(107, 107, 107)
+ .addComponent(naslov, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(134, 134, 134))
+ );
+ jPanel3Layout.setVerticalGroup(
+ jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel3Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(naslov, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+
+ jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+
+ shrani.setBackground(new java.awt.Color(102, 153, 255));
+ shrani.setForeground(new java.awt.Color(255, 255, 255));
+ shrani.setText("Shrani");
+ shrani.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ shraniActionPerformed(evt);
+ }
+ });
+
+ preklici.setBackground(new java.awt.Color(255, 153, 153));
+ preklici.setForeground(new java.awt.Color(255, 255, 255));
+ preklici.setText("Prekliči");
+ preklici.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ prekliciActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
+ jPanel4.setLayout(jPanel4Layout);
+ jPanel4Layout.setHorizontalGroup(
+ jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel4Layout.createSequentialGroup()
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(shrani)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(preklici)
+ .addContainerGap())
+ );
+ jPanel4Layout.setVerticalGroup(
+ jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel4Layout.createSequentialGroup()
+ .addGap(14, 14, 14)
+ .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(shrani)
+ .addComponent(preklici))
+ .addContainerGap(14, Short.MAX_VALUE))
+ );
+
+ jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ jPanel5.setAlignmentX(0.0F);
+ jPanel5.setAlignmentY(0.0F);
+
+ ime_tekst.setText("Ime profila:");
+ ime_tekst.setPreferredSize(new java.awt.Dimension(63, 24));
+
+ fiat_tekst.setText("Fiat valuta profila:");
+ fiat_tekst.setPreferredSize(new java.awt.Dimension(99, 24));
+
+ javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
+ jPanel5.setLayout(jPanel5Layout);
+ jPanel5Layout.setHorizontalGroup(
+ jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel5Layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(ime_tekst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(fiat_tekst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ jPanel5Layout.setVerticalGroup(
+ jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel5Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(ime_tekst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(fiat_tekst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+
+ ime_profila.setText("Moj profil");
+
+ fiat_valuta.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "EUR - Euro (€)", "USD - Ameriški dolar ($)", "GBP - Britanski funt (£)" }));
+
+ javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
+ jPanel6.setLayout(jPanel6Layout);
+ jPanel6Layout.setHorizontalGroup(
+ jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel6Layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(ime_profila, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(fiat_valuta, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ jPanel6Layout.setVerticalGroup(
+ jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel6Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(ime_profila, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(fiat_valuta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(146, Short.MAX_VALUE))
+ );
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, 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()
+ .addContainerGap()
+ .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
+
+ jPanel5.getAccessibleContext().setAccessibleName("");
+
+ pack();
+ }// //GEN-END:initComponents
+
+ public void usodnaNapaka(Exception e){
+
+ JOptionPane optionPane = new JOptionPane("Opa! Nekaj je šlo hudo narobe! Stabilnost seje se je porušila. " +
+ "Kriptomer se bo interno znova zagnal! V primeru persistente napake ročno znova zaženite aplikacijo " +
+ "oz. zavrzite konfiguracijsko datoteko.\n\n" + e.getMessage(), JOptionPane.ERROR_MESSAGE);
+ JDialog dialog = optionPane.createDialog("USODNA NAPAKA");
+ dialog.setAlwaysOnTop(true);
+ dialog.setVisible(true);
+
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, e);
+
+ Dimension d = new java.awt.Dimension(1080, 750);
+ Point p = new java.awt.Point(10, 10);
+
+ MainWindow m;
+ try {
+ m = new MainWindow(d, p);
+ m.restartKriptomer(false);
+ } catch (IOException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InterruptedException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InvocationTargetException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ }
+
+ private void shraniActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_shraniActionPerformed
+
+ System.out.println("> Ustvarjanje novega profila");
+
+ String ime = ime_profila.getText();
+ String fiat_ = fiat_valuta.getItemAt(fiat_valuta.getSelectedIndex());
+
+ String fiat;
+ switch(fiat_){
+ case "EUR - Euro (€)":
+ fiat = "eur";
+ break;
+ case "USD - Ameriški dolar ($)":
+ fiat = "usd";
+ break;
+ case "GBP - Britanski funt (£)":
+ fiat = "gbp";
+ break;
+ default:
+ fiat = "napaka";
+ throw new RuntimeException("Izbran neznan fiat simbol");
+ }
+
+ System.out.println(ime + " " + fiat);
+
+ JSONParser jsonParser = new JSONParser();
+
+ try {
+ FileReader reader = new FileReader("kriptomer.conf");
+
+ Object obj = jsonParser.parse(reader);
+ JSONObject saved = (JSONObject) obj;
+
+ System.out.println(saved);
+ System.out.println(" ...nalaganje profila");
+
+ JSONArray profili = (JSONArray) saved.get("profili");
+
+ JSONObject nov_profil = new JSONObject();
+ JSONArray valute = new JSONArray();
+
+ nov_profil.put("ime", ime);
+ nov_profil.put("valute", valute);
+ nov_profil.put("fiat", fiat);
+
+ profili.add(nov_profil);
+
+ saved.put("profili", profili);
+
+ FileWriter newfile = new FileWriter("kriptomer.conf");
+ newfile.write(saved.toJSONString());
+ newfile.flush();
+
+ System.out.println(" ... finished");
+
+ Dimension d = new java.awt.Dimension(1080, 750);
+ Point p = new java.awt.Point(10, 10);
+
+ MainWindow m;
+ try {
+ m = new MainWindow(d, p);
+ m.restartKriptomer(false);
+ } catch (IOException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InterruptedException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InvocationTargetException ex) {
+ Logger.getLogger(AddProfile.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(jPanel3);
+ frame.dispose();
+ Thread.currentThread().stop();
+
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("> profile loading error\n ... FileNotFound Excpetion");
+ usodnaNapaka(e);
+ } catch (java.io.IOException e) {
+ System.out.println(">> profile loading error\n ... IO Excpetion");
+ usodnaNapaka(e);
+ } catch (ParseException e) {
+ System.out.println(">> profile loading error\n ... Parsing Error. Corrupt File?");
+ usodnaNapaka(e);
+ }
+ }//GEN-LAST:event_shraniActionPerformed
+
+ private void prekliciActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prekliciActionPerformed
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(jPanel3);
+ frame.dispose();
+
+ }//GEN-LAST:event_prekliciActionPerformed
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(AddProfile.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(AddProfile.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(AddProfile.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(AddProfile.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ new AddProfile().setVisible(true);
+ }
+ });
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel fiat_tekst;
+ private javax.swing.JComboBox fiat_valuta;
+ private javax.swing.JTextField ime_profila;
+ private javax.swing.JLabel ime_tekst;
+ private javax.swing.JPanel jPanel3;
+ private javax.swing.JPanel jPanel4;
+ private javax.swing.JPanel jPanel5;
+ private javax.swing.JPanel jPanel6;
+ private javax.swing.JLabel naslov;
+ private javax.swing.JButton preklici;
+ private javax.swing.JButton shrani;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/src/main/java/me/sola/kriptomer/BitStampWebsocket.java b/src/main/java/me/sola/kriptomer/BitStampWebsocket.java
new file mode 100644
index 0000000..f3a3dfc
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/BitStampWebsocket.java
@@ -0,0 +1,92 @@
+package me.sola.kriptomer;
+
+import java.net.URI;
+import java.util.Map;
+import org.java_websocket.client.WebSocketClient;
+import org.java_websocket.drafts.Draft;
+import org.java_websocket.handshake.ServerHandshake;
+
+/**
+ * This example demonstrates how to create a websocket connection to a server.
+ * Only the most important callbacks are overloaded.
+ */
+public class BitStampWebsocket extends WebSocketClient {
+
+// public BitStampWebsocket(URI serverUri, Draft draft) {
+// super(serverUri, draft);
+// }
+
+ String valuta = "";
+ String fiat = "";
+
+ public BitStampWebsocket(URI serverURI) {
+ super(serverURI);
+ }
+
+// public BitStampWebsocket(URI serverUri, Map httpHeaders) {
+// super(serverUri, httpHeaders);
+// }
+
+ //String subscribeMsg = "{\"event\": \"bts:subscribe\",\"data\": {\"channel\": \"live_trades_btceur\"}}";
+
+
+ @Override
+ public void onOpen(ServerHandshake handshakedata) {
+
+ String subscribeMsg = "{\"event\": \"bts:subscribe\",\"data\": {\"channel\": \"live_trades_" + valuta + fiat + "\"}}";
+
+ send(subscribeMsg);
+ //System.out.println("opened connection");
+ if (this.messageHandler != null) {
+ this.messageHandler.handleMessage("opened connection", valuta);
+ }
+ // if you plan to refuse connection based on ip or httpfields overload: onWebsocketHandshakeReceivedAsClient
+ }
+
+ @Override
+ public void onMessage(String message) {
+ //System.out.println("received: " + message);
+ if (this.messageHandler != null) {
+ this.messageHandler.handleMessage(message, valuta);
+ }
+ }
+
+ @Override
+ public void onClose(int code, String reason, boolean remote) {
+ // The codecodes are documented in class org.java_websocket.framing.CloseFrame
+ System.out.println(
+ "Connection closed by " + (remote ? "remote peer" : "us") + " Code: " + code + " Reason: "
+ + reason);
+ }
+
+ @Override
+ public void onError(Exception ex) {
+ ex.printStackTrace();
+ // if the error is fatal then onClose will be called additionally
+ }
+
+ private MessageHandler messageHandler;
+
+ public void addMessageHandler(MessageHandler msgHandler) {
+ this.messageHandler = msgHandler;
+ }
+
+ public static interface MessageHandler {
+ public void handleMessage(String message, String valuta);
+ }
+
+ public void addValutaInFiat(String valuta_, String fiat_){
+ this.valuta = valuta_;
+ this.fiat = fiat_;
+ }
+
+ public String ija(){
+ return this.valuta + this.fiat;
+ }
+// public static void main(String[] args) throws URISyntaxException {
+// BitStampWebsocket c = new BitStampWebsocket(new URI(
+// "wss://ws.bitstamp.net"));
+// c.connect();
+// }
+
+}
diff --git a/src/main/java/me/sola/kriptomer/META-INF/MANIFEST b/src/main/java/me/sola/kriptomer/META-INF/MANIFEST
new file mode 100644
index 0000000..478778a
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/META-INF/MANIFEST
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: me.sola.kriptomer.RunKriptomer
+
diff --git a/src/main/java/me/sola/kriptomer/MainWindow.form b/src/main/java/me/sola/kriptomer/MainWindow.form
new file mode 100644
index 0000000..e891c5a
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/MainWindow.form
@@ -0,0 +1,524 @@
+
+
+
diff --git a/src/main/java/me/sola/kriptomer/MainWindow.java b/src/main/java/me/sola/kriptomer/MainWindow.java
new file mode 100644
index 0000000..d5a9b4c
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/MainWindow.java
@@ -0,0 +1,1538 @@
+/*
+ * 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 me.sola.kriptomer;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+import java.awt.Image;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Scanner;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingUtilities;
+import static me.sola.kriptomer.MainWindow.addValuteArray;
+
+import org.json.simple.*;
+//import org.json.simple.parser.JSONParser;
+//import org.json.simple.parser.ParseException;
+import com.google.gson.*;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.Formatter;
+import java.util.Locale;
+import java.util.Objects;
+import javax.imageio.ImageIO;
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import javax.swing.JRadioButtonMenuItem;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+/**
+ *
+ * @author TheGoodSpice
+ */
+public class MainWindow extends javax.swing.JFrame {
+
+ /*
+ * Global vars
+ */
+ /**
+ * Creates new form MainWindow
+ */
+ private final javax.swing.ButtonGroup profili;
+
+ public MainWindow(Dimension d, Point p) throws IOException, InterruptedException, InvocationTargetException {
+ initComponents();
+
+ // "Ročno" popravljeni atributi in GUI stvari (ker NetBeans nima podpore ali ne deluje pravilno)
+ JPanel panel = (JPanel) kriptoBox.getParent();
+ panel.remove(kriptoBox);
+ panel.revalidate();
+ panel.repaint();
+
+ profili = new javax.swing.ButtonGroup();
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ Image ikona = ImageIO.read(RunKriptomer.class.getResource("resources/icons/ikona1.png"));
+ frame.setIconImage(ikona);
+
+ frame.setSize(d);
+ frame.setLocation(p);
+
+ panel1.setBorder(BorderFactory.createLineBorder(Color.black));
+ panel2.setBorder(BorderFactory.createLineBorder(Color.black));
+ naslovnica.setBorder(BorderFactory.createLineBorder(Color.black));
+
+// dodajValuto.setIcon(new ImageIcon("src/main/java/me/sola/kriptomerresources/menu_icons/add_thumb.png"));
+// odstraniValuto.setIcon(new ImageIcon("src/main/java/me/sola/kriptomerresources/menu_icons/delete_thumb.png"));
+// urediValuto.setIcon(new ImageIcon("src/main/java/me/sola/kriptomerresources/menu_icons/edit_thumb.png"));
+ dodajValuto.setIcon(new ImageIcon(this.getClass().getResource("resources/menu_icons/add_thumb.png")));
+ odstraniValuto.setIcon(new ImageIcon(this.getClass().getResource("resources/menu_icons/delete_thumb.png")));
+ urediValuto.setIcon(new ImageIcon(this.getClass().getResource("resources/menu_icons/edit_thumb.png")));
+
+ for(int i = 0; i < 10; i++){
+ //addKriptoBox("t", 10.0, 10.0, "e");
+ }
+
+
+ //
+ profileHandler();
+
+ valuteHandler();
+
+ adaptSizeChange();
+ //refreshHandler("");
+ }
+
+ /**
+ * 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")
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ naslovnica = new javax.swing.JPanel();
+ jLabel3 = new javax.swing.JLabel();
+ jLabel4 = new javax.swing.JLabel();
+ panel1 = new javax.swing.JPanel();
+ jPanel1 = new javax.swing.JPanel();
+ jLabel1 = new javax.swing.JLabel();
+ valuteBoxScroll = new javax.swing.JScrollPane();
+ valuteBox = new javax.swing.JPanel();
+ kriptoBox = new javax.swing.JPanel();
+ icon = new javax.swing.JLabel();
+ name = new javax.swing.JLabel();
+ amount = new javax.swing.JLabel();
+ dot = new javax.swing.JLabel();
+ price = new javax.swing.JLabel();
+ worth = new javax.swing.JLabel();
+ trend = new javax.swing.JLabel();
+ trend_icon = new javax.swing.JLabel();
+ profit = new javax.swing.JLabel();
+ panel2 = new javax.swing.JPanel();
+ jLabel2 = new javax.swing.JLabel();
+ menu = new javax.swing.JMenuBar();
+ portfelj = new javax.swing.JMenu();
+ dodajValuto = new javax.swing.JMenuItem();
+ urediValuto = new javax.swing.JMenu();
+ test1 = new javax.swing.JMenuItem();
+ jSeparator1 = new javax.swing.JPopupMenu.Separator();
+ odstraniValuto = new javax.swing.JMenuItem();
+ profil = new javax.swing.JMenu();
+ spremeniProfil = new javax.swing.JMenu();
+ jSeparator2 = new javax.swing.JPopupMenu.Separator();
+ dodajProfil = new javax.swing.JMenuItem();
+ odstraniProfil = new javax.swing.JMenuItem();
+ seja = new javax.swing.JMenu();
+ restart = new javax.swing.JMenuItem();
+ osveziConfig = new javax.swing.JMenuItem();
+ pomoc = new javax.swing.JMenu();
+ zacnimo = new javax.swing.JMenuItem();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+ setTitle("Kriptomer - Avtor: Tilen Levak");
+ setMinimumSize(new java.awt.Dimension(360, 300));
+ setPreferredSize(new java.awt.Dimension(1080, 750));
+ addComponentListener(new java.awt.event.ComponentAdapter() {
+ public void componentResized(java.awt.event.ComponentEvent evt) {
+ formComponentResized(evt);
+ }
+ });
+ addWindowStateListener(new java.awt.event.WindowStateListener() {
+ public void windowStateChanged(java.awt.event.WindowEvent evt) {
+ formWindowStateChanged(evt);
+ }
+ });
+
+ naslovnica.setMinimumSize(new java.awt.Dimension(480, 60));
+ naslovnica.setPreferredSize(new java.awt.Dimension(1080, 60));
+
+ jLabel3.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
+ jLabel3.setText("Kriptomer - Vloži že danes in mogoče boš bogat čez 15 let! ");
+
+ jLabel4.setFont(new java.awt.Font("Dialog", 2, 8)); // NOI18N
+ jLabel4.setText("\"Denar, če vam že ne bo prinesel sreče, vam bo vsaj pomagal, da boste nesrečni v lagodju.\" - Helen Gurley Brown ");
+
+ javax.swing.GroupLayout naslovnicaLayout = new javax.swing.GroupLayout(naslovnica);
+ naslovnica.setLayout(naslovnicaLayout);
+ naslovnicaLayout.setHorizontalGroup(
+ naslovnicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(naslovnicaLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(naslovnicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jLabel3)
+ .addComponent(jLabel4))
+ .addContainerGap(435, Short.MAX_VALUE))
+ );
+ naslovnicaLayout.setVerticalGroup(
+ naslovnicaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(naslovnicaLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
+ .addComponent(jLabel4))
+ );
+
+ getContentPane().add(naslovnica, java.awt.BorderLayout.NORTH);
+
+ panel1.setAlignmentX(0.0F);
+ panel1.setAlignmentY(0.0F);
+ panel1.setPreferredSize(new java.awt.Dimension(530, 720));
+ panel1.setLayout(new java.awt.BorderLayout());
+
+ jPanel1.setPreferredSize(new java.awt.Dimension(530, 20));
+
+ jLabel1.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
+ jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+ jLabel1.setText("Moje Kriptovalute");
+
+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
+ jPanel1.setLayout(jPanel1Layout);
+ jPanel1Layout.setHorizontalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel1)
+ .addContainerGap(398, Short.MAX_VALUE))
+ );
+ jPanel1Layout.setVerticalGroup(
+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addGap(0, 1, Short.MAX_VALUE))
+ );
+
+ panel1.add(jPanel1, java.awt.BorderLayout.PAGE_START);
+
+ valuteBox.setForeground(new java.awt.Color(160, 163, 65));
+ valuteBox.setLayout(new javax.swing.BoxLayout(valuteBox, javax.swing.BoxLayout.LINE_AXIS));
+
+ kriptoBox.setBackground(new java.awt.Color(214, 217, 223));
+ kriptoBox.setForeground(new java.awt.Color(60, 63, 65));
+ kriptoBox.setMaximumSize(new java.awt.Dimension(32767, 68));
+ kriptoBox.setMinimumSize(new java.awt.Dimension(100, 68));
+ kriptoBox.setPreferredSize(new java.awt.Dimension(100, 68));
+
+ icon.setBackground(new java.awt.Color(60, 63, 64));
+ icon.setForeground(new java.awt.Color(80, 80, 80));
+ icon.setText("jLabel4");
+ icon.setPreferredSize(new java.awt.Dimension(56, 56));
+
+ name.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ name.setForeground(new java.awt.Color(60, 63, 65));
+ name.setText("Bitcoin");
+ name.setMaximumSize(null);
+ name.setMinimumSize(null);
+
+ amount.setFont(new java.awt.Font("Dialog", 2, 12)); // NOI18N
+ amount.setForeground(new java.awt.Color(60, 63, 65));
+ amount.setText("0.00012345");
+
+ dot.setForeground(new java.awt.Color(60, 63, 65));
+ dot.setText("•");
+ dot.setToolTipText("");
+
+ price.setForeground(new java.awt.Color(60, 63, 65));
+ price.setText("€40,000.00");
+
+ worth.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ worth.setForeground(new java.awt.Color(60, 63, 65));
+ worth.setText("€420.69");
+
+ trend.setForeground(new java.awt.Color(60, 63, 65));
+ trend.setText("10%");
+
+ trend_icon.setText("jLabel12");
+ trend_icon.setMaximumSize(new java.awt.Dimension(16, 16));
+ trend_icon.setMinimumSize(new java.awt.Dimension(16, 16));
+ trend_icon.setPreferredSize(new java.awt.Dimension(16, 16));
+
+ profit.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
+ profit.setForeground(new java.awt.Color(160, 163, 165));
+ profit.setText("(+€7.21)");
+
+ javax.swing.GroupLayout kriptoBoxLayout = new javax.swing.GroupLayout(kriptoBox);
+ kriptoBox.setLayout(kriptoBoxLayout);
+ kriptoBoxLayout.setHorizontalGroup(
+ kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(icon, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addComponent(amount)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(dot, javax.swing.GroupLayout.PREFERRED_SIZE, 8, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(price)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 260, Short.MAX_VALUE)
+ .addComponent(trend_icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(trend))
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(worth, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(profit, javax.swing.GroupLayout.Alignment.TRAILING))))
+ .addContainerGap())
+ );
+ kriptoBoxLayout.setVerticalGroup(
+ kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(worth, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(0, 0, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, kriptoBoxLayout.createSequentialGroup()
+ .addGap(0, 0, Short.MAX_VALUE)
+ .addComponent(profit)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(amount)
+ .addComponent(dot)
+ .addComponent(price)
+ .addComponent(trend)
+ .addComponent(trend_icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addComponent(icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+
+ valuteBox.add(kriptoBox);
+
+ valuteBoxScroll.setViewportView(valuteBox);
+
+ panel1.add(valuteBoxScroll, java.awt.BorderLayout.CENTER);
+
+ getContentPane().add(panel1, java.awt.BorderLayout.WEST);
+
+ panel2.setAlignmentX(0.0F);
+ panel2.setAlignmentY(0.0F);
+ panel2.setPreferredSize(new java.awt.Dimension(530, 720));
+
+ jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+ jLabel2.setText("Grafi");
+ jLabel2.setAlignmentY(0.0F);
+
+ javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
+ panel2.setLayout(panel2Layout);
+ panel2Layout.setHorizontalGroup(
+ panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(panel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(505, 505, 505))
+ );
+ panel2Layout.setVerticalGroup(
+ panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(panel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel2)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ getContentPane().add(panel2, java.awt.BorderLayout.CENTER);
+
+ portfelj.setText("Portfelj");
+
+ dodajValuto.setText("Dodaj novo valuto");
+ dodajValuto.setEnabled(false);
+ portfelj.add(dodajValuto);
+
+ urediValuto.setText("Uredi obstoječo valuto");
+ urediValuto.setEnabled(false);
+
+ test1.setText("test");
+ test1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ test1ActionPerformed(evt);
+ }
+ });
+ urediValuto.add(test1);
+
+ portfelj.add(urediValuto);
+ portfelj.add(jSeparator1);
+
+ odstraniValuto.setText("Odstrani obstoječo valuto");
+ odstraniValuto.setEnabled(false);
+ portfelj.add(odstraniValuto);
+
+ menu.add(portfelj);
+
+ profil.setText("Profil");
+
+ spremeniProfil.setText("Spremeni aktiven profil");
+ profil.add(spremeniProfil);
+ profil.add(jSeparator2);
+
+ dodajProfil.setText("Ustvari nov profil");
+ dodajProfil.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ dodajProfilActionPerformed(evt);
+ }
+ });
+ profil.add(dodajProfil);
+
+ odstraniProfil.setText("Odstrani obstoječi profil");
+ profil.add(odstraniProfil);
+
+ menu.add(profil);
+
+ seja.setText("Seja");
+ seja.setToolTipText("");
+
+ restart.setText("Ponovno zaženi Kriptomer");
+ restart.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ restartActionPerformed(evt);
+ }
+ });
+ seja.add(restart);
+
+ osveziConfig.setText("Osveži konfiguracijske podatke");
+ osveziConfig.setToolTipText("Če ste spreminjali podatke konfiguracijske datoteke med delovanjem aplikacije in želite videti spremembe je potrebno da program osveži le te.");
+ osveziConfig.setEnabled(false);
+ seja.add(osveziConfig);
+
+ menu.add(seja);
+
+ pomoc.setText("Pomoč");
+
+ zacnimo.setText("Pa začnimo...");
+ zacnimo.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ zacnimoActionPerformed(evt);
+ }
+ });
+ pomoc.add(zacnimo);
+
+ menu.add(pomoc);
+
+ setJMenuBar(menu);
+
+ pack();
+ }// //GEN-END:initComponents
+
+ public void usodnaNapaka(Exception e){
+
+ JOptionPane optionPane = new JOptionPane("Opa! Nekaj je šlo hudo narobe! Stabilnost seje se je porušila. " +
+ "Kriptomer se bo interno znova zagnal! V primeru persistente napake ročno znova zaženite aplikacijo " +
+ "oz. zavrzite konfiguracijsko datoteko.\n\n" + e.getMessage() + "\n\n" + e, JOptionPane.ERROR_MESSAGE);
+ JDialog dialog = optionPane.createDialog("USODNA NAPAKA");
+ dialog.setAlwaysOnTop(true);
+ dialog.setVisible(true);
+
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, e);
+
+ restartKriptomer(false);
+
+ }
+
+ private void profileHandler() throws IOException, InterruptedException, InvocationTargetException {
+
+ JSONParser jsonParser = new JSONParser();
+
+ try {
+ FileReader reader = new FileReader("kriptomer.conf");
+
+ Object obj = jsonParser.parse(reader);
+ JSONObject saved = (JSONObject) obj;
+
+ System.out.println(saved);
+ System.out.println("> nalaganje profila");
+
+ int profil = Integer.parseInt(saved.get("default_profil").toString());
+
+ selectProfile(profil, saved);
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("> profile loading error\n ... no file found");
+ System.out.println("> creating default profiles file");
+
+ // glavni -> profili, 2 profila (1 in 2)
+ JSONArray profili = new JSONArray();
+ JSONObject profil1 = new JSONObject();
+ JSONObject profil2 = new JSONObject();
+
+ // valuti 1 in 2 v profil 1
+ JSONObject valuta1 = new JSONObject();
+ valuta1.put("valuta", "btc");
+ valuta1.put("vlozek", 25.0);
+ //valuta1.put("kolicina", 0.00131779);
+ valuta1.put("kolicina", 0.00123321);
+
+ JSONObject valuta2 = new JSONObject();
+ valuta2.put("valuta", "eth");
+ valuta2.put("vlozek", 10.0);
+ //valuta2.put("kolicina", 0.00994653);
+ valuta2.put("kolicina", 0.00987789);
+
+ JSONArray array_valut1 = new JSONArray();
+ array_valut1.add(valuta1);
+ array_valut1.add(valuta2);
+
+ // valuti 3 in 4 v profil 2
+ JSONObject valuta3 = new JSONObject();
+ valuta3.put("valuta", "btc");
+ valuta3.put("vlozek", 15.0);
+ valuta3.put("kolicina", 0.00123456);
+
+ JSONObject valuta4 = new JSONObject();
+ valuta4.put("valuta", "eth");
+ valuta4.put("vlozek", 20.0);
+ valuta4.put("kolicina", 0.00654321);
+
+ JSONArray array_valut2 = new JSONArray();
+ array_valut2.add(valuta3);
+ array_valut2.add(valuta4);
+
+ // profil 1
+ profil1.put("ime", "Moj EUR Profil");
+ profil1.put("fiat", "eur");
+ profil1.put("valute", array_valut1);
+
+ // profil 2
+ profil2.put("ime", "Moj USD Profil");
+ profil2.put("fiat", "usd");
+ profil2.put("valute", array_valut2);
+
+ profili.add(profil1);
+ profili.add(profil2);
+
+ // bundle
+ JSONObject bundle = new JSONObject();
+ bundle.put("profili", profili);
+ bundle.put("default_profil", 0);
+
+ FileWriter newfile = new FileWriter("kriptomer.conf");
+ //We can write any JSONArray or JSONObject instance to the file
+ newfile.write(bundle.toJSONString());
+ newfile.flush();
+ System.out.println(" ... finished");
+
+ JOptionPane.showMessageDialog(null, "Zdravo naivni *ahem* nov uporabnik. Opazili smo, "
+ + "da ni konfiguracijske datoteke (kriptomer.conf) in smo za "
+ + "vas ustvarili novo z dvema privzetima profiloma. V kolikor "
+ + "že imate to datoteko jo zamenjajte po želji.");
+
+ profileHandler();
+ } catch (java.io.IOException e) {
+ System.out.println("> profile loading error\n ... IO Excpetion");
+ usodnaNapaka(e);
+ } catch (ParseException e) {
+ System.out.println("> profile loading error\n ... Parsing Error. Corrupt File?");
+ usodnaNapaka(e);
+ }
+
+ }
+
+ private void selectProfile(int profil_index, JSONObject json) throws InterruptedException, InvocationTargetException {
+
+ JRadioButtonMenuItem j;
+ for (int i = 0; i < spremeniProfil.getMenuComponents().length; i++){
+ j = (JRadioButtonMenuItem) spremeniProfil.getMenuComponent(i);
+ j.setSelected(false);
+ spremeniProfil.removeAll();
+ }
+
+ JSONArray profili = (JSONArray) json.get("profili");
+
+ JSONObject profil = null;
+
+ try{
+ profil = (JSONObject) profili.get(profil_index);
+ }
+ catch(IndexOutOfBoundsException e){
+ System.out.println("> profile loading error\n ... No profiles.");
+ usodnaNapaka(e);
+ }
+
+ for (int i = 0; i < profili.size(); i++) {
+ JSONObject profil_ = (JSONObject) profili.get(i);
+ String ime_ = profil_.get("ime").toString();
+ boolean selected = false;
+ if (profil_index == i) {
+ selected = true;
+ }
+
+ addProfileToMenu(ime_, i, selected);
+ }
+
+ String ime_profila = profil.get("ime").toString();
+ String fiat = profil.get("fiat").toString();
+
+ JSONArray valute = (JSONArray) profil.get("valute");
+
+ for (int i = 0; i < valute.size(); i++) {
+ JSONObject obj = (JSONObject) valute.get(i);
+ String valuta = obj.get("valuta").toString();
+ Double vlozek = Double.parseDouble(obj.get("vlozek").toString());
+ Double kolicina = Double.parseDouble(obj.get("kolicina").toString());
+
+ addKriptoBox(valuta, vlozek, kolicina, fiat);
+ }
+
+ //System.out.println("Profil -> " + profil.get(profil_index));
+
+ }
+
+ private void addProfileToMenu(String ime_profila, int index, boolean selected) {
+
+ System.out.println("addProfileToMenu -> " + ime_profila + " " + index + " " + selected);
+
+ JRadioButtonMenuItem novProfil = new javax.swing.JRadioButtonMenuItem();
+ novProfil.setSelected(selected);
+ novProfil.setText(ime_profila);
+ spremeniProfil.add(novProfil);
+ profili.add(novProfil);
+
+ spremeniProfil.getMenuComponents();
+ System.out.println("velikost spremeniProfil " + spremeniProfil.getMenuComponents().length);
+
+ novProfil.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+ spremeniAktivniProfil(index);
+ } catch (IOException | ParseException | InterruptedException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ });
+ }
+
+ private void spremeniAktivniProfil(int index) throws IOException, ParseException, InterruptedException {
+
+ JSONParser jsonParser = new JSONParser();
+
+ FileReader reader = null;
+ try {
+ reader = new FileReader("kriptomer.conf");
+ } catch (FileNotFoundException e) {
+ System.out.println("> profile loading error\n ... FileNotFound Excpetion");
+ usodnaNapaka(e);
+ }
+
+ Object obj = jsonParser.parse(reader);
+ JSONObject saved = (JSONObject) obj;
+
+ saved.put("default_profil", index);
+ FileWriter newfile = new FileWriter("kriptomer.conf");
+ //We can write any JSONArray or JSONObject instance to the file
+ newfile.write(saved.toJSONString());
+ newfile.flush();
+
+ JPanel j;
+ for (int i = 0; i < valuteBox.getComponents().length; i++) {
+ j = (JPanel) valuteBox.getComponent(i);
+ valuteBox.remove(j);
+ }
+
+ //for(int i = 0; i < valuteBox.getCompon)
+ System.out.println("velikost valuteBox-a " + valuteBox.getComponents().length);
+
+ restartKriptomer(true);
+
+ }
+
+ private Point getWindowLocation(){
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ Point location = frame.getLocation();
+
+ return location;
+
+ }
+
+ private Dimension getWindowSize(){
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ Dimension size = frame.getSize();
+
+ return size;
+
+ }
+
+ private void refreshHandler(String valuta, String fiat, Double investicija) {
+
+ Runnable auto_refresh = new Runnable() {
+ public void run() {
+ try {
+ refreshData(valuta, fiat, investicija);
+ } catch (URISyntaxException e) {
+ System.out.println(e);
+ }
+ }
+ };
+ Thread t = new Thread(null, auto_refresh, "Background");
+ t.start();
+
+ }
+
+ public static int[] addToArray(int arr[], int x) {
+ int n = arr.length;
+ int newarr[] = new int[n + 1];
+
+ for (int i = 0; i < n; i++) {
+ newarr[i] = arr[i];
+ }
+
+ newarr[n] = x;
+ return newarr;
+ }
+
+ public static JPanel[] addValuteArray(JPanel arr[], JPanel x) {
+ int n = arr.length;
+ JPanel newarr[] = new JPanel[n + 1];
+
+ for (int i = 0; i < n; i++) {
+ newarr[i] = arr[i];
+ }
+
+ newarr[n] = x;
+ return newarr;
+ }
+
+ int[] valute = {};
+ JPanel[] valute_paneli = {};
+
+ private void valuteHandler() {
+// try {
+//
+// addKriptoBox("btc", 11.0, 0.2);
+// } catch (InterruptedException ex) {
+// Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+// } catch (InvocationTargetException ex) {
+// Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+// }
+ }
+
+ // Samodejna
+ private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
+ adaptSizeChange();
+ }//GEN-LAST:event_formComponentResized
+
+ private void formWindowStateChanged(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowStateChanged
+ adaptSizeChange();
+ }//GEN-LAST:event_formWindowStateChanged
+
+ private void restartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_restartActionPerformed
+ restartKriptomer(false);
+ }//GEN-LAST:event_restartActionPerformed
+
+ public void restartKriptomer(boolean keepProperties){
+
+ try {
+ System.out.println("X X X X X X\n> Kriptomer se ponovno zaganja\nX X X X X X");
+
+ if(keepProperties){
+ Dimension d = getWindowSize();
+ Point p = getWindowLocation();
+ RunKriptomer.main(d, p);
+ }
+ else{
+ String[] arguments = new String[] {"123"};
+ RunKriptomer.main(arguments);
+ }
+
+ JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ frame.dispose();
+ Thread.currentThread().stop();
+
+ } catch (IOException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InterruptedException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ }
+
+ private void zacnimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zacnimoActionPerformed
+ System.out.println("> Odpiram pomoč");
+ JFrame f = new JFrame();
+
+ JLabel lab1 = new JLabel("Pomoči ni!");
+ f.setSize(new java.awt.Dimension(720, 480));
+ f.getContentPane().add(lab1);
+ f.repaint();
+ f.revalidate();
+
+ f.setVisible(true);
+ }//GEN-LAST:event_zacnimoActionPerformed
+
+ private void test1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_test1ActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_test1ActionPerformed
+
+ private void dodajProfilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dodajProfilActionPerformed
+
+ AddProfile a = new AddProfile();
+ a.setVisible(true);
+
+ }//GEN-LAST:event_dodajProfilActionPerformed
+
+ private void adaptSizeChange() {//java.awt.event.ComponentEvent evt){
+ //JFrame f5 = (JFrame) SwingUtilities.getRootPane(panel1).getParent();
+ //System.out.println(f5);
+ JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ //System.out.println(topFrame);
+ int frame_h = topFrame.getBounds().height;
+ int frame_w = topFrame.getBounds().width;
+
+ panel1.setPreferredSize(new Dimension((frame_w / 3) - 10, frame_h));
+ panel2.setPreferredSize(new Dimension(((frame_w / 3) * 2) - 10, frame_h));
+
+ int scroll_h = valuteBox.getHeight();
+ int scroll_w = valuteBox.getWidth();
+ //valuteBox.setPreferredSize(valuteBox.getPreferredSize());
+ //valuteBox.setPreferredSize(new Dimension(valuteBox.getPreferredSize().width, valuteBoxScroll.getPreferredSize().height));
+ //valuteBoxScroll.setPreferredSize(new Dimension(valuteBoxScroll.getPreferredSize().width, 100));
+
+ valuteBox.validate();
+ //valuteBox.repaint();
+ //System.out.println(valuteBoxScroll.getSize());
+ }
+
+ /**
+ * @param d
+ * @param p
+ */
+ public static void main(Dimension d, Point p) {
+
+ System.out.println("STARTING MainWindow");
+ /* Set the Nimbus look and feel */
+ //
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+ * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+ java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (InstantiationException ex) {
+ java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (IllegalAccessException ex) {
+ java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+ java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ }
+ //
+
+ /* Create and display the form */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ try {
+ new MainWindow(d, p).setVisible(true);
+ } catch (IOException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InterruptedException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (InvocationTargetException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ });
+ }
+
+// private boolean listsDone = false;
+//
+// boolean getListsDone() {
+// return listsDone;
+// }
+
+ private void addKriptoBox(String cryptoCurrency, Double cryptoVlozek, Double cryptoAmount, String fiat) throws InterruptedException, InvocationTargetException {
+
+// try {
+// refreshData();
+// } catch (IOException ex) {
+// Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+// }
+ System.out.println("> adding new KriptoBox ...");
+
+ // Nov ExecutorService ki poskrbi da nit konča z nalogo preden nadaljujemo z
+ ExecutorService es = Executors.newCachedThreadPool();
+ es.execute(new Runnable() {
+
+ @Override
+ public void run() {
+ System.out.println(" ...zaganjanje nove niti");
+
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+
+ System.out.println(" ...dodajanje nove valute");
+
+ // Prevajalna tabela
+ String cryptoName;
+ String base_path = "resources/thumbs/";
+ String iconPath;
+ switch (cryptoCurrency) {
+ case "btc":
+ cryptoName = "Bitcoin";
+ iconPath = base_path + "bitcoin.png";
+ break;
+ case "eth":
+ cryptoName = "Ethereum";
+ iconPath = base_path + "ethereum.png";
+ break;
+ case "bch":
+ cryptoName = "Bitcoin Cash";
+ iconPath = base_path + "bitcoin_cash.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ case "xrp":
+ cryptoName = "Ripple";
+ iconPath = base_path + "ripple.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ case "ltc":
+ cryptoName = "Litecoin";
+ iconPath = base_path + "litecoin.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ case "xlm":
+ cryptoName = "Stellar Lumens";
+ iconPath = base_path + "stellar_lumens.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ case "omg":
+ cryptoName = "OMG Network";
+ iconPath = base_path + "omg_network.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ case "zrx":
+ cryptoName = "0x";
+ iconPath = base_path + "zerox.png";
+ //iconPath = base_path + "bitcoin.png";
+ break;
+ default:
+ cryptoName = "Neznan: " + cryptoCurrency;
+ iconPath = base_path + "neznan.png";
+ }
+
+ JPanel kriptoBox = new javax.swing.JPanel();
+ JLabel icon = new javax.swing.JLabel();
+ JLabel name = new javax.swing.JLabel();
+ JLabel amount = new javax.swing.JLabel();
+ JLabel dot = new javax.swing.JLabel();
+ JLabel price = new javax.swing.JLabel();
+ JLabel worth = new javax.swing.JLabel();
+ JLabel trend = new javax.swing.JLabel();
+ JLabel trend_icon = new javax.swing.JLabel();
+ JLabel profit = new javax.swing.JLabel();
+
+ //ImageIcon imageIcon = new ImageIcon("src/main/java/me/sola/kriptomerresources/trend/up2.png"); // load the image to a imageIcon
+ ImageIcon imageIcon = new ImageIcon(this.getClass().getResource("resources/trend/up2.png")); // load the image to a imageIcon
+ Image image = imageIcon.getImage(); // transform it
+ Image newimg = image.getScaledInstance(10, 10, java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
+ ImageIcon newimg1 = new ImageIcon(newimg); // transform it back
+
+ trend_icon.setIcon(newimg1);
+
+ //System.out.println("iconPath " + iconPath);
+ ImageIcon imageIcon2;
+ try {
+ imageIcon2 = new ImageIcon(this.getClass().getResource(iconPath)); // load the image to a imageIcon
+ } catch (Exception e) {
+ imageIcon2 = new ImageIcon(this.getClass().getResource("resources/thumbs/neznan.png")); // load the image to a imageIcon
+ }
+ Image image2 = imageIcon2.getImage(); // transform it
+ Image newimg2 = image2.getScaledInstance(56, 56, java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
+ ImageIcon newimg12 = new ImageIcon(newimg2); // transform it back
+ icon.setIcon(newimg12);
+
+// icon.setText("ikona");
+// icon.setPreferredSize(new java.awt.Dimension(42, 42));
+//
+// name.setText(cryptoName);
+//
+// amount.setText("0.00012345");
+//
+// worth.setText(cryptoWorth);
+//
+// trend.setText("10%");
+//
+// trend_icon.setText("movement");
+// trend_icon.setPreferredSize(new java.awt.Dimension(10, 10));
+ kriptoBox.setBackground(new java.awt.Color(214, 217, 223));
+ kriptoBox.setForeground(new java.awt.Color(60, 63, 65));
+ kriptoBox.setMaximumSize(new java.awt.Dimension(32767, 58));
+ kriptoBox.setMinimumSize(new java.awt.Dimension(100, 56));
+ kriptoBox.setPreferredSize(new java.awt.Dimension(100, 56));
+
+ icon.setBackground(new java.awt.Color(60, 63, 64));
+ icon.setForeground(new java.awt.Color(80, 80, 80));
+ //icon.setText("ikona");
+ icon.setPreferredSize(new java.awt.Dimension(56, 56));
+
+ name.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ name.setForeground(new java.awt.Color(60, 63, 65));
+ name.setText(cryptoName);
+ name.setMaximumSize(null);
+ name.setMinimumSize(null);
+
+ amount.setFont(new java.awt.Font("Dialog", 2, 12)); // NOI18N
+ amount.setForeground(new java.awt.Color(60, 63, 65));
+ amount.setText("" + cryptoAmount);
+
+ dot.setForeground(new java.awt.Color(60, 63, 65));
+ dot.setText("•");
+ dot.setToolTipText("");
+
+ price.setForeground(new java.awt.Color(60, 63, 65));
+ price.setText("€--,---.--");
+
+ worth.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
+ worth.setForeground(new java.awt.Color(60, 63, 65));
+ worth.setText("€--.--");
+
+ trend.setForeground(new java.awt.Color(60, 63, 65));
+ trend.setText("--%");
+
+ //trend_icon.setText("trend_icon");
+ trend_icon.setMaximumSize(new java.awt.Dimension(16, 16));
+ trend_icon.setMinimumSize(new java.awt.Dimension(16, 16));
+ trend_icon.setPreferredSize(new java.awt.Dimension(16, 16));
+
+ kriptoBox.setMaximumSize(new java.awt.Dimension(2000, 68));
+ kriptoBox.setMinimumSize(new java.awt.Dimension(100, 68));
+
+ valuteBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+ valuteBox.setSize(valuteBox.getPreferredSize().width, valuteBox.getPreferredSize().height);
+
+ //kriptoBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+
+ profit.setFont(new java.awt.Font("Dialog", 1, 10)); // NOI18N
+ profit.setForeground(new java.awt.Color(160, 163, 165));
+ profit.setText("(+€-.--)");
+
+ javax.swing.GroupLayout kriptoBoxLayout = new javax.swing.GroupLayout(kriptoBox);
+ kriptoBox.setLayout(kriptoBoxLayout);
+ kriptoBoxLayout.setHorizontalGroup(
+ kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(icon, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addComponent(amount)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(dot, javax.swing.GroupLayout.PREFERRED_SIZE, 8, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(price)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 260, Short.MAX_VALUE)
+ .addComponent(trend_icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(trend))
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(profit, javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(worth, javax.swing.GroupLayout.Alignment.TRAILING))))
+ .addContainerGap())
+ );
+ kriptoBoxLayout.setVerticalGroup(
+ kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(kriptoBoxLayout.createSequentialGroup()
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(worth, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(0, 0, Short.MAX_VALUE))
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, kriptoBoxLayout.createSequentialGroup()
+ .addGap(0, 0, Short.MAX_VALUE)
+ .addComponent(profit)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
+ .addGroup(kriptoBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(amount)
+ .addComponent(dot)
+ .addComponent(price)
+ .addComponent(trend)
+ .addComponent(trend_icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addComponent(icon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap()
+ )
+ );
+
+ valuteBox.add(kriptoBox);
+
+ valuteBoxScroll.setViewportView(valuteBox);
+
+ panel1.add(valuteBoxScroll, java.awt.BorderLayout.CENTER);
+
+ getContentPane().add(panel1, java.awt.BorderLayout.WEST);
+
+ panel2.setAlignmentX(0.0F);
+ panel2.setAlignmentY(0.0F);
+ panel2.setPreferredSize(new java.awt.Dimension(530, 720));
+
+ jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+ jLabel2.setText("Grafi");
+ jLabel2.setAlignmentY(0.0F);
+
+ javax.swing.GroupLayout panel2Layout = new javax.swing.GroupLayout(panel2);
+ panel2.setLayout(panel2Layout);
+ panel2Layout.setHorizontalGroup(
+ panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(panel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGap(505, 505, 505))
+ );
+ panel2Layout.setVerticalGroup(
+ panel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(panel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel2)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ valuteBox.setBackground(new Color(0xbb, 0xbb, 0xbb));
+
+ //Dodaj v parent box
+ javax.swing.GroupLayout valuteBoxLayout = new javax.swing.GroupLayout(valuteBox);
+ valuteBox.setLayout(valuteBoxLayout);
+ valuteBox.setLayout(new BoxLayout(valuteBox, BoxLayout.Y_AXIS));
+ valuteBoxLayout.setHorizontalGroup(
+ valuteBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(valuteBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(kriptoBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ valuteBoxLayout.setVerticalGroup(
+ valuteBoxLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(valuteBoxLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(kriptoBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(576, Short.MAX_VALUE))
+ );
+
+ // Presledek med box-i
+ JPanel gapPanel = new javax.swing.JPanel();
+ gapPanel.setMaximumSize(new java.awt.Dimension(0, 5));
+ gapPanel.setMinimumSize(new java.awt.Dimension(0, 5));
+ valuteBox.add(gapPanel);
+
+ valute_paneli = addValuteArray(valute_paneli, kriptoBox);
+
+ System.out.println("...ustvarjanje novega panela " + cryptoName + " koncano");
+
+ //System.out.println(valute_paneli[valute.length-1]);
+ //frame.revalidate();
+ //frame.repaint();
+// synchronized (this) {
+// listsDone = true;
+// notifyAll();
+// }
+ }
+
+ });
+ }
+
+ });
+ //es.shutdown();
+ //boolean finished = es.awaitTermination(1, TimeUnit.MINUTES);
+
+// System.out.println("0");
+// synchronized (es) {
+// System.out.println("1");
+// if (!getListsDone()) {
+// System.out.println("2");
+// try {
+// es.wait();
+// } catch (InterruptedException e) {
+// System.out.println("X");
+// // handle it somehow
+// }
+// }
+// }
+ //System.out.println(" ...nit terminirana");
+ adaptSizeChange();
+
+ // indeks števila valut
+ valute = addToArray(valute, valute.length);
+ System.out.println("> Novo število valut: " + valute_paneli.length);
+
+ // nova valuta (ime)
+ String cryptoName_ = cryptoCurrency + " ID: " + valute.length;
+
+ // zajemanje glavnega okna
+ //final JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel1);
+ // log
+ System.out.println(" ...dodan KriptoBox " + cryptoName_);
+
+ refreshHandler(cryptoCurrency, fiat, cryptoVlozek);
+
+ }
+
+ // LEGACY BEGIN
+ int refreshRate = 10;
+
+ private void refreshDataOld() throws MalformedURLException, IOException, InterruptedException {
+ while (true) {
+ try {
+ System.out.println("> Osvezevanje podatkov... \n ...stevilo valut nacrtovanih za osvezevanje: " + valute_paneli.length + "");
+ for (int i = 0; i < valute.length; i++) {
+ Component[] comp = valute_paneli[i].getComponents();
+ //System.out.println(comp[1]);
+ var worth = (JLabel) comp[5];
+
+ String api_url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=eur";
+
+ URL url = new URL(api_url);
+
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("GET");
+ conn.connect();
+
+ String inline = "";
+ Scanner scanner = new Scanner(url.openStream());
+
+ //Write all the JSON data into a string using a scanner
+ while (scanner.hasNext()) {
+ inline += scanner.nextLine();
+ }
+
+ //Close the scanner
+ scanner.close();
+
+ //Using the JSON simple library parse the string into a json object
+ String json = inline;
+ JsonObject response = new JsonParser().parse(json).getAsJsonObject();
+ //System.out.println(response);
+
+ JsonObject odg = (JsonObject) response.get("bitcoin");
+ String wrth = odg.get("eur").getAsString();
+
+ //System.out.println(wrth);
+ worth.setText("€" + wrth);
+ }
+ } catch (Exception e) {
+ //handle
+ }
+ Thread.sleep(refreshRate * 1000);
+ }
+ }
+
+ // LEGACY END
+ private void refreshData(String valuta, String fiat, Double investicija) throws URISyntaxException {
+ System.out.println("...Osvezevanje (Websocket)");
+ try {
+ // open websocket
+ final BitStampWebsocket clientEndPoint = new BitStampWebsocket(new URI("wss://ws.bitstamp.net"));
+
+ clientEndPoint.valuta = valuta;
+ clientEndPoint.fiat = fiat;
+ //clientEndPoint.addValutaInFiat("btc", "eur");
+
+ clientEndPoint.connect();
+
+ // add listener
+ clientEndPoint.addMessageHandler(new BitStampWebsocket.MessageHandler() {
+ public void handleMessage(String message, String valuta) {
+ //System.out.println(message);
+ try {
+ JsonObject json = new JsonParser().parse(message).getAsJsonObject();
+ JsonObject data = (JsonObject) json.get("data");
+ JsonElement price = (JsonElement) data.get("price");
+ StringBuilder sb = new StringBuilder();
+ Formatter nf = new Formatter(sb, Locale.US);
+ String output = "" + nf.format("%(,.2f", price.getAsDouble());
+ System.out.println("> " + valuta + ": " + output);
+ updateData(price.getAsDouble() + "", valuta, investicija);
+ } catch (Exception e) {
+ System.out.println("> Recieved data: not data\n -> " + message);
+ //throw new RuntimeException(e);
+ }
+
+ }
+ });
+
+ // send message to websocket
+ //clientEndPoint.send("{'event':'addChannel','channel':'ok_btccny_ticker'}");
+ // wait 5 seconds for messages from websocket
+ //Thread.sleep(5000);
+ } catch (URISyntaxException e) {
+ System.err.println("URISyntaxException exception: " + e.getMessage());
+ usodnaNapaka(e);
+ }
+
+ }
+
+ /*
+ comp[0] : icon
+ comp[1] : amount (0.001)
+ comp[2] : dot
+ comp[3] : price
+ comp[4] : trend_icon
+ comp[5] : trend
+ comp[6] : name
+ comp[7] : profit
+ comp[8] : worth
+ */
+ //Double investicijaTest = 25.00;
+ Double[] prev_prices = new Double[10];
+
+ private void updateData(String price, String valuta, Double investicija) {
+
+ switch (valuta) {
+ case "btc":
+ valuta = "Bitcoin";
+ break;
+ case "eth":
+ valuta = "Ethereum";
+ break;
+ case "bch":
+ valuta = "Bitcoin Cash";
+ break;
+ case "xrp":
+ valuta = "Ripple";
+ break;
+ case "ltc":
+ valuta = "Litecoin";
+ break;
+ case "xlm":
+ valuta = "Stellar Lumens";
+ break;
+ case "omg":
+ valuta = "OMG Network";
+ break;
+ case "zrx":
+ valuta = "0x";
+ break;
+ default:
+ valuta = "Neznano";
+ }
+ for (int i = 0; i <= valute.length - 1; i++) {
+ Component[] comp = valute_paneli[i].getComponents();//System.out.println(comp[1]);
+ var name = (JLabel) comp[6];
+ String name_ = name.getText();
+
+ if (name_.equals(valuta)) {
+ // Nastavi ceno 1 kovanca
+ var price_ = (JLabel) comp[3];
+ StringBuilder sb = new StringBuilder();
+ Formatter nf = new Formatter(sb, Locale.US);
+ String output = nf.format("%(,.2f", Double.parseDouble(price)) + "";
+ price_.setText("€" + output);
+
+ // Nastavi vrednost valute v €
+ sb.setLength(0);
+ var amount_ = (JLabel) comp[1];
+ Double worth1 = Double.parseDouble(amount_.getText());
+ worth1 = (worth1 * 100) * Double.parseDouble(price) / 100;
+ output = nf.format("%(,.2f", worth1) + "";
+ var worth_ = (JLabel) comp[8];
+ worth_.setText("€" + output);
+
+ // Nastavi profit/izgubo v €
+ sb.setLength(0);
+ var profit_ = (JLabel) comp[7];
+ Double profit1 = worth1 - investicija;
+ Double temp_profit1 = Math.abs(profit1);
+ output = nf.format("%(,.2f", temp_profit1) + "";
+ if (profit1 >= 0) {
+ profit_.setText("(+€" + output + ")");
+ } else {
+ profit_.setText("(-€" + output + ")");
+ }
+
+ // Nastavi profit/izgubo v %
+ sb.setLength(0);
+ var trend_ = (JLabel) comp[5];
+ Double trend1 = Math.abs(((worth1 - investicija) * 100) / investicija);
+ output = nf.format("%(,.2f", trend1) + "";
+ if (investicija < worth1) {
+ trend_.setText("+" + output + "%");
+ } else if (Objects.equals(investicija, worth1)) {
+ trend_.setText("" + output + "%");
+ } else {
+ trend_.setText("-" + output + "%");
+ }
+
+ var trend_icon_ = (JLabel) comp[4];
+ //
+ //ImageIcon imageIcon = new ImageIcon("src/main/java/me/sola/kriptomerresources/trend/up2.png"); // load the image to a imageIcon
+ ImageIcon imageIcon = new ImageIcon(this.getClass().getResource("resources/trend/up2.png")); // load the image to a imageIcon
+ Image image = imageIcon.getImage(); // transform it
+ image = image.getScaledInstance(10, 10, java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
+ ImageIcon bullish = new ImageIcon(image); // transform it back
+ //
+ imageIcon = new ImageIcon(this.getClass().getResource("resources/trend/down2.png")); // load the image to a imageIcon
+ image = imageIcon.getImage(); // transform it
+ image = image.getScaledInstance(10, 10, java.awt.Image.SCALE_SMOOTH); // scale it the smooth way
+ ImageIcon bearish = new ImageIcon(image); // transform it back
+ //
+ if ((worth1 - investicija) > 0) {
+ trend_icon_.setIcon(bullish);
+ } else if ((worth1 - investicija) < 0) {
+ trend_icon_.setIcon(bearish);
+ } else {
+ trend_icon_.setIcon(null);
+ }
+
+ // Pridobitev prejšnje cene
+ Double prev_price = Double.parseDouble(price);
+ try {
+ if (prev_prices[i] != null) {
+ prev_price = prev_prices[i];
+ } else {
+ prev_price = Double.parseDouble(price);
+ }
+ } catch (java.lang.NullPointerException e) {
+ // PAČ
+ }
+
+ // Določanje če je trenutna cena višja od prejšnje
+ Boolean is_profit;
+ if (Double.parseDouble(price) > prev_price) {
+ is_profit = true;
+ } else if (Double.parseDouble(price) == prev_price) {
+ is_profit = true;
+ } else {
+ is_profit = false;
+ }
+
+ // Obarvanje cene ipd. ko je cena višja od prejšnje cene
+ if (is_profit) {
+ Thread one = new Thread() {
+ public void run() {
+ try {
+ price_.setForeground(new java.awt.Color(38, 106, 255));
+ worth_.setForeground(new java.awt.Color(38, 106, 255));
+ profit_.setForeground(new java.awt.Color(38, 106, 255));
+ trend_.setForeground(new java.awt.Color(38, 106, 255));
+ Thread.sleep(1000);
+ price_.setForeground(new java.awt.Color(60, 63, 65));
+ worth_.setForeground(new java.awt.Color(60, 63, 65));
+ profit_.setForeground(new java.awt.Color(160, 163, 165));
+ trend_.setForeground(new java.awt.Color(60, 63, 65));
+ } catch (InterruptedException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ };
+ one.start();
+ } else {
+ Thread barvaj = new Thread() {
+ public void run() {
+ try {
+ price_.setForeground(new java.awt.Color(249, 76, 255));
+ worth_.setForeground(new java.awt.Color(249, 76, 255));
+ profit_.setForeground(new java.awt.Color(249, 76, 255));
+ trend_.setForeground(new java.awt.Color(249, 76, 255));
+ Thread.sleep(1000);
+ price_.setForeground(new java.awt.Color(60, 63, 65));
+ worth_.setForeground(new java.awt.Color(60, 63, 65));
+ profit_.setForeground(new java.awt.Color(160, 163, 165));
+ trend_.setForeground(new java.awt.Color(60, 63, 65));
+ } catch (InterruptedException ex) {
+ Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ };
+ barvaj.start();
+ }
+
+ prev_prices[i] = Double.parseDouble(price);
+ }
+ }
+ }
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JLabel amount;
+ private javax.swing.JMenuItem dodajProfil;
+ private javax.swing.JMenuItem dodajValuto;
+ private javax.swing.JLabel dot;
+ private javax.swing.JLabel icon;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JPanel jPanel1;
+ private javax.swing.JPopupMenu.Separator jSeparator1;
+ private javax.swing.JPopupMenu.Separator jSeparator2;
+ private javax.swing.JPanel kriptoBox;
+ private javax.swing.JMenuBar menu;
+ private javax.swing.JLabel name;
+ private javax.swing.JPanel naslovnica;
+ private javax.swing.JMenuItem odstraniProfil;
+ private javax.swing.JMenuItem odstraniValuto;
+ private javax.swing.JMenuItem osveziConfig;
+ private javax.swing.JPanel panel1;
+ private javax.swing.JPanel panel2;
+ private javax.swing.JMenu pomoc;
+ private javax.swing.JMenu portfelj;
+ private javax.swing.JLabel price;
+ private javax.swing.JMenu profil;
+ private javax.swing.JLabel profit;
+ private javax.swing.JMenuItem restart;
+ private javax.swing.JMenu seja;
+ private javax.swing.JMenu spremeniProfil;
+ private javax.swing.JMenuItem test1;
+ private javax.swing.JLabel trend;
+ private javax.swing.JLabel trend_icon;
+ private javax.swing.JMenu urediValuto;
+ private javax.swing.JPanel valuteBox;
+ private javax.swing.JScrollPane valuteBoxScroll;
+ private javax.swing.JLabel worth;
+ private javax.swing.JMenuItem zacnimo;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/src/main/java/me/sola/kriptomer/RunKriptomer.java b/src/main/java/me/sola/kriptomer/RunKriptomer.java
new file mode 100644
index 0000000..d390283
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/RunKriptomer.java
@@ -0,0 +1,81 @@
+package me.sola.kriptomer;
+
+import java.awt.Dimension;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+
+/**
+ *
+ * @author Tilen Levak
+ */
+public class RunKriptomer {
+
+ static boolean dev = false;
+
+ public static void main(Dimension d, Point p) throws InterruptedException, IOException{
+
+ System.out.println("STARTING PreOkno");
+
+ //d = new java.awt.Dimension(1080, 1750);
+
+ dev = true;
+
+ startKriptomer(d, p);
+
+ }
+
+ public static void main(String args[]) throws IOException, InterruptedException{
+
+ System.out.println("STARTING PreOkno");
+
+ Dimension d = new java.awt.Dimension(1080, 750);
+ Point p = new java.awt.Point(10, 10);
+
+ startKriptomer(d, p);
+
+ }
+
+ public static void startKriptomer(Dimension d, Point p) throws InterruptedException, IOException{
+
+ // Novo okno, ki nima okvirja
+ JFrame frame = new JFrame("TitleLessJFrame");
+
+ Image ikona = ImageIO.read(RunKriptomer.class.getResource("resources/icons/ikona0.png"));
+ frame.setIconImage(ikona);
+
+ // Slika okna
+ //BufferedImage splash = ImageIO.read(new File("resources/splash.png"));
+ BufferedImage splash = ImageIO.read(RunKriptomer.class.getResourceAsStream("resources/splash.png"));
+ JLabel background = new JLabel(new ImageIcon(splash));
+
+ // Okno ob zaprtju ne bo prekinilo programa, dodamo sliko, brez dekorja, velikost, na sredino monitorja
+ frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
+ frame.getContentPane().add(background);
+ frame.setUndecorated(true);
+ frame.setSize(500, 375);
+ frame.setLocationRelativeTo(null);
+
+ // Prikaži okno
+ frame.setVisible(true);
+
+
+
+ // Čakaj 2 sekundi (pod normalnimi pogoji) nato zapri
+ if (!dev){
+ Thread.sleep(2000);
+ }
+ frame.dispose();
+ System.out.println("> disposed\n- - - - - - - - - -");
+
+ // Odpri glavno okno
+ MainWindow.main(d, p);
+
+ }
+}
diff --git a/src/main/java/me/sola/kriptomer/Seja.java b/src/main/java/me/sola/kriptomer/Seja.java
new file mode 100644
index 0000000..72fbb44
--- /dev/null
+++ b/src/main/java/me/sola/kriptomer/Seja.java
@@ -0,0 +1,13 @@
+package me.sola.kriptomer;
+
+/**
+ *
+ * @author TheGoodSpice
+ */
+public class Seja {
+
+ public static void doRestart() {
+ //new RunKriptomer();
+ }
+
+}
diff --git a/src/main/java/me/sola/kriptomer/resources/icons/ikona0.png b/src/main/java/me/sola/kriptomer/resources/icons/ikona0.png
new file mode 100644
index 0000000000000000000000000000000000000000..905d61099c603e4366e04c81f5371dcc0c2431f6
GIT binary patch
literal 31115
zcmd>l^>-UTfV*O?4$=f~N#%XlTSL%JSN1Xy~VpFFYLJFZ~mXQNS;B
zS8XLZw5lP7E#M87HRKHh4Gj@bcx#3YyvKJ^HgH8lBk6j4q4zkJTA-nMGpoo$biGXW
za&TLy6zc!jIj}2Xa$AuN7`V9)N?3auyOK2Q&$_?i#@J|}dlnoeu~|X)ERaHhO0Y1H
z8>29ZO2u>Gs>$v{gQwiZYxn#615Xn@QNcN>f_BLg^_(I+mQXUe|NnlNu@+Z{Hn8TX
zizTZ?^V>~-$nCf7{wxFwfDe-2uzXP+OyvV^46f#gii!MBy<|1oPdT-Jp5gtRl${G0
zc`0C*jX`N{h6q<5j@S5JTe8su|nr&M>CC$vn>J|Z$;mnNN7eV+DJMk*be
zBb0%DJoE(O@?aGrYF|oD(%j)nsn7()-dY%O<1TxBZJPtzMrau9AhMM>`CuArj{RN^
z63=p6jHDH2TWDadP`Cd~Rf}ZgBn5e$hO*OmoBT}cUqr@H-|+1}K?^2vX5wB%ASM`B
zB&bf)nN9oV*Mo&PDya9#m0CE?^QGN#f0Tr>V|rUL2++bW6DNodykvK+uHs^Ul_2@J
zQRIqk3G-`7bjv?XdYu`g`YUx={ZlFvquod?li*
z=k=*-ib&5cFf4l$$-G-Vts_?$FD*rqNEpg+vkD1H=Hcq|+`;!%eGRMw@47#o+@;O&
zKG0t_l*+rcI=KL;{>;IPT55OU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