當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。