⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractxyitemrenderer.java

📁 这是一个segy数据显示程序
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
     * @param generator  the generator (<code>null</code> permitted).     */    public void setSeriesToolTipGenerator(int series, XYToolTipGenerator generator) {        this.toolTipGeneratorList.set(series, generator);        notifyListeners(new RendererChangeEvent(this));    }    /**     * Returns the base tool tip generator.     *     * @return The generator (possibly <code>null</code>).     */    public XYToolTipGenerator getBaseToolTipGenerator() {        return this.baseToolTipGenerator;    }    /**     * Sets the base tool tip generator and sends a {@link RendererChangeEvent}     * to all registered listeners.     *     * @param generator  the generator (<code>null</code> permitted).     */    public void setBaseToolTipGenerator(XYToolTipGenerator generator) {        this.baseToolTipGenerator = generator;        notifyListeners(new RendererChangeEvent(this));    }    // URL GENERATOR        /**     * Returns the URL generator for HTML image maps.     *     * @return the URL generator (possibly <code>null</code>).     */    public XYURLGenerator getURLGenerator() {        return this.urlGenerator;    }    /**     * Sets the URL generator for HTML image maps.     *     * @param urlGenerator  the URL generator (<code>null</code> permitted).     */    public void setURLGenerator(XYURLGenerator urlGenerator) {        this.urlGenerator = urlGenerator;        notifyListeners(new RendererChangeEvent(this));    }    /**     * Returns the range type for the renderer.     * <p>     * The default implementation returns <code>STANDARD</code>, subclasses may override this     * behaviour.     * <p>     * The {@link org.jfree.chart.plot.XYPlot} uses this information when auto-calculating     * the range for the axis.     *     * @return the range type.     */    public RangeType getRangeType() {        return RangeType.STANDARD;    }    /**     * Returns the range of values the renderer requires to display all the items from the     * specified dataset.     *      * @param dataset  the dataset (<code>null</code> permitted).     *      * @return The range (or <code>null</code> if the dataset is <code>null</code> or empty).     */    public Range getRangeExtent(XYDataset dataset) {        return DatasetUtilities.getRangeExtent(dataset);       }    /**     * Returns a legend item for a series.     *     * @param datasetIndex  the dataset index (zero-based).     * @param series  the series index (zero-based).     *     * @return a legend item for the series.     */    public LegendItem getLegendItem(int datasetIndex, int series) {        LegendItem result = null;        XYPlot xyplot = getPlot();        if (xyplot != null) {            XYDataset dataset = xyplot.getDataset(datasetIndex);            if (dataset != null) {                String label = dataset.getSeriesName(series);                String description = label;                Shape shape = getSeriesShape(series);                Paint paint = getSeriesPaint(series);                Paint outlinePaint = getSeriesOutlinePaint(series);                Stroke stroke = getSeriesStroke(series);                result = new LegendItem(                    label, description, shape, true, paint, stroke, outlinePaint, stroke                );            }        }        return result;    }    /**     * Fills a band between two values on the axis.  This can be used to color bands between the     * grid lines.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the domain axis.     * @param dataArea  the data area.     * @param start  the start value.     * @param end  the end value.     */    public void fillDomainGridBand(Graphics2D g2,                                   XYPlot plot,                                   ValueAxis axis,                                   Rectangle2D dataArea,                                   double start, double end) {        double x1 = axis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge());        double x2 = axis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge());        // TODO: need to change the next line to take account of plot orientation...        Rectangle2D band = new Rectangle2D.Double(            x1, dataArea.getMinY(), x2 - x1, dataArea.getMaxY() - dataArea.getMinY()        );        Paint paint = plot.getDomainTickBandPaint();        if (paint != null) {            g2.setPaint(paint);            g2.fill(band);        }    }    /**     * Fills a band between two values on the range axis.  This can be used to color bands between     * the grid lines.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the range axis.     * @param dataArea  the data area.     * @param start  the start value.     * @param end  the end value.     */    public void fillRangeGridBand(Graphics2D g2,                                  XYPlot plot,                                  ValueAxis axis,                                  Rectangle2D dataArea,                                  double start, double end) {        double y1 = axis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());        double y2 = axis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());        // TODO: need to change the next line to take account of the plot orientation        Rectangle2D band = new Rectangle2D.Double(            dataArea.getMinX(), y2, dataArea.getWidth(), y1 - y2        );        Paint paint = plot.getRangeTickBandPaint();        if (paint != null) {            g2.setPaint(paint);            g2.fill(band);        }    }    /**     * Draws a grid line against the range axis.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param dataArea  the area for plotting data (not yet adjusted for any 3D effect).     * @param value  the value at which the grid line should be drawn.     *     */    public void drawDomainGridLine(Graphics2D g2,                                   XYPlot plot,                                   ValueAxis axis,                                   Rectangle2D dataArea,                                   double value) {        Range range = axis.getRange();        if (!range.contains(value)) {            return;        }        PlotOrientation orientation = plot.getOrientation();        double v = axis.valueToJava2D(value, dataArea, plot.getDomainAxisEdge());        Line2D line = null;        if (orientation == PlotOrientation.HORIZONTAL) {            line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);        }        else if (orientation == PlotOrientation.VERTICAL) {            line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());        }        Paint paint = plot.getDomainGridlinePaint();        Stroke stroke = plot.getDomainGridlineStroke();        g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT);        g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE);        g2.draw(line);    }    /**     * Draws a grid line against the range axis.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param axis  the value axis.     * @param dataArea  the area for plotting data (not yet adjusted for any 3D effect).     * @param value  the value at which the grid line should be drawn.     *     */    public void drawRangeGridLine(Graphics2D g2,                                  XYPlot plot,                                  ValueAxis axis,                                  Rectangle2D dataArea,                                  double value) {        Range range = axis.getRange();        if (!range.contains(value)) {            return;        }        PlotOrientation orientation = plot.getOrientation();        Line2D line = null;        double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());        if (orientation == PlotOrientation.HORIZONTAL) {            line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());        }        else if (orientation == PlotOrientation.VERTICAL) {            line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);        }        Paint paint = plot.getRangeGridlinePaint();        Stroke stroke = plot.getRangeGridlineStroke();        g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT);        g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE);        g2.draw(line);    }    /**     * Draws a vertical line on the chart to represent a 'range marker'.     *     * @param g2  the graphics device.     * @param plot  the plot.     * @param domainAxis  the domain axis.     * @param marker  the marker line.     * @param dataArea  the axis data area.     */    public void drawDomainMarker(Graphics2D g2,                                 XYPlot plot,                                 ValueAxis domainAxis,                                 Marker marker,                                 Rectangle2D dataArea) {        if (marker instanceof ValueMarker) {            ValueMarker vm = (ValueMarker) marker;            double value = vm.getValue();            Range range = domainAxis.getRange();            if (!range.contains(value)) {                return;            }            double v = domainAxis.valueToJava2D(value, dataArea, plot.getDomainAxisEdge());            PlotOrientation orientation = plot.getOrientation();            Line2D line = null;            if (orientation == PlotOrientation.HORIZONTAL) {                line = new Line2D.Double(dataArea.getMinX(), v, dataArea.getMaxX(), v);            }            else if (orientation == PlotOrientation.VERTICAL) {                line = new Line2D.Double(v, dataArea.getMinY(), v, dataArea.getMaxY());            }            g2.setPaint(marker.getPaint());            g2.setStroke(marker.getStroke());            g2.draw(line);            String label = marker.getLabel();            RectangleAnchor anchor = marker.getLabelAnchor();            if (label != null) {                Font labelFont = marker.getLabelFont();                g2.setFont(labelFont);                g2.setPaint(marker.getLabelPaint());                double[] coordinates = calculateDomainMarkerTextAnchorPoint(                    g2, orientation, dataArea, line.getBounds2D(), marker.getLabelOffset(), anchor,                     false                );                RefineryUtilities.drawAlignedString(                    label, g2, (float) coordinates[0], (float) coordinates[1],                     marker.getLabelTextAnchor()                );            }        }        else if (marker instanceof IntervalMarker) {            IntervalMarker im = (IntervalMarker) marker;            double start = im.getStartValue();            double end = im.getEndValue();            Range range = domainAxis.getRange();            if (!(range.intersects(start, end))) {                return;            }            // don't draw beyond the axis range...            start = range.constrain(start);            end = range.constrain(end);            double v0 = domainAxis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge());            double v1 = domainAxis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge());            PlotOrientation orientation = plot.getOrientation();            Rectangle2D rect = null;            if (orientation == PlotOrientation.HORIZONTAL) {                rect = new Rectangle2D.Double(                    dataArea.getMinX(), Math.min(v0, v1), dataArea.getWidth(), Math.abs(v1 - v0)                );            }            else if (orientation == PlotOrientation.VERTICAL) {                rect = new Rectangle2D.Double(                    Math.min(v0, v1), dataArea.getMinY(), Math.abs(v1 - v0), dataArea.getHeight()                );            }            g2.setPaint(marker.getPaint());            g2.fill(rect);            String label = marker.getLabel();            RectangleAnchor anchor = marker.getLabelAnchor();            if (label != null) {                Font labelFont = marker.getLabelFont();                g2.setFont(labelFont);                g2.setPaint(marker.getLabelPaint());                double[] coordinates = calculateDomainMarkerTextAnchorPoint(                    g2, orientation, dataArea, rect, marker.getLabelOffset(), anchor, true                );                RefineryUtilities.drawAlignedString(                    label, g2, (float) coordinates[0], (float) coordinates[1], 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -