Package java.awt

Examples of java.awt.Color


  public ColorButton(final ColorLabel lb) {
    super(mLocalizer.msg("Change", "Change"));
    addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Color newColor = AlphaColorChooser.showDialog(UiUtilities.getBestDialogParent(getParent()), mLocalizer.msg(
            "ChooseColor", "Please choose the Color"), lb.getColor(), lb.getStandardColor());
        lb.setColor(newColor);

      }
    });
View Full Code Here


        float l = rect.getLeft();
        float wt = rect.getBorderWidthTop();
        float wb = rect.getBorderWidthBottom();
        float wr = rect.getBorderWidthRight();
        float wl = rect.getBorderWidthLeft();
        Color ct = rect.getBorderColorTop();
        Color cb = rect.getBorderColorBottom();
        Color cr = rect.getBorderColorRight();
        Color cl = rect.getBorderColorLeft();
        saveState();
        setLineCap(PdfContentByte.LINE_CAP_BUTT);
        setLineJoin(PdfContentByte.LINE_JOIN_MITER);
        float clw = 0;
        boolean cdef = false;
        Color ccol = null;
        boolean cdefi = false;
        Color cfil = null;
        // draw top
        if (wt > 0) {
            setLineWidth(clw = wt);
            cdef = true;
            if (ct == null)
View Full Code Here

        float y1 = rectangle.getBottom();
        float x2 = rectangle.getRight();
        float y2 = rectangle.getTop();

        // the backgroundcolor is set
        Color background = rectangle.getBackgroundColor();
        if (background != null) {
            setColorFill(background);
            rectangle(x1, y1, x2 - x1, y2 - y1);
            fill();
            resetRGBColorFill();
        }

        // if the element hasn't got any borders, nothing is added
        if (! rectangle.hasBorders()) {
            return;
        }

        // if any of the individual border colors are set
        // we draw the borders all around using the
        // different colors
        if (rectangle.isUseVariableBorders()) {
            variableRectangle(rectangle);
        }
        else {
            // the width is set to the width of the element
            if (rectangle.getBorderWidth() != Rectangle.UNDEFINED) {
                setLineWidth(rectangle.getBorderWidth());
            }

            // the color is set to the color of the element
            Color color = rectangle.getBorderColor();
            if (color != null) {
                setColorStroke(color);
            }

            // if the box is a rectangle, it is added as a rectangle
View Full Code Here

        if (llx > urx) { float x = llx; llx = urx; urx = x; }
        if (lly > ury) { float y = lly; lly = ury; ury = y; }
        // silver circle
        setLineWidth(1);
        setLineCap(1);
        setColorStroke(new Color(0xC0, 0xC0, 0xC0));
        arc(llx + 1f, lly + 1f, urx - 1f, ury - 1f, 0f, 360f);
        stroke();
        // gray circle-segment
        setLineWidth(1);
        setLineCap(1);
        setColorStroke(new Color(0xA0, 0xA0, 0xA0));
        arc(llx + 0.5f, lly + 0.5f, urx - 0.5f, ury - 0.5f, 45, 180);
        stroke();
        // black circle-segment
        setLineWidth(1);
        setLineCap(1);
        setColorStroke(new Color(0x00, 0x00, 0x00));
        arc(llx + 1.5f, lly + 1.5f, urx - 1.5f, ury - 1.5f, 45, 180);
        stroke();
        if (on) {
            // gray circle
            setLineWidth(1);
            setLineCap(1);
            setColorFill(new Color(0x00, 0x00, 0x00));
            arc(llx + 4f, lly + 4f, urx - 4f, ury - 4f, 0, 360);
            fill();
        }
    }
View Full Code Here

     */  
    public void drawTextField(float llx, float lly, float urx, float ury) {
        if (llx > urx) { float x = llx; llx = urx; urx = x; }
        if (lly > ury) { float y = lly; lly = ury; ury = y; }
        // silver rectangle not filled
        setColorStroke(new Color(0xC0, 0xC0, 0xC0));
        setLineWidth(1);
        setLineCap(0);
        rectangle(llx, lly, urx - llx, ury - lly);
        stroke();
        // white rectangle filled
        setLineWidth(1);
        setLineCap(0);
        setColorFill(new Color(0xFF, 0xFF, 0xFF));
        rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury -lly - 1f);
        fill();
        // silver lines
        setColorStroke(new Color(0xC0, 0xC0, 0xC0));
        setLineWidth(1);
        setLineCap(0);
        moveTo(llx + 1f, lly + 1.5f);
        lineTo(urx - 1.5f, lly + 1.5f);
        lineTo(urx - 1.5f, ury - 1f);
        stroke();
        // gray lines
        setColorStroke(new Color(0xA0, 0xA0, 0xA0));
        setLineWidth(1);
        setLineCap(0);
        moveTo(llx + 1f, lly + 1);
        lineTo(llx + 1f, ury - 1f);
        lineTo(urx - 1f, ury - 1f);
        stroke();
        // black lines
        setColorStroke(new Color(0x00, 0x00, 0x00));
        setLineWidth(1);
        setLineCap(0);
        moveTo(llx + 2f, lly + 2f);
        lineTo(llx + 2f, ury - 2f);
        lineTo(urx - 2f, ury - 2f);
View Full Code Here

     */
    public void drawButton(float llx, float lly, float urx, float ury, String text, BaseFont bf, float size) {
        if (llx > urx) { float x = llx; llx = urx; urx = x; }
        if (lly > ury) { float y = lly; lly = ury; ury = y; }
        // black rectangle not filled
        setColorStroke(new Color(0x00, 0x00, 0x00));
        setLineWidth(1);
        setLineCap(0);
        rectangle(llx, lly, urx - llx, ury - lly);
        stroke();
        // silver rectangle filled
        setLineWidth(1);
        setLineCap(0);
        setColorFill(new Color(0xC0, 0xC0, 0xC0));
        rectangle(llx + 0.5f, lly + 0.5f, urx - llx - 1f, ury -lly - 1f);
        fill();
        // white lines
        setColorStroke(new Color(0xFF, 0xFF, 0xFF));
        setLineWidth(1);
        setLineCap(0);
        moveTo(llx + 1f, lly + 1f);
        lineTo(llx + 1f, ury - 1f);
        lineTo(urx - 1f, ury - 1f);
        stroke();
        // dark grey lines
        setColorStroke(new Color(0xA0, 0xA0, 0xA0));
        setLineWidth(1);
        setLineCap(0);
        moveTo(llx + 1f, lly + 1f);
        lineTo(urx - 1f, lly + 1f);
        lineTo(urx - 1f, ury - 1f);
View Full Code Here

            chart.getXYPlot().setRenderer(renderer);
        }

        if (chart != null) {
            chart.setAntiAlias(true);
            chart.setBackgroundPaint(new Color(backgroundColor));
            for (int i = 0; i < SERIES_NUM; i++) {
                if (seriesColor[i] >= 0) {
                    chart.getXYPlot().getRenderer().setSeriesPaint(i, new Color(seriesColor[i]));
                }
                if (seriesOutlineColor[i] >= 0) {
                    chart.getXYPlot().getRenderer().setSeriesOutlinePaint(i, new Color(seriesOutlineColor[i]));
                }
            }
            chart.getXYPlot().setDomainGridlinePaint(new Color(gridColor));
            chart.getXYPlot().setRangeGridlinePaint(new Color(gridColor));
            chart.getXYPlot().setDomainAxis(0, new DateAxis());
            chart.getXYPlot().setDomainAxis(1, new DateAxis());
            chart.getXYPlot().setInsets(new RectangleInsets(-15, 0, 0, 10));

            response.setHeader("Content-type", "image/png");
View Full Code Here

    float y2 = cell.getTop() + yPos;
    float x2 = cell.getRight() + xPos;
    float y1 = y2 - maxHeight;

    // the backgroundcolor is set
    Color background = cell.getBackgroundColor();
    if (background != null) {
      backgr.setColorFill(background);
      backgr.rectangle(x1, y1, x2 - x1, y2 - y1);
      backgr.fill();
        }
    // if the element hasn't got any borders, nothing is added
    if (cell.hasBorders()) {
      if (cell.isUseVariableBorders()) {
        Rectangle borderRect = new Rectangle(cell.getLeft() + xPos, cell
            .getTop()
            - maxHeight + yPos, cell.getRight() + xPos, cell.getTop()
            + yPos);
        borderRect.cloneNonPositionParameters(cell);
                borderRect.setBackgroundColor(null);
        lines.rectangle(borderRect);
      } else {
        // the width is set to the width of the element
        if (cell.getBorderWidth() != Rectangle.UNDEFINED) {
          lines.setLineWidth(cell.getBorderWidth());
        }
        // the color is set to the color of the element
        Color color = cell.getBorderColor();
        if (color != null) {
          lines.setColorStroke(color);
        }

        // if the box is a rectangle, it is added as a rectangle
View Full Code Here

    panel.add(mBorderForOnAirPrograms = new JCheckBox(mLocalizer.msg("color.programOnAirWithBorder",
        "Border for programs on air"), Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean()), cc.xyw(2, panel.getRowCount(),
        3));

    JPanel colors = new JPanel();
    Color programItemProgressColor = Settings.propProgramTableColorOnAirDark.getColor();
    Color programItemOnAirColor = Settings.propProgramTableColorOnAirLight.getColor();
    Color programItemKeyboardSelectedColor = Settings.propKeyboardSelectedColor.getColor();

    Color programItemDefaultProgressColor = Settings.propProgramTableColorOnAirDark.getDefaultColor();
    Color programItemDefaultOnAirColor = Settings.propProgramTableColorOnAirLight.getDefaultColor();
    Color programItemDefaultKeyboardSelectedColor = Settings.propKeyboardSelectedColor.getDefaultColor();

    FormLayout formLayout = new FormLayout("default, 5dlu, default, 5dlu, default, 5dlu, default",
        "5dlu, default, 3dlu, default, 3dlu, default");
    colors.setLayout(formLayout);
View Full Code Here

* Called by the command that edits the suppression proc of a section.
*
* @param isHidden new suppressed state
*/
public void setHidden(boolean isHidden) {
    Color c = isHidden ? SectionWidget.SUPPRESSED_COLOR
  : SectionWidget.NORMAL_COLOR;
    setBackground(c);
    Component[] kids = getComponents();
    for (int i = 0; i < kids.length; ++i)
  kids[i].setBackground(c);
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.