當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueMarker.setLabel方法代碼示例

本文整理匯總了Java中org.jfree.chart.plot.ValueMarker.setLabel方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueMarker.setLabel方法的具體用法?Java ValueMarker.setLabel怎麽用?Java ValueMarker.setLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.plot.ValueMarker的用法示例。


在下文中一共展示了ValueMarker.setLabel方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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());
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:MarkerTests.java

示例2: 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());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:19,代碼來源:MarkerTests.java

示例3: addSliceMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
/**
 * adds the slice marker to the plot
 */
private void addSliceMarker() {
    sliceMarker = new ValueMarker(currentSlice);
    sliceMarker.setPaint(Color.gray);
    sliceMarker.setStroke(new BasicStroke(1.0f, // Width
            BasicStroke.CAP_SQUARE, // End cap
            BasicStroke.JOIN_MITER, // Join style
            10.0f, // Miter limit
            new float[]{10.0f, 10.0f}, // Dash pattern
            0.0f)); // Dash phase
    sliceMarker.setLabel("Slice");
    plot.addDomainMarker(sliceMarker);
}
 
開發者ID:fact-project,項目名稱:fact-tools,代碼行數:16,代碼來源:MainPlotPanel.java

示例4: getAverageMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
public static Marker getAverageMarker(double paramDouble) {
	ValueMarker localValueMarker = new ValueMarker(paramDouble, Color.red, new BasicStroke(0.3F));
	localValueMarker.setLabel(I18N.getMsg("msg.common.average"));
	localValueMarker.setLabelFont(new Font("SansSerif", 2, 11));
	localValueMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
	localValueMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
	return localValueMarker;
}
 
開發者ID:markkohdev,項目名稱:oStorybook,代碼行數:9,代碼來源:ChartUtil.java

示例5: getDateMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
public static Marker getDateMarker(Date paramDate, String paramString, boolean paramBoolean) {
	double d = paramDate.getTime();
	ValueMarker localValueMarker = new ValueMarker(d, Color.red, new BasicStroke(0.3F));
	localValueMarker.setLabel(paramString);
	localValueMarker.setLabelFont(new Font("SansSerif", 2, 11));
	localValueMarker.setLabelAnchor(RectangleAnchor.BOTTOM);
	if (paramBoolean) {
		localValueMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
	} else {
		localValueMarker.setLabelTextAnchor(TextAnchor.BOTTOM_LEFT);
	}
	return localValueMarker;
}
 
開發者ID:markkohdev,項目名稱:oStorybook,代碼行數:14,代碼來源:ChartUtil.java

示例6: 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

示例7: 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

示例8: makeMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
protected ValueMarker makeMarker( final double value )
{
	final ValueMarker valueMarker = new ValueMarker( value );
	valueMarker.setStroke( new BasicStroke ( 2f ) );
	valueMarker.setPaint( new Color( 0f/255f, 0f/255f, 255f/255f ) );
	valueMarker.setLabel( " Distance=" + value );
	valueMarker.setLabelPaint( Color.BLUE );
	valueMarker.setLabelAnchor( RectangleAnchor.TOP );
	valueMarker.setLabelTextAnchor( TextAnchor.TOP_LEFT );

	return valueMarker;
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:13,代碼來源:MouseListenerValue.java

示例9: makeMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
protected ValueMarker makeMarker( final int timePoint )
{
	final ValueMarker valueMarker = new ValueMarker( timePoint );
	valueMarker.setStroke( new BasicStroke ( 1.5f ) );
	valueMarker.setPaint( new Color( 0.0f, 93f/255f, 9f/255f ) );
	valueMarker.setLabel( " Reference\n Timepoint " + timePoint );
	valueMarker.setLabelAnchor(RectangleAnchor.BOTTOM );
	valueMarker.setLabelTextAnchor( TextAnchor.BOTTOM_LEFT );
	
	return valueMarker;
}
 
開發者ID:fiji,項目名稱:SPIM_Registration,代碼行數:12,代碼來源:MouseListenerTimelapse.java

示例10: 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

示例11: addValueMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
protected void addValueMarker(final JFreeChart chart,
		final double position, final String label) {
	final ValueMarker marker = new ValueMarker(position);
	marker.setPaint(Color.black);
	marker.setLabel(label);
	final XYPlot plot = (XYPlot) chart.getPlot();
	plot.addDomainMarker(marker);
}
 
開發者ID:uwol,項目名稱:ComputationalEconomy,代碼行數:9,代碼來源:HouseholdsPanel.java

示例12: addDomainMarker

import org.jfree.chart.plot.ValueMarker; //導入方法依賴的package包/類
public void addDomainMarker(XYPlot plot, cfCHARTDOMAINMARKERData dmData) throws cfmRunTimeException {
	double dbl;
	try {
		dbl = Double.parseDouble(dmData.getValue());
	} catch (NumberFormatException nfe) {
		throw newRunTimeException("the CFCHARTDOMAINMARKER value attribute must be numeric for scale charts");
	}
	ValueMarker domainMarker = new ValueMarker(dbl);
	boolean drawAsLine = true; // XY charts currently only support drawing
															// domain markers as lines
	domainMarker.setPaint(convertStringToColor(dmData.getColor()));
	if (dmData.getLabel() != null) {
		domainMarker.setLabel(dmData.getLabel());
		domainMarker.setLabelPaint(convertStringToColor(dmData.getLabelColor()));
		String labelPos = dmData.getLabelPosition();
		if (labelPos.equals("top_left")) {
			domainMarker.setLabelAnchor(RectangleAnchor.TOP_LEFT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
		} else if (labelPos.equals("top")) {
			domainMarker.setLabelAnchor(RectangleAnchor.TOP);
			domainMarker.setLabelTextAnchor(TextAnchor.TOP_CENTER);
		} else if (labelPos.equals("top_right")) {
			domainMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.TOP_LEFT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
		} else if (labelPos.equals("left")) {
			domainMarker.setLabelAnchor(RectangleAnchor.LEFT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.CENTER_RIGHT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
		} else if (labelPos.equals("center")) {
			domainMarker.setLabelAnchor(RectangleAnchor.CENTER);
			domainMarker.setLabelTextAnchor(TextAnchor.CENTER);
		} else if (labelPos.equals("right")) {
			domainMarker.setLabelAnchor(RectangleAnchor.RIGHT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.CENTER_LEFT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.CENTER_RIGHT);
		} else if (labelPos.equals("bottom_left")) {
			domainMarker.setLabelAnchor(RectangleAnchor.BOTTOM_LEFT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.BOTTOM_LEFT);
		} else if (labelPos.equals("bottom")) {
			domainMarker.setLabelAnchor(RectangleAnchor.BOTTOM);
			domainMarker.setLabelTextAnchor(TextAnchor.BOTTOM_CENTER);
		} else if (labelPos.equals("bottom_right")) {
			domainMarker.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT);
			if (drawAsLine)
				domainMarker.setLabelTextAnchor(TextAnchor.BOTTOM_LEFT);
			else
				domainMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
		}
		domainMarker.setLabelOffsetType(LengthAdjustmentType.NO_CHANGE);
		domainMarker.setLabelFont(getFont(dmData.getFont(), dmData.getFontBold(), dmData.getFontItalic(), dmData.getFontSize()));
	}
	plot.addDomainMarker(domainMarker, Layer.BACKGROUND);
}
 
開發者ID:OpenBD,項目名稱:openbd-core,代碼行數:67,代碼來源:cfCHART.java


注:本文中的org.jfree.chart.plot.ValueMarker.setLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。