protected void paintBackground(Graphics g) {
    // paint my bubble
    int col = g.getColor();

    int height = this.getContentHeight();
    // int width = this.getContentWidth();
    int width = this.getWidth();

    // draw corners
    g.drawBitmap(0, 0, 17, 17, blue_bubble, 0, 0); // left top
    g.drawBitmap(width - 11, 0, 10, 10, blue_bubble, 36, 0); // right top
    g.drawBitmap(0, height - 11, 17, 11, blue_bubble, 0, 17); // left bottom
    g.drawBitmap(width - 11, height - 11, 11, 11, blue_bubble, 36, 17); // right bottom
    // draw borders
    g.tileRop(Graphics.ROP_SRC_ALPHA, 17, 0, width - 27, 9, blue_top_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, 7, 17, 10, height - 28, blue_left_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, 17, height - 11, width - 27, 11, blue_bottom_bar, 0, 0);
    g.tileRop(Graphics.ROP_SRC_ALPHA, width - 15, 10, 9, height - 21, blue_right_bar, 0, 0);

    // draw inside bubble
    // g.tileRop(Graphics.ROP_SRC_ALPHA, 17, 10, width-27, height-19, grey_inside_bubble, 0, 0);
    g.setColor(0x00FAFAFA);
    g.fillRect(17, 9, width - 28, height - 19);

    g.setColor(col);
    super.paintBackground(g);
  }
 protected void paintBackground(Graphics graphics) {
   int BGR_COLOR = graphics.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS) ? 0x000000 : 0x393939;
   graphics.setColor(BGR_COLOR);
   graphics.fillRect(0, 0, getPreferredWidth(), getPreferredHeight());
   graphics.setColor(0x000000);
   graphics.drawLine(0, getPreferredHeight() - 1, getPreferredWidth(), getPreferredHeight() - 1);
 }
 protected void paintBackground(Graphics g) {
   int oldColor = g.getColor();
   try {
     g.setColor(0xFFFFFF);
     g.fillRect(0, getVerticalScroll(), getWidth(), getHeight());
   } finally {
     g.setColor(oldColor);
   }
 }
示例#4
0
  protected void paint(Graphics g) {
    g.setColor(Color.WHITE);
    g.fillRect(0, 0, userField.getWidth() + 8, userImage.getHeight());

    g.setColor(Color.GRAY);
    g.drawRect(0, 0, userField.getWidth() + 8, userImage.getHeight());

    super.paint(g);
  }
示例#5
0
 protected void paintBackground(Graphics g) {
   super.paintBackground(g);
   if (myCounter % 2 == 0) {
     g.setColor(Color.WHITE);
   } else {
     g.setColor(0xf8f8f8);
   }
   g.fillRect(0, 0, getWidth(), getHeight());
   g.setColor(0xe4e3e1);
   g.drawLine(0, getHeight() - 1, getWidth(), getHeight() - 1);
 }
示例#6
0
 protected void paint(Graphics g) {
   g.setFont(fontSetting.getFont());
   boolean focus = g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS);
   int textColor = Color.BLACK;
   if (focus) {
     g.setColor(Color.GREEN);
     g.fillRect(0, 0, 5, getHeight());
   }
   if (locked) {
     textColor = Color.GRAY;
     g.drawBitmap(
         getWidth() - 5 - lock.getWidth(),
         (getHeight() - lock.getHeight()) / 2,
         lock.getWidth(),
         lock.getHeight(),
         lock,
         0,
         0);
   } else {
     if (focus) {
       g.drawBitmap(
           getWidth() - 5 - focusArrow.getWidth(),
           (getHeight() - focusArrow.getHeight()) / 2,
           focusArrow.getWidth(),
           focusArrow.getHeight(),
           focusArrow,
           0,
           0);
     } else {
       g.drawBitmap(
           getWidth() - 5 - normalArrow.getWidth(),
           (getHeight() - normalArrow.getHeight()) / 2,
           normalArrow.getWidth(),
           normalArrow.getHeight(),
           normalArrow,
           0,
           0);
     }
   }
   g.drawBitmap(
       25,
       (getHeight() - image.getHeight()) / 2,
       image.getWidth(),
       image.getHeight(),
       image,
       0,
       0);
   g.setColor(textColor);
   g.drawText(title, 5 + 20 + image.getWidth() + 20, (getHeight() - g.getFont().getHeight()) / 2);
 }
  public void paint(Graphics g) {
    // Calculate the slider position
    int sliderHeight = _imageSlider.getHeight();
    int sliderBackYOffset = (_totalHeight - sliderHeight) >> 1;

    // Determine a Background Color for the slider
    int backgroundColor = _defaultBackgroundColour;
    if (_backgroundSelectedColours != null || _backgroundColours != null) {

      if (_selected) {
        backgroundColor =
            _backgroundSelectedColours != null
                ? _backgroundSelectedColours[getState()]
                : _defaultSelectColour;
      } else if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS)) {
        backgroundColor =
            _backgroundColours != null ? _backgroundColours[getState()] : _defaultHoverColour;
      } else {
        backgroundColor = _defaultBackgroundColour;
      }
    }
    g.setColor(backgroundColor);
    g.fillRect(1, sliderBackYOffset + 1, _totalWidth - 2, sliderHeight - 2);

    if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS)) {
      paintSliderBackground(
          g, _imageSliderFocusLeft, _imageSliderFocusCenter, _imageSliderFocusRight);
    } else {
      paintSliderBackground(g, _imageSliderLeft, _imageSliderCenter, _imageSliderRight);
    }

    // Calculate the thumb position
    int thumbXOffset = ((_totalWidth - _thumbWidth) * _currentState) / _numStates;

    // Draw the thumb
    g.drawBitmap(
        thumbXOffset,
        (_totalHeight - _thumbHeight) >> 1,
        _thumbWidth,
        _thumbHeight,
        _imageThumb,
        0,
        0);
  }