[med-svn] [Git][med-team/libjloda-java][master] 7 commits: Watch file based on git mode

Andreas Tille gitlab at salsa.debian.org
Fri May 25 22:33:31 BST 2018


Andreas Tille pushed to branch master at Debian Med / libjloda-java


Commits:
10595d92 by Andreas Tille at 2018-05-25T23:04:02+02:00
Watch file based on git mode

- - - - -
62d90dfc by Andreas Tille at 2018-05-25T23:08:08+02:00
New upstream version 0.0+git20180523.cbaf6d1
- - - - -
6da6ff9e by Andreas Tille at 2018-05-25T23:08:09+02:00
Update upstream source from tag 'upstream/0.0+git20180523.cbaf6d1'

Update to upstream version '0.0+git20180523.cbaf6d1'
with Debian dir 90e139aa1b77d7e49476523d2dfe1dcafd40ce31
- - - - -
b28d7bf0 by Andreas Tille at 2018-05-25T23:09:16+02:00
New upstream commit

- - - - -
282dec97 by Andreas Tille at 2018-05-25T23:09:45+02:00
Drop unneeded get-orig-source target

- - - - -
aa44ee77 by Andreas Tille at 2018-05-25T23:11:26+02:00
Point Vcs-fields to Salsa, Standards-Version: 4.1.4

- - - - -
763289bb by Andreas Tille at 2018-05-25T23:33:04+02:00
Upload to unstable

- - - - -


13 changed files:

- debian/changelog
- debian/control
- − debian/get-orig-source
- debian/rules
- debian/watch
- src/jloda/fx/IHasJavaFXStageAndRoot.java
- src/jloda/fx/JPanelWithFXStageAndRoot.java
- src/jloda/fx/JavaFX2PDF.java
- src/jloda/graph/FruchtermanReingoldLayout.java
- src/jloda/util/GFF3FileFilter.java
- src/jloda/util/Pair.java
- src/jloda/util/RecursiveFileLister.java
- src/jloda/util/Statistics.java


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+libjloda-java (0.0+git20180523.cbaf6d1-1) unstable; urgency=medium
+
+  * New upstream commit
+  * Watch file based on git mode
+  * Point Vcs-fields to Salsa
+  * Standards-Version: 4.1.4
+
+ -- Andreas Tille <tille at debian.org>  Fri, 25 May 2018 23:11:46 +0200
+
 libjloda-java (0.0+20180317-1) experimental; urgency=medium
 
   * New upstream commit


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -10,9 +10,9 @@ Build-Depends: debhelper (>= 11~),
                libbatik-java,
                libjama-java,
                libopenjfx-java
-Standards-Version: 4.1.3
-Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/libjloda-java.git
-Vcs-Git: https://anonscm.debian.org/git/debian-med/libjloda-java.git
+Standards-Version: 4.1.4
+Vcs-Browser: https://salsa.debian.org/med-team/libjloda-java
+Vcs-Git: https://salsa.debian.org/med-team/libjloda-java.git
 Homepage: https://github.com/danielhuson/jloda
 
 Package: libjloda-java


=====================================
debian/get-orig-source deleted
=====================================
--- a/debian/get-orig-source
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh -e
-
-COMPRESS=xz
-
-NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
-ONAME=`echo $NAME | sed 's/lib\(.*\)-java/\1/'`
-MVERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/^\([0-9\.]\+\)[+~][-0-9]\+$/\1/'`
-
-mkdir -p ../tarballs
-cd ../tarballs
-# need to clean up the tarballs dir first because upstream tarball might
-# contain a directory with unpredictable name
-rm -rf *
-git clone --quiet https://github.com/danielhuson/${ONAME} ${NAME}
-cd $NAME
-VERSION=${MVERSION}+`date -d @$(git show --format="%at" | head -n1) +%Y%m%d`
-# for esthetical reasons set file timestamps (if git-restore-mtime is installed)
-git restore-mtime || true
-cd ..
-TARDIR=${NAME}-${VERSION}
-mv ${NAME} ${TARDIR}
-rm -rf ${TARDIR}/.git
-rm -rf ${TARDIR}/jars/batik*
-rm -rf ${TARDIR}/jars/Jama-*
-find ${TARDIR} -name .DS_Store -delete
-
-GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
-rm -rf ${TARDIR}


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -13,6 +13,3 @@ override_dh_clean:
 
 override_dh_auto_build:
 	ant -buildfile antbuild/build.xml jar
-
-get-orig-source:
-	. debian/get-orig-source


=====================================
debian/watch
=====================================
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,7 @@
-version=3
+version=4
 
-https://github.com/danielhuson/jloda/releases .*/archive/.*(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz)
+opts="mode=git,pretty=0.0+git%cd.%h" \
+  https://github.com/danielhuson/jloda.git HEAD
+
+# Issue asking for release tags:
+# https://github.com/danielhuson/jloda/issues/1


