From d89e3900af01b40c41bf3c34827b235db30a4d76 Mon Sep 17 00:00:00 2001 From: Jean Palate Date: Wed, 18 Apr 2018 12:28:53 +0200 Subject: [PATCH 1/5] Next release --- nbdemetra-benchmarking/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbdemetra-benchmarking/pom.xml b/nbdemetra-benchmarking/pom.xml index 540e1b1..359cfea 100644 --- a/nbdemetra-benchmarking/pom.xml +++ b/nbdemetra-benchmarking/pom.xml @@ -5,7 +5,7 @@ eu.europa.ec.joinup.sat nbdemetra-benchmarking nbm - 2.2.1 + 2.2.2-SNAPSHOT NbDemetra - Benchmarking This module provides some experimental methods for temporal disaggregation and multi-variate benchmarking: From d3f5221192409055ec479d28d8bd4d78b21ede69 Mon Sep 17 00:00:00 2001 From: Philippe Charles Date: Wed, 18 Apr 2018 13:25:54 +0200 Subject: [PATCH 2/5] Added travis script. --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2c93e6b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: java +jdk: + - oraclejdk8 + +cache: + directories: + - $HOME/.m2 + +before_script: cd nbdemetra-benchmarking From 81d7611c8c1cbc7bab0148e1e30d595c6e4c8fc1 Mon Sep 17 00:00:00 2001 From: Philippe Charles Date: Wed, 18 Apr 2018 13:30:44 +0200 Subject: [PATCH 3/5] Fixed maven repositories. --- nbdemetra-benchmarking/pom.xml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/nbdemetra-benchmarking/pom.xml b/nbdemetra-benchmarking/pom.xml index 359cfea..3a08659 100644 --- a/nbdemetra-benchmarking/pom.xml +++ b/nbdemetra-benchmarking/pom.xml @@ -125,26 +125,14 @@ netbeans-releases - http://bits.netbeans.org/nexus/content/groups/netbeans/ - - false - - - - joinup-releases - https://joinup.ec.europa.eu/nexus/content/repositories/releases/ - - false - - + http://bits.netbeans.org/maven2/ + - joinup-snapshots - https://joinup.ec.europa.eu/nexus/content/repositories/snapshots/ - - true - + oss-jfrog-artifactory-releases + https://oss.jfrog.org/artifactory/oss-release-local + From c83652cc2b12f7ad593a8a94d10fb1fb0f60f6a4 Mon Sep 17 00:00:00 2001 From: Philippe Charles Date: Wed, 5 Sep 2018 11:00:44 +0200 Subject: [PATCH 4/5] Added temp fix for Ts deadlock. --- .../FixedRegTsProcessingViewer.java | 151 ++++++++++++++++++ .../TsDisaggregationModelTopComponent.java | 7 +- 2 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/FixedRegTsProcessingViewer.java diff --git a/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/FixedRegTsProcessingViewer.java b/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/FixedRegTsProcessingViewer.java new file mode 100644 index 0000000..466071c --- /dev/null +++ b/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/FixedRegTsProcessingViewer.java @@ -0,0 +1,151 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package ec.nbdemetra.disaggregation; + +import com.google.common.collect.ObjectArrays; +import ec.tss.Ts; +import ec.tss.TsInformationType; +import ec.tss.documents.MultiTsDocument; +import ec.tstoolkit.algorithm.IProcSpecification; +import ec.ui.interfaces.ITsCollectionView.TsUpdateMode; +import ec.ui.interfaces.ITsList.InfoType; +import ec.ui.list.JTsList; +import ec.ui.view.tsprocessing.DefaultProcessingViewer; +import java.awt.Dimension; +import java.util.Arrays; +import javax.swing.Box; +import javax.swing.JLabel; +import javax.swing.JToolBar; + +/** + * + * @author Jean + */ +final class FixedRegTsProcessingViewer extends DefaultProcessingViewer { + + // FACTORY METHODS > + public static FixedRegTsProcessingViewer create(MultiTsDocument doc) { + FixedRegTsProcessingViewer viewer = new FixedRegTsProcessingViewer(DefaultProcessingViewer.Type.APPLY); + if (doc != null) { + viewer.setDocument(doc); + } + return viewer; + } + // visual components + private final JTsList yList, xList; + private final JLabel specLabel; + private boolean quietRefresh; + + public FixedRegTsProcessingViewer(DefaultProcessingViewer.Type type) { + super(type); + yList = new JTsList(); + yList.setVisible(true); + yList.setShowHeader(false); + yList.setTsUpdateMode(TsUpdateMode.Single); + yList.setInformation(new InfoType[]{InfoType.Name}); + xList = new JTsList(); + yList.setVisible(true); + xList.setShowHeader(false); + xList.setInformation(new InfoType[]{InfoType.Name}); + this.specLabel = new JLabel("Spec: "); + specLabel.setVisible(true); + xList.setPreferredSize(new Dimension(50, 60)); + yList.setPreferredSize(new Dimension(50, 60)); + + toolBar.add(Box.createHorizontalStrut(3), 0); + toolBar.add(new JLabel("Y: "), 1); + toolBar.add(new JToolBar.Separator(), 2); + toolBar.add(yList, 3); + toolBar.add(new JToolBar.Separator(), 4); + toolBar.add(new JLabel("X: "), 5); + toolBar.add(new JToolBar.Separator(), 6); + toolBar.add(xList, 7); + toolBar.add(new JToolBar.Separator(), 8); + toolBar.add(specLabel, 9); + toolBar.add(new JToolBar.Separator(), 10); + toolBar.add(Box.createHorizontalStrut(100), 11); + + toolBar.setVisible(true); + + // FIXME: there is a deadlock with Ts.Master#freeze() & TsFactory#update(TsInformation); + // these two lines force loading to prevent deadlock but might freeze EDT + xList.setFreezeOnImport(true); + yList.setFreezeOnImport(true); + + xList.addPropertyChangeListener(JTsList.TS_COLLECTION_PROPERTY, evt -> { + if (!quietRefresh) { + updateDocument(); + } + }); + yList.addPropertyChangeListener(JTsList.TS_COLLECTION_PROPERTY, evt -> { + if (!quietRefresh) { + updateDocument(); + } + }); + } + + private void updateDocument() { + try { + + quietRefresh = true; + Ts[] y = yList.getTsCollection().toArray(); + if (y == null || y.length == 0) { + getDocument().setInput(null); + } + Ts[] x = xList.getTsCollection().toArray(); + if (x == null || x.length == 0) { + getDocument().setInput(y); + } else { + getDocument().setInput(ObjectArrays.concat(y[0], x)); + } + refreshAll(); + } catch (Exception err) { + } finally { + quietRefresh = false; + } + } + + private void updateList() { + Ts[] s = getDocument().getTs(); + if (s == null || s.length == 0) { + yList.getTsCollection().clear(); + xList.getTsCollection().clear(); + } else { + yList.getTsCollection().replace(s[0]); + xList.getTsCollection().replace(Arrays.copyOfRange(s, 1, s.length)); + } + } + + public void refreshSpec() { + MultiTsDocument doc = getDocument(); + IProcSpecification spec = doc.getSpecification(); + specLabel.setText("Spec: " + (spec != null ? spec.toString() : "")); + } + + @Override + public void refreshHeader() { + try { + if (quietRefresh) { + return; + } + refreshSpec(); + updateList(); + } catch (Exception err) { + } + } + + @Override + public void refreshView() { + super.refreshView(); + refreshSpec(); + } + + @Override + public void dispose() { + super.dispose(); + yList.dispose(); + xList.dispose(); + } +} diff --git a/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/TsDisaggregationModelTopComponent.java b/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/TsDisaggregationModelTopComponent.java index d9052f4..6857c13 100644 --- a/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/TsDisaggregationModelTopComponent.java +++ b/nbdemetra-benchmarking/src/main/java/ec/nbdemetra/disaggregation/TsDisaggregationModelTopComponent.java @@ -17,14 +17,11 @@ package ec.nbdemetra.disaggregation; import ec.nbdemetra.ui.NbUtilities; -import ec.nbdemetra.ws.WorkspaceFactory; import ec.nbdemetra.ws.WorkspaceItem; import ec.nbdemetra.ws.ui.WorkspaceTopComponent; import ec.tss.disaggregation.documents.TsDisaggregationModelDocument; import ec.ui.view.tsprocessing.RegTsProcessingViewer; import org.netbeans.api.settings.ConvertAsProperties; -import org.openide.awt.ActionID; -import org.openide.awt.ActionReference; import org.openide.util.NbBundle; import org.openide.windows.TopComponent; @@ -47,7 +44,7 @@ }) public final class TsDisaggregationModelTopComponent extends WorkspaceTopComponent { - protected RegTsProcessingViewer panel; + protected FixedRegTsProcessingViewer panel; public TsDisaggregationModelTopComponent() { super(null); @@ -63,7 +60,7 @@ public void initDocument() { setName(getDocument().getDisplayName()); setToolTipText(Bundle.HINT_TsDisaggregationModelTopComponent()); initComponents(); - panel = RegTsProcessingViewer.create(this.getDocument().getElement()); + panel = FixedRegTsProcessingViewer.create(this.getDocument().getElement()); add(panel); } From bf51b59689469efbb859b857c6454122b3b13b12 Mon Sep 17 00:00:00 2001 From: Philippe Charles Date: Wed, 5 Sep 2018 11:09:25 +0200 Subject: [PATCH 5/5] Updated to version 2.2.2. --- nbdemetra-benchmarking/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbdemetra-benchmarking/pom.xml b/nbdemetra-benchmarking/pom.xml index 3a08659..ff0eb44 100644 --- a/nbdemetra-benchmarking/pom.xml +++ b/nbdemetra-benchmarking/pom.xml @@ -5,7 +5,7 @@ eu.europa.ec.joinup.sat nbdemetra-benchmarking nbm - 2.2.2-SNAPSHOT + 2.2.2 NbDemetra - Benchmarking This module provides some experimental methods for temporal disaggregation and multi-variate benchmarking: