/** * Returns the maximum value of the y axis * @return The y axis maximum value */ public double getMaxYValue() { return this.yAxisConfig.getMaxValue(); }
@Override public Double calculateUnitsAt( final Double position ) { return position / (this.axisLength/(this.config.getMaxValue()-this.config.getMinValue())); }
/** * Get the maximum value for the scaling * * @return The maximum value */ public double getMaxValue() { return axesRenderer2D.getyAxisConfig().getMaxValue(); }
@Override public Double calculatePosition( final Double units ) { return this.axisLength/(this.config.getMaxValue()-this.config.getMinValue()) * units; }
@Override public Double scaleDimension( final Double dimension ) { return dimension * (this.axisLength/(this.config.getMaxValue()-this.config.getMinValue())); } }
/** * The data range being displayed. * * @return the axisRangeY */ public double getAxisRangeY() { return axesRenderer2D.getyAxisConfig().getMaxValue() - axesRenderer2D.getyAxisConfig().getMinValue(); }
/** * The data range being displayed. * * @return the axisRangeX */ public double getAxisRangeX() { return axesRenderer2D.getxAxisConfig().getMaxValue() - axesRenderer2D.getxAxisConfig().getMinValue(); }
@Override public void precalc() { // Create an axis line between the min and max value this.axisLine = new Line2d( (float)this.config.getMinValue(), 0, (float)this.config.getMaxValue(), 0 ); // Transform to (0,0) in data units this.transform = TransformUtilities.translateMatrix( -this.config.getMinValue(), 0 ); // Scale to pixels this.currentScale = this.axisLength / (this.config.getMaxValue() - this.config.getMinValue()); this.transform = TransformUtilities.scaleMatrix( (float)this.currentScale, 1 ) .times(this.transform); // Rotate to the preferred orientation this.transform = TransformUtilities.rotationMatrix( this.config.getOrientation()[0] ) .times(this.transform); // Translate to the preferred position this.transform = TransformUtilities.translateMatrix( this.config.getLocation()[0], this.config.getLocation()[1] ) .times( this.transform ); // Transform the axis this.axisLine = this.axisLine.transform( this.transform ); }
this.axesRenderer2D.getyAxisConfig().getMaxValue() * this.axesRenderer2D.getyAxisRenderer().getAxisLength() / (this.axesRenderer2D.getyAxisConfig().getMaxValue() - this.axesRenderer2D.getyAxisConfig().getMinValue());
@Override public void drawAxis( final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { gl.glLineWidth( (float)config.getRenderingConfig().getThickness() ); gl.glColor3f( config.getRenderingConfig().getColour()[0], config.getRenderingConfig().getColour()[1], config.getRenderingConfig().getColour()[2] ); final float n1 = this.calculatePosition( config.getMinValue() ).floatValue(); final float n2 = this.calculatePosition( config.getMaxValue() ).floatValue(); // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( n1, zero, zero ); gl.glVertex3f( n2, zero, zero ); } gl.glEnd(); gl.glPopMatrix(); }
double max = this.config.getMaxValue();