Java Code Examples for org.jfree.chart.util.RectangleInsets#ZERO_INSETS

The following examples show how to use org.jfree.chart.util.RectangleInsets#ZERO_INSETS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Cardumen_003_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 2
Source File: Nopol2017_005_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 3
Source File: JGenProg2017_00127_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 4
Source File: JGenProg2017_003_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 5
Source File: jMutRepair_001_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 6
Source File: JFreeChart.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 7
Source File: jKali_001_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 8
Source File: jMutRepair_0030_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 9
Source File: Nopol2017_005_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 10
Source File: Cardumen_003_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 11
Source File: Cardumen_00193_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 12
Source File: Cardumen_00243_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 13
Source File: Cardumen_00243_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 14
Source File: Cardumen_00141_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 15
Source File: jMutRepair_0021_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 16
Source File: patch1-Chart-26-jMutRepair_patch1-Chart-26-jMutRepair_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new plot.
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 * @param domainAxis  the domain axis (<code>null</code> permitted).
 * @param rangeAxis  the range axis (<code>null</code> permitted).
 * @param renderer  the item renderer (<code>null</code> permitted).
 *
 */
public CategoryPlot(CategoryDataset dataset,
                    CategoryAxis domainAxis,
                    ValueAxis rangeAxis,
                    CategoryItemRenderer renderer) {

    super();

    this.orientation = PlotOrientation.VERTICAL;

    // allocate storage for dataset, axes and renderers
    this.domainAxes = new ObjectList();
    this.domainAxisLocations = new ObjectList();
    this.rangeAxes = new ObjectList();
    this.rangeAxisLocations = new ObjectList();
    
    this.datasetToDomainAxisMap = new ObjectList();
    this.datasetToRangeAxisMap = new ObjectList();

    this.renderers = new ObjectList();

    this.datasets = new ObjectList();
    this.datasets.set(0, dataset);
    if (dataset != null) {
        dataset.addChangeListener(this);
    }

    this.axisOffset = RectangleInsets.ZERO_INSETS;

    setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT, false);
    setRangeAxisLocation(AxisLocation.TOP_OR_LEFT, false);

    this.renderers.set(0, renderer);
    if (renderer != null) {
        renderer.setPlot(this);
        renderer.addChangeListener(this);
    }

    this.domainAxes.set(0, domainAxis);
    this.mapDatasetToDomainAxis(0, 0);
    if (domainAxis != null) {
        domainAxis.setPlot(this);
        domainAxis.addChangeListener(this);
    }
    this.drawSharedDomainAxis = false;

    this.rangeAxes.set(0, rangeAxis);
    this.mapDatasetToRangeAxis(0, 0);
    if (rangeAxis != null) {
        rangeAxis.setPlot(this);
        rangeAxis.addChangeListener(this);
    }
    
    configureDomainAxes();
    configureRangeAxes();

    this.domainGridlinesVisible = DEFAULT_DOMAIN_GRIDLINES_VISIBLE;
    this.domainGridlinePosition = CategoryAnchor.MIDDLE;
    this.domainGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.domainGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.rangeGridlinesVisible = DEFAULT_RANGE_GRIDLINES_VISIBLE;
    this.rangeGridlineStroke = DEFAULT_GRIDLINE_STROKE;
    this.rangeGridlinePaint = DEFAULT_GRIDLINE_PAINT;

    this.foregroundDomainMarkers = new HashMap();
    this.backgroundDomainMarkers = new HashMap();
    this.foregroundRangeMarkers = new HashMap();
    this.backgroundRangeMarkers = new HashMap();

    Marker baseline = new ValueMarker(0.0, new Color(0.8f, 0.8f, 0.8f, 
            0.5f), new BasicStroke(1.0f), new Color(0.85f, 0.85f, 0.95f, 
            0.5f), new BasicStroke(1.0f), 0.6f);
    addRangeMarker(baseline, Layer.BACKGROUND);

    this.anchorValue = 0.0;

    this.rangeCrosshairVisible = DEFAULT_CROSSHAIR_VISIBLE;
    this.rangeCrosshairValue = 0.0;
    this.rangeCrosshairStroke = DEFAULT_CROSSHAIR_STROKE;
    this.rangeCrosshairPaint = DEFAULT_CROSSHAIR_PAINT;
    
    this.annotations = new java.util.ArrayList();

}
 
Example 17
Source File: jKali_0052_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 18
Source File: Cardumen_00241_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 19
Source File: Cardumen_00241_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}
 
Example 20
Source File: Cardumen_00193_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * Creates a new chart with the given title and plot.  The 
 * <code>createLegend</code> argument specifies whether or not a legend
 * should be added to the chart.  
 * <br><br>
 * Note that the  {@link ChartFactory} class contains a range 
 * of static methods that will return ready-made charts, and often this
 * is a more convenient way to create charts than using this constructor.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param titleFont  the font for displaying the chart title 
 *                   (<code>null</code> permitted).
 * @param plot  controller of the visual representation of the data 
 *              (<code>null</code> not permitted).
 * @param createLegend  a flag indicating whether or not a legend should   
 *                      be created for the chart.
 */
public JFreeChart(String title, Font titleFont, Plot plot, 
                  boolean createLegend) {

    if (plot == null) {
        throw new NullPointerException("Null 'plot' argument.");
    }

    // create storage for listeners...
    this.progressListeners = new EventListenerList();
    this.changeListeners = new EventListenerList();
    this.notify = true;  // default is to notify listeners when the 
                         // chart changes

    this.renderingHints = new RenderingHints(
            RenderingHints.KEY_ANTIALIASING, 
            RenderingHints.VALUE_ANTIALIAS_ON);

    this.borderVisible = false;
    this.borderStroke = new BasicStroke(1.0f);
    this.borderPaint = Color.black;

    this.padding = RectangleInsets.ZERO_INSETS;
    
    this.plot = plot;
    plot.addChangeListener(this);

    this.subtitles = new ArrayList();

    // create a legend, if requested...
    if (createLegend) {
        LegendTitle legend = new LegendTitle(this.plot);
        legend.setMargin(new RectangleInsets(1.0, 1.0, 1.0, 1.0));
        legend.setFrame(new LineBorder());
        legend.setBackgroundPaint(Color.white);
        legend.setPosition(RectangleEdge.BOTTOM);
        this.subtitles.add(legend);
        legend.addChangeListener(this);
    }

    // add the chart title, if one has been specified...
    if (title != null) {
        if (titleFont == null) {
            titleFont = DEFAULT_TITLE_FONT;
        }
        this.title = new TextTitle(title, titleFont);
        this.title.addChangeListener(this);
    }

    this.backgroundPaint = DEFAULT_BACKGROUND_PAINT;

    this.backgroundImage = DEFAULT_BACKGROUND_IMAGE;
    this.backgroundImageAlignment = DEFAULT_BACKGROUND_IMAGE_ALIGNMENT;
    this.backgroundImageAlpha = DEFAULT_BACKGROUND_IMAGE_ALPHA;

}