Package java.awt

Examples of java.awt.Color$ColorPaintContext


    repaint();
  }
 
  private void resetBackground() {
    Color temp = Settings.propProgramTableBackgroundSingleColor.getColor();
   
    Settings.propProgramTableBackgroundSingleColor.setColor(Color.white);
    repaint();
    Settings.propProgramTableBackgroundSingleColor.setColor(temp);
  }
View Full Code Here


          }
          mCueLine.setRect(rect);
        }

        Graphics2D g2 = (Graphics2D) getGraphics();
        Color c = new Color(255, 0, 0, mCueLine.getHeight() > 2 ? 40 : 180);
        g2.setColor(c);
        g2.fill(mCueLine);
      }

      return true;
View Full Code Here

    if (!menuItem.isArmed() && (isMarked || isOnAir || mTime != -1)) {
      g.setColor(Color.white);
      g.fillRect(x, top, menuItem.getWidth(), bottom);
    }

    Color markedColor = Plugin.getPluginManager().getTvBrowserSettings().getColorForMarkingPriority(
        mProgram.getMarkPriority());

    if (isMarked) {
      if (markedColor != null) {
        g.setColor(markedColor);
      }
      g.fillRect(x, top, menuItem.getWidth(), bottom);
    }

    if (isOnAir || mTime != -1) {
      int minutesAfterMidnight = mTime != -1 ? mTime : IOUtilities.getMinutesAfterMidnight();
      int progLength = mProgram.getLength();
      int startTime = mProgram.getHours() * 60 + mProgram.getMinutes();
      int elapsedMinutes;
      if (minutesAfterMidnight < startTime) {
        // The next day has begun -> we have to add 24 * 60 minutes
        // Example: Start time was 23:50 = 1430 minutes after midnight
        // now it is 0:03 = 3 minutes after midnight
        // elapsedMinutes = (24 * 60) + 3 - 1430 = 13 minutes
        elapsedMinutes = (24 * 60) + minutesAfterMidnight - startTime;
      } else {
        elapsedMinutes = minutesAfterMidnight - startTime;
      }

      int progressX = 0;
      if (progLength > 0) {
        progressX = elapsedMinutes * (width - i.left - i.right) / progLength;
      }

      if (!isMarked) {
        g.setColor(mTime == -1 ? Settings.propProgramTableColorOnAirLight.getColor()
            : Settings.propTrayOnTimeProgramsLightBackground.getColor());
        g.fillRect(x + progressX - i.right - i.left, top, width - progressX + i.right + i.left, bottom);
      }
      g.setColor(mTime == -1 ? Settings.propProgramTableColorOnAirDark.getColor() : isMarked ? new Color(markedColor
          .darker().getRed(), markedColor.darker().getGreen(), markedColor.darker().getBlue(), (markedColor
          .darker().getAlpha() / 3)) : Settings.propTrayOnTimeProgramsDarkBackground.getColor());

      g.fillRect(x, top, progressX - i.right - i.left, bottom);
    } else if (mProgram.isExpired()) {
      ((ProgramMenuItem) menuItem).stopTimer();
View Full Code Here

        new FormLayout("default:grow,default,default:grow",
            "default,fill:default:grow,default"),
        (JPanel)getContentPane());
   
    JLabel l = pb.addLabel(mLocalizer.msg("header","TV-Browser was updated from {0} to {1}!",oldTvBrowserVersion,TVBrowser.VERSION), cc.xy(2,1));
    l.setForeground(new Color(200,0,0));
    l.setFont(l.getFont().deriveFont(Font.BOLD,22));
    l.setBorder(Borders.createEmptyBorder("10dlu,0dlu,5dlu,0dlu"));
   
    JEditorPane pane = UiUtilities.createHtmlHelpTextArea(mLocalizer.msg("text","<div style=\"font-size:large;text-align:justify\"><p>TV-Browser is developed on a regular basis. Every version contains changes to improve TV-Browser, but sometimes it is necessary to change some functions that could lead to discontinued support for old Plugin versions.</p><br><div style=\"font-weight:bold;color:red\">We recommend to update all installed plugins now.</div><p>You will need an Internet connection.</b> If you currently don't have an internet connection we recommend to close TV-Browser now and using the previous version until a Plugin update is possible.</p><p>Do you want to update your Plugins now (this may take some time)?</p></div>"),
        new HyperlinkListener() {
View Full Code Here

              mTrayIcon = new TrayIcon(ImageIO.read(new File("imgs/TrayIcon.png")), tooltip);
            }
            else {
              Dimension trayIconSize = getTrayIconSize();
              BufferedImage trayIconImage = null;
              Color backgroundColor = null;

              if(trayIconSize.height > 16 && trayIconSize.height <= 32 && new File("imgs/tvbrowser32.png").isFile()) {
                trayIconImage = UiUtilities.scaleIconToBufferedImage(ImageIO.read(new File("imgs/tvbrowser32.png")),
                    trayIconSize.width, trayIconSize.height, BufferedImage.TYPE_INT_ARGB, backgroundColor);
              }
View Full Code Here

         
          if(m_colorList.size()==0)
            m_colorList.addElement(Color.black);
          for(int i=m_colorList.size();
          i < m_data.attribute(m_classIndex).numValues()+1; i++) {
            Color pc = m_defaultColors[(i-1) % 10];
            int ija =  (i-1) / 10;
            ija *= 2;
           
            for (int j=0;j<ija;j++) {
              pc = pc.darker();
            }
           
            m_colorList.addElement(pc);
          }
         
View Full Code Here

         
          if(m_colorList.size()==0)
            m_colorList.addElement(Color.black);
          for(int i = m_colorList.size();
          i < m_data.attribute(m_classIndex).numValues()+1; i++) {
            Color pc = m_defaultColors[(i-1) % 10];
            int ija =  (i-1) / 10;
            ija *= 2;
            for (int j=0;j<ija;j++) {
              pc = pc.darker();
            }
            m_colorList.addElement(pc);
          }
         
          for(int k=0; k<m_data.numInstances(); k++) {
View Full Code Here

/**
* Returns field color based on visibility.
*/
public Color getColor(Format format) {
    Color color = format.getColor();
    if (!field.isVisible()) {  // If hidden, lighten color
  if (color.equals(Color.black))
      color = HIDDEN_FG_COLOR;
  else {
      float[] hsb = new float[3];

      Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(),
         hsb);
      hsb[1] = (float)0.5; // Saturation
      hsb[2] = (float)0.9; // Brightness
      color = Color.getHSBColor(hsb[0], hsb[1], hsb[2]);
  }
View Full Code Here

  public static Color decodeColor(String s) {
    if (s == null)
      return null;
    s = s.toLowerCase().trim();
    Color c = WebColors.getRGBColor(s);
    if (c != null)
      return c;
    try {
      if (s.startsWith("#")) {
        if (s.length() == 4)
          s = "#" + s.substring(1, 2) + s.substring(1, 2)
              + s.substring(2, 3) + s.substring(2, 3)
              + s.substring(3, 4) + s.substring(3, 4);
        if (s.length() == 7)
          return new Color(Integer.parseInt(s.substring(1), 16));
      } else if (s.startsWith("rgb")) {
        StringTokenizer tk = new StringTokenizer(s.substring(3),
            " \t\r\n\f(),");
        int[] cc = new int[3];
        for (int k = 0; k < 3; ++k) {
          if (!tk.hasMoreTokens())
            return null;
          String t = tk.nextToken();
          float n;
          if (t.endsWith("%")) {
            n = Float.parseFloat(t.substring(0, t.length() - 1));
            n = n * 255f / 100f;
          } else
            n = Float.parseFloat(t);
          int ni = (int) n;
          if (ni > 255)
            ni = 255;
          else if (ni < 0)
            ni = 0;
          cc[k] = ni;
        }
        return new Color(cc[0], cc[1], cc[2]);
      }
    } catch (Exception e) {
    }
    return null;
  }
View Full Code Here

  protected Color getHighlightColor() {
    int code = getProperty(KEY_HIGHLIGHT_COLOR, -1);
    if (code == -1) {
      return Color.PINK;
    }
    return new Color(code, true);
  }
View Full Code Here

TOP

Related Classes of java.awt.Color$ColorPaintContext

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.