Example usage for java.awt Color gray

List of usage examples for java.awt Color gray

Introduction

In this page you can find the example usage for java.awt Color gray.

Prototype

Color gray

To view the source code for java.awt Color gray.

Click Source Link

Document

The color gray.

Usage

From source file:com.wcmc.Software.screens.RegistrationScreen.java

@Override
public void reloadControls() {
    controls.clear();/*from  w ww . j a  va  2  s . c  o  m*/
    existingRiderControls.clear();

    btnNewRider = new Button();
    btnNewRider.setText("New Rider");
    btnNewRider.setLocation(8, 90);
    controls.add(btnNewRider);

    btnExistingRider = new Button();
    btnExistingRider.setText("Existing Rider");
    btnExistingRider.setLocation(115, 90);
    controls.add(btnExistingRider);

    Button btnRainout = new Button();
    btnRainout.setText("Rain Out");
    btnRainout.setLocation(Client.WIDTH - btnRainout.getWidth() - 125, 90);
    controls.add(btnRainout);

    Button btnClear = new Button();
    btnClear.setText("Clear Attendance");
    btnClear.setWidth(Button.DEFAULT_WIDTH + 10);
    btnClear.setLocation(Client.WIDTH - btnClear.getWidth() - 10, 90);
    controls.add(btnClear);

    txtSearch = new Textbox();
    txtSearch.setText("Search For Rider...");
    txtSearch.setLocation(222, 90);
    txtSearch.setWidth(400);
    txtSearch.setCentered(false);
    txtSearch.setForeColor(Color.GRAY);
    existingRiderControls.add(txtSearch);

    classes.setLocation(8, 120);
    classRiders.setLocation(145, 120);
    rider.setWidth(650);
    rider.setLocation(Client.WIDTH - rider.getWidth() - 10, 120);
}

From source file:nl.strohalm.cyclos.utils.jfreeAsymmetric.AsymmetricStatisticalBarRenderer.java

/**
 * Default constructor.
 */
public AsymmetricStatisticalBarRenderer() {
    super();
    errorIndicatorPaint = Color.gray;
}

From source file:it.alus.GPSreceiver.instruments.Speedometer.java

