Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.drawText()


    final Image image = new Image(display, extent.x, extent.y);
    final GC gc = new GC(image);
    gc.setFont(newFont);

    gc.setForeground(new Color(display, new RGB(0, 0, 0)));
    gc.drawText(stringToDraw, 0, 0);

    final ImmutableList.Builder<Point> coordinateBuilder = ImmutableList
        .builder();
    final int white = (int) Math.pow(2, 24) / 2 - 1;
    for (int i = 0; i < image.getBounds().width; i++) {
View Full Code Here


        if (i % large == 0) {
          String time = TimeFormatter.format(15000 * i);
          time = time.substring(0, time.length() - 3);
          gc.setFont(font);
          final Point size = gc.textExtent(time);
          gc.drawText(time, i - (size.x / 2), 0);
        }

        gc.drawLine(i, 20 - height, i, 20);

      }
View Full Code Here

          if (align == SWT.RIGHT) {
            int lineWidth = gc.textExtent(lines[i], DRAW_FLAGS).x;
            lineX = Math.max(x, rect.x + rect.width - hIndent - lineWidth);
          }
        }
        gc.drawText(lines[i], lineX, lineY, DRAW_FLAGS);
        lineY += lineHeight;
      }
    }
  }
View Full Code Here

                    gc.drawImage(image, x, bounds.y + MARGIN_Y);
                    x += imgBounds.width + 5;
                }
            }

            gc.drawText(text, x, bounds.y + MARGIN_Y, true);

            gc.setBackground(oldBackground);
            gc.setForeground(oldForeground);
        }
    }
View Full Code Here

    public void drawString(OutputDevice outputDevice, String string, float x,
            float y) {
        GC gc = ((SWTOutputDevice) outputDevice).getGC();
        FontMetrics metrics = gc.getFontMetrics();
        y -= (metrics.getAscent() + metrics.getLeading());
        gc.drawText(string, (int) x, (int) y, SWT.DRAW_TRANSPARENT);
    }

    public FSFontMetrics getFSFontMetrics(FontContext context, FSFont font,
            String string) {
        return new SWTFontMetricsAdapter((SWTFontContext) context,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.