Package java.awt

Examples of java.awt.Color


            if (working.intersects(bounds)) {
                page.paintBackground(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
                page.paintMarginAreas(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
                page.paintBorder(c, pagePaintingClearanceWidth, Layer.PAGED_MODE_SCREEN);
               
                Color old = g.getColor();
               
                g.setColor(Color.BLACK);
                g.drawRect(overall.x, overall.y, overall.width, overall.height);
                g.setColor(old);
               
View Full Code Here


      style |= Font.STRIKETHRU;
    String value = props.getProperty(ElementTags.SIZE);
    float size = 12;
    if (value != null)
      size = Float.parseFloat(value);
    Color color = Markup.decodeColor(props.getProperty("color"));
    String encoding = props.getProperty("encoding");
    if (encoding == null)
      encoding = BaseFont.WINANSI;
    return fontImp.getFont(face, encoding, true, size, style, color);
  }
View Full Code Here

      } else if (key.equals(Markup.CSS_KEY_TEXTDECORATION)) {
        String ss = prop.getProperty(key).trim().toLowerCase();
        if (ss.equals(Markup.CSS_VALUE_UNDERLINE))
          h.put("u", null);
      } else if (key.equals(Markup.CSS_KEY_COLOR)) {
        Color c = Markup.decodeColor(prop.getProperty(key));
        if (c != null) {
          int hh = c.getRGB();
          String hs = Integer.toHexString(hh);
          hs = "000000" + hs;
          hs = "#" + hs.substring(hs.length() - 6);
          h.put("color", hs);
        }
View Full Code Here

      } else if (key.equals(Markup.CSS_KEY_TEXTDECORATION)) {
        String ss = prop.getProperty(key).trim().toLowerCase();
        if (ss.equals(Markup.CSS_VALUE_UNDERLINE))
          h.put("u", null);
      } else if (key.equals(Markup.CSS_KEY_COLOR)) {
        Color c = Markup.decodeColor(prop.getProperty(key));
        if (c != null) {
          int hh = c.getRGB();
          String hs = Integer.toHexString(hh);
          hs = "000000" + hs;
          hs = "#" + hs.substring(hs.length() - 6);
          h.put("color", hs);
        }
View Full Code Here

    out = new XMLWriter(s, false, 1); // Indent level == 1
    linesep = System.getProperty("line.separator").toString();
}

public void testXML_1() {
    Color c = new Color(12, 34, 56);
    out.xmlDecl("UTF-8");
    out.startElement("foo");
    out.startElement("bar");
    out.endElement();
    out.startElement("bletch");
    out.attr("color", c);
    out.endElement();
    out.endElement();
    out.close();

    assertEquals("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + linesep
     + "<foo>" + linesep
     + " <bar/>" + linesep
     + " <bletch color=\"" + c.getRed() + ';' + c.getGreen()
     + ';' + c.getBlue() + ';' + c.getAlpha() + "\"/>" + linesep
     + "</foo>" + linesep,
     s.toString());
}
View Full Code Here

        // Use DST_OVER to cause under-painting to occur
        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.DST_OVER,
            0.5f));

        Color c1 = new Color(UIManager.getDefaults().getColor(
            "Tree.selectionBackground").getRGB());
        c1 = c1.darker();

        g2.setPaint(new GradientPaint(0, 0, c1, getWidth(), 0, new Color(255,
            255, 255, 0)));

        // Paint under the JLabel's text
        g2.fillRect(0, 0, getWidth(), mGhostImage.getHeight());