public Speedometer(int Vs0, int Vfe, int Vs, int Vno, int Vne, int endScaleKmh) {
    super(null);//from w w  w .  ja  va2 s .  c  o m
    currentGroundSpeedKmh = 0;
    if (!setArcs(Vs0, Vfe, Vs, Vno, Vne, endScaleKmh)) {
        this.Vx = 90;
        this.Vy = 100;
        this.Vs0 = 45;
        this.Vs = 55;
        this.Vfe = 86;
        this.Va = 135;
        this.Vno = 160;
        this.Vne = 180;
        this.endScale = 185;
    }
    groundSpeedDataset = new DefaultValueDataset(0);
    totalSpeedDataset = new DefaultValueDataset(0);
    DialPlot dialplot = new DialPlot();
    dialplot.setDataset(0, groundSpeedDataset);
    dialplot.setDataset(1, totalSpeedDataset);
    StandardDialFrame dialFrame = new StandardDialFrame();
    dialFrame.setBackgroundPaint(Color.lightGray);
    dialFrame.setForegroundPaint(Color.gray);
    DialBackground db = new DialBackground(Color.black);
    dialplot.setBackground(db);
    dialplot.setDialFrame(dialFrame);

    DialTextAnnotation dialtextannotation = new DialTextAnnotation("Km/h");
    dialtextannotation.setFont(new Font("Arial", 1, 14));
    dialtextannotation.setRadius(0.4D);
    dialtextannotation.setPaint(Color.lightGray);
    dialplot.addLayer(dialtextannotation);

    //DialValueIndicator dialvalueindicator = new DialValueIndicator(0);
    //dialplot.addLayer(dialvalueindicator);
    DialValueIndicator groundIndicator = new DialValueIndicator(0);
    groundIndicator.setFont(new Font("Dialog", 0, 10));
    groundIndicator.setOutlinePaint(Color.green);
    groundIndicator.setRadius(0.3);
    groundIndicator.setAngle(-110D);
    dialplot.addLayer(groundIndicator);
    DialValueIndicator realIndicator = new DialValueIndicator(1);
    realIndicator.setFont(new Font("Dialog", 0, 10));
    realIndicator.setOutlinePaint(Color.cyan);
    realIndicator.setRadius(0.3);
    realIndicator.setAngle(-70);
    dialplot.addLayer(realIndicator);
    StandardDialScale scale = new StandardDialScale(0, endScale, 90, -350, 10, 5);
    scale.setFirstTickLabelVisible(true);
    scale.setTickRadius(0.9D);
    scale.setTickLabelOffset(0.14999999999999999D);
    NumberFormat formatter = new DecimalFormat("#");
    scale.setTickLabelFormatter(formatter);
    scale.setTickLabelFont(new Font("Arial", Font.BOLD, 16));
    scale.setMajorTickPaint(Color.white);
    scale.setMinorTickPaint(Color.lightGray);
    scale.setTickLabelPaint(Color.white);
    dialplot.addScale(0, scale);
    dialplot.addPointer(new org.jfree.chart.plot.dial.DialPointer.Pin());
    DialCap dialcap = new DialCap();
    dialcap.setRadius(0.10);
    dialcap.setFillPaint(Color.lightGray);
    dialplot.setCap(dialcap);
    jChart = new JFreeChart(dialplot);
    StandardDialRange standarddialrange = new StandardDialRange(this.Vne, endScale, Color.red);
    standarddialrange.setInnerRadius(0.54D);
    standarddialrange.setOuterRadius(0.56D);
    dialplot.addLayer(standarddialrange);
    StandardDialRange standarddialrange1 = new StandardDialRange(this.Vno, this.Vne, Color.yellow);
    standarddialrange1.setInnerRadius(0.54D);
    standarddialrange1.setOuterRadius(0.56D);
    dialplot.addLayer(standarddialrange1);
    StandardDialRange standarddialrange2 = new StandardDialRange(this.Vs, this.Vno, Color.green);
    standarddialrange2.setInnerRadius(0.54D);
    standarddialrange2.setOuterRadius(0.56D);
    dialplot.addLayer(standarddialrange2);
    StandardDialRange standarddialrange3 = new StandardDialRange(this.Vs0, this.Vfe, Color.white);
    standarddialrange3.setInnerRadius(0.50D);
    standarddialrange3.setOuterRadius(0.52D);
    dialplot.addLayer(standarddialrange3);
    //dialplot.removePointer(0);
    Pointer realPointer = new Pointer(1);
    realPointer.setFillPaint(Color.cyan);
    dialplot.addPointer(realPointer);
    Pointer groundPointer = new Pointer(0);
    groundPointer.setFillPaint(Color.green);
    dialplot.addPointer(groundPointer);

    /* PER NASCONDERE GLI INDICATORI
    groundIndicator.setVisible(false);
    realIndicator.setVisible(false);
    groundPointer.setVisible(false);
    realPointer.setVisible(false);
    */

    super.setChart(jChart);
    super.setPreferredSize(new Dimension(400, 400));
}

From source file:com.wattzap.view.graphs.DistributionGraph.java

public DistributionGraph(ArrayList<Telemetry> telemetry[], DistributionAccessor da, String domainLabel,
        int scale) {
    super();/*www  .  j a v  a  2s.co m*/

    this.telemetry = telemetry;
    this.da = da;

    // create the chart...
    JFreeChart chart = ChartFactory.createBarChart("", domainLabel, // domain
            // axis
            // label
            "Time %", // range axis label
            null, // data
            PlotOrientation.VERTICAL, // orientation
            false, // include legend
            true, // tooltips?
            false // URLs?
    );

    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    plot = (CategoryPlot) chart.getPlot();

    // set the range axis to display integers only...
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // disable bar outlines...
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    // set up gradient paints for series...
    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.gray, 0.0f, 0.0f, new Color(0, 0, 64));
    renderer.setSeriesPaint(0, gp0);

    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    // OPTIONAL CUSTOMISATION COMPLETED.

    chartPanel = new ChartPanel(chart);
    chartPanel.setSize(100, 800);
    chartPanel.setFillZoomRectangle(true);
    chartPanel.setMouseWheelEnabled(true);
    setLayout(new BorderLayout());
    add(chartPanel, BorderLayout.CENTER);

    BucketPanel bucketPanel = new BucketPanel(this, scale);
    add(bucketPanel, BorderLayout.SOUTH);

    setBackground(Color.black);
    chartPanel.revalidate();
    setVisible(true);
}

