List of usage examples for java.awt Font BOLD
int BOLD
To view the source code for java.awt Font BOLD.
Click Source Link
From source file:de.hs.mannheim.modUro.diagram.JTimeSeriesDiagram.java
protected JFreeChart createChart(XYDataset dataset, String name) { String title = name;//from w ww.jav a 2s .c o m JFreeChart xyLineChart = ChartFactory.createXYLineChart(title, // title "t", // x-axis label "f", // y-axis label dataset); 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); if (isMetric) { 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)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); xyLineChart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14)); xyLineChart.getLegend().setFrame(BlockBorder.NONE); xyLineChart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(false); renderer.setDrawSeriesLineAsPath(true); // set the default stroke for all series renderer.setAutoPopulateSeriesStroke(false); renderer.setSeriesPaint(0, Color.blue); renderer.setSeriesPaint(1, new Color(24, 123, 58)); renderer.setSeriesPaint(2, new Color(149, 201, 136)); renderer.setSeriesPaint(3, new Color(1, 62, 29)); renderer.setSeriesPaint(4, new Color(81, 176, 86)); renderer.setSeriesPaint(5, new Color(0, 55, 122)); renderer.setSeriesPaint(6, new Color(0, 92, 165)); } return xyLineChart; }
From source file:net.sf.dynamicreports.test.jasper.chart.XyBarChartTest.java
@Override public void test() { super.test(); numberOfPagesTest(1);//from w ww.j a v a 2 s . co m JFreeChart chart = getChart("summary.chart1", 0); XYPlot plot = chart.getXYPlot(); Assert.assertEquals("renderer", XYBarRenderer.class, plot.getRenderer().getClass()); Assert.assertTrue("show labels", plot.getRenderer().getBaseItemLabelsVisible()); //Assert.assertFalse("show tick labels", plot.getDomainAxis().isTickMarksVisible()); //Assert.assertFalse("show tick marks", plot.getDomainAxis().isTickLabelsVisible()); chart = getChart("summary.chart2", 0); Axis axis = chart.getXYPlot().getDomainAxis(); Assert.assertEquals("category label", "category", axis.getLabel()); Assert.assertEquals("category label color", Color.BLUE, axis.getLabelPaint()); Assert.assertEquals("category label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont()); Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint()); Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont()); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); chart = getChart("summary.chart3", 0); axis = chart.getXYPlot().getRangeAxis(); Assert.assertEquals("value label", "value", axis.getLabel()); Assert.assertEquals("value label color", Color.BLUE, axis.getLabelPaint()); Assert.assertEquals("value label font", new Font("Arial", Font.BOLD, 10), axis.getLabelFont()); Assert.assertEquals("tick label color", Color.CYAN, axis.getTickLabelPaint()); Assert.assertEquals("tick label font", new Font("Arial", Font.ITALIC, 10), axis.getTickLabelFont()); Assert.assertEquals("tick label mask", "10.00", ((NumberAxis) axis).getNumberFormatOverride().format(10)); Assert.assertEquals("line color", Color.LIGHT_GRAY, axis.getAxisLinePaint()); Assert.assertEquals("range min value", 1d, ((ValueAxis) axis).getLowerBound()); Assert.assertEquals("range max value", 15d, ((ValueAxis) axis).getUpperBound()); }
From source file:com.xilinx.ultrascale.gui.BarChartsEth.java
License:asdf
private void makeChart(String name) { dataset = new DefaultCategoryDataset(); // chart = ChartFactory.createLineChart("", "", name, dataset, PlotOrientation.VERTICAL, true, true, false); // chart = ChartFactory.createBarChart("asd", "asd", "asdffa", dataset, PlotOrientation.HORIZONTAL, true, true, false); chart = ChartFactory.createBarChart("power", "Time Interval", "Throughput (Gbps)", dataset, PlotOrientation.VERTICAL, true, true, false); chart.setBackgroundPaint(bg);/*from w w w . j av a 2s .co m*/ TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15)); ttitle.setPaint(Color.BLACK); chart.setTitle(ttitle); CategoryPlot plot = chart.getCategoryPlot(); // BarRenderer renderer = (BarRenderer)plot.getRenderer(); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); ValueAxis axis = plot.getRangeAxis(); upperBounds(65); axis.setTickLabelPaint(new Color(0, 0, 0));//(185, 185, 185) axis.setLabelPaint(new Color(0, 0, 0)); CategoryAxis caxis = plot.getDomainAxis(); caxis.setTickLabelPaint(new Color(0, 0, 0)); caxis.setLabelPaint(new Color(0, 0, 0)); renderer.setItemMargin(0); renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c)); renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73) renderer.setSeriesPaint(3, new Color(0xff, 0x80, 0x40)); renderer.setSeriesPaint(2, new Color(0x6f, 0x2c, 0x85)); // renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000"))); //renderer.setMaximumBarWidth(0.05); addDummy(); }
From source file:ToolbarDemo.java
protected JMenuBar createMenuBar() { final JMenuBar menuBar = new JMenuBar(); JMenu mFile = new JMenu("File"); mFile.setMnemonic('f'); ImageIcon iconNew = new ImageIcon("file_new.gif"); Action actionNew = new AbstractAction("New", iconNew) { public void actionPerformed(ActionEvent e) { System.out.println("new action"); }//from w ww . jav a 2 s . c om }; JMenuItem item = mFile.add(actionNew); mFile.add(item); ImageIcon iconOpen = new ImageIcon("file_open.gif"); Action actionOpen = new AbstractAction("Open...", iconOpen) { public void actionPerformed(ActionEvent e) { System.out.println("open action"); } }; item = mFile.add(actionOpen); mFile.add(item); ImageIcon iconSave = new ImageIcon("file_save.gif"); Action actionSave = new AbstractAction("Save...", iconSave) { public void actionPerformed(ActionEvent e) { System.out.println("save action"); } }; item = mFile.add(actionSave); mFile.add(item); mFile.addSeparator(); Action actionExit = new AbstractAction("Exit") { public void actionPerformed(ActionEvent e) { System.exit(0); } }; item = mFile.add(actionExit); item.setMnemonic('x'); menuBar.add(mFile); toolBar = new JToolBar(); JButton btn1 = toolBar.add(actionNew); btn1.setToolTipText("New text"); JButton btn2 = toolBar.add(actionOpen); btn2.setToolTipText("Open text file"); JButton btn3 = toolBar.add(actionSave); btn3.setToolTipText("Save text file"); ActionListener fontListener = new ActionListener() { public void actionPerformed(ActionEvent e) { updateMonitor(); } }; JMenu mFont = new JMenu("Font"); mFont.setMnemonic('o'); ButtonGroup group = new ButtonGroup(); fontMenus = new JMenuItem[FontNames.length]; for (int k = 0; k < FontNames.length; k++) { int m = k + 1; fontMenus[k] = new JRadioButtonMenuItem(m + " " + FontNames[k]); boolean selected = (k == 0); fontMenus[k].setSelected(selected); fontMenus[k].setMnemonic('1' + k); fontMenus[k].setFont(fonts[k]); fontMenus[k].addActionListener(fontListener); group.add(fontMenus[k]); mFont.add(fontMenus[k]); } mFont.addSeparator(); boldMenu.setMnemonic('b'); Font fn = fonts[1].deriveFont(Font.BOLD); boldMenu.setFont(fn); boldMenu.setSelected(false); boldMenu.addActionListener(fontListener); mFont.add(boldMenu); italicMenu.setMnemonic('i'); fn = fonts[1].deriveFont(Font.ITALIC); italicMenu.setFont(fn); italicMenu.setSelected(false); italicMenu.addActionListener(fontListener); mFont.add(italicMenu); menuBar.add(mFont); getContentPane().add(toolBar, BorderLayout.NORTH); return menuBar; }
From source file:edu.ucla.stat.SOCR.analyses.gui.MultiLinearRegression.java
/**Initialize the Analysis*/ public void init() { showInput = false;/*from w w w . j a va 2 s. com*/ showSelect = false; showVisualize = false; super.init(); analysisType = AnalysisType.MULTI_LINEAR_REGRESSION; useInputExample = false; useLocalExample = true; useRandomExample = false; useServerExample = true; useStaticExample = MultiLinearRegressionExamples.availableExamples; onlineDescription = "http://en.wikipedia.org/wiki/Linear_regression"; depMax = 1; // max number of dependent var indMax = 15; // max number of independent var resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize)); frame = getFrame(this); setName("Regression & Correlation Analysis"); // Create the toolBar toolBar = new JToolBar(); createActionComponents(toolBar); this.getContentPane().add(toolBar, BorderLayout.NORTH); // use the new JFreeChar function. annie che 20060312 chartFactory = new Chart(); resetGraph(); validate(); }
From source file:D20140128.ApacheXMLGraphicsTest.TilingPatternExample.java
private void paintText(Graphics2D g2d) { g2d.setPaint(paint);/*from w ww .ja v a2 s . c o m*/ Font font = new Font("serif", Font.BOLD, 80); GlyphVector gv = font.createGlyphVector(g2d.getFontRenderContext(), "Java"); g2d.translate(100, 180); g2d.fill(gv.getOutline()); }
From source file:com.xilinx.ultrascale.gui.PowerChart.java
private void makeChart() { dataset = new DefaultCategoryDataset(); chart = ChartFactory.createBarChart("", "Time Interval", "", dataset, PlotOrientation.HORIZONTAL, true, true, false);/* w ww . java 2 s. c om*/ TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15)); ttitle.setPaint(Color.WHITE); chart.setTitle(ttitle); chart.setBackgroundPaint(bg); CategoryPlot plot = chart.getCategoryPlot(); plot.setDomainGridlinesVisible(false); plot.setRangeGridlinesVisible(false); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); ValueAxis axis = plot.getRangeAxis(); // axis.setUpperBound(6); axis.setAutoRange(true); axis.setLowerMargin(0); axis.setUpperMargin(.40); // TickUnits tickUnits = new TickUnits(); // tickUnits.add(new NumberTickUnit(1)); // axis.setStandardTickUnits(tickUnits); // axis.setLowerBound(0.0); axis.setTickLabelPaint(new Color(185, 185, 185)); CategoryAxis caxis = plot.getDomainAxis(); caxis.setTickLabelPaint(new Color(185, 185, 185)); caxis.setLabelPaint(new Color(185, 185, 185)); renderer.setItemMargin(0); renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c)); renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73) renderer.setSeriesPaint(2, new Color(0xff, 0x80, 0x40)); renderer.setSeriesPaint(3, new Color(0x6f, 0x2c, 0x85)); renderer.setBaseToolTipGenerator( new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000"))); addDummy(); }
From source file:org.jdal.swing.form.FormUtils.java
/** * Make font of JLabel bold//from w w w . ja va 2s . c o m * @param label JLabel to make bold */ public static void setBold(JLabel label) { label.setFont(label.getFont().deriveFont(Font.BOLD)); }
From source file:edu.ucla.stat.SOCR.analyses.gui.FlignerKilleen.java
/**Initialize the Analysis*/ public void init() { mapDep = false;//from www . j a v a 2 s .c om showGraph = false; showSelect = false; showVisualize = false; showInput = false; super.init(); analysisType = AnalysisType.FLIGNER_KILLEEN; useInputExample = false; useLocalExample = true; useRandomExample = false; useServerExample = true; useStaticExample = FlignerKilleenExamples.availableExamples; onlineDescription = "http://wiki.stat.ucla.edu/socr/index.php/AP_Statistics_Curriculum_2007_NonParam_VarIndep"; depMax = 1; // max number of dependent var indMax = 9; // max number of independent var resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize)); frame = getFrame(this); setName("Regression & Correlation Analysis"); // Create the toolBar toolBar = new JToolBar(); createActionComponents(toolBar); this.getContentPane().add(toolBar, BorderLayout.NORTH); // use the new JFreeChar function. annie chu 20060312 chartFactory = new Chart(); //depLabel.setText("Variable 1"); indLabel.setText("SELECT AT LEAST TWO GROUPS:"); validate(); }
From source file:edu.ucla.stat.SOCR.analyses.jri.gui.LogisticRegression.java
/**Initialize the Analysis*/ public void init() { super.init(); analysisType = AnalysisType.LOGISTIC_REGRESSION; ////System.out.println("SLR analysisType = " + analysisType); useInputExample = false;/*from w ww. ja va2 s.c o m*/ useLocalExample = false; useRandomExample = true; useServerExample = false; useStaticExample = true; useGraph = true; callServer = true; onlineDescription = "http://mathworld.wolfram.com/LinearRegression.html"; depMax = 1; // max number of dependent var indMax = 1; // max number of independent var resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize)); frame = getFrame(this); setName("Regression & Correlation Analysis"); // Create the toolBar toolBar = new JToolBar(); createActionComponents(toolBar); this.getContentPane().add(toolBar, BorderLayout.NORTH); chartFactory = new Chart(); resetGraph(); validate(); // reset(); }