本文整理匯總了Java中org.jfree.chart.plot.ValueMarker.addChangeListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueMarker.addChangeListener方法的具體用法?Java ValueMarker.addChangeListener怎麽用?Java ValueMarker.addChangeListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.plot.ValueMarker
的用法示例。
在下文中一共展示了ValueMarker.addChangeListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testGetSetLabelOffset
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelOffset() and setLabelOffset() methods.
*/
public void testGetSetLabelOffset() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new RectangleInsets(3, 3, 3, 3), m.getLabelOffset());
m.setLabelOffset(new RectangleInsets(1, 2, 3, 4));
assertEquals(new RectangleInsets(1, 2, 3, 4), m.getLabelOffset());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelOffset(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例2: testGetSetPaint
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getPaint() and setPaint() methods.
*/
public void testGetSetPaint() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(Color.gray, m.getPaint());
m.setPaint(Color.blue);
assertEquals(Color.blue, m.getPaint());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setPaint(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例3: testGetSetStroke
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getStroke() and setStroke() methods.
*/
public void testGetSetStroke() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new BasicStroke(0.5f), m.getStroke());
m.setStroke(new BasicStroke(1.1f));
assertEquals(new BasicStroke(1.1f), m.getStroke());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setStroke(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例4: testGetSetOutlinePaint
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getOutlinePaint() and setOutlinePaint() methods.
*/
public void testGetSetOutlinePaint() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(Color.gray, m.getOutlinePaint());
m.setOutlinePaint(Color.yellow);
assertEquals(Color.yellow, m.getOutlinePaint());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
m.setOutlinePaint(null);
assertEquals(null, m.getOutlinePaint());
}
示例5: testGetSetOutlineStroke
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getOutlineStroke() and setOutlineStroke() methods.
*/
public void testGetSetOutlineStroke() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new BasicStroke(0.5f), m.getOutlineStroke());
m.setOutlineStroke(new BasicStroke(1.1f));
assertEquals(new BasicStroke(1.1f), m.getOutlineStroke());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
m.setOutlineStroke(null);
assertEquals(null, m.getOutlineStroke());
}
示例6: testGetSetLabel
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabel() and setLabel() methods.
*/
public void testGetSetLabel() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(null, m.getLabel());
m.setLabel("XYZ");
assertEquals("XYZ", m.getLabel());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
m.setLabel(null);
assertEquals(null, m.getLabel());
}
示例7: testGetSetLabelFont
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelFont() and setLabelFont() methods.
*/
public void testGetSetLabelFont() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new Font("SansSerif", Font.PLAIN, 9), m.getLabelFont());
m.setLabelFont(new Font("SansSerif", Font.BOLD, 10));
assertEquals(new Font("SansSerif", Font.BOLD, 10), m.getLabelFont());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelFont(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例8: testGetSetLabelPaint
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelPaint() and setLabelPaint() methods.
*/
public void testGetSetLabelPaint() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(Color.black, m.getLabelPaint());
m.setLabelPaint(Color.red);
assertEquals(Color.red, m.getLabelPaint());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelPaint(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例9: testGetSetLabelAnchor
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelAnchor() and setLabelAnchor() methods.
*/
public void testGetSetLabelAnchor() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(RectangleAnchor.TOP_LEFT, m.getLabelAnchor());
m.setLabelAnchor(RectangleAnchor.TOP);
assertEquals(RectangleAnchor.TOP, m.getLabelAnchor());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelAnchor(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例10: testGetSetLabelOffsetType
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelOffsetType() and setLabelOffsetType()
* methods.
*/
public void testGetSetLabelOffsetType() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(LengthAdjustmentType.CONTRACT, m.getLabelOffsetType());
m.setLabelOffsetType(LengthAdjustmentType.EXPAND);
assertEquals(LengthAdjustmentType.EXPAND, m.getLabelOffsetType());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelOffsetType(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例11: testGetSetLabelTextAnchor
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelTextAnchor() and setLabelTextAnchor()
* methods.
*/
public void testGetSetLabelTextAnchor() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(TextAnchor.CENTER, m.getLabelTextAnchor());
m.setLabelTextAnchor(TextAnchor.BASELINE_LEFT);
assertEquals(TextAnchor.BASELINE_LEFT, m.getLabelTextAnchor());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelTextAnchor(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例12: testGetSetLabelPaint
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelPaint() and setLabelPaint() methods.
*/
public void testGetSetLabelPaint() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(Color.black, m.getLabelPaint());
m.setLabelPaint(Color.red);
assertEquals(Color.red, m.getLabelPaint());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelPaint(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例13: testGetSetLabelOffset
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getLabelOffset() and setLabelOffset() methods.
*/
public void testGetSetLabelOffset() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new RectangleInsets(3, 3, 3, 3), m.getLabelOffset());
m.setLabelOffset(new RectangleInsets(1, 2, 3, 4));
assertEquals(new RectangleInsets(1, 2, 3, 4), m.getLabelOffset());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setLabelOffset(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例14: testGetSetPaint
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getPaint() and setPaint() methods.
*/
public void testGetSetPaint() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(Color.gray, m.getPaint());
m.setPaint(Color.blue);
assertEquals(Color.blue, m.getPaint());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setPaint(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}
示例15: testGetSetStroke
import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
* Some checks for the getStroke() and setStroke() methods.
*/
public void testGetSetStroke() {
// we use ValueMarker for the tests, because we need a concrete
// subclass...
ValueMarker m = new ValueMarker(1.1);
m.addChangeListener(this);
this.lastEvent = null;
assertEquals(new BasicStroke(0.5f), m.getStroke());
m.setStroke(new BasicStroke(1.1f));
assertEquals(new BasicStroke(1.1f), m.getStroke());
assertEquals(m, this.lastEvent.getMarker());
// check null argument...
try {
m.setStroke(null);
fail("Expected an IllegalArgumentException for null.");
}
catch (IllegalArgumentException e) {
assertTrue(true);
}
}