@Override public void init(GLAutoDrawable arg0) { getGL().getGL2().glLineWidth(1f); getGL().getGL2().glEnable(GL2.GL_BLEND); getGL().getGL2().glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); }
@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(); }
gl.glEnable(GL.GL_LINE_SMOOTH); gl.glLineWidth(shared.settings.linewidth);
gl.glLineWidth( (float)config.getRenderingConfig().getMinorTickThickness() ); gl.glColor3f( config.getRenderingConfig().getMinorTickColour()[0], config.getRenderingConfig().getMinorTickColour()[1],
@Override public void drawMajorTickGridline( final double location, final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); gl.glLineWidth( (float)config.getRenderingConfig().getMajorGridThickness() ); gl.glColor3f( config.getRenderingConfig().getMajorGridColour()[0], config.getRenderingConfig().getMajorGridColour()[1], config.getRenderingConfig().getMajorGridColour()[2] ); final float ll = this.calculatePosition( location ).floatValue(); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, zero ); gl.glVertex3f( ll, 1, zero ); } gl.glEnd(); gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, zero ); gl.glVertex3f( ll, zero, 1*this.gridDirection ); } gl.glEnd(); gl.glPopMatrix(); }
@Override public void drawMajorTick( final double location, final AxisConfig<float[]> config ) { final GL2 gl = this.glad.getGL().getGL2(); gl.glPushMatrix(); this.orient( gl ); gl.glLineWidth( (float)config.getRenderingConfig().getMajorTickThickness() ); gl.glColor3f( config.getRenderingConfig().getMajorTickColour()[0], config.getRenderingConfig().getMajorTickColour()[1], config.getRenderingConfig().getMajorTickColour()[2] ); final float l = (float)config.getRenderingConfig().getMajorTickLength(); final float l2 = -l; final float ll = this.calculatePosition( location ).floatValue(); final float zero = 0.001f; gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, l, zero ); gl.glVertex3f( ll, l2, zero ); } gl.glEnd(); gl.glBegin( GL.GL_LINE_STRIP ); { // We draw in the x axis, so the orientation has to be set appropriately gl.glVertex3f( ll, zero, l ); gl.glVertex3f( ll, zero, l2 ); } gl.glEnd(); gl.glPopMatrix(); }
gl.glLineWidth( (float)config.getRenderingConfig().getMinorGridThickness() ); gl.glColor3f( config.getRenderingConfig().getMinorGridColour()[0], config.getRenderingConfig().getMinorGridColour()[1],
gl.glShadeModel(GL2.GL_FLAT); gl.glLineWidth(shared.settings.linewidth); // outside glBegin! gl.glBegin(GL.GL_LINES); gl.glColor4f(0f, 0f, 0f, 1f); gl.glLineWidth(shared.settings.linewidth); // outside glBegin! gl.glBegin(GL.GL_LINES); gl.glColor4f(0f, 0f, 0f, 1f);