Mercurial > dive4elements > river
changeset 9258:d950c6055102
Made serializable for use with FloodDurationCalculationResults
author | mschaefer |
---|---|
date | Mon, 16 Jul 2018 08:41:51 +0200 |
parents | ef7b65576d4b |
children | 66b003701546 |
files | artifacts/src/main/java/org/dive4elements/river/jfree/StickyAxisAnnotation.java |
diffstat | 1 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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; }