Skip to content

Commit a59167a

Browse files
committed
JStock 1.0.7.34
1 parent 9795a0c commit a59167a

30 files changed

+487
-297
lines changed

docs/changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
This file summarizes changes in JStock releases.
22
Numbers in parentheses refer to SourceForge.net tracker item numbers (#XXXXX)
33

4+
JStock 1.0.7.34 - 2018-07--25
5+
Feature: Show buy date in sell transaction.
6+
Feature: Resizing is allowed for most dialogs.
7+
Bugfix: Remove DriveWealth service.
8+
49
JStock 1.0.7.33 - 2018-06-06
510
Feature: Promote WeNote.
611
Bugfix: Prepare to terminate DriveWealth service.

installer/windows/jstock.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name ${PRODUCT_NAME}
1212
RequestExecutionLevel admin ;Workaround for Vista
1313

1414
; The file to write
15-
OutFile "jstock-1.0.7.33-setup.exe"
15+
OutFile "jstock-1.0.7.34-setup.exe"
1616
LicenseData "gpl-2.0.txt"
1717

1818
; The default installation directory

installer/windows/jstock.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
<maxHeapSize>512</maxHeapSize>
2727
</jre>
2828
<versionInfo>
29-
<fileVersion>1.1.6.2</fileVersion>
30-
<txtFileVersion>1.1.6.2</txtFileVersion>
29+
<fileVersion>1.1.6.3</fileVersion>
30+
<txtFileVersion>1.1.6.3</txtFileVersion>
3131
<fileDescription>JStock - Stock Market Software</fileDescription>
3232
<copyright>Yan Cheng Cheok &lt;[email protected]&gt;</copyright>
33-
<productVersion>1.1.6.2</productVersion>
34-
<txtProductVersion>1.1.6.2</txtProductVersion>
33+
<productVersion>1.1.6.3</productVersion>
34+
<txtProductVersion>1.1.6.3</txtProductVersion>
3535
<productName>JStock - Stock Market Software</productName>
3636
<companyName>Yan Cheng Cheok &lt;[email protected]&gt;</companyName>
3737
<internalName>jstock</internalName>

src/images/16x16/wenote.png

650 Bytes
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* JStock - Free Stock Market Software
3+
* Copyright (C) 2018 Yan Cheng Cheok <[email protected]>
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License along
16+
* with this program; if not, write to the Free Software Foundation, Inc.,
17+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*/
19+
20+
package org.yccheok.jstock.file;
21+
22+
import java.io.File;
23+
24+
/**
25+
*
26+
* @author yccheok
27+
*/
28+
public enum UserDataDirectory {
29+
Android("android"),
30+
Databases("databases"),
31+
Config("config");
32+
33+
UserDataDirectory(String directory) {
34+
this.directory = directory;
35+
}
36+
37+
public String get() {
38+
return org.yccheok.jstock.gui.Utils.getUserDataDirectory() + this.directory + File.separator;
39+
}
40+
41+
public final String directory;
42+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* JStock - Free Stock Market Software
3+
* Copyright (C) 2018 Yan Cheng Cheok <[email protected]>
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License along
16+
* with this program; if not, write to the Free Software Foundation, Inc.,
17+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*/
19+
20+
package org.yccheok.jstock.file;
21+
22+
/**
23+
*
24+
* @author yccheok
25+
*/
26+
public enum UserDataFile {
27+
CashFlowChartJDialogXml("cashflowchartjdialog.xml"),
28+
ChartJDialogOptionsXml("chartjdialogoptions.xml"),
29+
IndicatorScannerJPanelXml("indicatorscannerjpanel.xml"),
30+
MainFrameXml("mainframe.xml"),
31+
OptionsXml("options.xml"),
32+
PortfolioManagementJPanelXml("portfoliomanagementjpanel.xml"),
33+
UIOptionsJson("uioptions.json");
34+
35+
UserDataFile(String filename) {
36+
this.filename = filename;
37+
}
38+
39+
public String get() {
40+
return this.filename;
41+
}
42+
43+
private final String filename;
44+
}

src/org/yccheok/jstock/gui/FairUsagePolicyJDialog.form

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@
1010
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
1111
<ResourceString bundle="org/yccheok/jstock/data/gui.properties" key="FairUsagePolicyJDialog_Title" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
1212
</Property>
13-
<Property name="resizable" type="boolean" value="false"/>
1413
</Properties>
1514
<SyntheticProperties>
16-
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,34,0,0,1,77"/>
15+
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,121,0,0,1,-88"/>
1716
<SyntheticProperty name="formPosition" type="java.awt.Point" value="-84,-19,0,5,115,114,0,14,106,97,118,97,46,97,119,116,46,80,111,105,110,116,-74,-60,-118,114,52,126,-56,38,2,0,2,73,0,1,120,73,0,1,121,120,112,0,0,0,0,0,0,0,0"/>
1817
<SyntheticProperty name="formSizePolicy" type="int" value="0"/>
1918
<SyntheticProperty name="generatePosition" type="boolean" value="true"/>
2019
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
2120
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
2221
</SyntheticProperties>
22+
<Events>
23+
<EventHandler event="windowClosed" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosed"/>
24+
</Events>
2325
<AuxValues>
2426
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
2527
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -118,7 +120,7 @@
118120
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
119121
</Group>
120122
</Group>
121-
<EmptySpace pref="80" max="32767" attributes="0"/>
123+
<EmptySpace pref="60" max="32767" attributes="0"/>
122124
</Group>
123125
</Group>
124126
</DimensionLayout>
@@ -135,7 +137,7 @@
135137
<Component id="jSpinner1" alignment="3" min="-2" max="-2" attributes="0"/>
136138
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
137139
</Group>
138-
<EmptySpace pref="21" max="32767" attributes="0"/>
140+
<EmptySpace pref="20" max="32767" attributes="0"/>
139141
</Group>
140142
</Group>
141143
</DimensionLayout>

src/org/yccheok/jstock/gui/FairUsagePolicyJDialog.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.yccheok.jstock.gui;
2121

22+
import java.awt.Dimension;
2223
import java.awt.event.ItemEvent;
2324

2425
/**
@@ -51,7 +52,14 @@ public FairUsagePolicyJDialog(java.awt.Frame parent, boolean modal) {
5152

5253
// Hackish way to make Mac works.
5354
pack();
54-
setSize(new java.awt.Dimension(333, 290));
55+
56+
Dimension dimension = JStock.instance().getUIOptions().getDimension(UIOptions.FAIR_USAGE_POLICY_JDIALOG);
57+
if (dimension != null) {
58+
setSize(dimension);
59+
} else {
60+
setSize(new java.awt.Dimension(424, 377));
61+
}
62+
5563
setLocationRelativeTo(null);
5664
}
5765

@@ -79,7 +87,11 @@ private void initComponents() {
7987
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
8088
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N
8189
setTitle(bundle.getString("FairUsagePolicyJDialog_Title")); // NOI18N
82-
setResizable(false);
90+
addWindowListener(new java.awt.event.WindowAdapter() {
91+
public void windowClosed(java.awt.event.WindowEvent evt) {
92+
formWindowClosed(evt);
93+
}
94+
});
8395
getContentPane().setLayout(new java.awt.BorderLayout(5, 5));
8496

8597
jXHeader1.setDescription(bundle.getString("FairUsagePolicyJDialog_Description")); // NOI18N
@@ -139,7 +151,7 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
139151
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
140152
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
141153
.addComponent(jLabel1)))
142-
.addContainerGap(80, Short.MAX_VALUE))
154+
.addContainerGap(60, Short.MAX_VALUE))
143155
);
144156
jPanel1Layout.setVerticalGroup(
145157
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -153,12 +165,12 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) {
153165
.addComponent(jRadioButton3)
154166
.addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
155167
.addComponent(jLabel1))
156-
.addContainerGap(21, Short.MAX_VALUE))
168+
.addContainerGap(20, Short.MAX_VALUE))
157169
);
158170

159171
getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
160172

161-
setBounds(0, 0, 333, 290);
173+
setBounds(0, 0, 424, 377);
162174
}// </editor-fold>//GEN-END:initComponents
163175

164176
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
@@ -183,6 +195,10 @@ private void jRadioButton3ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-
183195
this.jSpinner1.setEnabled(evt.getStateChange() == ItemEvent.SELECTED);
184196
}//GEN-LAST:event_jRadioButton3ItemStateChanged
185197

198+
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
199+
JStock.instance().getUIOptions().setDimension(UIOptions.FAIR_USAGE_POLICY_JDIALOG, getSize());
200+
}//GEN-LAST:event_formWindowClosed
201+
186202
/**
187203
* @param args the command line arguments
188204
*/

src/org/yccheok/jstock/gui/IndicatorScannerJPanel.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
import org.yccheok.jstock.analysis.*;
3636
import org.yccheok.jstock.analysis.Indicator;
3737
import org.yccheok.jstock.engine.*;
38+
import org.yccheok.jstock.file.UserDataDirectory;
39+
import org.yccheok.jstock.file.UserDataFile;
3840
import org.yccheok.jstock.gui.trading.TradingView;
3941
import org.yccheok.jstock.internationalization.GUIBundle;
40-
import org.yccheok.jstock.internationalization.MessagesBundle;
4142

4243
/**
4344
*
@@ -202,7 +203,7 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
202203
* Initialize GUI options of this indicator scanner panel.
203204
*/
204205
public void initGUIOptions() {
205-
File f = new File(org.yccheok.jstock.gui.Utils.getUserDataDirectory() + "config" + File.separator + "indicatorscannerjpanel.xml");
206+
File f = new File(UserDataDirectory.Config.get() + UserDataFile.IndicatorScannerJPanelXml.get());
206207
GUIOptions guiOptions = org.yccheok.jstock.gui.Utils.fromXML(GUIOptions.class, f);
207208

208209
if (guiOptions == null)
@@ -230,7 +231,7 @@ public void initGUIOptions() {
230231
}
231232

232233
public boolean saveGUIOptions() {
233-
if(Utils.createCompleteDirectoryHierarchyIfDoesNotExist(org.yccheok.jstock.gui.Utils.getUserDataDirectory() + "config") == false)
234+
if(Utils.createCompleteDirectoryHierarchyIfDoesNotExist(UserDataDirectory.Config.get()) == false)
234235
{
235236
return false;
236237
}
@@ -247,7 +248,7 @@ public boolean saveGUIOptions() {
247248
final GUIOptions guiOptions = new GUIOptions();
248249
guiOptions.addJTableOptions(jTableOptions);
249250

250-
File f = new File(org.yccheok.jstock.gui.Utils.getUserDataDirectory() + "config" + File.separator + "indicatorscannerjpanel.xml");
251+
File f = new File(UserDataDirectory.Config.get() + UserDataFile.IndicatorScannerJPanelXml.get());
251252
return org.yccheok.jstock.gui.Utils.toXML(guiOptions, f);
252253
}
253254

@@ -1159,15 +1160,6 @@ public void actionPerformed(ActionEvent evt) {
11591160
final IndicatorTableModel tableModel = (IndicatorTableModel)jTable1.getModel();
11601161
final Indicator indicator = tableModel.getIndicator(modelIndex);
11611162
final Stock stock = indicator.getStock();
1162-
if (JStock.instance().isDriveWealthCodes(stock.code)) {
1163-
menuItem = new JMenuItem(java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui").getString("MainFrame_DriveWealthBuy..."), this.getImageIcon("/images/16x16/drivewealth_logo.png"));
1164-
1165-
menuItem.addActionListener((ActionEvent evt) -> {
1166-
TradingView.getInstance().showBuyDialog(stock.code.toString());
1167-
});
1168-
1169-
popup.add(menuItem);
1170-
}
11711163
}
11721164

11731165
return popup;

0 commit comments

Comments
 (0)