From source file:edu.cmu.sv.modelinference.eventtool.charting.DataChart.java

private void createChartPanel(JFreeChart chart) {
    chartPanel = new ChartPanel(chart);

    chartPanel.addChartMouseListener(new ChartMouseListener() {

        @Override/* w  w w  .j av a2  s  .  co  m*/
        public void chartMouseClicked(ChartMouseEvent arg0) {
            //ignore
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent event) {
            Rectangle2D dataArea = chartPanel.getScreenDataArea();
            JFreeChart chart = event.getChart();
            XYPlot plot = (XYPlot) chart.getPlot();
            ValueAxis xAxis = plot.getDomainAxis();
            double x = xAxis.java2DToValue(event.getTrigger().getX(), dataArea, RectangleEdge.BOTTOM);
            ValueAxis yAxis = plot.getRangeAxis();
            double y = yAxis.java2DToValue(event.getTrigger().getY(), dataArea, RectangleEdge.LEFT);

            //Alternatively, obtain y for one of the subplots, which would be very neat.
            //We should find the "nearest" subplot to the cursor -- this is easy
            //double y = DatasetUtilities.findYValue(plot.getDataset(), 0, x);
            xCrosshair.setValue(x);
            yCrosshair.setValue(y);
        }
    });

    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    xCrosshair = new Crosshair(Double.NaN, Color.GRAY, new BasicStroke(0f));
    xCrosshair.setLabelVisible(true);
    yCrosshair = new Crosshair(Double.NaN, Color.GRAY, new BasicStroke(0f));
    yCrosshair.setLabelVisible(true);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    crosshairOverlay.addRangeCrosshair(yCrosshair);
    chartPanel.addOverlay(crosshairOverlay);

    chartPanel.setPreferredSize(new java.awt.Dimension(800, 600));
    setContentPane(chartPanel);
}

From source file:org.jrecruiter.service.impl.DataServiceImpl.java

/** {@inheritDoc} */
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public Image getGoogleMapImage(final BigDecimal latitude, final BigDecimal longitude, final Integer zoomLevel) {

    if (longitude == null) {
        throw new IllegalArgumentException("Longitude cannot be null.");
    }//ww  w  .  j a  va  2s  .com

    if (latitude == null) {
        throw new IllegalArgumentException("Latitude cannot be null.");
    }

    if (zoomLevel == null) {
        throw new IllegalArgumentException("ZoomLevel cannot be null.");
    }

    final URI url = GoogleMapsUtils.buildGoogleMapsStaticUrl(latitude, longitude, zoomLevel);

    BufferedImage img;
    try {
        URLConnection conn = url.toURL().openConnection();
        img = ImageIO.read(conn.getInputStream());
    } catch (UnknownHostException e) {
        LOGGER.error("Google static MAPS web service is not reachable (UnknownHostException).", e);
        img = new BufferedImage(GoogleMapsUtils.defaultWidth, 100, BufferedImage.TYPE_INT_RGB);

        final Graphics2D graphics = img.createGraphics();

        final Map<Object, Object> renderingHints = CollectionUtils.getHashMap();
        renderingHints.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        graphics.addRenderingHints(renderingHints);
        graphics.setBackground(Color.WHITE);
        graphics.setColor(Color.GRAY);
        graphics.clearRect(0, 0, GoogleMapsUtils.defaultWidth, 100);

        graphics.drawString("Not Available", 30, 30);

    } catch (IOException e) {
        throw new IllegalStateException(e);
    }

    return img;
}

From source file:org.sonar.plugins.scmstats.charts.PieChart3D.java

