1 /*******************************************************************************
2 * Copyright (c) 2000, 2013 IBM Corporation and others.
3 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
11 * Contributors:
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.examples.graphics;
15
16 import org.eclipse.swt.graphics.*;
17
18 public class LineTab extends GraphicsTab {
19
LineTab(GraphicsExample example)20 public LineTab(GraphicsExample example) {
21 super(example);
22 }
23
24 @Override
getCategory()25 public String getCategory() {
26 return GraphicsExample.getResourceString("Lines"); //$NON-NLS-1$
27 }
28
29 @Override
getText()30 public String getText() {
31 return GraphicsExample.getResourceString("Line"); //$NON-NLS-1$
32 }
33
34 @Override
getDescription()35 public String getDescription() {
36 return GraphicsExample.getResourceString("LineDescription"); //$NON-NLS-1$
37 }
38
39 @Override
paint(GC gc, int width, int height)40 public void paint(GC gc, int width, int height) {
41 gc.drawLine(0, 0, width, height);
42 gc.drawLine(width, 0, 0, height);
43 }
44 }
45