Package java.awt

Examples of java.awt.Color


          painter.drawDongle(cent.getX(), cent.getY());
        }
      }
    } else {
      Graphics g = painter.getGraphics();
      Color baseColor = g.getColor();
      GraphicsUtil.switchToWidth(g, 3);
      for (int i = 0; i < inputs; i++) {
        Location offs = factory.getInputOffset(attrs, i);
        Location src = loc.translate(offs.getX(), offs.getY());
        int len = lengths[i];
View Full Code Here


    if (inColor) {
      g.setColor(c == null ? Color.RED : c);
    } else {
      int hue = c == null ? 128
          : (c.getRed() + c.getGreen() + c.getBlue()) / 3;
      g.setColor(new Color(hue, hue, hue));
    }
    GraphicsUtil.switchToWidth(g, 1);
    g.fillOval(x - 4, y - 4, 8, 8);
    g.setColor(Color.BLACK);
    g.drawOval(x - 4, y - 4, 8, 8);
View Full Code Here

      int x0 = x - 15 + (dx > 5 ? 1 : dx < -5 ? -1 : 0);
      int y0 = y + 5 + (dy > 5 ? 1 : dy < 0 ? -1 : 0);
      int x1 = x - 15 + dx;
      int y1 = y + 5 + dy;
      g.drawLine(x0, y0, x1, y1);
      Color ballColor = painter.getAttributeValue(Io.ATTR_COLOR);
      Joystick.drawBall(g, x1, y1, ballColor, true);
    }
View Full Code Here

      repaint();
    }

    public void paintComponent(Graphics g) {

      Color oldColor = g.getColor();

      g.setColor(ScrollableMenu.this.getBackground());
      Rectangle rect = g.getClipBounds();
      g.fillRect(rect.x, rect.y, rect.width, rect.height);
View Full Code Here

    super.paint(graphics);
    final Graphics2D g2 = (Graphics2D) graphics;

    int w = getWidth();
    int h = 70;
    GradientPaint gradient = new GradientPaint(0, 0, new Color(255, 255, 255, 255), 2, h, new Color(255, 255, 255, 0), false);
    g2.setPaint(gradient);
    g2.fillRect(0, 0, w, h);

    gradient = new GradientPaint(0, getHeight() - h, new Color(255, 255, 255, 0), 2, getHeight(), new Color(255, 255, 255, 255), false);
    g2.setPaint(gradient);
    g2.fillRect(0, getHeight() - h, w, h);
  }
View Full Code Here

    mSearchField.requestFocusInWindow();
    if(changed(mComponent, mSearchField.getText(), bias)) {
      reset();
    }
    else {
      mSearchField.setBackground(new Color(255,102,102));
      mSearchField.setForeground(Color.white);
      mMessage.setVisible(true);
    }
  }
View Full Code Here

    descTA.setOpaque(false);
    descTA.setWrapStyleWord(true);
    descTA.setLineWrap(true);
    descTA.setFocusable(false);

    Color bg = new JPanel().getBackground();

    descTA.setBackground(new Color(bg.getRed(),bg.getGreen(),bg.getBlue()));

    return descTA;
  }
