comparison artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java @ 8757:bd17bd07db69

Remove further indirection in WINFOArtifact.
author Tom Gottfried <tom@intevation.de>
date Fri, 26 Jun 2015 14:31:08 +0200
parents 26dedebbe39f
children d4caab3fedde
comparison
equal deleted inserted replaced
8756:26dedebbe39f 8757:bd17bd07db69
780 }; 780 };
781 } 781 }
782 782
783 783
784 /** 784 /**
785 * Determines the selected mode of distance/range input.
786 *
787 * Compatibility wrapper around RangeAccess.
788 *
789 * @return true, if the range mode is selected otherwise false.
790 */
791 public boolean isRange() {
792 RangeAccess rangeAccess = new RangeAccess(this);
793 return rangeAccess.isRange();
794 }
795
796
797 /**
798 * Returns the selected distance based on a given range (from, to). 785 * Returns the selected distance based on a given range (from, to).
799 * 786 *
800 * @param dFrom The StateData that contains the lower value. 787 * @param dFrom The StateData that contains the lower value.
801 * @param dTo The StateData that contains the upper value. 788 * @param dTo The StateData that contains the upper value.
802 * 789 *
814 * Returns the selected Kms. 801 * Returns the selected Kms.
815 * 802 *
816 * @return the selected kms. 803 * @return the selected kms.
817 */ 804 */
818 public double[] getKms() { 805 public double[] getKms() {
819 if (isRange()) { 806 RangeAccess rangeAccess = new RangeAccess(this);
820 RangeAccess rangeAccess = new RangeAccess(this); 807 if (rangeAccess.isRange()) {
821 return rangeAccess.getKmSteps(); 808 return rangeAccess.getKmSteps();
822 } 809 }
823 else { 810 else {
824 return LocationDistanceSelect.getLocations(this); 811 return LocationDistanceSelect.getLocations(this);
825 } 812 }
826 } 813 }
827 814
828 815
829 public double [] getFromToStep() { 816 public double [] getFromToStep() {
830 if (!isRange()) {
831 return null;
832 }
833 RangeAccess rangeAccess = new RangeAccess(this); 817 RangeAccess rangeAccess = new RangeAccess(this);
818 if (!rangeAccess.isRange()) {
819 return null;
820 }
834 double [] fromTo = rangeAccess.getKmRange(); 821 double [] fromTo = rangeAccess.getKmRange();
835 822
836 if (fromTo == null) { 823 if (fromTo == null) {
837 return null; 824 return null;
838 } 825 }

http://dive4elements.wald.intevation.org