当前位置: 首页>>代码示例>>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;未经允许,请勿转载。