View Full Code Here

      this.size = size;
      this.priority = priority;
    }

    public void paintIcon(Component c, Graphics g, int x, int y) {
      Color color = c == null ? Color.GRAY : c.getBackground();
      // In a compound sort, make each successive triangle 20%
      // smaller than the previous one.
      int dx = (int) (Math.pow(0.8, priority) * size / 2);
      int dy = descending ? dx : -dx;
      // Align icon (roughly) with font baseline.
      y = y + 5 * size / 6 + (descending ? -dy : 0);
      int shift = descending ? 1 : -1;
      g.translate(x, y);

      // Right diagonal.
      g.setColor(color.darker());
      g.drawLine(dx / 2, dy, 0, 0);
      g.drawLine(dx / 2, dy + shift, 0, shift);

      // Left diagonal.
      g.setColor(color.brighter());
      g.drawLine(dx / 2, dy, dx, 0);
      g.drawLine(dx / 2, dy + shift, dx, shift);

      // Horizontal line.
      if (descending) {
        g.setColor(color.darker().darker());
      } else {
        g.setColor(color.brighter().brighter());
      }
      g.drawLine(dx, 0, 0, 0);

      g.setColor(color);
      g.translate(-x, -y);
View Full Code Here

        int progressX = 0;
        if (progLength > 0) {
          progressX = elapsedMinutes * width / progLength;
        }

        Color c = Settings.propProgramTableColorOnAirDark.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        int fillWidth = progressX - borderWidth;
        if (fillWidth > 0) {
          grp.fillRect(borderWidth, borderWidth, fillWidth, height - borderWidth);
        }
        c = Settings.propProgramTableColorOnAirLight.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        fillWidth = width - progressX - borderWidth * 2;
        if (fillWidth > 0) {
          grp.fillRect(progressX, borderWidth, fillWidth, height - borderWidth);
        }

      } else {
        // vertical filling panel
        int progressY = 0;
        if (progLength > 0) {
          progressY = elapsedMinutes * height / progLength;
        }

        Color c = Settings.propProgramTableColorOnAirDark.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        int fillHeight = progressY - borderWidth;

        if (fillHeight > height) {
          mLog.severe("paint program panel: fill height 1 to large");
          fillHeight = height;
        }

        if (fillHeight > 0) {
          grp.fillRect(borderWidth, borderWidth, width - borderWidth * 2, fillHeight);
        }

        c = Settings.propProgramTableColorOnAirLight.getColor();
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(c.getAlpha()*mProgramImportance/10.)));

        fillHeight = height - progressY - borderWidth;

        if (fillHeight > height) {
          mLog.severe("paint program panel: fill height 2 to large");
          fillHeight = height;
        }

        if (fillHeight > 0) {
          grp.fillRect(borderWidth, progressY, width - borderWidth * 2, fillHeight);
        }
      }
      if (Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean()) {
        grp.draw3DRect(0, 0, width - 1, height - 1, true);
      }
    }

    // If there are plugins that have marked the program -> paint the background
    Marker[] markedByPluginArr = mProgram.getMarkerArr();
    if (markedByPluginArr.length != 0) {
      Color c = Plugin.getPluginManager().getTvBrowserSettings().getColorForMarkingPriority(mProgram.getMarkPriority());

      if(c == null) {
        c = Settings.propProgramPanelMarkedMinPriorityColor.getColor();
      }

      int alphaValue = (int)(c.getAlpha()*mProgramImportance/10.);

      if(mProgram.isExpired()) {
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(alphaValue*6/10.)));
      }
      else {
        grp.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(), alphaValue));
      }

      if(mProgram.getMarkPriority() > Program.NO_MARK_PRIORITY) {
        if(Settings.propProgramPanelWithMarkingsShowingBoder.getBoolean()) {
          grp.fill3DRect(0, 0, width, height, true);
        }
        else {
          grp.fillRect(0, 0, width, height);
        }
      }
    }

    if (mMouseOver || mIsSelected) {
      Color test = Settings.propProgramTableMouseOverColor.getColor();
      if (mIsSelected) {
        test = Settings.propKeyboardSelectedColor.getColor();
      }
      grp.setColor(test);
      grp.fillRect(0, 0, width - 1, height - 1);

      Stroke str = grp.getStroke();
      Color col = grp.getColor();
      float[] dash = { 2.0f };
      int lineWidth = 1;
      BasicStroke dashed = new BasicStroke(lineWidth, BasicStroke.CAP_BUTT,
          BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
      grp.setColor(Color.BLACK);
      grp.setStroke(dashed);

      grp.drawRect(lineWidth - 1, lineWidth - 1, width - lineWidth, height - lineWidth);

      grp.setStroke(str);
      grp.setColor(col);
    }

    // Draw all the text
    if (mPaintExpiredProgramsPale && mProgram.isExpired()) {
      Color c = new Color(Color.gray.getRed(), Color.gray.getGreen(), Color.gray.getBlue(), (int)(Color.gray.getAlpha()*mProgramImportance/10.));

      setForeground(c);
      grp.setColor(c);
    } else {
      Color c = new Color(mTextColor.getRed(), mTextColor.getGreen(), mTextColor.getBlue(), (int)(mTextColor.getAlpha()*mProgramImportance/10.));

      setForeground(c);
      grp.setColor(c);
    }
    grp.setFont(ProgramPanel.mTimeFont);
View Full Code Here

            mSwitched = true;
            mOldIndex = i;
            paint = true;
          }
          if(paint) {
            Color c = new Color(255,0,0,180);
            g2.setColor(c);
            g2.fill(mCueLine);
          }
        }
      }
View Full Code Here

TOP

Related Classes of java.awt.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.