本文整理汇总了Java中org.jfree.chart.axis.DateAxis.setMaximumDate方法的典型用法代码示例。如果您正苦于以下问题:Java DateAxis.setMaximumDate方法的具体用法?Java DateAxis.setMaximumDate怎么用?Java DateAxis.setMaximumDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.axis.DateAxis
的用法示例。
在下文中一共展示了DateAxis.setMaximumDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSetMaximumDate
import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
* Test that the setMaximumDate() method works.
*/
public void testSetMaximumDate() {
DateAxis axis = new DateAxis("Test Axis");
Date date = new Date();
axis.setMaximumDate(date);
assertEquals(date, axis.getMaximumDate());
// check that setting the max date to something on or before the
// current min date works...
Date d1 = new Date();
Date d2 = new Date(d1.getTime() + 1);
Date d0 = new Date(d1.getTime() - 1);
axis.setMaximumDate(d2);
axis.setMinimumDate(d1);
axis.setMaximumDate(d1);
assertEquals(d0, axis.getMinimumDate());
}
示例2: testSetMaximumDate
import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
* Test that the setMaximumDate() method works.
*/
public void testSetMaximumDate() {
DateAxis axis = new DateAxis("Test Axis");
Date date = new Date();
axis.setMaximumDate(date);
assertEquals(date, axis.getMaximumDate());
}
示例3: testSetMinimumDate
import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
* Test that the setMinimumDate() method works.
*/
public void testSetMinimumDate() {
DateAxis axis = new DateAxis("Test Axis");
Date d1 = new Date();
Date d2 = new Date(d1.getTime() + 1);
axis.setMaximumDate(d2);
axis.setMinimumDate(d1);
assertEquals(d1, axis.getMinimumDate());
}
示例4: testSetMinimumDate
import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
/**
* Test that the setMinimumDate() method works.
*/
public void testSetMinimumDate() {
DateAxis axis = new DateAxis("Test Axis");
Date d1 = new Date();
Date d2 = new Date(d1.getTime() + 1);
axis.setMaximumDate(d2);
axis.setMinimumDate(d1);
assertEquals(d1, axis.getMinimumDate());
// check that setting the min date to something on or after the
// current min date works...
Date d3 = new Date(d2.getTime() + 1);
axis.setMinimumDate(d2);
assertEquals(d3, axis.getMaximumDate());
}
示例5: PannableTimeChartPanel
import org.jfree.chart.axis.DateAxis; //导入方法依赖的package包/类
public PannableTimeChartPanel(long startTime, long endTime, TimeSeriesCollection dataset) {
double interval = ((endTime - startTime) / (30000.));
JFreeChart chart = ChartFactory.createXYLineChart(
"Memory Telemtry View", "Time",
"Memory (Mb)", dataset, PlotOrientation.VERTICAL,
true, true, false
);
plot = (XYPlot) chart.getPlot();
DateAxis domainAxis = new DateAxis();
plot.setDomainAxis(domainAxis);
domainAxis.setLabelAngle(Math.PI / 2);
domainAxis.setAutoRange(true);
domainAxis.setMinimumDate(new Date(startTime));
domainAxis.setMaximumDate(new Date(startTime + 30L * 1000L));
plot.setDomainPannable(true);
setLayout(new BorderLayout());
add(new ChartPanel(chart), BorderLayout.CENTER);
JScrollBar panScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
rangeModel = new DefaultBoundedRangeModel();
rangeModel.setMinimum(0);
rangeModel.setMaximum((int)((interval - 1) * 100));
rangeModel.addChangeListener(this);
panScrollBar.setModel(rangeModel);
add(panScrollBar, BorderLayout.SOUTH);
}