~ubuntu-branches/debian/sid/swt-gtk/sid

« back to all changes in this revision

Viewing changes to org/eclipse/swt/custom/CTabItem.java

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Perez
  • Date: 2009-12-07 10:22:24 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20091207102224-70w2tax575mcks1w
Tags: 3.5.1-1
* New upstream release. Closes: #558663.
* debian/control: 
  - Add Vcs-* fields for Git repository.
  - Allow DM-Uploads.
  - Remove "Conflicts", package should live with eclipse.
* debian/rules: Fix default-java path around AWT_LIB_PATH.
* debian/copyright: Minor update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2000, 2008 IBM Corporation and others.
 
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
3
 * All rights reserved. This program and the accompanying materials
4
4
 * are made available under the terms of the Eclipse Public License v1.0
5
5
 * which accompanies this distribution, and is available at
31
31
 *
32
32
 * @see <a href="http://www.eclipse.org/swt/snippets/#ctabfolder">CTabFolder, CTabItem snippets</a>
33
33
 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
 
34
 * @noextend This class is not intended to be subclassed by clients.
34
35
 */
35
36
public class CTabItem extends Item {
36
37
        CTabFolder parent;
197
198
                                                         x+9,y+2, x+7,y+4, x+7,y+5, x+9,y+7, x+9,y+9,
198
199
                                                 x+7,y+9, x+5,y+7, x+4,y+7, x+2,y+9, x,y+9,
199
200
                                                 x,y+7, x+2,y+5, x+2,y+4, x,y+2};
200
 
                        Color fill = new Color(display, CTabFolder.CLOSE_FILL);
201
 
                        gc.setBackground(fill);
 
201
                        gc.setBackground(parent.getFillColor());
202
202
                        gc.fillPolygon(shape);
203
 
                        fill.dispose();
204
203
                        gc.setForeground(closeBorder);
205
204
                        gc.drawPolygon(shape);
206
205
                        break;
210
209
                                                         x+10,y+3, x+8,y+5, x+8,y+6, x+10,y+8, x+10,y+10,
211
210
                                                 x+8,y+10, x+6,y+8, x+5,y+8, x+3,y+10, x+1,y+10,
212
211
                                                 x+1,y+8, x+3,y+6, x+3,y+5, x+1,y+3};
213
 
                        Color fill = new Color(display, CTabFolder.CLOSE_FILL);
214
 
                        gc.setBackground(fill);
 
212
                        gc.setBackground(parent.getFillColor());
215
213
                        gc.fillPolygon(shape);
216
 
                        fill.dispose();
217
214
                        gc.setForeground(closeBorder);
218
215
                        gc.drawPolygon(shape);
219
216
                        break;
224
221
                                parent.drawBackground(gc, shape, false);
225
222
                        } else {
226
223
                                Color defaultBackground = parent.getBackground();
227
 
                                Image image = parent.bgImage;
228
224
                                Color[] colors = parent.gradientColors;
229
225
                                int[] percents = parent.gradientPercents;
230
226
                                boolean vertical = parent.gradientVertical; 
231
 
                                parent.drawBackground(gc, shape, x, y, 10, 10, defaultBackground, image, colors, percents, vertical);
 
227
                                parent.drawBackground(gc, shape, x, y, 10, 10, defaultBackground, null, colors, percents, vertical);
232
228
                        }
233
229
                        break;
234
230
                }
260
256
                        int x1 = Math.max(0, parent.borderLeft - 1);
261
257
                        int y1 = (parent.onBottom) ? y - 1 : y + height;
262
258
                        int x2 = size.x - parent.borderRight;
263
 
                        gc.setForeground(CTabFolder.borderColor);
 
259
                        gc.setForeground(getDisplay().getSystemColor(CTabFolder.BORDER1_COLOR));
264
260
                        gc.drawLine(x1, y1, x2, y1);
265
261
                        return;
266
262
                }
362
358
                    inside = null;
363
359
                }
364
360
                RGB outside = parent.getBackground().getRGB();          
365
 
                if (parent.bgImage != null || 
366
 
                    (parent.gradientColors != null && parent.gradientColors.length > 1)) {
 
361
                if (parent.gradientColors != null && parent.gradientColors.length > 1) {
367
362
                    outside = null;
368
363
                }
369
 
                parent.antialias(shape, CTabFolder.borderColor.getRGB(), inside, outside, gc);
370
 
                gc.setForeground(CTabFolder.borderColor);
 
364
                Color borderColor = getDisplay().getSystemColor(CTabFolder.BORDER1_COLOR);
 
365
                parent.antialias(shape, borderColor.getRGB(), inside, outside, gc);
 
366
                gc.setForeground(borderColor);
371
367
                gc.drawPolyline(shape);
372
368
                
373
369
                if (!tabInPaint) return;
569
565
 */
570
566
void drawBorder(GC gc, int[] shape) {
571
567
 
572
 
        gc.setForeground(CTabFolder.borderColor);
 
568
        gc.setForeground(getDisplay().getSystemColor(CTabFolder.BORDER1_COLOR));
573
569
        gc.drawPolyline(shape);
574
570
}
575
571
 
1036
1032
}
1037
1033
/**
1038
1034
 * Sets the receiver's tool tip text to the argument, which
1039
 
 * may be null indicating that no tool tip text should be shown.
 
1035
 * may be null indicating that the default tool tip for the 
 
1036
 * control will be shown. For a control that has a default
 
1037
 * tool tip, such as the Tree control on Windows, setting
 
1038
 * the tool tip text to an empty string replaces the default,
 
1039
 * causing no tool tip text to be shown.
1040
1040
 *
1041
1041
 * @param string the new tool tip text (or null)
1042
1042
 *