本文整理汇总了Java中org.jfree.data.time.TimeSeries.setKey方法的典型用法代码示例。如果您正苦于以下问题:Java TimeSeries.setKey方法的具体用法?Java TimeSeries.setKey怎么用?Java TimeSeries.setKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.time.TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.setKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSeriesLabel
import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
@Override
public void setSeriesLabel(int seriesIndex, String newLabel) {
TimeSeries series = this.getSeries(seriesIndex);
if(series != null){
series.setKey(newLabel);
}
this.setChanged();
this.notifyObservers(ChartModel.EventType.SERIES_RENAMED);
}
示例2: testEquals
import org.jfree.data.time.TimeSeries; //导入方法依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
TimeSeries s1 = new TimeSeries("Time Series 1");
TimeSeries s2 = new TimeSeries("Time Series 2");
boolean b1 = s1.equals(s2);
assertFalse("b1", b1);
s2.setKey("Time Series 1");
boolean b2 = s1.equals(s2);
assertTrue("b2", b2);
RegularTimePeriod p1 = new Day();
RegularTimePeriod p2 = p1.next();
s1.add(p1, 100.0);
s1.add(p2, 200.0);
boolean b3 = s1.equals(s2);
assertFalse("b3", b3);
s2.add(p1, 100.0);
s2.add(p2, 200.0);
boolean b4 = s1.equals(s2);
assertTrue("b4", b4);
s1.setMaximumItemCount(100);
boolean b5 = s1.equals(s2);
assertFalse("b5", b5);
s2.setMaximumItemCount(100);
boolean b6 = s1.equals(s2);
assertTrue("b6", b6);
s1.setMaximumItemAge(100);
boolean b7 = s1.equals(s2);
assertFalse("b7", b7);
s2.setMaximumItemAge(100);
boolean b8 = s1.equals(s2);
assertTrue("b8", b8);
}