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


Java Polygon.translate方法代碼示例

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


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

示例1: paint

import java.awt.Polygon; //導入方法依賴的package包/類
@Override public void paint(Graphics graphics) {
	graphics.setColor(Color.BLACK);
	graphics.drawRect(10, 0, size.width-20, size.height);
	Class<? extends FlipFlop> cls = this.getClass();
	if(cls.isAnnotationPresent(Clocked.class)) {
		if(tiggerType!=TiggerType.PULSE_TIGGERED) {
			graphics.drawLine(10, size.height/2-5, 20, size.height/2);
			graphics.drawLine(10, size.height/2+5, 20, size.height/2);
			if(tiggerType==TiggerType.NEGATIVE_EDGE_TIGGERED)
				graphics.drawOval(2, size.height/2-4, 8, 8);
		}
	}
	if(cls.isAnnotationPresent(MasterSlave.class)&&isMasterSlave) {
		Polygon polygon = new Polygon(new int[]{0, 8, 8},
				new int[]{0, 0, 8}, 3);
		polygon.translate(size.width-22, 5);
		graphics.drawPolyline(polygon.xpoints, polygon.ypoints, polygon.npoints);
		polygon.translate(0, size.height-17);
		graphics.drawPolyline(polygon.xpoints, polygon.ypoints, polygon.npoints);
	}
}
 
開發者ID:kristian,項目名稱:JDigitalSimulator,代碼行數:22,代碼來源:FlipFlop.java

示例2: getExactTabIndication

import java.awt.Polygon; //導入方法依賴的package包/類
public Polygon getExactTabIndication(int idx) {
    Polygon result = tabDisplayer.getUI().getExactTabIndication(idx);
    scratchPoint.setLocation(0,0);
    Point p = SwingUtilities.convertPoint(tabDisplayer, scratchPoint, container);
    result.translate (-p.x, -p.y);
    return appendContentBoundsTo(result);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:DefaultTabbedContainerUI.java

示例3: getInsertTabIndication

import java.awt.Polygon; //導入方法依賴的package包/類
public Polygon getInsertTabIndication(int idx) {
    Polygon result = tabDisplayer.getUI().getInsertTabIndication(idx);
    scratchPoint.setLocation(0,0);
    Point p = SwingUtilities.convertPoint(tabDisplayer, scratchPoint, container);
    result.translate (-p.x, -p.y);
    return appendContentBoundsTo(result);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:DefaultTabbedContainerUI.java

示例4: getBounds

import java.awt.Polygon; //導入方法依賴的package包/類
@Override public Shape getBounds() {
  tempShape = new Polygon(drawShape.xpoints, drawShape.ypoints, drawShape.xpoints.length);
  tempShape.translate(-1 * (tempShape.getBounds().x + tempShape.getBounds().width/2), -1 * (tempShape.getBounds().y + tempShape.getBounds().height/2));
  return EZElement.boundHelper(tempShape, this);
}
 
開發者ID:gcalica,項目名稱:agar.io,代碼行數:6,代碼來源:EZ.java

示例5: paint

import java.awt.Polygon; //導入方法依賴的package包/類
@Override public void paint(Graphics graphics) {
	graphics.setColor(Color.BLACK);
	graphics.drawRect(10, 0, size.width-10, size.height);
	for(int input=0;input<inputs.length;input++) {
		Polygon polygon = new Polygon(POLYGONS_X[input], POLYGONS_Y[input], 7);
		polygon.translate(15, 4);
		if(inputs[input].isCharged()) {
			graphics.setColor(Color.RED);
			graphics.fillPolygon(polygon);
		}
		graphics.setColor(Color.BLACK);
		graphics.drawPolyline(polygon.xpoints, polygon.ypoints, polygon.npoints);
	}
	ContactUtilities.paintSolderingJoints(graphics, 10, 0, inputs);
}
 
開發者ID:kristian,項目名稱:JDigitalSimulator,代碼行數:16,代碼來源:TenSegmentDisplay.java


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