List of usage examples for java.awt Font PLAIN
int PLAIN
To view the source code for java.awt Font PLAIN.
Click Source Link
From source file:org.jfree.chart.demo.WaferMapChartDemo.java
/** * Creates a new demo./* www . j a v a 2 s .c om*/ * * @param title the frame title. */ public WaferMapChartDemo(final String title) { super(title); final WaferMapDataset dataset = DemoDatasetFactory.createRandomWaferMapDataset(5); final JFreeChart chart = ChartFactory.createWaferMapChart("Wafer Map Demo", // title dataset, // wafermapdataset PlotOrientation.VERTICAL, // vertical = notchdown true, // legend false, // tooltips false); // final Legend legend = chart.getLegend(); // legend.setAnchor(Legend.EAST); chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue)); final TextTitle copyright = new TextTitle("JFreeChart WaferMapPlot", new Font("SansSerif", Font.PLAIN, 9)); copyright.setPosition(RectangleEdge.BOTTOM); copyright.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(copyright); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 400)); setContentPane(chartPanel); }
From source file:io.github.tavernaextras.biocatalogue.ui.search_results.SOAPOperationListCellRenderer.java
public SOAPOperationListCellRenderer() { jlItemTitle.setFont(jlItemTitle.getFont().deriveFont(Font.PLAIN, jlItemTitle.getFont().getSize() + 2)); jtDescription.setOpaque(false);// ww w . j a v a2 s . c o m jtDescription.setLineWrap(true); jtDescription.setWrapStyleWord(true); }
From source file:MyStatsPanel.java
JPanel setFields() { getDatabaseInfo();//from w ww . j av a2 s . c om GroupLayout layout; JPanel p; numGuestsIn = new JLabel("Total guests in house ............................."); numGuestsIn.setFont(new Font("Courier New", Font.PLAIN, 20)); numGuestsIn.setForeground(Color.WHITE); checkIns = new JLabel("Todays guest check ins ............................"); checkIns.setForeground(Color.WHITE); checkIns.setFont(new Font("Courier New", Font.PLAIN, 20)); numGuestsOut = new JLabel("Todays guest check outs ..........................."); numGuestsOut.setFont(new Font("Courier New", Font.PLAIN, 20)); numGuestsOut.setForeground(Color.WHITE); overnights = new JLabel("Total overnight guests ............................"); overnights.setForeground(Color.WHITE); overnights.setFont(new Font("Courier New", Font.PLAIN, 20)); JLabel n1 = new JLabel(totalGuestsIn); n1.setForeground(Color.WHITE); n1.setFont(new Font("Courier New", Font.PLAIN, 20)); JLabel n2 = new JLabel(todaysCheckIns); n2.setForeground(Color.WHITE); n2.setFont(new Font("Courier New", Font.PLAIN, 20)); JLabel n3 = new JLabel(todaysCheckOuts); n3.setForeground(Color.WHITE); n3.setFont(new Font("Courier New", Font.PLAIN, 20)); JLabel n4 = new JLabel(totalOvernights); n4.setForeground(Color.WHITE); n4.setFont(new Font("Courier New", Font.PLAIN, 20)); p = new JPanel(); p.setBackground(Color.GRAY); layout = new GroupLayout(p); p.setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup(); hGroup.addGroup(layout.createParallelGroup().addComponent(numGuestsIn).addComponent(checkIns) .addComponent(numGuestsOut).addComponent(overnights)); hGroup.addGroup( layout.createParallelGroup().addComponent(n1).addComponent(n2).addComponent(n3).addComponent(n4)); layout.setHorizontalGroup(hGroup); GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup(); vGroup.addGroup(layout.createParallelGroup(BASELINE).addComponent(numGuestsIn).addComponent(n1)); vGroup.addGroup(layout.createParallelGroup(BASELINE).addComponent(checkIns).addComponent(n2)); vGroup.addGroup(layout.createParallelGroup(BASELINE).addComponent(numGuestsOut).addComponent(n3)); vGroup.addGroup(layout.createParallelGroup(BASELINE).addComponent(overnights).addComponent(n4)); layout.setVerticalGroup(vGroup); return (p); }
From source file:org.mustbe.consulo.xprofiler.ui.mainPanel.MemoryPlotPanel.java
public MemoryPlotPanel(int maxAge, String title) { super(new BorderLayout()); totalSeries = new TimeSeries("Committed Memory"); totalSeries.setMaximumItemAge(maxAge); usedSeries = new TimeSeries("Used Memory"); usedSeries.setMaximumItemAge(maxAge); TimeSeriesCollection seriesCollection = new TimeSeriesCollection(); seriesCollection.addSeries(totalSeries); seriesCollection.addSeries(usedSeries); NumberAxis numberAxis = new NumberAxis("Memory (KB)"); numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); DateAxis dateAxis = new DateAxis("Time"); dateAxis.setAutoRange(true);// w w w . j a va2 s.com dateAxis.setLowerMargin(0); dateAxis.setUpperMargin(0); dateAxis.setTickLabelsVisible(true); dateAxis.setDateFormatOverride(new SimpleDateFormat("HH:mm:ss")); XYLineAndShapeRenderer lineRenderer = new XYLineAndShapeRenderer(true, false); lineRenderer.setSeriesPaint(0, JBColor.RED); lineRenderer.setSeriesPaint(1, JBColor.GREEN); lineRenderer.setDefaultStroke(new BasicStroke(2F, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); XYPlot xyplot = new XYPlot(seriesCollection, dateAxis, numberAxis, lineRenderer); xyplot.setBackgroundPainter(new ColorPainter(JBColor.white)); xyplot.setDomainGridlinePaint(JBColor.LIGHT_GRAY); xyplot.setRangeGridlinePaint(JBColor.LIGHT_GRAY); xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); JFreeChart chart = new JFreeChart(title, new Font("SansSerif", Font.PLAIN, 14), xyplot, true); chart.setBackgroundPainter(new ColorPainter(JBColor.white)); add(new ChartPanel(chart, 300, 300, 0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE, true, true, false, false, false, false), BorderLayout.CENTER); }
From source file:com.mxgraph.examples.swing.chart.PieChartDemo1.java
/** * Creates a chart./* w w w.j av a2 s. c o m*/ * * @param dataset the dataset. * * @return A chart. */ public static JFreeChart createChart(PieDataset dataset) { JFreeChart chart = ChartFactory.createPieChart("", // chart title dataset, // data true, // include legend true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setSectionOutlinesVisible(false); plot.setNoDataMessage("No data available"); plot.setCircular(true); plot.setLabelGap(0.01D);// plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}:\r\n{1}({2})", NumberFormat.getNumberInstance(), new DecimalFormat("0.00%"))); // // plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})")); chart.getTitle().setFont(new Font("", Font.PLAIN, 20));// PiePlot piePlot = (PiePlot) chart.getPlot();// piePlot.setLabelFont(new Font("", Font.PLAIN, 10)); chart.getLegend().setItemFont(new Font("", Font.PLAIN, 10)); return chart; }
From source file:FormattedTextFieldExample.java
public FormattedTextField(Document doc, String text, int columns, FormatSpec spec) { super(doc, text, columns); setFont(new Font("monospaced", Font.PLAIN, 14)); if (spec != null) { setFormatSpec(spec);// w ww.j av a 2s. c o m } }
From source file:de.hs.mannheim.modUro.diagram.JCellcycletimeDiagram.java
protected JFreeChart createChart(XYDataset dataset, List<String> celltypes) { String title = "Cell cycle times"; JFreeChart xyLineChart = ChartFactory.createXYLineChart(title, // title "t", // x-axis label "T", // y-axis label dataset);// w ww .ja va2 s .co m String fontName = "Palatino"; xyLineChart.getTitle().setFont(new Font(fontName, Font.BOLD, 18)); XYPlot plot = (XYPlot) xyLineChart.getPlot(); plot.setDomainPannable(true); plot.setRangePannable(true); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); plot.getDomainAxis().setLowerMargin(0.0); plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14)); plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12)); plot.getRangeAxis().setLowerMargin(0.0); // plot.getRangeAxis().setRange(0.0, 1.01); plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14)); plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12)); xyLineChart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14)); xyLineChart.getLegend().setFrame(BlockBorder.NONE); xyLineChart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER); XYItemRenderer r = plot.getRenderer(); // set the default stroke for all series int i = 0; for (String celltype : celltypes) { r.setSeriesPaint(i, CellTypeColor.getColor(celltype)); i++; } return xyLineChart; }
From source file:com.thalesgroup.hudson.plugins.klocwork.graph.KloPieChart.java
protected JFreeChart createGraph() { JFreeChart chart = ChartFactory.createPieChart(null, dataset, true, true, false); chart.setBackgroundPaint(Color.white); PiePlot plot = (PiePlot) chart.getPlot(); plot.setDataset(dataset);//from w ww.ja v a 2 s. com plot.setOutlinePaint(null); plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12)); plot.setNoDataMessage("No Klocwork data found."); plot.setCircular(false); plot.setLabelGap(0.02); plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}")); // Set colours //plot.setOutlinePaint("New", new Color(200, 0, 0)); int i = 0; if (kloConfig.getBuildGraph().isNeww() && kloReport.getNeww() > 0) { plot.setSectionPaint(plot.getDataset().getKey(i), new Color(200, 0, 0)); i++; } if (kloConfig.getBuildGraph().isExisting() && kloReport.getExisting() > 0) { plot.setSectionPaint(plot.getDataset().getKey(i), new Color(0, 0, 200)); i++; } if (kloConfig.getBuildGraph().isFixed() && kloReport.getFixed() > 0) { plot.setSectionPaint(plot.getDataset().getKey(i), new Color(0, 200, 0)); } //plot.setOutlinePaint("Existing", new Color(0, 0, 200)); //plot.setOutlinePaint("Fixed", new Color(0, 200, 0)); return chart; }
From source file:MainClass.java
public MainClass() { super();/*from w w w . j av a2 s.c o m*/ setChannel(currentNumber); numberLabel.setHorizontalAlignment(JLabel.CENTER); numberLabel.setFont(new Font("Serif", Font.PLAIN, 32)); getContentPane().add(numberLabel, BorderLayout.NORTH); JPanel buttonPanel = new JPanel(new GridLayout(2, 2, 16, 6)); buttonPanel.setBorder(BorderFactory.createEmptyBorder(6, 16, 16, 16)); getContentPane().add(buttonPanel, BorderLayout.CENTER); buttonPanel.add(new JButton(upAction)); buttonPanel.add(new JButton(gotoFavoriteAction)); buttonPanel.add(new JButton(downAction)); buttonPanel.add(new JButton(setFavoriteAction)); JMenuBar mb = new JMenuBar(); JMenu menu = new JMenu("Number"); menu.add(new JMenuItem(upAction)); menu.add(new JMenuItem(downAction)); menu.addSeparator(); menu.add(new JMenuItem(gotoFavoriteAction)); menu.add(new JMenuItem(setFavoriteAction)); mb.add(menu); setJMenuBar(mb); }
From source file:com.bdb.weather.display.current.Hygrometer.java
private ChartViewer createChartElements() { humidityPlot.addLayer(/* www . j a v a 2 s.co m*/ new DialBackground(new GradientPaint(0.0f, 0.0f, Color.LIGHT_GRAY, 100.0f, 0.0f, Color.blue))); StandardDialScale scale = new StandardDialScale(Humidity.MIN_HUMIDITY.get(), Humidity.MAX_HUMIDITY.get(), 240.0, -300.0, 10.0, 9); scale.setTickLabelFont(scale.getTickLabelFont().deriveFont(14.0F).deriveFont(Font.PLAIN)); scale.setTickRadius(.9); scale.setTickLabelFormatter(new DecimalFormat("#")); scale.setTickLabelOffset(.2); scale.setTickLabelPaint(Color.BLACK); humidityPlot.addScale(0, scale); humidityPlot.setDialFrame(new StandardDialFrame()); DialValueIndicator valueInd = new DialValueIndicator(0); valueInd.setNumberFormat(new DecimalFormat("# '%rH'")); Color c = new Color(255, 255, 255, 0); valueInd.setBackgroundPaint(c); valueInd.setOutlinePaint(c); valueInd.setPaint(Color.cyan); humidityPlot.addLayer(valueInd); double angle = valueInd.getAngle(); double radius = valueInd.getRadius(); trendAnnotation.setPaint(Color.cyan); trendAnnotation.setAngle(angle); trendAnnotation.setRadius(radius + .1); humidityPlot.addLayer(trendAnnotation); DialPointer.Pointer pointer = new DialPointer.Pointer(0); humidityPlot.addPointer(pointer); DialCap cap = new DialCap(); cap.setRadius(cap.getRadius() * 1.5); humidityPlot.setCap(cap); range = new StandardDialRange(Humidity.MIN_HUMIDITY.get(), Humidity.MAX_HUMIDITY.get(), Color.BLACK); range.setInnerRadius(.40); range.setOuterRadius(.45); range.setScaleIndex(0); humidityPlot.addLayer(range); JFreeChart chart = new JFreeChart(humidityPlot); chart.setBackgroundPaint(Color.GRAY); ChartViewer chartViewer = new ChartViewer(chart); //chartViewer.setMinHeight(100); //chartViewer.setMinWidth(100); //chartViewer.setMaxHeight(400); //chartViewer.setMaxWidth(400); //chartViewer.setBackground(Color.GRAY); return chartViewer; }