[PATCH 1 of 2] Made serializable for use with FloodDurationCalculationResults

Wald Commits scm-commit at wald.intevation.org
Mon Jul 16 08:43:27 CEST 2018


# HG changeset patch
# User mschaefer
# Date 1531723311 -7200
# Node ID d950c6055102627ac283cfc75c1ee9df5964f69c
# Parent  ef7b65576d4b61e5108aeb27a5c732ec7d2506eb
Made serializable for use with FloodDurationCalculationResults

diff -r ef7b65576d4b -r d950c6055102 artifacts/src/main/java/org/dive4elements/river/jfree/StickyAxisAnnotation.java
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/StickyAxisAnnotation.java	Fri Jul 13 18:38:05 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StickyAxisAnnotation.java	Mon Jul 16 08:41:51 2018 +0200
@@ -8,13 +8,17 @@
 
 package org.dive4elements.river.jfree;
 
+import java.io.Serializable;
+
 /**
  * Text, position on axis, and maybe a hit-point in a class.
  *
  * Idea is to draw a given text and a line to it from either axis.
  * This class just keeps the info.
  */
-public class StickyAxisAnnotation {
+public class StickyAxisAnnotation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
 
     /** Simplified view on axes. */
     public static enum SimpleAxis {
@@ -48,7 +52,7 @@
      * @param text the text to display.
      * @param pos  the position at which to draw the text and mark.
      */
-    public StickyAxisAnnotation(String text, float pos) {
+    public StickyAxisAnnotation(final String text, final float pos) {
         this(text, pos, SimpleAxis.X_AXIS);
     }
 
@@ -60,8 +64,8 @@
      * @param stickAxis the axis at which to stick (and to which 'pos' is
      *                   relative).
      */
-    public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis
-    ) {
+    public StickyAxisAnnotation(final String text, final float pos, final SimpleAxis stickAxis
+            ) {
         this(text, pos, stickAxis, 0);
     }
 
@@ -73,9 +77,9 @@
      * @param stickAxis  the axis at which to stick (and to which 'pos' is
      *                   relative).
      */
-    public StickyAxisAnnotation(String text, float pos, SimpleAxis stickAxis,
-            int axisSymbol
-    ) {
+    public StickyAxisAnnotation(final String text, final float pos, final SimpleAxis stickAxis,
+            final int axisSymbol
+            ) {
         setStickyAxis(stickAxis);
         this.text   = text;
         this.pos    = pos;
@@ -90,7 +94,7 @@
      *
      * @param stickyAxis axis to stick to.
      */
-    public void setStickyAxis(SimpleAxis stickyAxis) {
+    public void setStickyAxis(final SimpleAxis stickyAxis) {
         this.stickyAxis = stickyAxis;
     }
 
@@ -101,7 +105,7 @@
     }
 
     /** The position (relative to axis). */
-    public void setPos(double pos) {
+    public void setPos(final double pos) {
         this.pos = (float) pos;
     }
 
@@ -124,12 +128,12 @@
         return this.axisSymbol;
     }
 
-    public void setAxisSymbol(int axis) {
+    public void setAxisSymbol(final int axis) {
         this.axisSymbol = axis;
     }
 
     /** Set where to hit a curve (if any). */
-    public void setHitPoint(float pos) {
+    public void setHitPoint(final float pos) {
         this.hitPoint = pos;
     }
 


More information about the Dive4Elements-commits mailing list