当前位置: 首页>>代码示例>>Java>>正文


Java ValueMarker.setLabelOffset方法代码示例

本文整理汇总了Java中org.jfree.chart.plot.ValueMarker.setLabelOffset方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMarker.setLabelOffset方法的具体用法?Java ValueMarker.setLabelOffset怎么用?Java ValueMarker.setLabelOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.plot.ValueMarker的用法示例。


在下文中一共展示了ValueMarker.setLabelOffset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:MarkerTests.java

示例2: 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);
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:24,代码来源:MarkerTests.java

示例3: addKillEvent

import org.jfree.chart.plot.ValueMarker; //导入方法依赖的package包/类
private static void addKillEvent(XYPlot xyplot, long pos) {
	ValueMarker vm = new ValueMarker(pos);
	vm.setPaint(ChartColor.VERY_DARK_GREEN);
	vm.setLabelOffset(new RectangleInsets(10.0D, 1.0D, 1.0D, 1.0D));
	vm.setLabel("Container Kill Event");
	vm.setStroke(new BasicStroke(2));
	xyplot.addDomainMarker(vm);
}
 
开发者ID:project-flink,项目名称:flink-perf,代码行数:9,代码来源:KafkaFT.java

示例4: addIllegalEvent

import org.jfree.chart.plot.ValueMarker; //导入方法依赖的package包/类
private static void addIllegalEvent(XYPlot xyplot, long pos) {
	ValueMarker vm = new ValueMarker(pos);
	vm.setPaint(ChartColor.LIGHT_YELLOW);
	vm.setLabelOffset(new RectangleInsets(10.0D, 1.0D, 1.0D, 1.0D));
	vm.setLabel("Illegal State");
	vm.setStroke(new BasicStroke(2));
	xyplot.addDomainMarker(vm);
}
 
开发者ID:project-flink,项目名称:flink-perf,代码行数:9,代码来源:KafkaFT.java

示例5: addData

import org.jfree.chart.plot.ValueMarker; //导入方法依赖的package包/类
public void addData(int datasetIndex, double x, double y){
	XYSeries series = dataCollection.get(datasetIndex).getSeries(0);
	series.add(x, y);

	if(showCurrentAverage){
		if(markers[datasetIndex] != null){
			plot.removeRangeMarker(markers[datasetIndex]);
		}
		
		pastData[datasetIndex].add(y);

		double average = pastData[datasetIndex].getAverage();
		
		ValueMarker marker = new ValueMarker(average);
		marker.setPaint(Color.black);
		String label = String.format(labelFormat, average);

		marker.setLabel(label);
		marker.setLabelOffset(new RectangleInsets(10, 0, 0, 10));
		marker.setLabelAnchor(RectangleAnchor.RIGHT);

		markers[datasetIndex] = marker;
		plot.addRangeMarker(marker);
	}


}
 
开发者ID:yeokm1,项目名称:odroid-power-measure,代码行数:28,代码来源:Chart.java


注:本文中的org.jfree.chart.plot.ValueMarker.setLabelOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。