Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.GC.fillGradientRectangle()


    Color oldBackground = gc.getBackground();

    /* Gradient */
    gc.setForeground(fg);
    gc.setBackground(bg);
    gc.fillGradientRectangle(0, rect.y, area.width, rect.height, true);

    /* Bottom Line */
    gc.setForeground(end);
    gc.drawLine(0, rect.y + rect.height - 1, area.width, rect.y + rect.height - 1);

View Full Code Here


      Color oldBackground = gc.getBackground();

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

      /* Bottom Line */
      gc.setForeground(fGradientEndColor);
      gc.drawLine(0, rect.y + rect.height - 1, area.width, rect.y + rect.height - 1);

View Full Code Here

            if (lastColor == null)
              lastColor = oldBackground;
            gc.setBackground(lastColor);
            if (gradientVertical) {
              final int gradientHeight = (gradientPercents[i] * rect.height / 100) - pos;
              gc.fillGradientRectangle(0, pos, rect.width, gradientHeight, true);
              pos += gradientHeight;
            } else {
              final int gradientWidth = (gradientPercents[i] * rect.width / 100) - pos;
              gc.fillGradientRectangle(pos, 0, gradientWidth, rect.height, false);
              pos += gradientWidth;
View Full Code Here

              final int gradientHeight = (gradientPercents[i] * rect.height / 100) - pos;
              gc.fillGradientRectangle(0, pos, rect.width, gradientHeight, true);
              pos += gradientHeight;
            } else {
              final int gradientWidth = (gradientPercents[i] * rect.width / 100) - pos;
              gc.fillGradientRectangle(pos, 0, gradientWidth, rect.height, false);
              pos += gradientWidth;
            }
          }
          if (gradientVertical && pos < rect.height) {
            gc.setBackground(getBackground());
View Full Code Here

          GC gc = e.gc;
          Rectangle clArea = descriptionContainer.getClientArea();

          gc.setForeground(fNotifierColors.getBorder());
          gc.setBackground(fNotifierColors.getGradientEnd());
          gc.fillGradientRectangle(4, 1, clArea.width, 1, false);
        }
      });

      Label descriptionText = new Label(descriptionContainer, SWT.WRAP);
      descriptionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
View Full Code Here

      }

      private void drawGradient(GC gc, Rectangle clArea) {
        gc.setForeground(fNotifierColors.getGradientBegin());
        gc.setBackground(fNotifierColors.getGradientEnd());
        gc.fillGradientRectangle(clArea.x, clArea.y, clArea.width, clArea.height, true);
      }

      private void fixRegion(GC gc, Rectangle clArea) {
        gc.setForeground(fNotifierColors.getBorder());
View Full Code Here

      }

      private void drawGradient(GC gc, Rectangle clArea) {
        gc.setBackground(fNotifierColors.getGradientBegin());
        gc.setForeground(fNotifierColors.getGradientEnd());
        gc.fillGradientRectangle(clArea.x, clArea.y, clArea.width, clArea.height, true);
      }

      private void fixRegion(GC gc, Rectangle clArea) {
        gc.setForeground(fNotifierColors.getBorder());
View Full Code Here

    {
        GC gc = e.gc;
        gc.setForeground(backgroundColor);
        gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
        Rectangle r = getClientArea();
        gc.fillGradientRectangle(0, 0, r.width, r.height, false);
    }

    private void keyPressed(KeyEvent e)
    {
        if (selection != null && (e.keyCode == SWT.ARROW_UP || e.keyCode == SWT.ARROW_DOWN))
View Full Code Here

            if (Sidebar.this.selection != null && this == Sidebar.this.selection.item)
            {
                gc.setForeground(isDragTarget ? selectedColor : lighterSelectedColor);
                gc.setBackground(selectedColor);
                gc.fillGradientRectangle(bounds.x, bounds.y, bounds.width, bounds.height, true);

                gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
                gc.setFont(boldFont);
            }
            else
View Full Code Here

            }
            else
            {
                gc.setForeground(backgroundColor);
                gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
                gc.fillGradientRectangle(bounds.x, bounds.y, bounds.width, bounds.height, false);

                if (indent > 0)
                {
                    gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_BLACK));
                    gc.setFont(isDragTarget ? boldFont : regularFont);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.