GL2 gl = context(ctx).getGL().getGL2();
gl.glLineWidth(lineWidth);
if (linePattern == LineAttributes.PATTERN_SOLID) {
gl.glDisable(GL2.GL_LINE_STIPPLE);
} else {
if (linePattern == LineAttributes.PATTERN_DASH) { // dashed lines
gl.glLineStipple(1, (short) 0x00ff);
} else if (linePattern == LineAttributes.PATTERN_DOT) { // dotted lines
gl.glLineStipple(1, (short) 0x0101);