protected void drawToolTipText(
      DrawContext dc, String text, int x, int y, ToolTipAttributes attributes) {
    java.awt.Color textColor =
        this.modulateColorOpacity(attributes.getTextColor(), attributes.getTextOpacity());

    TextRenderer textRenderer = this.getTextRenderer(dc, attributes.getFont());
    textRenderer.begin3DRendering();
    textRenderer.setColor(textColor);
    textRenderer.draw(text, x, y);
    textRenderer.end3DRendering();
  }
Beispiel #2
0
 @Override
 public void init(final GLAutoDrawable drawable) {
   super.init(drawable);
   if (renderer != null) {
     renderer.dispose();
   }
   renderer = new TextRenderer(new Font("Inconsolata", Font.PLAIN, 18), true, true);
 }
Beispiel #3
0
  public void display(GLAutoDrawable drawable) {
    GL2 gl = drawable.getGL().getGL2();
    gl.glClearColor(0, 0, 0, 0);
    gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);

    gl.glMatrixMode(GL2.GL_PROJECTION);
    gl.glLoadIdentity();
    // new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
    gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
    gl.glMatrixMode(GL2.GL_MODELVIEW);
    gl.glLoadIdentity();

    tr.beginRendering(800, 800);
    tr.draw("die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
    tr.draw("Hello World! This text is scrambled", 16, 16);
    tr.endRendering();
  }
Beispiel #4
0
 @Override
 protected void render(GL2 gl, GLAutoDrawable drawable) {
   renderer.beginRendering(drawable.getWidth(), drawable.getHeight());
   renderer.draw("No time.", 25, 25);
   renderer.endRendering();
 }
 protected java.awt.geom.Rectangle2D computeTextBounds(
     DrawContext dc, String text, java.awt.Font font) {
   TextRenderer textRenderer = this.getTextRenderer(dc, font);
   return textRenderer.getBounds(text);
 }
Beispiel #6
0
 public void init(GLAutoDrawable arg0) {
   tr =
       new TextRenderer(
           new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
   tr.setColor(1, 1, 1, 1);
 }