Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Color


public void createControl(Composite parent)
{
  Composite composite = new Composite(parent, SWT.NULL);
  GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 5;
  composite.setLayout(gridLayout);
  Color backYellow = new Color(composite.getDisplay(), 231, 231, 191);
  Color[] labelColors =new Color[] {backYellow, composite.getDisplay().getSystemColor(SWT.COLOR_WHITE) };

  //*-- build first row and description for scanning hidden directories 
  GridData skipGd = new GridData(); skipGd.grabExcessHorizontalSpace = true; skipGd.horizontalAlignment = GridData.FILL;
  Label skipLabel = new Label(composite, SWT.LEFT); skipLabel.setText("Skip Hidden Directories: ");
View Full Code Here


  //*-- brand the window with the title and icon
  getShell().setText("Mustru Question & Answer v0.1");
  getShell().setImage(new Image(parent.getDisplay(), Constants.MUSTRU_HOME + File.separator + "icons" + File.separator + "mustru_16.png"));

  //*-- assign the colors
  backYellow = new Color(parent.getDisplay(), 231, 231, 191);
  backWhite = new Color(parent.getDisplay(), 218, 218, 237);
  frontBlue = new Color(parent.getDisplay(), 0, 22, 135);
  frontRed = new Color(parent.getDisplay(), 255, 0, 0);

  //*-- create the table and columns
  table = new Table ( getShell(), SWT.BORDER | SWT.FULL_SELECTION );  
  table.setLinesVisible(true); table.setHeaderVisible(true);
  table.setLayout(new GridLayout() );
View Full Code Here

  final Composite composite = new Composite(parent, SWT.NULL);
  GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3;
  gridLayout.makeColumnsEqualWidth = false;
  composite.setLayout(gridLayout);

  Color backYellow = new Color(composite.getDisplay(), 231, 231, 191);
  Color[] labelColors =new Color[] {backYellow, composite.getDisplay().getSystemColor(SWT.COLOR_WHITE) };

  //*-- add the index directory selector
  GridData indexGd = new GridData(); indexGd.grabExcessHorizontalSpace = false; indexGd.horizontalAlignment = GridData.FILL;
  CLabel indexLabel = new CLabel(composite, SWT.LEFT); indexLabel.setText("Lucene index dir.: ");
View Full Code Here

      /* Font */
      cell.setFont(getFont(scoredNews.getNews(), cell.getColumnIndex() - 1));

      /* Foreground */
      Color foreground = getForeground(scoredNews.getNews(), cell.getColumnIndex() - 1);

      /* TODO This is required to invalidate + redraw the entire TableItem! */
      if (USE_CUSTOM_OWNER_DRAWN) {
        Item item = (Item) cell.getItem();
        if (item instanceof TableItem)
View Full Code Here

    /* Font */
    cell.setFont(getFont(cell.getElement(), cell.getColumnIndex()));

    /* Foreground */
    Color foreground = getForeground(cell.getElement(), cell.getColumnIndex());

    /* TODO This is required to invalidate + redraw the entire TableItem! */
    if (NewsTableControl.USE_CUSTOM_OWNER_DRAWN) {
      Item item = (Item) cell.getItem();
      if (item instanceof TreeItem)
View Full Code Here

      /* Paint the selection beyond the end of last column */
      expandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(OwlUI.getColor(fResources, news.getLabel()));
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);
      gc.setForeground(scrollable.getDisplay().getSystemColor(SWT.COLOR_WHITE));

      /* Mark as Selected being handled */
      event.detail &= ~SWT.SELECTED;
    }

    /* Handle Non-Selected flagged News */
    else if (news.isFlagged()) {
      Rectangle clArea = scrollable.getClientArea();
      Rectangle itemRect = event.getBounds();

      /* Paint the selection beyond the end of last column */
      expandRegion(event, scrollable, gc, clArea);

      /* Draw Rectangle */
      Color oldBackground = gc.getBackground();
      gc.setBackground(fStickyBgColor);
      gc.fillRectangle(0, itemRect.y, clArea.width, itemRect.height);
      gc.setBackground(oldBackground);

      /* Mark as Background being handled */
 
View Full Code Here

    /* Paint the selection beyond the end of last column */
    expandRegion(event, scrollable, gc, area);

    /* Draw Gradient Rectangle */
    Color oldForeground = gc.getForeground();
    Color oldBackground = gc.getBackground();

    /* Gradient */
    gc.setForeground(fGradientFgColor);
    gc.setBackground(fGradientBgColor);
    gc.fillGradientRectangle(0, rect.y, area.width, rect.height, true);
View Full Code Here

    fBorder = OwlUI.getColor(fResources, tbBorder);
  }

  private void createGradientColors() {
    RGB titleBg = getSystemColor(SWT.COLOR_TITLE_BACKGROUND);
    Color bgColor = getImpliedBackground();
    RGB bg = bgColor.getRGB();
    RGB bottom, top;

    // Group 1
    // Rule: If at least 2 of the RGB values are equal to or between 180 and
    // 255, then apply specified opacity for Group 1
View Full Code Here

          }
          xPos += imageRect.width;
        }
      } else if (gradientColors != null) {
        // draw a gradient behind the text
        final Color oldBackground = gc.getBackground();
        if (gradientColors.length == 1) {
          if (gradientColors[0] != null)
            gc.setBackground(gradientColors[0]);
          gc.fillRectangle(0, 0, rect.width, rect.height);
        } else {
          final Color oldForeground = gc.getForeground();
          Color lastColor = gradientColors[0];
          if (lastColor == null)
            lastColor = oldBackground;
          int pos = 0;
          for (int i = 0; i < gradientPercents.length; ++i) {
            gc.setForeground(lastColor);
View Full Code Here

   * Paint the Label's border.
   */
  private void paintBorder(GC gc, Rectangle r) {
    Display disp = getDisplay();

    Color c1 = null;
    Color c2 = null;

    int style = getStyle();
    if ((style & SWT.SHADOW_IN) != 0) {
      c1 = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
      c2 = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.graphics.Color

Copyright © 2018 www.massapicom. 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.