Skip to content

Commit 79fd780

Browse files
committed
...
1 parent 614fcde commit 79fd780

File tree

3 files changed

+13
-39
lines changed

3 files changed

+13
-39
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ private static String[] getPriceSourceEntryValues(Country country) {
539539
static {
540540
priceSourceEntries.put(PriceSource.Yahoo.name(), GUIBundle.getString("OptionsNetworkJPanel_YahooFinance"));
541541
priceSourceEntries.put(PriceSource.Google.name(), GUIBundle.getString("OptionsNetworkJPanel_GoogleFinance"));
542+
priceSourceEntries.put(PriceSource.IEX.name(), GUIBundle.getString("OptionsNetworkJPanel_IEX"));
542543
}
543544

544545
// Variables declaration - do not modify//GEN-BEGIN:variables

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,11 +2736,11 @@ public ApplicationInfo(int applicationVersionID, String windowsDownloadLink, Str
27362736

27372737
////////////////////////////////////////////////////////////////////////////
27382738
////////////////////////////////////////////////////////////////////////////
2739-
private static final String ABOUT_BOX_VERSION_STRING = "1.0.7.28";
2739+
private static final String ABOUT_BOX_VERSION_STRING = "1.0.7.29";
27402740

2741-
// 1.0.7.28
2741+
// 1.0.7.29
27422742
// For About box comparision on latest version purpose.
2743-
private static final int APPLICATION_VERSION_ID = 1157;
2743+
private static final int APPLICATION_VERSION_ID = 1158;
27442744
////////////////////////////////////////////////////////////////////////////
27452745
////////////////////////////////////////////////////////////////////////////
27462746

src/org/yccheok/jstock/gui/portfolio/DividendSummaryJDialog.java

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -575,50 +575,23 @@ public Map<Code, List<Dividend>> doInBackground() {
575575
final TransactionSummary transactionSummary = transactionSummaries.get(i);
576576
final Code code = ((Transaction)transactionSummary.getChildAt(0)).getStockInfo().code;
577577
Dividend latestDividend = org.yccheok.jstock.portfolio.Utils.getLatestDividend(dividendSummary, code);
578-
579-
final Duration duration;
580-
581-
SimpleDate date = null;
582-
583-
if (latestDividend == null) {
584-
for (int j = 0, ej = transactionSummary.getChildCount(); j < ej; j++) {
585-
Transaction transaction = (Transaction)transactionSummary.getChildAt(j);
586-
SimpleDate simpleDate = transaction.getContract().getDate();
587-
if (date == null) {
588-
date = simpleDate;
589-
} else {
590-
if (date.compareTo(simpleDate) > 0) {
591-
date = simpleDate;
592-
}
593-
}
594-
}
595-
} else {
596-
date = latestDividend.date;
597-
}
598-
599-
Calendar c = date.getCalendar();
600-
c.add(Calendar.DATE, 1);
601-
SimpleDate startDate = new SimpleDate(c);
602-
SimpleDate endDate = new SimpleDate();
603-
if (startDate.compareTo(endDate) > 0) {
604-
this.setProgress(i + 1);
605-
continue;
606-
}
607-
duration = new Duration(startDate, endDate);
608-
609-
List<Dividend> suggestedDividends = new ArrayList<Dividend>();
578+
579+
List<Dividend> suggestedDividends = new ArrayList<>();
610580
for (StockServerFactory stockServerFactory : Factories.INSTANCE.getStockServerFactories(code)) {
611581
if (isCancelled()) {
612582
break;
613583
}
614584

615585
DividendServer dividendServer = stockServerFactory.getDividendServer();
616586
if (dividendServer != null) {
617-
List<Dividend> dividends = dividendServer.getDividends(code, duration);
618-
for (Dividend dividend : dividends) {
619-
if (false == duration.isContains(dividend.date)) {
620-
continue;
587+
List<Dividend> dividends = dividendServer.getDividends(code);
588+
for (Dividend dividend : dividends) {
589+
if (latestDividend != null) {
590+
if (latestDividend.date.compareTo(dividend.date) >= 0) {
591+
continue;
592+
}
621593
}
594+
622595
double total = dividend.amount * quantityQuery.getBalance(code, dividend.date);
623596
if (total == 0) {
624597
continue;

0 commit comments

Comments
 (0)