本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}