=====================================
src/jloda/fx/IHasJavaFXStageAndRoot.java
=====================================
--- a/src/jloda/fx/IHasJavaFXStageAndRoot.java
+++ b/src/jloda/fx/IHasJavaFXStageAndRoot.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Daniel H. Huson
+ *  Copyright (C) 2018 Daniel H. Huson
  *
  *  (Some files contain contributions from other authors, who are then mentioned separately.)
  *


=====================================
src/jloda/fx/JPanelWithFXStageAndRoot.java
=====================================
--- a/src/jloda/fx/JPanelWithFXStageAndRoot.java
+++ b/src/jloda/fx/JPanelWithFXStageAndRoot.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Daniel H. Huson
+ *  Copyright (C) 2018 Daniel H. Huson
  *
  *  (Some files contain contributions from other authors, who are then mentioned separately.)
  *


=====================================
src/jloda/fx/JavaFX2PDF.java
=====================================
--- a/src/jloda/fx/JavaFX2PDF.java
+++ b/src/jloda/fx/JavaFX2PDF.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Daniel H. Huson
+ *  Copyright (C) 2018 Daniel H. Huson
  *
  *  (Some files contain contributions from other authors, who are then mentioned separately.)
  *


=====================================
src/jloda/graph/FruchtermanReingoldLayout.java
=====================================
--- a/src/jloda/graph/FruchtermanReingoldLayout.java
+++ b/src/jloda/graph/FruchtermanReingoldLayout.java
@@ -43,9 +43,9 @@ public class FruchtermanReingoldLayout {
     public FruchtermanReingoldLayout(Graph graph, NodeSet fixedNodes) {
         this.graph = graph;
         nodes = graph.getNodes().toArray();
-        edges = new int[graph.getNumberOfEdges()][2];
-        coordinates = new float[nodes.length][2];
-        forceDelta = new float[nodes.length][2];
+        edges = new int[2][graph.getNumberOfEdges()];
+        coordinates = new float[2][nodes.length];
+        forceDelta = new float[2][nodes.length];
         fixed = new BitSet();
 
         initialize(fixedNodes);
@@ -63,8 +63,8 @@ public class FruchtermanReingoldLayout {
         }
         int eId = 0;
         for (Edge e = graph.getFirstEdge(); e != null; e = e.getNext()) {
-            edges[eId][0] = node2id.get(e.getSource());
-            edges[eId][1] = node2id.get(e.getTarget());
+            edges[0][eId] = node2id.get(e.getSource());
+            edges[1][eId] = node2id.get(e.getTarget());
             eId++;
         }
 
@@ -79,8 +79,8 @@ public class FruchtermanReingoldLayout {
                     while (stack.size() > 0) {
                         Node w = stack.pop();
                         int id = node2id.get(w);
-                        coordinates[id][0] = (float) (100 * Math.sin(2 * Math.PI * count / nodes.length));
-                        coordinates[id][1] = (float) (100 * Math.cos(2 * Math.PI * count / nodes.length));
+                        coordinates[0][id] = (float) (100 * Math.sin(2 * Math.PI * count / nodes.length));
+                        coordinates[1][id] = (float) (100 * Math.cos(2 * Math.PI * count / nodes.length));
                         count++;
                         for (Edge e = w.getFirstAdjacentEdge(); e != null; e = w.getNextAdjacentEdge(e)) {
                             Node u = e.getOpposite(w);
@@ -114,7 +114,7 @@ public class FruchtermanReingoldLayout {
         }
 
         for (int v = 0; v < nodes.length; v++) {
-            result.set(nodes[v], new Point2D.Float(coordinates[v][0], coordinates[v][1]));
+            result.set(nodes[v], new Point2D.Float(coordinates[0][v], coordinates[1][v]));
 
         }
     }
@@ -131,57 +131,57 @@ public class FruchtermanReingoldLayout {
         for (int v1 = 0; v1 < nodes.length; v1++) {
             for (int v2 = 0; v2 < nodes.length; v2++) {
                 if (v1 != v2) {
-                    float xDist = coordinates[v1][0] - coordinates[v2][0];
-                    float yDist = coordinates[v1][1] - coordinates[v2][1];
+                    float xDist = coordinates[0][v1] - coordinates[0][v2];
+                    float yDist = coordinates[1][v1] - coordinates[1][v2];
                     float dist = (float) Math.sqrt(xDist * xDist + yDist * yDist);
                     if (dist > 0) {
                         float repulsiveF = k * k / dist;
-                        forceDelta[v1][0] += xDist / dist * repulsiveF;
-                        forceDelta[v1][1] += yDist / dist * repulsiveF;
+                        forceDelta[0][v1] += xDist / dist * repulsiveF;
+                        forceDelta[1][v1] += yDist / dist * repulsiveF;
                     }
                 }
             }
         }
         // attraction
-        for (int[] edge : edges) {
-            int v1 = edge[0];
-            int v2 = edge[1];
-            float xDist = coordinates[v1][0] - coordinates[v2][0];
-            float yDist = coordinates[v1][1] - coordinates[v2][1];
+        for (int i = 0; i < edges[0].length; i++) {
+            int v1 = edges[0][i];
+            int v2 = edges[1][i];
+            float xDist = coordinates[0][v1] - coordinates[0][v2];
+            float yDist = coordinates[1][v1] - coordinates[1][v2];
             float dist = (float) Math.sqrt(xDist * xDist + yDist * yDist);
             if (dist > 0) {
                 float attractiveF = dist * dist / k;
-                forceDelta[v1][0] -= xDist / dist * attractiveF;
-                forceDelta[v1][1] -= yDist / dist * attractiveF;
-                forceDelta[v2][0] += xDist / dist * attractiveF;
-                forceDelta[v2][1] += yDist / dist * attractiveF;
+                forceDelta[0][v1] -= xDist / dist * attractiveF;
+                forceDelta[1][v1] -= yDist / dist * attractiveF;
+                forceDelta[0][v2] += xDist / dist * attractiveF;
+                forceDelta[1][v2] += yDist / dist * attractiveF;
             }
         }
 
         // gravity
         for (int v = 0; v < nodes.length; v++) {
-            float distSquared = (float) Math.sqrt(coordinates[v][0] * coordinates[v][0] + coordinates[v][1] * coordinates[v][1]);
+            float distSquared = (float) Math.sqrt(coordinates[0][v] * coordinates[0][v] + coordinates[1][v] * coordinates[1][v]);
             float gravityF = 0.01f * k * (float) gravity * distSquared;
-            forceDelta[v][0] -= gravityF * coordinates[v][0] / distSquared;
-            forceDelta[v][1] -= gravityF * coordinates[v][1] / distSquared;
+            forceDelta[0][v] -= gravityF * coordinates[0][v] / distSquared;
+            forceDelta[1][v] -= gravityF * coordinates[1][v] / distSquared;
         }
 
         // speed
         for (int v = 0; v < nodes.length; v++) {
-            forceDelta[v][0] *= speed / SPEED_DIVISOR;
-            forceDelta[v][1] *= speed / SPEED_DIVISOR;
+            forceDelta[0][v] *= speed / SPEED_DIVISOR;
+            forceDelta[1][v] *= speed / SPEED_DIVISOR;
 
         }
 
         // apply the forces:
         for (int v = 0; v < nodes.length; v++) {
-            float xDist = forceDelta[v][0];
-            float yDist = forceDelta[v][1];
+            float xDist = forceDelta[0][v];
+            float yDist = forceDelta[1][v];
             float dist = (float) Math.sqrt(xDist * xDist + yDist * yDist);
             if (dist > 0 && !fixed.get(v)) {
                 float limitedDist = Math.min(maxDisplace * ((float) speed / SPEED_DIVISOR), dist);
-                coordinates[v][0] += xDist / dist * limitedDist;
-                coordinates[v][1] += yDist / dist * limitedDist;
+                coordinates[0][v] += xDist / dist * limitedDist;
+                coordinates[1][v] += yDist / dist * limitedDist;
             }
         }
     }


=====================================
src/jloda/util/GFF3FileFilter.java
=====================================
--- a/src/jloda/util/GFF3FileFilter.java
+++ b/src/jloda/util/GFF3FileFilter.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Daniel H. Huson
+ *  Copyright (C) 2018 Daniel H. Huson
  *
  *  (Some files contain contributions from other authors, who are then mentioned separately.)
  *
@@ -26,8 +26,11 @@ import java.io.FilenameFilter;
  * Daniel Huson, 12.2017
  */
 public class GFF3FileFilter extends FileFilterBase implements FilenameFilter {
-    public GFF3FileFilter() {
-        this(true);
+    private boolean lookInside = true;
+
+    public GFF3FileFilter(boolean allowGZip, boolean lookInside, String... additionalSuffixes) {
+        this(allowGZip, additionalSuffixes);
+        this.lookInside = lookInside;
     }
 
     public GFF3FileFilter(String... additionalSuffixes) {
@@ -46,8 +49,11 @@ public class GFF3FileFilter extends FileFilterBase implements FilenameFilter {
     public boolean accept(String fileName) {
         boolean suffixOk = super.accept(Basic.getFileNameWithoutZipOrGZipSuffix(fileName));
         if (suffixOk) {   // look inside the file
-            final String[] lines = Basic.getFirstLinesFromFile(new File(fileName), 1);
-            return lines != null && lines[0] != null && lines[0].startsWith("##gff-version 3");
+            if (lookInside) {
+                final String[] lines = Basic.getFirstLinesFromFile(new File(fileName), 1);
+                return lines != null && lines[0] != null && lines[0].startsWith("##gff-version 3");
+            } else
+                return true;
         } else
             return false;
     }
@@ -56,6 +62,14 @@ public class GFF3FileFilter extends FileFilterBase implements FilenameFilter {
      * @return description of file matching the filter
      */
     public String getBriefDescription() {
-        return "GFF Files";
+        return "GFF3 Files";
+    }
+
+    public boolean isLookInside() {
+        return lookInside;
+    }
+
+    public void setLookInside(boolean lookInside) {
+        this.lookInside = lookInside;
     }
 }


=====================================
src/jloda/util/Pair.java
=====================================
--- a/src/jloda/util/Pair.java
+++ b/src/jloda/util/Pair.java
@@ -20,6 +20,7 @@
 package jloda.util;
 
 import java.util.Comparator;
+import java.util.Iterator;
 
 /**
  * a generic pair of objects
@@ -196,4 +197,72 @@ public class Pair<S, T> implements Comparable<Pair<S, T>>, Comparator<Pair<S, T>
     public boolean contains(Object x) {
         return x.equals(first) || x.equals(second);
     }
+
+    /**
+     * iterable over first elements
+     *
+     * @param src
+     * @param <P>
+     * @param <Q>
+     * @return iterable over all first elements
+     */
+    public static <P, Q> Iterable<P> firstValues(final Iterable<Pair<P, Q>> src) {
+        return new Iterable<P>() {
+            @Override
+            public Iterator<P> iterator() {
+                return new Iterator<P>() {
+                    private final Iterator<Pair<P, Q>> it = src.iterator();
+
+                    @Override
+                    public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override
+                    public P next() {
+                        return it.next().getFirst();
+                    }
+
+                    @Override
+                    public void remove() {
+                        it.remove();
+                    }
+                };
+            }
+        };
+    }
+
+    /**
+     * iterable over second elements
+     *
+     * @param src
+     * @param <P>
+     * @param <Q>
+     * @return iterable over all second elements
+     */
+    public static <P, Q> Iterable<Q> secondValues(final Iterable<Pair<P, Q>> src) {
+        return new Iterable<Q>() {
+            @Override
+            public Iterator<Q> iterator() {
+                return new Iterator<Q>() {
+                    private final Iterator<Pair<P, Q>> it = src.iterator();
+
+                    @Override
+                    public boolean hasNext() {
+                        return it.hasNext();
+                    }
+
+                    @Override
+                    public Q next() {
+                        return it.next().getSecond();
+                    }
+
+                    @Override
+                    public void remove() {
+                        it.remove();
+                    }
+                };
+            }
+        };
+    }
 }


=====================================
src/jloda/util/RecursiveFileLister.java
=====================================
--- a/src/jloda/util/RecursiveFileLister.java
+++ b/src/jloda/util/RecursiveFileLister.java
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2015 Daniel H. Huson
+ *  Copyright (C) 2018 Daniel H. Huson
  *
  *  (Some files contain contributions from other authors, who are then mentioned separately.)
  *


=====================================
src/jloda/util/Statistics.java
=====================================
--- a/src/jloda/util/Statistics.java
+++ b/src/jloda/util/Statistics.java
@@ -19,8 +19,6 @@
  */
 package jloda.util;
 
-import java.util.Collection;
-
 /**
  * calculates basic statistics
  * Daniel Huson, 5.2006
@@ -38,17 +36,19 @@ public class Statistics {
      *
      * @param data
      */
-    public Statistics(Collection<? extends Number> data) {
-        count = data.size();
+    public Statistics(Iterable<? extends Number> data) {
+        int count = 0;
+        for (Number number : data) {
+            double value = number.doubleValue();
+            sum += value;
+            if (value < min)
+                min = value;
+            if (value > max)
+                max = value;
+            count++;
+        }
+        this.count = count;
         if (count > 0) {
-            for (Number number : data) {
-                double value = number.doubleValue();
-                sum += value;
-                if (value < min)
-                    min = value;
-                if (value > max)
-                    max = value;
-            }
             mean = sum / count;
             if (count > 1) {
                 double sum2 = 0;



View it on GitLab: https://salsa.debian.org/med-team/libjloda-java/compare/bd596d737e9b4e4c2f83d1cf4a24c9dd639b8fcc...763289bb4741efc50f66a6ec8091a16e0a2096f0

-- 
View it on GitLab: https://salsa.debian.org/med-team/libjloda-java/compare/bd596d737e9b4e4c2f83d1cf4a24c9dd639b8fcc...763289bb4741efc50f66a6ec8091a16e0a2096f0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180525/126e1094/attachment-0001.html>


More information about the debian-med-commit mailing list