Package org.eclipse.swt.graphics

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


                    r.y + MARGIN, SYMBOL_WIDTH, r.height - MARGIN * 2));

            // draw plot id
            gc.setBackground(getBackground());
            gc.setForeground(getForeground());
            gc.drawText(id, r.x + SYMBOL_WIDTH + MARGIN * 2, r.y, true);
        }
    }
}
View Full Code Here


            Image image = new Image(Display.getCurrent(), textWidth, textHeight);
            GC tmpGc = new GC(image);
            tmpGc.setForeground(getForeground());
            tmpGc.setBackground(getBackground());
            tmpGc.setFont(getFont());
            tmpGc.drawText(text, 0, 0);

            // set transform to rotate
            Transform transform = new Transform(gc.getDevice());
            transform.translate(0, textWidth);
            transform.rotate(270);
View Full Code Here

        Image image = new Image(Display.getCurrent(), textWidth, textHeight);
        GC tmpGc = new GC(image);
        tmpGc.setForeground(getForeground());
        tmpGc.setBackground(gc.getBackground());
        tmpGc.setFont(getFont());
        tmpGc.drawText(text, 0, 0);

        // set transform to rotate
        Transform transform = new Transform(gc.getDevice());
        transform.translate(x, y);
        transform.rotate(360 - angle);
View Full Code Here

      gc.setBackground(background);
      gc.setForeground(foreground);
      gc.fillRectangle(event.getBounds());

      // This is a workaround for an SWT-Bug on WinXP bug 169517
      gc.drawText(" ", cell.getBounds().x, cell.getBounds().y, false); //$NON-NLS-1$
      event.detail &= ~SWT.SELECTED;
    }
  }

  private void removeSelectionInformation(Event event, ViewerCell cell) {
View Full Code Here

        cell.getColumnIndex()));
    gc.setForeground(cell.getViewerRow().getForeground(
        cell.getColumnIndex()));
    gc.fillRectangle(cell.getBounds());
    // This is a workaround for an SWT-Bug on WinXP bug 169517
    gc.drawText(" ", cell.getBounds().x, cell.getBounds().y, false); //$NON-NLS-1$
    event.detail &= ~SWT.SELECTED;
  }

  private void hookListener(final ColumnViewer viewer) {
View Full Code Here

        // to avoid white spaces if the text does not fill the
        // whole image (e.g. on new lines)
        stringGc.fillRectangle(0, 0, pt.x, pt.y);

        // Draw the text onto the image
        stringGc.drawText(string, 0, 0);

        // draw underline and/or strikethrough
        if (underline || strikethrough) {
            // check and draw underline and strikethrough separately so it is
            // possible to combine both
View Full Code Here

        gc.setFont(font);
        gc.setForeground(foreground);
        gc.setBackground(background);

        // Draw the text onto the image
        gc.drawText(text, 0, 0);

        // Draw the image vertically onto the original GC
        Image image = createRotatedImage(stringImage, style);

        // Dispose the new GC
View Full Code Here

    gc.setBackground(chartColour);
    gc.fillRoundRectangle(x, y, width, height, arcWidth, arcHeight);

    gc.setForeground(foreground);
    gc.setBackground(background);
    gc.drawText(text, x + textWidthOffset, y + textHeightOffset, true);
   
    chartColour.dispose();
  }
}
View Full Code Here

      String text = bar.getText();
      if (text != null) {
        gc.setForeground(foreground);
        gc.setBackground(background);
        gc.drawText(text, x + textWidthOffset, y + textHeightOffset, true);
      }

      x += width;
    }
    chartColour.dispose();
View Full Code Here

                try {
                    gc.setForeground(colorForeground);
                    gc.setBackground(colorBackground);
                    gc.setTextAntialias(SWT.ON);
                    gc.setFont(font);
                    gc.drawText(stringToAddToDecoration, 5, 0, true);
                } catch (Exception e) {
                    Log.log(e);
                } finally {
                    colorBackground.dispose();
                    colorForeground.dispose();
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.