本文整理汇总了Java中org.jfree.chart.annotations.XYBoxAnnotation类的典型用法代码示例。如果您正苦于以下问题:Java XYBoxAnnotation类的具体用法?Java XYBoxAnnotation怎么用?Java XYBoxAnnotation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XYBoxAnnotation类属于org.jfree.chart.annotations包,在下文中一共展示了XYBoxAnnotation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testHashCode
import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashCode() {
XYBoxAnnotation a1 = new XYBoxAnnotation(
1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
);
XYBoxAnnotation a2 = new XYBoxAnnotation(
1.0, 2.0, 3.0, 4.0, new BasicStroke(1.2f), Color.red, Color.blue
);
assertTrue(a1.equals(a2));
int h1 = a1.hashCode();
int h2 = a2.hashCode();
assertEquals(h1, h2);
}
示例2: testHashCode
import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashCode() {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.red, Color.blue);
XYBoxAnnotation a2 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.red, Color.blue);
assertTrue(a1.equals(a2));
int h1 = a1.hashCode();
int h2 = a2.hashCode();
assertEquals(h1, h2);
}
示例3: testDrawWithNullInfo
import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> info object to make sure that
* no exceptions are thrown.
*/
public void testDrawWithNullInfo() {
boolean success = false;
try {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries s1 = new XYSeries("Series 1", true, false);
s1.add(5.0, 5.0);
s1.add(10.0, 15.5);
s1.add(15.0, 9.5);
s1.add(20.0, 7.5);
dataset.addSeries(s1);
XYSeries s2 = new XYSeries("Series 2", true, false);
s2.add(5.0, 5.0);
s2.add(10.0, 15.5);
s2.add(15.0, 9.5);
s2.add(20.0, 3.5);
dataset.addSeries(s2);
XYPlot plot = new XYPlot(dataset,
new NumberAxis("X"), new NumberAxis("Y"),
new XYLineAndShapeRenderer());
plot.addAnnotation(new XYBoxAnnotation(10.0, 12.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.red, Color.blue));
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例4: testPublicCloneable
import org.jfree.chart.annotations.XYBoxAnnotation; //导入依赖的package包/类
/**
* Checks that this class implements PublicCloneable.
*/
public void testPublicCloneable() {
XYBoxAnnotation a1 = new XYBoxAnnotation(1.0, 2.0, 3.0, 4.0,
new BasicStroke(1.2f), Color.red, Color.blue);
assertTrue(a1 instanceof PublicCloneable);
}