View Full Code Here

              mCueLine.setRect(((PluginTree) ((DropTarget) e.getSource())
                  .getComponent()).getPathBounds(targetPath));

              Graphics2D g2 = (Graphics2D) getGraphics();
              Color c = new Color(255, 0, 0, 40);
              g2.setColor(c);
              g2.fill(mCueLine);
              mPlugin = temp;
            }
          } else {
            e.rejectDrag();
          }
        } catch (Exception e2) {
          e.rejectDrag();
        }

        if (reject && !rejected) {
          e.rejectDrag();
          this.paintImmediately(mCueLine.getBounds());
          mPlugin = null;
          rejected = true;
        }

        Point location = (Point) e.getLocation().clone();

        if (flavors[0].getHumanPresentableName().equals("NodeExport")
            && ((mCurrentPoint.x != location.x) || (mCurrentPoint.y != location.y))) {

          if (!DragSource.isDragImageSupported()) {
            Graphics2D g2 = (Graphics2D) getGraphics();

            Rectangle2D old = (Rectangle2D) mGhostRect.clone();

            // Remember where you are about to draw the new ghost image
            mGhostRect.setRect(location.x + 20, location.y, mGhostImage
                .getWidth(), mGhostImage.getHeight());

            Rectangle2D target = (Rectangle2D) old.clone();
            target.add(mGhostRect);

            BufferedImage bf = new BufferedImage((int) target.getWidth(),
                (int) target.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);
            Graphics2D g2b = bf.createGraphics();

            int width = ((int) (mTreeImage.getWidth() - (target.getX() + target
                .getWidth()))) > 0 ? (int) target.getWidth()
                : (int) (mTreeImage.getWidth() - (target.getX()));
            int height = ((int) (mTreeImage.getHeight() - (target.getY() + target
                .getHeight()))) > 0 ? (int) target.getHeight()
                : (int) (mTreeImage.getHeight() - (target.getY()));

            if (width > 0 && height > 0) {
              g2b.drawImage(mTreeImage.getSubimage((int) target.getX(),
                  (int) target.getY(), width, height), 0, 0, null);
            }

            if (mCueLine.contains(location) && !reject) {
              Rectangle2D temp1 = mCueLine.createIntersection(target);
              double y = 0;

              if (changed) {
                y = mCueLine.getY() - target.getY();
                changed = false;
              }
              temp1.setRect(0, y, temp1.getWidth(), temp1.getHeight());

              Color c = new Color(255, 0, 0, 40);
              g2b.setColor(c);
              if (mCueLine.contains(mCueLine.createIntersection(target))) {
                g2b.fill(temp1);
              }
            }
View Full Code Here

    }
   
    public void setColor(FSColor color) {
        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor)color;
            _color = new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        } else if (color instanceof FSCMYKColor) {
            FSCMYKColor cmyk = (FSCMYKColor)color;
            _color = new CMYKColor(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
        } else {
            throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
View Full Code Here

    // Chart level visible items
    chart.setBorderVisible(visibility.isBorder());
    plot.setOutlineVisible(visibility.isOutline());
   
    // chart level colors
    final Color  BACKGROUND  = new Color(colors.getBg());
    plot.setBackgroundPaint(BACKGROUND);
    chart.setBackgroundPaint(BACKGROUND);
   
    // Chart level title
    if(chart.getTitle() != null){
      TextTitle title = chart.getTitle();
      title.setVisible(visibility.isTitle());
      title.setBackgroundPaint(new Color(colors.getTitleBg()));
      title.setPaint(new Color(colors.getTitle()));
      title.setExpandToFitSpace(true);
    }
   
    // In case of multiple plot read and update child level chart
    if(plot instanceof MultiplePiePlot){
      MultiplePiePlot multiplePiePlot = (MultiplePiePlot)plot;
      chart  = multiplePiePlot.getPieChart();
      plot   = chart.getPlot();
     
      chart.setBorderVisible(visibility.isBorder());
      plot.setOutlineVisible(visibility.isOutline());
     
      chart.setBackgroundPaint(BACKGROUND);
      plot.setBackgroundPaint(BACKGROUND);
    }
   
    if(plot instanceof CategoryPlot){
      CategoryPlot   categoryPlot   = (CategoryPlot)chart.getPlot();
      categoryPlot.setRangeGridlinesVisible(visibility.isRangeGridLines());
      categoryPlot.setOrientation((visibility.getOrientation() != null &&
          visibility.getOrientation() == com.googlecode.jsonwebservice.attachment.PlotOrientation.HORIZONTAL)
          ? PlotOrientation.HORIZONTAL : PlotOrientation.VERTICAL);
      categoryPlot.setRangeZeroBaselineVisible(visibility.isRangeZeroBaseline());
      categoryPlot.setRangeCrosshairVisible(visibility.isRangeCrosshair());
      /**
       * RANGE Axis settings
       */
      ValueAxis     rangeAxis      = categoryPlot.getRangeAxis();
     
      rangeAxis.setAxisLineVisible(visibility.isAxisLine());
      rangeAxis.setTickMarksVisible(visibility.isTickMarks());
      rangeAxis.setMinorTickMarksVisible(visibility.isMinerTickMarks());
     
      Color axisLabel = new Color(colors.getAxisLabel());
      Color tickLabel = new Color(colors.getTickLabel());
     
      rangeAxis.setLabelPaint(axisLabel);
      rangeAxis.setTickLabelPaint(tickLabel);
      if(rangeAxis instanceof NumberAxis){
        NumberAxis numberAxis = (NumberAxis)rangeAxis;
        // rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      }
     
      /**
       * DOAMIN AXIS settings
       */
      CategoryAxis   domainAxis     = categoryPlot.getDomainAxis();
      domainAxis.setAxisLineVisible(visibility.isAxisLine());
      domainAxis.setTickMarksVisible(visibility.isTickMarks());
      domainAxis.setMinorTickMarksVisible(visibility.isMinerTickMarks());
     
      domainAxis.setLabelPaint(axisLabel);
      domainAxis.setTickLabelPaint(tickLabel);
     
      domainAxis.setCategoryLabelPositions(
          CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
     
      CategoryItemRenderer rendrer = categoryPlot.getRenderer();
      for(int index = 0; index < colors.getSeries().size(); index++){
        rendrer.setSeriesPaint(index, new Color(colors.getSeries().get(index)));
      }
    }else if(plot instanceof PiePlot){
      PiePlot piePlot = (PiePlot)plot;
     
      piePlot.setSimpleLabels(visibility.isPieSimpleLabels());
      piePlot.setSectionOutlinesVisible(visibility.isPieOutlines());
      piePlot.setLabelLinksVisible(visibility.isPieLabelLinks());
     
      //piePlot.setExplodePercent("1", 0.07000000000000001D);
      //piePlot.setInteriorGap(0.00D);
      piePlot.setLabelGenerator(new StandardPieSectionLabelGenerator(chartConfig.getDataSettings().getPieSectionLabel()));
      //piePlot.setLabelBackgroundPaint(new Color(220, 220, 220));
      for(int index = 0; index < colors.getSeries().size(); index++){
        piePlot.setSectionPaint(String.valueOf(index), new Color(colors.getSeries().get(index)));
      }
    }
  }
View Full Code Here

   */
  protected void startParsing(final Attributes attrs) throws SAXException
  {
    super.startParsing(attrs);

    final Color color = ColorConverter.getObject(attrs.getValue(getUri(), "color"));
    if ("true".equals(attrs.getValue(getUri(), "enabled")))
    {
      final boolean startState = "true".equals(attrs.getValue(getUri(), "startState"));
      final int itemCount = ParserUtil.parseInt
          (attrs.getValue(getUri(), "switchItemCount"), "Failed to parse", getLocator());
View Full Code Here

TOP

Related Classes of java.awt.Color

Copyright © 2015 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.