本文整理匯總了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);
}