Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2004-12-15 21:59:17 +0000
committerVeronika Irvine2004-12-15 21:59:17 +0000
commit285cce80136d4e48e3f07aa683212a1d1a5237a6 (patch)
tree3cf0e9834af4113834a0d099361d923598b8d5df /examples
parentc63df7f15ff2a3926585f42dd6e86b035077d228 (diff)
downloadeclipse.platform.swt-285cce80136d4e48e3f07aa683212a1d1a5237a6.tar.gz
eclipse.platform.swt-285cce80136d4e48e3f07aa683212a1d1a5237a6.tar.xz
eclipse.platform.swt-285cce80136d4e48e3f07aa683212a1d1a5237a6.zip
*** empty log message ***
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet168.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet168.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet168.java
index 7302403328..529ba0f8fa 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet168.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet168.java
@@ -26,22 +26,25 @@ public class Snippet168 {
public static void main(String[] args) {
final Display display = new Display();
Shell shell = new Shell(display);
- shell.setText("PR");
- shell.setBackground(display.getSystemColor(SWT.COLOR_WHITE));
shell.addListener(SWT.Paint, new Listener() {
public void handleEvent(Event event) {
GC gc = event.gc;
gc.setLineWidth(10);
gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));
+ int x = 20;
+ int y = 20;
+ int w = 120;
int[] caps = {SWT.CAP_FLAT, SWT.CAP_ROUND, SWT.CAP_SQUARE};
for (int i = 0; i < caps.length; i++) {
gc.setLineCap(caps[i]);
- gc.drawLine(10,10 + i * 20, 100, 10 + i * 20);
+ gc.drawLine(x, y, x + w, y);
+ y += 20;
}
int[] joins = {SWT.JOIN_BEVEL, SWT.JOIN_MITER, SWT.JOIN_ROUND};
for (int i = 0; i < joins.length; i++) {
gc.setLineJoin(joins[i]);
- gc.drawPolygon(new int[] {10,80 + i * 60, 50, 120 + i * 60, 100, 80 + i * 60});
+ gc.drawPolygon(new int[] {x, y, x + w/2, y + 60, x + w, y});
+ y += 80;
}
}
});

Back to the top