本文整理匯總了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);
}