org.jfree.data.contour.ContourDataset Java Examples
The following examples show how to use
org.jfree.data.contour.ContourDataset.
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: ContourPlot.java From SIMVA-SoS with Apache License 2.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #2
Source File: ContourPlot.java From openstock with GNU General Public License v3.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #3
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #4
Source File: ContourPlot.java From opensim-gui with Apache License 2.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #5
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #6
Source File: ContourPlot.java From ECG-Viewer with GNU General Public License v2.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #7
Source File: ContourPlot.java From ccu-historian with GNU General Public License v3.0 | 6 votes |
/** * Sets the dataset for the plot, replacing the existing dataset if there * is one. * * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(ContourDataset dataset) { // if there is an existing dataset, remove the plot from the list of // change listeners... ContourDataset existing = this.dataset; if (existing != null) { existing.removeChangeListener(this); } // set the new dataset, and register the chart as a change listener... this.dataset = dataset; if (dataset != null) { setDatasetGroup(dataset.getGroup()); dataset.addChangeListener(this); } // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); }
Example #8
Source File: StandardContourToolTipGenerator.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #9
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #10
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #11
Source File: ContourPlot.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #12
Source File: ContourPlot.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #13
Source File: StandardContourToolTipGenerator.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString = null; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #14
Source File: StandardContourToolTipGenerator.java From openstock with GNU General Public License v3.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #15
Source File: ContourPlot.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #16
Source File: ContourPlot.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #17
Source File: ContourPlot.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #18
Source File: StandardContourToolTipGenerator.java From ccu-historian with GNU General Public License v3.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #19
Source File: StandardContourToolTipGenerator.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #20
Source File: StandardContourToolTipGenerator.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #21
Source File: ContourPlot.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #22
Source File: ContourPlot.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #23
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #24
Source File: StandardContourToolTipGenerator.java From ECG-Viewer with GNU General Public License v2.0 | 5 votes |
/** * Generates a tooltip text item for a particular item within a series. * * @param data the dataset. * @param item the item index (zero-based). * * @return The tooltip text. */ @Override public String generateToolTip(ContourDataset data, int item) { double x = data.getXValue(0, item); double y = data.getYValue(0, item); double z = data.getZValue(0, item); String xString; if (data.isDateAxis(0)) { SimpleDateFormat formatter = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); StringBuffer strbuf = new StringBuffer(); strbuf = formatter.format( new Date((long) x), strbuf, new java.text.FieldPosition(0) ); xString = strbuf.toString(); } else { xString = this.valueForm.format(x); } if (!Double.isNaN(z)) { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: " + this.valueForm.format(z); } else { return "X: " + xString + ", Y: " + this.valueForm.format(y) + ", Z: no data"; } }
Example #25
Source File: ContourPlot.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #26
Source File: ContourPlot.java From opensim-gui with Apache License 2.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #27
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 5 votes |
/** * Constructs a contour plot with the specified axes (other attributes take * default values). * * @param dataset The dataset. * @param domainAxis The domain axis. * @param rangeAxis The range axis. * @param colorBar The z-axis axis. */ public ContourPlot(ContourDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, ColorBar colorBar) { super(); this.dataset = dataset; if (dataset != null) { dataset.addChangeListener(this); } this.domainAxis = domainAxis; if (domainAxis != null) { domainAxis.setPlot(this); domainAxis.addChangeListener(this); } this.rangeAxis = rangeAxis; if (rangeAxis != null) { rangeAxis.setPlot(this); rangeAxis.addChangeListener(this); } this.colorBar = colorBar; if (colorBar != null) { colorBar.getAxis().setPlot(this); colorBar.getAxis().addChangeListener(this); colorBar.configure(this); } this.colorBarLocation = RectangleEdge.LEFT; this.toolTipGenerator = new StandardContourToolTipGenerator(); }
Example #28
Source File: ContourPlot.java From SIMVA-SoS with Apache License 2.0 | 5 votes |
/** * Returns the range for the Contours. * * @return The range for the Contours (z-axis). */ @Override public Range getContourDataRange() { Range result = null; ContourDataset data = getDataset(); if (data != null) { Range h = getDomainAxis().getRange(); Range v = getRangeAxis().getRange(); result = this.visibleRange(data, h, v); } return result; }
Example #29
Source File: ContourPlot.java From openstock with GNU General Public License v3.0 | 4 votes |
/** * Draws a representation of the data within the dataArea region, using the * current renderer. * <P> * The <code>info</code> and <code>crosshairState</code> arguments may be * <code>null</code>. * * @param g2 the graphics device. * @param dataArea the region in which the data is to be drawn. * @param info an optional object for collection dimension information. * @param crosshairState an optional object for collecting crosshair info. */ public void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState) { // now get the data and plot it (the visual representation will depend // on the renderer that has been set)... ContourDataset data = getDataset(); if (data != null) { ColorBar zAxis = getColorBar(); if (this.clipPath != null) { GeneralPath clipper = getClipPath().draw(g2, dataArea, this.domainAxis, this.rangeAxis); if (this.clipPath.isClip()) { g2.clip(clipper); } } if (this.renderAsPoints) { pointRenderer(g2, dataArea, info, this, this.domainAxis, this.rangeAxis, zAxis, data, crosshairState); } else { contourRenderer(g2, dataArea, info, this, this.domainAxis, this.rangeAxis, zAxis, data, crosshairState); } // draw vertical crosshair if required... setDomainCrosshairValue(crosshairState.getCrosshairX(), false); if (isDomainCrosshairVisible()) { drawVerticalLine(g2, dataArea, getDomainCrosshairValue(), getDomainCrosshairStroke(), getDomainCrosshairPaint()); } // draw horizontal crosshair if required... setRangeCrosshairValue(crosshairState.getCrosshairY(), false); if (isRangeCrosshairVisible()) { drawHorizontalLine(g2, dataArea, getRangeCrosshairValue(), getRangeCrosshairStroke(), getRangeCrosshairPaint()); } } else if (this.clipPath != null) { getClipPath().draw(g2, dataArea, this.domainAxis, this.rangeAxis); } }
Example #30
Source File: ContourPlot.java From buffer_bci with GNU General Public License v3.0 | 4 votes |
/** * Draws a representation of the data within the dataArea region, using the * current renderer. * <P> * The <code>info</code> and <code>crosshairState</code> arguments may be * <code>null</code>. * * @param g2 the graphics device. * @param dataArea the region in which the data is to be drawn. * @param info an optional object for collection dimension information. * @param crosshairState an optional object for collecting crosshair info. */ public void render(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, CrosshairState crosshairState) { // now get the data and plot it (the visual representation will depend // on the renderer that has been set)... ContourDataset data = getDataset(); if (data != null) { ColorBar zAxis = getColorBar(); if (this.clipPath != null) { GeneralPath clipper = getClipPath().draw(g2, dataArea, this.domainAxis, this.rangeAxis); if (this.clipPath.isClip()) { g2.clip(clipper); } } if (this.renderAsPoints) { pointRenderer(g2, dataArea, info, this, this.domainAxis, this.rangeAxis, zAxis, data, crosshairState); } else { contourRenderer(g2, dataArea, info, this, this.domainAxis, this.rangeAxis, zAxis, data, crosshairState); } // draw vertical crosshair if required... setDomainCrosshairValue(crosshairState.getCrosshairX(), false); if (isDomainCrosshairVisible()) { drawVerticalLine(g2, dataArea, getDomainCrosshairValue(), getDomainCrosshairStroke(), getDomainCrosshairPaint()); } // draw horizontal crosshair if required... setRangeCrosshairValue(crosshairState.getCrosshairY(), false); if (isRangeCrosshairVisible()) { drawHorizontalLine(g2, dataArea, getRangeCrosshairValue(), getRangeCrosshairStroke(), getRangeCrosshairPaint()); } } else if (this.clipPath != null) { getClipPath().draw(g2, dataArea, this.domainAxis, this.rangeAxis); } }