List of usage examples for java.awt Color WHITE
Color WHITE
To view the source code for java.awt Color WHITE.
Click Source Link
From source file:netplot.TimeSeriesPlotPanel.java
private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createTimeSeriesChart(plotTitle, // title xAxisName, // x-axis label yAxisName, // y-axis label dataset, // data enableLegend, // create legend? true, // generate tooltips? true // generate URLs? );/* ww w. j ava 2s. c om*/ XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.DARK_GRAY); plot.setRangeGridlinePaint(Color.DARK_GRAY); return chart; }
From source file:userinterface.CyberSecurity.ChartFactory.java
public static ChartPanel createChart(UserAccount account) { Map<String, LoginDetails> loginDetails = account.getLoginDetails(); DefaultCategoryDataset dataset1 = new DefaultCategoryDataset(); DefaultCategoryDataset dataset2 = new DefaultCategoryDataset(); Collection<LoginDetails> values = loginDetails.values(); for (LoginDetails details : values) { dataset1.addValue(TimeUnit.MILLISECONDS.toHours(details.getLogoutTime() - details.getLoginTime()), HOURS_WORKED_BY_USER, details.getLoginDate()); dataset2.addValue(2.5, MINIMUM_WORKING_HOURS, details.getLoginDate()); }//from ww w . j a va 2 s . c o m dataset1.addValue(2, HOURS_WORKED_BY_USER, "4-19-2016"); dataset1.addValue(3, HOURS_WORKED_BY_USER, "4-20-2016"); dataset2.addValue(2.5, MINIMUM_WORKING_HOURS, "4-19-2016"); dataset2.addValue(2.5, MINIMUM_WORKING_HOURS, "4-20-2016"); final CategoryItemRenderer renderer = new BarRenderer(); final CategoryPlot plot = new CategoryPlot(); plot.setDataset(dataset1); plot.setRenderer(renderer); plot.setDomainAxis(new CategoryAxis("Date")); plot.setRangeAxis(new NumberAxis("Hours")); plot.setOrientation(PlotOrientation.VERTICAL); plot.setRangeGridlinesVisible(true); plot.setDomainGridlinesVisible(true); // now create the second dataset and renderer... final CategoryItemRenderer renderer2 = new LineAndShapeRenderer(); plot.setDataset(1, dataset2); plot.setRenderer(1, renderer2); plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); final JFreeChart chart = new JFreeChart(plot); chart.setTitle("Employee work hours"); chart.setBackgroundPaint(Color.WHITE); // add the chart to a panel... final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); return chartPanel; }
From source file:br.unicamp.cst.motivational.MotivationalMonitor.java
@Override public synchronized void run() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); final JFreeChart chart = ChartFactory.createBarChart(getTitle(), getEntity(), "Value", dataset, PlotOrientation.VERTICAL, true, true, false); final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); chart.setBackgroundPaint(Color.lightGray); ChartFrame frame = new ChartFrame(getTitle(), chart); frame.pack();//from w ww. j a va 2 s . c o m frame.setVisible(true); while (true) { ArrayList<Codelet> tempCodeletsList = new ArrayList<Codelet>(); tempCodeletsList.addAll(this.getListOfMotivationalEntities()); synchronized (tempCodeletsList) { for (Codelet co : tempCodeletsList) { dataset.addValue(co.getActivation(), co.getName(), "activation"); } try { Thread.currentThread().sleep(getRefreshPeriod()); } catch (InterruptedException e) { e.printStackTrace(); } } } }
From source file:de.fub.maps.gpx.analysis.ui.charts.LineChart.java
/** * Creates new form LineChart//from w w w.j a va 2 s .c o m */ public LineChart() { initComponents(); chart = ChartFactory.createXYLineChart(null, NbBundle.getMessage(LineChart.class, "LineChart.Domain.Name"), NbBundle.getMessage(LineChart.class, "LineCHart.Value.Name"), dataset, PlotOrientation.VERTICAL, false, true, true); plot = chart.getXYPlot(); plot.setRangeAxisLocation(0, AxisLocation.BOTTOM_OR_LEFT); plot.setBackgroundPaint(Color.white); plot.getRenderer(0).setSeriesPaint(0, Color.BLUE); plot.getRenderer(0).setSeriesShape(0, new Ellipse2D.Double(0, 0, 2, 2)); plot.getRenderer(0).setBaseShape(new Ellipse2D.Double(0, 0, 2, 2)); chartPanel = new ChartPanel(chart, false); add(chartPanel, BorderLayout.CENTER); }
From source file:loadmaprenderer.ChartTest.java
private JFreeChart makeChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createXYLineChart("Cost/Year Chart", "Year", "Cost", dataset, PlotOrientation.VERTICAL, false, true, false); XYPlot plot = chart.getXYPlot();/*from w ww. j av a2 s . c o m*/ plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.BLUE); plot.setRangeGridlinePaint(Color.BLUE); XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesShapesVisible(1, false); plot.setRenderer(renderer); NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setAutoRange(rootPaneCheckingEnabled); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setAutoRange(rootPaneCheckingEnabled); return chart; }
From source file:st.jigasoft.dbutil.util.ReportTheme.java
public static void crescentTheme(JFreeChart chart, String... lineNames) { XYPlot plot = (XYPlot) chart.getPlot(); chart.setBackgroundPaint(Color.white); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; //renderer.setBaseShapesVisible(true); renderer.setStroke(new BasicStroke(3)); renderer.setBaseShapesFilled(true); renderer.setDrawSeriesLineAsPath(true); }/* w ww . j ava 2 s . co m*/ DateAxis axis = (DateAxis) plot.getDomainAxis(); /* chart.setBackgroundPaint(new GradientPaint(new Point(0, 0), Color.decode("#121E31"), new Point(400, 200), Color.DARK_GRAY)); plot.setBackgroundPaint(null); //plot.setInteriorGap(0.04); plot.setOutlineVisible(false); int iCount = 0; // use gradients and white borders for the section colours for(Object s : lineNames) { // plot.setDomainGridlinePaint(new PrintColorUIResource(25, Color.CYAN)));//s.toString(), createGradientPaint(new Color(200, 200, 255), colorItems(iCount ++))); if(iCount == MAX_COLUNS_COLOR) iCount = 0; } // // add a subtitle giving the data source TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", new Font("Courier New", Font.PLAIN, 12)); source.setPaint(Color.WHITE); source.setPosition(RectangleEdge.BOTTOM); source.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(source); */ }
From source file:TexturedPanel.java
/** * Creates a new TexturedPanel with a simple pattern based on the provided * texture map and consisting of the given foreground and background colors. *///from w w w. java2 s. co m public TexturedPanel(Color foreground, Color background, boolean[][] texture) { super(); ourDefaultForeground = (foreground != null ? foreground : Color.white); ourDefaultBackground = (background != null ? background : getBackground()); setupTexturePainter(ourDefaultForeground, ourDefaultBackground, texture, 1); }
From source file:WeeklyReport.Sections.Declines.java
private JFreeChart declinesByReasonChart() { DefaultPieDataset dataset = new DefaultPieDataset(); Map<Double, String> mp = DECLINES_BY_REASON; mp.entrySet().stream().forEach((mapEntry) -> { dataset.setValue(mapEntry.getValue(), mapEntry.getKey()); });//from www . j a va2 s.co m JFreeChart pieChart = ChartFactory.createPieChart3D("Reason for Decline by total CBM", dataset, true, true, false); Plot plot = pieChart.getPlot(); plot.setBackgroundPaint(Color.WHITE); return pieChart; }
From source file:name.dlazerka.gm.shell.store.GraphmlStorerTest.java
@Before public void setUp() { graph = new BasicGraph(false); BasicVertex vertex1 = graph.createVertex(); vertex1.getVisual().setColor(Color.RED); BasicVertex vertex2 = graph.createVertex(); vertex2.getVisual().setColor(Color.WHITE); BasicVertex vertex3 = graph.createVertex(); vertex3.getVisual().setColor(Color.RED); BasicEdge edge1 = graph.createEdge(vertex1, vertex2); edge1.getVisual().setColor(Color.BLACK); BasicEdge edge2 = graph.createEdge(vertex1, vertex3, true); edge2.getVisual().setColor(Color.GREEN); }
From source file:edu.asu.mgb.gui.IndividualTransformer.java
@Override public Transformer<State, Paint> getVertexPaintTransformer() { return new Transformer<State, Paint>() { @Override//from w w w.ja v a 2s . c o m public Paint transform(State state) { boolean isInCorrect = state.isStudentCorrect(student); boolean isInWrong = state.isStudentWrong(student); if (isInCorrect) { return Color.GREEN; } else if (isInWrong) { return Color.RED; } else { return Color.WHITE; } } }; }