From 3c50dc80ca0071f8c6bdb1f2848d1d74f2ec2671 Mon Sep 17 00:00:00 2001
From: 7u83 <7u83@mail.ru>
Date: Sun, 17 Dec 2017 20:10:20 +0100
Subject: [PATCH] some work
---
nbproject/project.properties | 2 +-
src/chart/MMChart.form | 1 +
src/chart/MMChart.java | 42 +++++++++++++++++++++--------
src/chart/NewPanel.form | 24 +++++++----------
src/chart/NewPanel.java | 52 +++++++++++++++---------------------
5 files changed, 64 insertions(+), 57 deletions(-)
diff --git a/nbproject/project.properties b/nbproject/project.properties
index e17d811..87c2281 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -1,4 +1,4 @@
-#Mon, 11 Dec 2017 23:22:26 +0100
+#Sat, 16 Dec 2017 19:44:00 +0100
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processors.list=
diff --git a/src/chart/MMChart.form b/src/chart/MMChart.form
index 518aed6..1c767da 100644
--- a/src/chart/MMChart.form
+++ b/src/chart/MMChart.form
@@ -11,6 +11,7 @@
+
diff --git a/src/chart/MMChart.java b/src/chart/MMChart.java
index c788f46..37d3663 100644
--- a/src/chart/MMChart.java
+++ b/src/chart/MMChart.java
@@ -25,25 +25,36 @@
*/
package chart;
+import chart.painter.XLegendPainter;
+import gui.Globals;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.border.Border;
+import sesim.Stock;
/**
*
* @author 7u83 <7u83@mail.ru>
*/
public class MMChart extends javax.swing.JPanel {
+
+ Stock stock;
/**
* Creates new form MMChart
*/
public MMChart() {
+ stock = Globals.se.getDefaultStock();
initComponents();
setupLayout();
+
+
}
+
+ JPanel xLegend;
+
void setupLayout() {
Border redborder = javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0));
Border blueborder = javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 255));
@@ -61,31 +72,40 @@ public class MMChart extends javax.swing.JPanel {
p = new JPanel();
p.setBorder(redborder);
p.setBackground(Color.blue);
+ p.setPreferredSize(new Dimension(0,0));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
- gridBagConstraints.gridwidth = 1;
- gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
- gridBagConstraints.weighty = 0.7;
+ gridBagConstraints.weighty = 1.0;
add(p, gridBagConstraints);
-
-
p = new JPanel();
+ p.setPreferredSize(new Dimension(100,40));
p.setBorder(redborder);
- p.setBackground(Color.white);
- p.setPreferredSize(new Dimension(100,100));
+ p.setBackground(Color.yellow);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ add(p, gridBagConstraints);
+
+ xLegend = new JPanel();
+ xLegend.setBorder(redborder);
+ xLegend.setBackground(Color.white);
+ xLegend.setPreferredSize(new Dimension(100,0));
+ xLegend.setMinimumSize(new Dimension(100,0));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
- gridBagConstraints.gridwidth = 1;
- gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
+
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 0.0;
- gridBagConstraints.weighty = 0.7;
- add(p, gridBagConstraints);
+ gridBagConstraints.weighty = 0.0;
+ add(xLegend, gridBagConstraints);
diff --git a/src/chart/NewPanel.form b/src/chart/NewPanel.form
index 67e12aa..c1dfa80 100644
--- a/src/chart/NewPanel.form
+++ b/src/chart/NewPanel.form
@@ -16,39 +16,33 @@
-
+
-
-
-
-
+
-
+
-
+
-
-
-
-
+
-
+
-
+
-
+
-
+
diff --git a/src/chart/NewPanel.java b/src/chart/NewPanel.java
index 0da4814..e03afae 100644
--- a/src/chart/NewPanel.java
+++ b/src/chart/NewPanel.java
@@ -47,50 +47,42 @@ public class NewPanel extends java.awt.Panel {
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
- jButton1 = new javax.swing.JButton();
- jButton2 = new javax.swing.JButton();
- jButton3 = new javax.swing.JButton();
+ jButton4 = new javax.swing.JButton();
+ jButton5 = new javax.swing.JButton();
+ jButton6 = new javax.swing.JButton();
setLayout(new java.awt.GridBagLayout());
- jButton1.setText("jButton1");
- jButton1.setPreferredSize(new java.awt.Dimension(0, 0));
+ jButton4.setText("jButton4");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
- gridBagConstraints.gridwidth = 80;
- gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.weightx = 50.0;
- gridBagConstraints.weighty = 0.7;
- add(jButton1, gridBagConstraints);
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ add(jButton4, gridBagConstraints);
- jButton2.setText("jButton2");
- jButton2.setPreferredSize(new java.awt.Dimension(0, 0));
+ jButton5.setText("jButton5");
gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridy = 1;
- gridBagConstraints.gridwidth = 80;
- gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
- gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.weightx = 0.5;
- gridBagConstraints.weighty = 0.3;
- add(jButton2, gridBagConstraints);
-
- jButton3.setText("jButton3");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 80;
+ gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
- gridBagConstraints.gridwidth = 20;
- gridBagConstraints.gridheight = java.awt.GridBagConstraints.RELATIVE;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
- gridBagConstraints.weighty = 0.7;
- add(jButton3, gridBagConstraints);
+ add(jButton5, gridBagConstraints);
+
+ jButton6.setText("jButton6");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ add(jButton6, gridBagConstraints);
}// //GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton jButton1;
- private javax.swing.JButton jButton2;
- private javax.swing.JButton jButton3;
+ private javax.swing.JButton jButton4;
+ private javax.swing.JButton jButton5;
+ private javax.swing.JButton jButton6;
// End of variables declaration//GEN-END:variables
}