@Override
protected Plot getPlot(ChartParameters params) {
    PiePlot3D plot = new PiePlot3D();

    String[] colorsHex = params.getValues(PARAM_COLORS, ",", true);
    String[] serie = params.getValues(PARAM_VALUES, ";", true);

    DefaultPieDataset set = new DefaultPieDataset();

    Color[] colors = COLORS;//from w w w. ja va 2 s.  c om
    if (colorsHex != null && colorsHex.length > 0) {
        colors = new Color[colorsHex.length];
        for (int i = 0; i < colorsHex.length; i++) {
            colors[i] = Color.decode("#" + colorsHex[i]);
        }
    }

    String[] keyValue = null;
    for (int i = 0; i < serie.length; i++) {
        if (!StringUtils.isEmpty(serie[i])) {
            keyValue = StringUtils.split(serie[i], "=");
            set.setValue(keyValue[0], Double.parseDouble(keyValue[1]));
            plot.setSectionPaint(keyValue[0], colors[i]);
        }
    }
    plot.setDataset(set);

    plot.setStartAngle(180);
    plot.setCircular(true);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setNoDataMessage(DEFAULT_MESSAGE_NODATA);
    plot.setInsets(RectangleInsets.ZERO_INSETS);
    plot.setForegroundAlpha(1.0f);
    plot.setBackgroundAlpha(0.0f);
    plot.setIgnoreNullValues(true);
    plot.setIgnoreZeroValues(true);
    plot.setOutlinePaint(Color.WHITE);
    plot.setShadowPaint(Color.GREEN);
    plot.setDarkerSides(true);
    plot.setLabelFont(DEFAULT_FONT);
    plot.setLabelPaint(Color.BLACK);
    plot.setLabelBackgroundPaint(Color.WHITE);
    plot.setLabelOutlinePaint(Color.WHITE);
    plot.setLabelShadowPaint(Color.GRAY);
    plot.setLabelPadding(new RectangleInsets(1, 1, 1, 1));
    plot.setInteriorGap(0.01);
    plot.setMaximumLabelWidth(0.25);

    return plot;
}

From source file:gov.nih.nci.cma.web.graphing.CMAPrincipalComponentAnalysisPlot.java

public CMAPrincipalComponentAnalysisPlot(Collection<CMAPCADataPoint> dataPoints, PCAcomponent component1,
        PCAcomponent component2, Map<String, String> sampleGroupNames) { //, ColorByType colorBy) {
    //this.colorBy = colorBy;
    this.component1 = component1;
    this.component2 = component2;
    this.dataPoints = dataPoints;
    this.nf.setMaximumFractionDigits(1);
    this.sampleGroupNames = sampleGroupNames;
    colorMap.put("1", Color.GREEN);
    colorMap.put("2", Color.BLUE);
    colorMap.put("3", Color.YELLOW);
    colorMap.put("4", Color.CYAN);
    colorMap.put("5", Color.MAGENTA);
    colorMap.put("6", Color.ORANGE);
    colorMap.put("7", Color.PINK);
    colorMap.put("8", Color.RED);
    colorMap.put("9", Color.GRAY);

    createChart();/*  ww  w.  j a va 2s.c  om*/

}

From source file:jat.examples.CRTBP.CRTBPPlot.java

