public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) { Color tmp = g.getBackground(); g.setBackground(g.getForeground()); g.fillArc(x, y, width, height, startAngle, arcAngle); g.setBackground(tmp); }
public void fillRect(int x, int y, int width, int height) { Color tmp = g.getBackground(); g.setBackground(g.getForeground()); g.fillRectangle(x, y, width, height); g.setBackground(tmp); }
public void create() { shell = createShell(); contents = createContents(shell); //initialize the bounds of the shell to that appropriate for the contents initializeBounds(); }
public void run() { SwtGraphics gc = new SwtGraphics(instance.getParent().getDisplay()); gc.setFont(font); stringWidth = gc.stringWidth(str); gc.dispose(); } }
public void run() { SwtGraphics gc = new SwtGraphics(instance.getParent().getDisplay()); gc.setFont(font); fontMetrics = gc.getFontMetrics(); gc.dispose(); } }
public static Image createImage(ImageData data) { CreateImageRunnable createImageRunnable = instance.new CreateImageRunnable(data); instance.getDisplay().syncExec(createImageRunnable); return createImageRunnable.getImage(); }
public static Font getFont(String name, int size, int style, boolean antialiasing) { GetFontRunnable getFontRunnable = instance.new GetFontRunnable(name, size, style, antialiasing); instance.getDisplay().syncExec(getFontRunnable); return getFontRunnable.getFont(); }
public static FontMetrics getFontMetrics(Font font) { GetFontMetricsRunnable getFontMetricsRunnable = instance.new GetFontMetricsRunnable(font); instance.getDisplay().syncExec(getFontMetricsRunnable); return getFontMetricsRunnable.getFontMetrics(); }
public static int stringWidth(Font font, String str) { StringWidthRunnable stringWidthRunnable = instance.new StringWidthRunnable(font, str); instance.getDisplay().syncExec(stringWidthRunnable); return stringWidthRunnable.stringWidth(); }
public static void openMessageDialog(Shell parent, String title, String message, int messageType) { SwtMessageDialog dialog = new SwtMessageDialog(parent, title, message, messageType, new String[] {"OK"}, 0); dialog.open(); }
protected void buttonPressed(int buttonId) { setReturnCode(buttonId); close(); }
protected void buttonPressed(int buttonId) { if (buttonId == OK) { okPressed(); } else if (buttonId == CANCEL) { cancelPressed(); } }
protected void okPressed() { setReturnCode(OK); close(); }
public void widgetSelected(SelectionEvent event) { buttonPressed(CANCEL); } });
public int getClipX() { Rectangle rect = g.getClipping(); if (rect == null) { return 0; } else { return rect.x; } }
public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3) { int[] points = new int[6]; points[0] = x1; points[1] = y1; points[2] = x2; points[3] = y2; points[4] = x3; points[5] = y3; g.fillPolygon(points); }
public void paintControl(PaintEvent e) { SwtDeviceComponent.this.paintControl(e); } });
public void paint(SwtGraphics gc) { synchronized (this) { if (displayImage != null) { gc.drawImage(displayImage.img, 0, 0); } } }
public static boolean openQuestion(Shell parent, String title, String message) { SwtMessageDialog dialog = new SwtMessageDialog(parent, title, message, QUESTION, new String[] {"Yes", "No"}, 0); return dialog.open() == 0; }
public void widgetSelected(SelectionEvent event) { buttonPressed(OK); } });