1 23 package info.monitorenter.gui.chart.axis; 24 25 import info.monitorenter.gui.chart.ITrace2D; 26 import info.monitorenter.gui.chart.labelformatters.LabelFormatterSimple; 27 28 import java.util.Iterator ; 29 30 51 public class AxisLogE extends AAxisTransformation { 52 53 59 public AxisLogE() { 60 super(new LabelFormatterSimple()); 61 } 62 63 81 protected double transform(final double in) { 82 double toTransform = in; 83 if (toTransform < 1) { 89 Iterator itTraces = this.m_accessor.getChart().getTraces().iterator(); 92 if (!itTraces.hasNext()) { 93 toTransform = 1.0; 94 } else { 95 ITrace2D trace; 96 while (itTraces.hasNext()) { 97 trace = (ITrace2D) itTraces.next(); 98 if (trace.iterator().hasNext()) { 99 throw new IllegalArgumentException (this.getClass().getName() 101 + " must not be used with values < 1!"); 102 } 103 } 104 toTransform = 1.0; 106 } 107 } 108 double result = Math.log(toTransform); 110 if (result == Double.POSITIVE_INFINITY) { 111 result = Double.MAX_VALUE; 112 } 113 return result; 114 } 115 116 119 protected double untransform(final double in) { 120 return Math.pow(Math.E, in); 121 } 122 123 } 124 | Popular Tags |