Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Color


      /* 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


    }

    public void drawCell(GC gc, Rectangle rect, int col, int row,
            Object content, boolean focus, boolean fixed, boolean clicked,
            KTableModel model) {
        Color textColor = m_Display.getSystemColor(SWT.COLOR_BLUE);
        Color backColor = m_Display.getSystemColor(SWT.COLOR_WHITE);
        Color borderColor = m_Display.getSystemColor(SWT.COLOR_GRAY);;
        if (focus) {
          // CB TODO, Migrate Color handling.
//            textColor = UITheme.getInstance().SELECTION_FORGROUND_COLOR;
//            backColor = UITheme.getInstance().SELECTION_BACKGROUND_COLOR;
        } else {
View Full Code Here

    }
    return null;
  }

  public Color getForeground(Object pElement, int pColumnIndex) {
    Color lColor = null;

    if (!(pElement instanceof IXFile)) {
      return null;
    }
    IXFile lFile = (IXFile) pElement;
View Full Code Here

  }

  public Color getBackground(Object pElement, int pColumnIndex) {

    Color lColor = null;
    int lRowIndex;
    if (!(pElement instanceof IXFile)) {
      return null;
    }
    IXFile lFile = (IXFile) pElement;
View Full Code Here

  protected HashMap<String,Image> mImageMap;

  protected Object[] mElements;

  public ModelPreparator(MediaView pMediaView, IPersonalBookMark pBookMark) {
    STATUS_INCOMPLETE_COLOR = new Color(Display
        .getDefault(), 251, 251, 192);

    STATUS_SCHEDULED_COLOR = new Color(Display.getDefault(), 245,
        174, 249);
   
    LOCAL_ODD_BACKGROUND_COLOR = new Color(Display
        .getDefault(), 253, 221, 164);

    APP_FONT3_COLOR = new Color(Display.getDefault(),
        96, 96, 96);

    FEED_TITLE_COLOR = new Color(Display.getDefault(), 0,
        57, 163);
   
    TABLE_ODD_BACKGROUND_COLOR = new Color(Display
        .getDefault(), 250, 250, 237);

   
    mMediaView = pMediaView;
    mBookMark = pBookMark;
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

        }
      }
    }

    // Are these settings the same as before?
    final Color background = getBackground();
    if (backgroundImage == null) {
      if ((gradientColors != null) && (colors != null) && (gradientColors.length == colors.length)) {
        boolean same = false;
        for (int i = 0; i < gradientColors.length; i++) {
          same = (gradientColors[i] == colors[i]) || ((gradientColors[i] == null) && (colors[i] == background)) || ((gradientColors[i] == background) && (colors[i] == null));
View Full Code Here

   * @param rgb the color value to use in the image
   * @return an {@link Image} for the color that must be disposed when no longer
   * used.
   */
  public static Image createColorImage(Display display, RGB rgb) {
    Color color = new Color(display, rgb);

    Image image = new Image(display, 12, 12);

    GC gc = new GC(image);

    gc.setBackground(color);
    gc.fillRectangle(0, 0, 12, 12);

    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0, 0, 11, 11);

    gc.dispose();
    color.dispose();

    return image;
  }
View Full Code Here

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

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

    /* Gradient */
    gc.setForeground(fg);
    gc.setBackground(bg);
    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.