Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Color


        for (Iterator iter = mapOptions.keySet().iterator(); iter.hasNext();) {
          long value = (Long) iter.next();
          String text = (String) mapOptions.get(value);

          Rectangle area = new Rectangle(0, y, WIDTH, OPTION_HEIGHT);
          Color bg;
          if (area.contains(mousePos)) {
            bg = display.getSystemColor(SWT.COLOR_LIST_SELECTION);
            e.gc.setBackground(bg);
            e.gc.setForeground(display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
            e.gc.fillRectangle(area);
          } else {
            bg = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
            e.gc.setBackground(bg);
            e.gc.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
          }

          int ovalSize = OPTION_HEIGHT - 6;
          if (getValue() == value) {
            Color saveColor = e.gc.getBackground();
            e.gc.setBackground(e.gc.getForeground());
            e.gc.fillOval(4, y + 5, ovalSize - 3, ovalSize - 3);
            e.gc.setBackground(saveColor);
          }
          if (JMConstants.isLinux) {
            // Hack: on linux, drawing oval seems to draw a line from last pos
            // to start of oval.. drawing a point (anywhere) seems to clear the
            // path
            Color saveColor = e.gc.getForeground();
            e.gc.setForeground(bg);
            e.gc.drawPoint(2, y + 3);
            e.gc.setForeground(saveColor);
          }
          e.gc.drawOval(2, y + 3, ovalSize, ovalSize);
View Full Code Here


      alternatingColors = new Color[] {
          table.getDisplay().getSystemColor(SWT.COLOR_WHITE),
          table.getDisplay().getSystemColor(SWT.COLOR_WHITE)  };
    }

    Color newColor = alternatingColors[index % alternatingColors.length];
    if (!newColor.equals(getBackground()))
      item.setBackground(newColor);
  }
View Full Code Here

      System.arraycopy( foreground_colors, 0, new_colors, 0, foreground_colors.length );
     
      foreground_colors = new_colors;
    }

    Color value = foreground_colors[index];
   
    if ( new_color == value ){
     
      return false;
    }
View Full Code Here

    if (table == null || item == null)
      return;

//    newItem.setText(text_values);
    newItem.setImage(image_values);
    Color colorFG = item.getForeground();
    Color colorBG = item.getBackground();
    newItem.setForeground(colorFG);
    newItem.setBackground(colorBG);
    int numColumns = table.getColumnCount();
    for (int i = 0; i < numColumns; i++) {
      try {
        newItem.setText(i, item.getText(i));
        Color colorColumnFG = item.getForeground(i);
        Color colorColumnBG = item.getBackground(i);
        if (!colorColumnFG.equals(colorFG))
          newItem.setForeground(i, colorColumnFG);
        if (!colorColumnBG.equals(colorBG))
          newItem.setBackground(i, colorColumnBG);
      } catch (NoSuchMethodError e) {
        /* Ignore for Pre 3.0 SWT.. */
      }
    }
View Full Code Here

      Boolean status = SWTPreferences.getInstance().isColumnVisible(column_id);
      newEnabledState.put(column, status);
    }
   
   
    blue = new Color(display,0,0,128);
  
    Shell shell1=new Shell(display,SWT.ON_TOP);
  shell=new Shell(shell1,SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
  shell.setText(Localizer._("columneditorwindow.title"));
  shell.setImage(SWTImageRepository.getImage("columns_setup.png"));
View Full Code Here

      return control;
    }

    private void updateColorItem() {
      Color color = OwlUI.getColor(fResources, fSelectedColor);

      /* Dispose old first */
      if (fColorImage != null)
        fColorImage.dispose();

View Full Code Here

    /* Font */
    FontData fontData = splash.getDisplay().getSystemFont().getFontData()[0];
    fVersionFont = new Font(splash.getDisplay(), fontData.getName(), 8, SWT.BOLD);

    /* Color */
    fVersionColor = new Color(splash.getDisplay(), new RGB(53, 53, 53));
  }
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, label));
      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

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.