1 23 package info.monitorenter.gui.chart.axis; 24 25 import info.monitorenter.gui.chart.AAxis; 26 import info.monitorenter.util.Range; 27 28 import java.awt.event.MouseEvent ; 29 30 31 40 public class AxisLinear extends AAxis { 41 42 45 protected double translateMousePosition(final MouseEvent mouseEvent) throws IllegalArgumentException { 46 return this.getAccessor().translateMousePosition(mouseEvent); 47 } 48 49 52 protected double getScaledValue(final double absolute) { 53 Range range = this.getRange(); 54 double scalerX = range.getExtent(); 55 double result = (absolute - range.getMin()) / scalerX; 56 if (result == Double.NaN || Double.isInfinite(result)) { 57 result = 0; 58 } 59 return result; 60 } 61 } 62 | Popular Tags |