Package org.jfree.chart

Examples of org.jfree.chart.StandardLegend


        }

        if (chromeless || parameters.get("hideLegend") != null)
            chart.setLegend(null);
        else {
            StandardLegend l = (StandardLegend) chart.getLegend();
            String legendFontSize = getSetting("legendFontSize");
            if (l != null && legendFontSize != null) try {
                float fontSize = Float.parseFloat(legendFontSize);
                l.setItemFont(l.getItemFont().deriveFont(fontSize));
            } catch (Exception lfe) {}
        }


View Full Code Here


     *
     * @param legend    the legend, which should be changed.
     */
    public LegendPropertyEditPanel(Legend legend) {

        StandardLegend l = ( legend != null ? (StandardLegend) legend : new StandardLegend() );
        this.showLegend = ( legend != null );
        this.outlineStroke = new StrokeSample(l.getOutlineStroke());
        this.outlinePaint = new PaintSample(l.getOutlinePaint());
        this.backgroundPaint = new PaintSample(l.getBackgroundPaint());
        this.seriesFont = l.getItemFont();
        this.seriesPaint = new PaintSample(l.getItemPaint());

        this.availableStrokeSamples = new StrokeSample[4];
        this.availableStrokeSamples[0] = new StrokeSample(new BasicStroke(1.0f));
        this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(2.0f));
        this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(3.0f));
View Full Code Here

     */
    public void setLegendProperties(JFreeChart chart) {
        if(this.showLegend) {
            Legend legend = chart.getLegend();
            if(legend == null) {
                legend = new StandardLegend();
                chart.setLegend(legend);
            }
            if (legend instanceof StandardLegend) {
                // only supports StandardLegend at present
                StandardLegend standard = (StandardLegend) legend;
                standard.setOutlineStroke(getOutlineStroke());
                standard.setOutlinePaint(getOutlinePaint());
                standard.setBackgroundPaint(getBackgroundPaint());
                standard.setItemFont(getSeriesFont());
                standard.setItemPaint(getSeriesPaint());
            }
            else {
                // raise exception - unrecognised legend
            }
        }
View Full Code Here

TOP

Related Classes of org.jfree.chart.StandardLegend

Copyright © 2018 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.