本文整理汇总了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);
}
}
示例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;
}
示例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);
}