Skip to content

Commit

Permalink
Merge branch 'release-2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
charphi committed Jul 11, 2017
2 parents f4977d8 + 936d49a commit 0d6a534
Show file tree
Hide file tree
Showing 545 changed files with 27,714 additions and 16,138 deletions.
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: java
jdk:
- oraclejdk8
sudo: required

before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

# Use latest JDK
addons:
apt:
packages:
- oracle-java8-installer

cache:
directories:
- $HOME/.m2

deploy:
provider: script
script: mvn deploy -Dmaven.test.skip -s settings.xml
skip_cleanup: true
on:
branch: develop
jdk: oraclejdk8
condition: $TRAVIS_PULL_REQUEST = "false"
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ JDemetra+ implements the concepts and algorithms used in the two leading SA meth

Besides seasonal adjustment, JDemetra+ bundles other time series models that are useful in the production or analysis of economic statistics, including for instance outlier detection, nowcasting, temporal disaggregation or benchmarking.

From a technical point of view, JDemetra+ is a collection of reusable and extensible Java components, which can be easily accessed through a rich graphical interface. The software is a free and open-source software (FOSS) developed under the [EUPL licence](http://ec.europa.eu/idabc/eupl).
From a technical point of view, JDemetra+ is a collection of reusable and extensible Java components, which can be easily accessed through a rich graphical interface. The software is a free and open-source software (FOSS) developed under the [EUPL licence](http://ec.europa.eu/idabc/eupl.html).

JDemetra+ has been [officially recommended](http://www.cros-portal.eu/sites/default/files/Jdemetra%2B%20release.pdf), since 2 February 2015, to the members of the ESS and the European System of Central Banks as software for seasonal and calendar adjustment of official statistics.
JDemetra+ has been [officially recommended](https://ec.europa.eu/eurostat/cros/system/files/Jdemetra_%20release.pdf), since 2 February 2015, to the members of the ESS and the European System of Central Banks as software for seasonal and calendar adjustment of official statistics.

##Quickstart

JDemetra+ runs on multiple platforms such as Windows, Mac OS X and Linux (Java SE 7 or later version is required).

To install, download the [latest version](https://github.com/jdemetra/jdemetra-app/releases/latest), unzip it somewhere and launch the executable in `/bin`.

The SACE has elaborated an extensive documentation, available through the [CROS - PORTAL](http://www.cros-portal.eu/content/seasonal-adjustment):
The SACE has elaborated an extensive documentation, available through the [CROS - PORTAL](https://ec.europa.eu/eurostat/cros/content/seasonal-adjustment):

- [Quick start](http://www.cros-portal.eu/content/jdemetra-quick-start-0) is an introduction to the JDemetra+ functions for seasonal adjustment, including details regarding installation.
- [User guide](http://www.cros-portal.eu/content/jdemetra-user-guide-0) includes step-by-step descriptions of how to perform a typical analysis of seasonal data and useful tips that facilitate replication of the results with the user’s own data and working instructions.
- [Reference manual](http://www.cros-portal.eu/content/jdemetra-reference-manual) covers all available JDemetra+ functionalities, options and functions available through the interface.
- [Quick start](https://ec.europa.eu/eurostat/cros/content/jdemetra-quick-start-0) is an introduction to the JDemetra+ functions for seasonal adjustment, including details regarding installation.
- [User guide](https://ec.europa.eu/eurostat/cros/content/jdemetra-user-guide-0) includes step-by-step descriptions of how to perform a typical analysis of seasonal data and useful tips that facilitate replication of the results with the user’s own data and working instructions.
- [Reference manual](https://ec.europa.eu/eurostat/cros/content/jdemetra-reference-manual) covers all available JDemetra+ functionalities, options and functions available through the interface.

The [technical docs](https://github.com/jdemetra/jdemetra-app/wiki) are available on the wiki.
6 changes: 5 additions & 1 deletion nbdemetra-anomalydetection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>nbdemetra-parent</artifactId>
<groupId>eu.europa.ec.joinup.sat</groupId>
<version>2.1.0</version>
<version>2.2.0</version>
</parent>

<artifactId>nbdemetra-anomalydetection</artifactId>
Expand Down Expand Up @@ -90,6 +90,10 @@
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-progress</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-filesystems-nb</artifactId>
</dependency>

<!-- Projects -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public boolean isNotProcessable() {
return this == NotProcessable;
}
}
private Integer id_ = new Integer(0);
private Integer id_ = 0;
private Ts ts_;
private int backCount;
private Double[] absoluteError, relativeError;
Expand Down Expand Up @@ -173,8 +173,8 @@ public void process(CheckLast check) {

if (ok) {
for (int i = 0; i < check.getBackCount(); i++) {
relativeError[i] = check.getScore(i);
absoluteError[i] = check.getForecastsValues()[i] - d.get(d.getLength() - (i + 1));
relativeError[i] = check.getRelativeError(i);
absoluteError[i] = check.getAbsoluteError(i);
}

status_ = Status.Processed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand All @@ -49,7 +50,7 @@
public class HtmlOutliers extends AbstractHtmlElement implements IHtmlElement {

private OutlierEstimation[] outliers_;
Map<OutlierType, OutlierPojo> map = new EnumMap<>(OutlierType.class);
Map<String, OutlierPojo> map = new HashMap<>();

public HtmlOutliers(OutlierEstimation[] estimations) {
outliers_ = estimations;
Expand All @@ -74,11 +75,9 @@ public void write(HtmlStream stream) throws IOException {
// Data
Arrays.sort(outliers_, new OutlierEstimationComparator());

for (int i = 0; i < outliers_.length; i++) {
for (OutlierEstimation e : outliers_) {
stream.open(HtmlTag.TABLEROW);
OutlierEstimation e = outliers_[i];

stream.write(new HtmlTableCell(e.getCode().toString(), 40, HtmlStyle.Center, getForeground(e.getCode())), ColorChooser.getBgHexColor(e.getCode()));
stream.write(new HtmlTableCell(e.getCode(), 40, HtmlStyle.Center, getForeground(e.getCode())), ColorChooser.getBgHexColor(e.getCode()));
stream.write(new HtmlTableCell(e.getPosition().toString(), 50));
stream.write(new HtmlTableCell(df4.format(e.getValue()), 80));
stream.write(new HtmlTableCell(df4.format(e.getStdev()), 80));
Expand All @@ -101,7 +100,7 @@ public void write(HtmlStream stream) throws IOException {

// Data
processOutliers();
List<OutlierType> l = new ArrayList<>(map.keySet());
List<String> l = new ArrayList<>(map.keySet());
for (int i = 0; i < l.size(); i++) {
stream.open(HtmlTag.TABLEROW);
OutlierPojo o = map.get(l.get(i));
Expand All @@ -113,12 +112,12 @@ public void write(HtmlStream stream) throws IOException {
}
}

public static HtmlStyle getForeground(OutlierType t) {
public static HtmlStyle getForeground(String t) {
switch (t) {
case AO:
case "AO":
return CustomDark;
case LS:
case TC:
case "LS":
case "TC":
return CustomLight;
default:
return Black;
Expand Down Expand Up @@ -155,13 +154,13 @@ public double getAverageValue() {

private void processOutliers() {
map.clear();
map.put(OutlierType.AO, new OutlierPojo());
map.put(OutlierType.LS, new OutlierPojo());
map.put(OutlierType.TC, new OutlierPojo());
map.put(OutlierType.SO, new OutlierPojo());
map.put("AO", new OutlierPojo());
map.put("LS", new OutlierPojo());
map.put("TC", new OutlierPojo());
map.put("SO", new OutlierPojo());

for (int i = 0; i < outliers_.length; i++) {
map.get(outliers_[i].getCode()).add(outliers_[i]);
for (OutlierEstimation e : outliers_) {
map.get(e.getCode()).add(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@
*/
package ec.nbdemetra.anomalydetection.report;

import ec.tstoolkit.design.ServiceDefinition;
import java.util.Map;

/**
*
* @author Mats Maggi
*/
@ServiceDefinition
public interface ICheckLastReportFactory {

String getReportName();

String getReportDescription();

boolean createReport(Map parameters);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@
*/
package ec.nbdemetra.anomalydetection.report;

import ec.util.list.swing.JLists;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import org.openide.windows.WindowManager;

/**
Expand All @@ -40,39 +36,29 @@
public class ReportSelectionDialog extends JDialog {

private String report;
private JList list;
private JList<ICheckLastReportFactory> list;

private void fillList() {
List<ICheckLastReportFactory> factories = CheckLastReportManager.getInstance().getFactories();
DefaultComboBoxModel model = new DefaultComboBoxModel(factories.toArray());
list.setModel(model);
list.setModel(JLists.modelOf(CheckLastReportManager.getInstance().getFactories()));
}

public ReportSelectionDialog() {
super(WindowManager.getDefault().getMainWindow(), true);
setTitle("Choose report");

final JButton btnOK_ = new JButton("OK");
btnOK_.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
btnOK_.addActionListener(event -> setVisible(false));
btnOK_.setEnabled(false);

list = new JList();
list = new JList<>();
list.setPreferredSize(new Dimension(200, 200));
list.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (e.getLastIndex() < 0) {
report = null;
btnOK_.setEnabled(false);
} else {
report = list.getModel().getElementAt(e.getLastIndex()).toString();
btnOK_.setEnabled(true);
}
list.addListSelectionListener(event -> {
if (event.getLastIndex() < 0) {
report = null;
btnOK_.setEnabled(false);
} else {
report = list.getModel().getElementAt(event.getLastIndex()).toString();
btnOK_.setEnabled(true);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*/
package ec.nbdemetra.anomalydetection.ui;

import com.google.common.base.Predicates;
import com.google.common.collect.FluentIterable;
import ec.nbdemetra.ui.ThemeSupport;
import ec.nbdemetra.ui.properties.l2fprod.ColorChooser;
import ec.tss.Ts;
Expand Down Expand Up @@ -46,6 +44,7 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.text.NumberFormat;
import java.util.Arrays;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.swing.JComponent;
Expand Down Expand Up @@ -120,17 +119,14 @@ public Color apply(int series, int obs) {
}

private void enableProperties() {
addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
switch (evt.getPropertyName()) {
case MODEL_PROPERTY:
onModelChange();
break;
case HOVERED_OBS_PROPERTY:
onHoveredObsChange();
break;
}
addPropertyChangeListener(evt -> {
switch (evt.getPropertyName()) {
case MODEL_PROPERTY:
onModelChange();
break;
case HOVERED_OBS_PROPERTY:
onHoveredObsChange();
break;
}
});
chart.addPropertyChangeListener(chartHandler);
Expand Down Expand Up @@ -265,7 +261,7 @@ public void execute(AnomalyDetectionChart c) throws Exception {
}

private Table<Object> toTable(OutlierEstimation[] input) {
OutlierEstimation[] tmp = FluentIterable.of(input).filter(Predicates.notNull()).toArray(OutlierEstimation.class);
OutlierEstimation[] tmp = Arrays.stream(input).filter(o -> o != null).toArray(OutlierEstimation[]::new);
Table<Object> result = new Table<>(tmp.length + 1, 5);
result.set(0, 0, "");
result.set(0, 1, "Period");
Expand Down
Loading

0 comments on commit 0d6a534

Please sign in to comment.