void doExample() {
    double mu = 0.15;
    double[] y0 = { .11, 0, 0, 1.35, 1.33, 0 }; // initial state

    // double mu = 0.1;
    // double mu = 3.035909999e-6;

    // double mu = 0.012277471;
    // double[] y0 = { .1, 0, 0, 2.69, 2.69, 0 }; // initial state

    // double mu = 0.2;

    CRTBP myCRTBP = new CRTBP(mu);
    FirstOrderIntegrator dp853 = new DormandPrince853Integrator(1.0e-8, 100.0, 1.0e-10, 1.0e-10);
    dp853.addStepHandler(myCRTBP.stepHandler);

    FirstOrderDifferentialEquations ode = myCRTBP;

    double tf;/*  w  w w .  j  a  v a 2  s . c  o  m*/
    double[] y = new double[6]; // initial state

    // for (int i = 1; i < 2; i++) {
    // tf = i * 20.;
    tf = 40.;
    System.arraycopy(y0, 0, y, 0, 6);

    dp853.integrate(ode, 0.0, y, tf, y); // now y contains final state
    // at
    // time tf
    if (print) {
        System.out.printf("%9.6f %9.6f %9.6f %9.6f %9.6f", tf, y[0], y[1], y[2], myCRTBP.JacobiIntegral(y));
        System.out.println();
    }

    int arraySize = myCRTBP.time.size();
    double[] timeArray = ArrayUtils.toPrimitive(myCRTBP.time.toArray(new Double[arraySize]));
    double[] xsolArray = ArrayUtils.toPrimitive(myCRTBP.xsol.toArray(new Double[arraySize]));
    double[] ysolArray = ArrayUtils.toPrimitive(myCRTBP.ysol.toArray(new Double[arraySize]));
    double[][] XY = new double[timeArray.length][2];
    for (int i = 0; i < timeArray.length; i++) {
        XY[i][0] = xsolArray[i];
        XY[i][1] = ysolArray[i];
    }

    Plot2DPanel p = new Plot2DPanel();
    LinePlot l = new LinePlot("spacecraft", Color.RED, XY);
    l.closed_curve = false;
    l.draw_dot = true;
    p.addPlot(l);
    double plotSize = 1.2;
    myCRTBP.findLibrationPoints();
    Color darkGreen = new java.awt.Color(0, 190, 0);

    addPoint(p, "Earth", java.awt.Color.BLUE, -mu, 0);
    addPoint(p, "Moon", java.awt.Color.gray, 1 - mu, 0);
    addPoint(p, "L1", darkGreen, myCRTBP.LibPoints[0].getX(), 0);
    addPoint(p, "L2", darkGreen, myCRTBP.LibPoints[1].getX(), 0);
    addPoint(p, "L3", darkGreen, myCRTBP.LibPoints[2].getX(), 0);

    String Labelmu = "mu = " + myCRTBP.mu;
    p.addLabel(Labelmu, java.awt.Color.black, 1, .9 * plotSize);
    String initial = "initial x,v = (" + y0[0] + "," + y0[1] + "),(" + y0[3] + "," + y0[4] + ")";
    p.addLabel(initial, java.awt.Color.black, 1, .8 * plotSize);
    String Jacobi = "spacecraft C = " + myCRTBP.C;
    p.addLabel(Jacobi, java.awt.Color.black, 1, .7 * plotSize);
    String L1C = "L1 C = " + myCRTBP.C1;
    p.addLabel(L1C, java.awt.Color.black, 1, .6 * plotSize);

    myCRTBP.findZeroVelocity();
    int size = myCRTBP.xzv.size();
    double[] xzvArray = ArrayUtils.toPrimitive(myCRTBP.xzv.toArray(new Double[size]));
    double[] yzvArray = ArrayUtils.toPrimitive(myCRTBP.yzv.toArray(new Double[size]));
    double[][] XYzv = new double[size][2];
    for (int i = 0; i < size; i++) {
        XYzv[i][0] = xzvArray[i];
        XYzv[i][1] = yzvArray[i];
    }
    LinePlot lzv = new LinePlot("zero vel", Color.blue, XYzv);
    lzv.closed_curve = false;
    lzv.draw_dot = true;
    p.addPlot(lzv);

    p.setLegendOrientation(PlotPanel.SOUTH);
    p.setFixedBounds(0, -plotSize, plotSize);
    p.setFixedBounds(1, -plotSize, plotSize);
    new FrameView(p).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}

From source file:org.jfree.experimental.chart.plot.dial.SimpleDialFrame.java

/**
 * Creates a new instance of <code>SimpleDialFrame</code>.
 *//*from w  w  w  . j  av a2s .co m*/
public SimpleDialFrame() {
    this.backgroundPaint = Color.gray;
    this.foregroundPaint = Color.black;
    this.stroke = new BasicStroke(2.0f);
    this.radius = 0.95;
}