当前位置: 首页>>代码示例>>Java>>正文


Java CombinedDomainXYPlot.getSubplots方法代码示例

本文整理汇总了Java中org.jfree.chart.plot.CombinedDomainXYPlot.getSubplots方法的典型用法代码示例。如果您正苦于以下问题:Java CombinedDomainXYPlot.getSubplots方法的具体用法?Java CombinedDomainXYPlot.getSubplots怎么用?Java CombinedDomainXYPlot.getSubplots使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.plot.CombinedDomainXYPlot的用法示例。


在下文中一共展示了CombinedDomainXYPlot.getSubplots方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: slideChart

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
public void slideChart(int increment, Rectangle2D plotarea) {

        CombinedDomainXYPlot combinedDomainXYPlot = (CombinedDomainXYPlot) jFreeChart.getXYPlot();
        @SuppressWarnings("unchecked") List<XYPlot> subplots = combinedDomainXYPlot.getSubplots();

        if (subplots.size() != 2) {
            return;
        } else {
            int upChartweight = subplots.get(0).getWeight();
            int newUpChartWeight = upChartweight-increment;
            if (newUpChartWeight <= 0 || newUpChartWeight >= CHARTS_TOTAL_WEIGHT) return;
            subplots.get(0).setWeight(newUpChartWeight);
            int lowChartweight = subplots.get(1).getWeight();
            int newLowChartWeight = lowChartweight+increment;
            if (newLowChartWeight <= 0 || newLowChartWeight >= CHARTS_TOTAL_WEIGHT) return;
            subplots.get(1).setWeight(newLowChartWeight);
            indicPlotWeight = newLowChartWeight;

            resetVerticalLines(plotarea);
        }

    }
 
开发者ID:premiummarkets,项目名称:pm,代码行数:23,代码来源:ChartMain.java

示例2: isSlidingArea

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
public Boolean isSlidingArea(double chartY, double mouseY) {

        CombinedDomainXYPlot combinedDomainXYPlot = (CombinedDomainXYPlot) jFreeChart.getXYPlot();
        @SuppressWarnings("unchecked") List<XYPlot> subplots = combinedDomainXYPlot.getSubplots();
        double xAxisDim = 20;

        if (subplots.size() != 2) {
            return false;
        } else {
            double mousePos = mouseY/(chartY-xAxisDim);
            double slidingArea = (double)subplots.get(0).getWeight()/(double)CHARTS_TOTAL_WEIGHT;
            if (slidingArea + .01 >= mousePos && mousePos >= slidingArea - .01) {
                return true;
            }
        }

        return false;
    }
 
开发者ID:premiummarkets,项目名称:pm,代码行数:19,代码来源:ChartMain.java

示例3: testRemoveSubplot

import org.jfree.chart.plot.CombinedDomainXYPlot; //导入方法依赖的package包/类
/**
 * This is a test to replicate the bug report 987080.
 */
public void testRemoveSubplot() {
    CombinedDomainXYPlot plot = new CombinedDomainXYPlot();
    XYPlot plot1 = new XYPlot();
    XYPlot plot2 = new XYPlot();
    plot.add(plot1);
    plot.add(plot2);
    // remove plot2, but plot1 is removed instead
    plot.remove(plot2);
    List plots = plot.getSubplots();
    assertTrue(plots.get(0) == plot1);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:CombinedDomainXYPlotTests.java


注:本文中的org.jfree.chart.plot.CombinedDomainXYPlot.getSubplots方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。