Package org.eclipse.swt.graphics

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


  public void fillErrorMessage(String errorMessage) {
    GC gcmessage = new GC(mainPanel);
    Font font = new Font(getDisplay(), new FontData("Arial", 10, SWT.BOLD));
    gcmessage.setFont(font);
    gcmessage.setForeground(getDisplay().getSystemColor(SWT.COLOR_RED));
    gcmessage.drawText(errorMessage, posX-(gc.textExtent(errorMessage).x/2), posY+265, SWT.DRAW_TRANSPARENT);
  }

  public void close() {
    this.dispose();
  }
View Full Code Here


                gc.setLineWidth(1);
                gc.drawLine(0, title.getClientArea().height-2, title.getClientArea().width, title.getClientArea().height-2);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
                gc.drawLine(0, title.getClientArea().height-1, title.getClientArea().width, title.getClientArea().height-1);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
                gc.drawText("Extrato Recebido do Banco", 10, 3, SWT.DRAW_TRANSPARENT);

                gc.dispose();
            }
        });
       
View Full Code Here

                gc.setLineWidth(1);
                gc.drawLine(0, 30, mainPanel.getClientArea().width, 30);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));

                if (screenMessageLabel.getText().equals("")) {
                    gc.drawText(DEFAULT_MESSAGE, 10, 10, SWT.DRAW_TRANSPARENT);
                } else {
                    gc.drawText(screenMessageLabel.getText(), 32, 10, SWT.DRAW_TRANSPARENT);
                    gc.drawImage(new Image(null,"img/exclamation.png"),9,9);
                }
                gc.dispose();
View Full Code Here

                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));

                if (screenMessageLabel.getText().equals("")) {
                    gc.drawText(DEFAULT_MESSAGE, 10, 10, SWT.DRAW_TRANSPARENT);
                } else {
                    gc.drawText(screenMessageLabel.getText(), 32, 10, SWT.DRAW_TRANSPARENT);
                    gc.drawImage(new Image(null,"img/exclamation.png"),9,9);
                }
                gc.dispose();
            }
        });
View Full Code Here

        {
          String message = image.getBounds().width + "x" + image.getBounds().height;
          Point extent = gc.textExtent(message);
          int x = (clientArea.width - extent.x) / 2;
          int y = clientArea.height - extent.y - 5;
          gc.drawText(message, x, y);
        }
      }
    });
  }
}
View Full Code Here

                gc.setLineWidth(1);
                gc.drawLine(0, 30, mainPanel.getClientArea().width, 30);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));

                if (screenMessageLabel.getText().equals("")) {
                    gc.drawText("", 10, 10, SWT.DRAW_TRANSPARENT);
                } else {
                    gc.drawText(screenMessageLabel.getText(), 32, 10, SWT.DRAW_TRANSPARENT);
                    gc.drawImage(new Image(null,"img/exclamation.png"),9,9);
                }
                gc.dispose();
View Full Code Here

                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));

                if (screenMessageLabel.getText().equals("")) {
                    gc.drawText("", 10, 10, SWT.DRAW_TRANSPARENT);
                } else {
                    gc.drawText(screenMessageLabel.getText(), 32, 10, SWT.DRAW_TRANSPARENT);
                    gc.drawImage(new Image(null,"img/exclamation.png"),9,9);
                }
                gc.dispose();
            }
        });
View Full Code Here

    stringGc.setForeground(gc.getForeground());
    stringGc.setBackground(gc.getBackground());
    stringGc.setFont(gc.getFont());

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

    // Draw the image vertically onto the original GC
    drawVerticalImage(stringImage, x, y, gc, style);

    // Dispose the new GC
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

         
          if (eachItemInPaintOrder.hasText()) {
            newForeground = UI.newColor(eachItemInPaintOrder.getRenderForeground());
            gc.setForeground(newForeground);
            Rectangle textBounds = computeTextBounds(eachItemInPaintOrder, bounds);
            gc.drawText(eachItemInPaintOrder.getText(), textBounds.x, textBounds.y, true);
            gc.setForeground(oldForeground);
            newForeground.dispose();
          }
         
          Rectangle closeButtonBounds = computeCloseButtonBounds(eachItemInPaintOrder, bounds);
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.