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


Java PLine類代碼示例

本文整理匯總了Java中edu.umd.cs.piccolox.nodes.PLine的典型用法代碼示例。如果您正苦於以下問題:Java PLine類的具體用法?Java PLine怎麽用?Java PLine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PLine類屬於edu.umd.cs.piccolox.nodes包,在下文中一共展示了PLine類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: GraphLegend

import edu.umd.cs.piccolox.nodes.PLine; //導入依賴的package包/類
public GraphLegend() {

            // Create the background and main shape.
            _background = new PPath();
            _background.setStroke( LEGEND_BORDER_STROKE );
            _background.setStrokePaint( LEGEND_BORDER_COLOR );
            _background.setPaint( LEGEND_BACKGROUND_COLOR );
            addChild( _background );

            // Add the title.
            _title = new PText( NuclearPhysicsStrings.POTENTIAL_PROFILE_LEGEND_TITLE );
            _title.setFont( new PhetFont( Font.BOLD, 14 ) );
            _background.addChild( _title );

            // Add other text and graphics to the legend.
            _potentialEnergyLine = new PLine();
            _potentialEnergyLine.setStrokePaint( POTENTIAL_ENERGY_LINE_COLOR );
            _potentialEnergyLine.setStroke( ENERGY_LINE_STROKE );
            _background.addChild( _potentialEnergyLine );

            _potentialEnergyLabel = new PText( NuclearPhysicsStrings.POTENTIAL_PROFILE_POTENTIAL_ENERGY );
            _potentialEnergyLabel.setFont( new PhetFont( Font.PLAIN, 14 ) );
            _background.addChild( _potentialEnergyLabel );

            _totalEnergyLine = new PLine();
            _totalEnergyLine.setStrokePaint( TOTAL_ENERGY_LINE_COLOR );
            _totalEnergyLine.setStroke( ENERGY_LINE_STROKE );
            _background.addChild( _totalEnergyLine );

            _totalEnergyLabel = new PText( NuclearPhysicsStrings.POTENTIAL_PROFILE_TOTAL_ENERGY );
            _totalEnergyLabel.setFont( new PhetFont( Font.PLAIN, 14 ) );
            _background.addChild( _totalEnergyLabel );
        }
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:34,代碼來源:AlphaDecayEnergyChart.java

示例2: drawBorderLine

import edu.umd.cs.piccolox.nodes.PLine; //導入依賴的package包/類
private PLine drawBorderLine(double x,double y, double x2, double y2)
{
	PLine pline = new PLine();
	pline.addPoint(0, x, y);
	pline.addPoint(1, x2, y2);
	pline.setStroke(new BasicStroke( 1.0f ));
	pline.setStrokePaint( CGrid.item_border );
	return pline;
}
 
開發者ID:uci-sdcl,項目名稱:Calico,代碼行數:10,代碼來源:CGridCell.java

示例3: drawDashedBorderLine

import edu.umd.cs.piccolox.nodes.PLine; //導入依賴的package包/類
private PLine drawDashedBorderLine(double x,double y, double x2, double y2)
{
	PLine pline = new PLine();
	pline.addPoint(0, x, y);
	pline.addPoint(1, x2, y2);
	float[] dashFloat = {5f, 10f};
	pline.setStroke(new BasicStroke( 5.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER, 10.0f, dashFloat ,0f));
	pline.setStrokePaint( CGrid.item_border );
	return pline;
}
 
開發者ID:uci-sdcl,項目名稱:Calico,代碼行數:11,代碼來源:CGrid.java

示例4: drawBorderLine

import edu.umd.cs.piccolox.nodes.PLine; //導入依賴的package包/類
private PLine drawBorderLine(int x,int y, int x2, int y2)
{
	PLine pline = new PLine();
	pline.addPoint(0, x, y);
	pline.addPoint(1, x2, y2);
	pline.setStroke(new BasicStroke( 1.0f ));
	pline.setStrokePaint( CCanvasController.getActiveCanvasBackgroundColor() );
	return pline;
}
 
開發者ID:uci-sdcl,項目名稱:Calico,代碼行數:10,代碼來源:CCanvas.java

示例5: addRenderingElements

import edu.umd.cs.piccolox.nodes.PLine; //導入依賴的package包/類
protected void addRenderingElements()
{
	if (arrowType == CArrow.TYPE_NORM_HEAD_AB || arrowType == CArrow.TYPE_NORM_HEAD_A)
	{
		arrowHeadA = null;

		int[] apoints = Geometry.createArrow(anchorB.getPoint().x, anchorB.getPoint().y, anchorA.getPoint().x, anchorA.getPoint().y,
				CalicoOptions.arrow.length, CalicoOptions.arrow.angle, CalicoOptions.arrow.inset);

		arrowHeadA = new PPath();
		arrowHeadA.moveTo((float) apoints[0], (float) apoints[1]);
		for (int i = 2; i < apoints.length; i = i + 2)
		{
			arrowHeadA.lineTo((float) apoints[i], (float) apoints[i + 1]);
		}
		arrowHeadA.setStroke(new BasicStroke(CalicoOptions.arrow.stroke_size));
		arrowHeadA.setStrokePaint(this.color);
		arrowHeadA.setPaint(this.color);

		//this.addChild(0, arrowHeadA);
		//CalicoDraw.addChildToNode(this, arrowHeadA, 0);
	}
	if (arrowType == CArrow.TYPE_NORM_HEAD_AB || arrowType == CArrow.TYPE_NORM_HEAD_B)
	{
		int[] bpoints = Geometry.createArrow(anchorA.getPoint().x, anchorA.getPoint().y, anchorB.getPoint().x, anchorB.getPoint().y,
				CalicoOptions.arrow.length, CalicoOptions.arrow.angle, CalicoOptions.arrow.inset);

		arrowHeadB = new PPath();
		arrowHeadB.moveTo((float) bpoints[0], (float) bpoints[1]);
		for (int i = 2; i < bpoints.length; i = i + 2)
		{
			arrowHeadB.lineTo((float) bpoints[i], (float) bpoints[i + 1]);
		}
		arrowHeadB.setStroke(new BasicStroke(CalicoOptions.arrow.stroke_size));
		arrowHeadB.setStrokePaint(this.color);
		arrowHeadB.setPaint(this.color);
		//this.addChild(0, arrowHeadB);
		//CalicoDraw.addChildToNode(this, arrowHeadB, 0);
	}

	arrowLine = new PLine();
	arrowLine.addPoint(0, anchorA.getPoint().x, anchorA.getPoint().y);
	arrowLine.addPoint(1, anchorB.getPoint().x, anchorB.getPoint().y);
	arrowLine.setStroke(new BasicStroke(CalicoOptions.arrow.stroke_size));
	arrowLine.setStrokePaint(this.color);
	arrowLine.setPaint(this.color);

	//this.addChild(0, arrowLine);
	//CalicoDraw.addChildToNode(this, arrowLine, 0);
}
 
開發者ID:uci-sdcl,項目名稱:Calico,代碼行數:51,代碼來源:AbstractArrow.java


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