File src/menu/TimeMenu.form copied from file src/menu/ChanMenu.form (similarity 73%) (mode: 100644) (index 2c1e6d8..996847f) |
49 |
49 |
<Group type="102" attributes="0"> |
<Group type="102" attributes="0"> |
50 |
50 |
<EmptySpace max="-2" attributes="0"/> |
<EmptySpace max="-2" attributes="0"/> |
51 |
51 |
<Group type="103" groupAlignment="0" attributes="0"> |
<Group type="103" groupAlignment="0" attributes="0"> |
52 |
|
<Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/> |
|
53 |
|
<Group type="102" alignment="1" attributes="0"> |
|
54 |
|
<Component id="jButton2" min="-2" max="-2" attributes="0"/> |
|
55 |
|
<EmptySpace pref="113" max="32767" attributes="0"/> |
|
56 |
|
<Component id="jButton1" min="-2" max="-2" attributes="0"/> |
|
57 |
|
</Group> |
|
58 |
|
<Group type="102" alignment="0" attributes="0"> |
|
59 |
|
<Component id="jLabel1" min="-2" pref="94" max="-2" attributes="0"/> |
|
60 |
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/> |
|
|
52 |
|
<Component id="jLabel1" max="32767" attributes="0"/> |
|
53 |
|
<Group type="102" attributes="0"> |
|
54 |
|
<Group type="103" groupAlignment="0" attributes="0"> |
|
55 |
|
<Component id="jScrollPane1" min="-2" pref="181" max="-2" attributes="0"/> |
|
56 |
|
<Component id="jButton1" alignment="0" min="-2" max="-2" attributes="0"/> |
|
57 |
|
</Group> |
|
58 |
|
<EmptySpace min="0" pref="179" max="32767" attributes="0"/> |
61 |
59 |
</Group> |
</Group> |
62 |
60 |
</Group> |
</Group> |
63 |
61 |
<EmptySpace max="-2" attributes="0"/> |
<EmptySpace max="-2" attributes="0"/> |
|
67 |
65 |
<DimensionLayout dim="1"> |
<DimensionLayout dim="1"> |
68 |
66 |
<Group type="103" groupAlignment="0" attributes="0"> |
<Group type="103" groupAlignment="0" attributes="0"> |
69 |
67 |
<Group type="102" alignment="0" attributes="0"> |
<Group type="102" alignment="0" attributes="0"> |
70 |
|
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/> |
|
|
68 |
|
<EmptySpace max="-2" attributes="0"/> |
71 |
69 |
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> |
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> |
72 |
|
<EmptySpace type="separate" max="-2" attributes="0"/> |
|
73 |
|
<Component id="jScrollPane1" min="-2" pref="130" max="-2" attributes="0"/> |
|
74 |
|
<EmptySpace type="unrelated" max="-2" attributes="0"/> |
|
75 |
|
<Group type="103" groupAlignment="3" attributes="0"> |
|
76 |
|
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> |
|
77 |
|
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> |
|
78 |
|
</Group> |
|
79 |
|
<EmptySpace pref="21" max="32767" attributes="0"/> |
|
|
70 |
|
<EmptySpace max="-2" attributes="0"/> |
|
71 |
|
<Component id="jScrollPane1" min="-2" pref="152" max="-2" attributes="0"/> |
|
72 |
|
<EmptySpace pref="68" max="32767" attributes="0"/> |
|
73 |
|
<Component id="jButton1" min="-2" max="-2" attributes="0"/> |
|
74 |
|
<EmptySpace max="-2" attributes="0"/> |
80 |
75 |
</Group> |
</Group> |
81 |
76 |
</Group> |
</Group> |
82 |
77 |
</DimensionLayout> |
</DimensionLayout> |
83 |
78 |
</Layout> |
</Layout> |
84 |
79 |
<SubComponents> |
<SubComponents> |
|
80 |
|
<Component class="javax.swing.JLabel" name="jLabel1"> |
|
81 |
|
<Properties> |
|
82 |
|
<Property name="text" type="java.lang.String" value="Выберите нужные моменты времени:"/> |
|
83 |
|
</Properties> |
|
84 |
|
</Component> |
85 |
85 |
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> |
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> |
86 |
86 |
<AuxValues> |
<AuxValues> |
87 |
87 |
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> |
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> |
|
108 |
108 |
</SubComponents> |
</SubComponents> |
109 |
109 |
</Container> |
</Container> |
110 |
110 |
<Component class="javax.swing.JButton" name="jButton1"> |
<Component class="javax.swing.JButton" name="jButton1"> |
111 |
|
<Properties> |
|
112 |
|
<Property name="text" type="java.lang.String" value="Выбрать"/> |
|
113 |
|
</Properties> |
|
114 |
|
</Component> |
|
115 |
|
<Component class="javax.swing.JButton" name="jButton2"> |
|
116 |
111 |
<Properties> |
<Properties> |
117 |
112 |
<Property name="text" type="java.lang.String" value="Назад"/> |
<Property name="text" type="java.lang.String" value="Назад"/> |
118 |
113 |
</Properties> |
</Properties> |
119 |
114 |
<Events> |
<Events> |
120 |
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> |
|
|
115 |
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> |
121 |
116 |
</Events> |
</Events> |
122 |
117 |
</Component> |
</Component> |
123 |
|
<Component class="javax.swing.JLabel" name="jLabel1"> |
|
124 |
|
<Properties> |
|
125 |
|
<Property name="text" type="java.lang.String" value="Выберите канал"/> |
|
126 |
|
</Properties> |
|
127 |
|
</Component> |
|
128 |
118 |
</SubComponents> |
</SubComponents> |
129 |
119 |
</Container> |
</Container> |
130 |
120 |
</SubComponents> |
</SubComponents> |
File src/menu/TimeMenu.java copied from file src/menu/ChanMenu.java (similarity 66%) (mode: 100644) (index 1b3049e..2ce0838) |
5 |
5 |
*/ |
*/ |
6 |
6 |
package menu; |
package menu; |
7 |
7 |
|
|
8 |
|
|
|
|
8 |
|
import java.text.DecimalFormat; |
|
9 |
|
import java.text.DecimalFormatSymbols; |
|
10 |
|
import java.util.ArrayList; |
9 |
11 |
import javax.swing.DefaultListModel; |
import javax.swing.DefaultListModel; |
10 |
|
import lleak.helpers.*; |
|
|
12 |
|
import lleak.helpers.TimeInterval; |
|
13 |
|
import lleak.helpers.TimeReader; |
11 |
14 |
|
|
12 |
15 |
/** |
/** |
13 |
16 |
* |
* |
14 |
17 |
* @author tassy |
* @author tassy |
15 |
18 |
*/ |
*/ |
16 |
|
public class ChanMenu extends javax.swing.JDialog { |
|
|
19 |
|
public class TimeMenu extends javax.swing.JDialog { |
|
20 |
|
private MainMenu parent = null; |
17 |
21 |
private DefaultListModel<String> lmod = new DefaultListModel<>(); |
private DefaultListModel<String> lmod = new DefaultListModel<>(); |
18 |
|
private MainMenu parent; |
|
19 |
|
|
|
20 |
22 |
/** |
/** |
21 |
|
* Creates new form ChanMenu |
|
|
23 |
|
* Creates new form TimeMenu |
22 |
24 |
*/ |
*/ |
23 |
|
public ChanMenu(MainMenu parent) { |
|
|
25 |
|
public TimeMenu(MainMenu parent) { |
24 |
26 |
this.parent = parent; |
this.parent = parent; |
25 |
27 |
initComponents(); |
initComponents(); |
26 |
28 |
setInf(); |
setInf(); |
|
... |
... |
public class ChanMenu extends javax.swing.JDialog { |
28 |
30 |
setLocationRelativeTo(parent); |
setLocationRelativeTo(parent); |
29 |
31 |
} |
} |
30 |
32 |
|
|
31 |
|
|
|
32 |
33 |
private void setInf(){ |
private void setInf(){ |
33 |
34 |
lmod.clear(); |
lmod.clear(); |
34 |
|
ChanProfReader cpr = new ChanProfReader(parent.getRootDir() + parent.getCr().getChan()); |
|
35 |
|
cpr.getChans(). |
|
36 |
|
stream(). |
|
37 |
|
forEach(s ->lmod.addElement(s.getFile())); |
|
|
35 |
|
TimeReader tr = new TimeReader(parent.getRootDir() + parent.getCr().getTime()); |
|
36 |
|
|
|
37 |
|
|
|
38 |
|
DecimalFormatSymbols dfs = new DecimalFormatSymbols(); |
|
39 |
|
dfs.setDecimalSeparator('.'); |
|
40 |
|
DecimalFormat decimalFormat = new DecimalFormat("#.####"); |
|
41 |
|
decimalFormat.setDecimalFormatSymbols(dfs); |
|
42 |
|
|
|
43 |
|
ArrayList<Double> pointsInTime = tr.getPointsInTime(); |
|
44 |
|
for (Double p : pointsInTime) { |
|
45 |
|
lmod.addElement(decimalFormat.format(p)); |
|
46 |
|
} |
|
47 |
|
|
38 |
48 |
} |
} |
39 |
49 |
|
|
40 |
50 |
/** |
/** |
|
... |
... |
public class ChanMenu extends javax.swing.JDialog { |
47 |
57 |
private void initComponents() { |
private void initComponents() { |
48 |
58 |
|
|
49 |
59 |
jPanel1 = new javax.swing.JPanel(); |
jPanel1 = new javax.swing.JPanel(); |
|
60 |
|
jLabel1 = new javax.swing.JLabel(); |
50 |
61 |
jScrollPane1 = new javax.swing.JScrollPane(); |
jScrollPane1 = new javax.swing.JScrollPane(); |
51 |
62 |
jList1 = new javax.swing.JList<>(); |
jList1 = new javax.swing.JList<>(); |
52 |
63 |
jButton1 = new javax.swing.JButton(); |
jButton1 = new javax.swing.JButton(); |
53 |
|
jButton2 = new javax.swing.JButton(); |
|
54 |
|
jLabel1 = new javax.swing.JLabel(); |
|
55 |
64 |
|
|
56 |
65 |
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); |
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); |
57 |
66 |
|
|
|
67 |
|
jLabel1.setText("Выберите нужные моменты времени:"); |
|
68 |
|
|
58 |
69 |
jList1.setModel(new javax.swing.AbstractListModel<String>() { |
jList1.setModel(new javax.swing.AbstractListModel<String>() { |
59 |
70 |
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; |
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; |
60 |
71 |
public int getSize() { return strings.length; } |
public int getSize() { return strings.length; } |
|
... |
... |
public class ChanMenu extends javax.swing.JDialog { |
62 |
73 |
}); |
}); |
63 |
74 |
jScrollPane1.setViewportView(jList1); |
jScrollPane1.setViewportView(jList1); |
64 |
75 |
|
|
65 |
|
jButton1.setText("Выбрать"); |
|
66 |
|
|
|
67 |
|
jButton2.setText("Назад"); |
|
68 |
|
jButton2.addActionListener(new java.awt.event.ActionListener() { |
|
|
76 |
|
jButton1.setText("Назад"); |
|
77 |
|
jButton1.addActionListener(new java.awt.event.ActionListener() { |
69 |
78 |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
public void actionPerformed(java.awt.event.ActionEvent evt) { |
70 |
|
jButton2ActionPerformed(evt); |
|
|
79 |
|
jButton1ActionPerformed(evt); |
71 |
80 |
} |
} |
72 |
81 |
}); |
}); |
73 |
82 |
|
|
74 |
|
jLabel1.setText("Выберите канал"); |
|
75 |
|
|
|
76 |
83 |
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); |
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); |
77 |
84 |
jPanel1.setLayout(jPanel1Layout); |
jPanel1.setLayout(jPanel1Layout); |
78 |
85 |
jPanel1Layout.setHorizontalGroup( |
jPanel1Layout.setHorizontalGroup( |
|
... |
... |
public class ChanMenu extends javax.swing.JDialog { |
80 |
87 |
.addGroup(jPanel1Layout.createSequentialGroup() |
.addGroup(jPanel1Layout.createSequentialGroup() |
81 |
88 |
.addContainerGap() |
.addContainerGap() |
82 |
89 |
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
83 |
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING) |
|
84 |
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() |
|
85 |
|
.addComponent(jButton2) |
|
86 |
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 113, Short.MAX_VALUE) |
|
87 |
|
.addComponent(jButton1)) |
|
|
90 |
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) |
88 |
91 |
.addGroup(jPanel1Layout.createSequentialGroup() |
.addGroup(jPanel1Layout.createSequentialGroup() |
89 |
|
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE) |
|
90 |
|
.addGap(0, 0, Short.MAX_VALUE))) |
|
|
92 |
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
93 |
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE) |
|
94 |
|
.addComponent(jButton1)) |
|
95 |
|
.addGap(0, 179, Short.MAX_VALUE))) |
91 |
96 |
.addContainerGap()) |
.addContainerGap()) |
92 |
97 |
); |
); |
93 |
98 |
jPanel1Layout.setVerticalGroup( |
jPanel1Layout.setVerticalGroup( |
94 |
99 |
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
95 |
100 |
.addGroup(jPanel1Layout.createSequentialGroup() |
.addGroup(jPanel1Layout.createSequentialGroup() |
96 |
|
.addGap(33, 33, 33) |
|
|
101 |
|
.addContainerGap() |
97 |
102 |
.addComponent(jLabel1) |
.addComponent(jLabel1) |
98 |
|
.addGap(18, 18, 18) |
|
99 |
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) |
|
100 |
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) |
|
101 |
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) |
|
102 |
|
.addComponent(jButton2) |
|
103 |
|
.addComponent(jButton1)) |
|
104 |
|
.addContainerGap(21, Short.MAX_VALUE)) |
|
|
103 |
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) |
|
104 |
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE) |
|
105 |
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 68, Short.MAX_VALUE) |
|
106 |
|
.addComponent(jButton1) |
|
107 |
|
.addContainerGap()) |
105 |
108 |
); |
); |
106 |
109 |
|
|
107 |
110 |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); |
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); |
|
... |
... |
public class ChanMenu extends javax.swing.JDialog { |
124 |
127 |
pack(); |
pack(); |
125 |
128 |
}// </editor-fold>//GEN-END:initComponents |
}// </editor-fold>//GEN-END:initComponents |
126 |
129 |
|
|
127 |
|
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed |
|
|
130 |
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed |
128 |
131 |
// back |
// back |
129 |
132 |
this.setVisible(false); |
this.setVisible(false); |
130 |
133 |
parent.setVisible(true); |
parent.setVisible(true); |
131 |
|
|
|
132 |
|
}//GEN-LAST:event_jButton2ActionPerformed |
|
|
134 |
|
}//GEN-LAST:event_jButton1ActionPerformed |
133 |
135 |
|
|
134 |
|
|
|
135 |
|
|
|
|
136 |
|
|
136 |
137 |
|
|
137 |
138 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
// Variables declaration - do not modify//GEN-BEGIN:variables |
138 |
139 |
private javax.swing.JButton jButton1; |
private javax.swing.JButton jButton1; |
139 |
|
private javax.swing.JButton jButton2; |
|
140 |
140 |
private javax.swing.JLabel jLabel1; |
private javax.swing.JLabel jLabel1; |
141 |
141 |
private javax.swing.JList<String> jList1; |
private javax.swing.JList<String> jList1; |
142 |
142 |
private javax.swing.JPanel jPanel1; |
private javax.swing.JPanel jPanel1; |