本文整理匯總了Java中org.eclipse.draw2d.geometry.Point.translate方法的典型用法代碼示例。如果您正苦於以下問題:Java Point.translate方法的具體用法?Java Point.translate怎麽用?Java Point.translate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.geometry.Point
的用法示例。
在下文中一共展示了Point.translate方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: relocate
import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
public void relocate(IFigure figure) {
Dimension minimum = FigureUtilities.getTextExtents(text, figure.getFont());
figure.setSize(minimum);
Point location = polyline.getPoints().getMidpoint();
Point offsetCopy = offset.getCopy();
offsetCopy.translate(location);
figure.setLocation(offsetCopy);
}
示例2: execute
import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
public void execute() {
Point offset=this.label.getOffset().getCopy();
parentFigure.translateToAbsolute(offset);
offset.translate(point);
parentFigure.translateToRelative(offset);
oldOffset=label.getOffset();
label.setOffset(offset);
}
示例3: drawHistory
import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
private void drawHistory(Graphics g, IArrayIndexModel v, Color color) {
g.setBackgroundColor(color);
List<String> history = v.getHistory();
for (int j = 0; j < history.size()-1; j++) {
Integer i = Integer.parseInt(history.get(j));
Point p = getIndexLocation(i);
if(horizontal)
p = p.translate(0, EXTRA);
g.fillOval(p.x, p.y, PandionJConstants.ILLUSTRATION_LINE_WIDTH+1, PandionJConstants.ILLUSTRATION_LINE_WIDTH+1);
}
}
示例4: getIndexLocation
import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
private Point getIndexLocation(int index) {
Point origin = arrayFigure.getPositionBounds(index, horizontal).getLocation();
if(horizontal)
origin.translate(firstPositionBounds.width/2, firstPositionBounds.height + PandionJConstants.ARRAY_POSITION_SPACING);
else {
origin.translate(-PandionJConstants.POSITION_WIDTH/2, firstPositionBounds.height/2);
}
return origin;
}
示例5: drawBar
import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
private void drawBar(Graphics g, Integer boundVal, IBound bound, Direction direction) {
if(direction != Direction.NONE) {
Point origin = getIndexLocation(boundVal);
int s;
boolean b = direction == Direction.FORWARD && bound.getType() == BoundType.CLOSE ||
direction == Direction.BACKWARD && bound.getType() == BoundType.OPEN;
if(horizontal){
s = firstLabelBounds.width/2 + PandionJConstants.ARRAY_POSITION_SPACING;
if(!b)
s = -s;
}else{
s = firstPositionBounds.height/2 + PandionJConstants.ARRAY_POSITION_SPACING;
if(!b)
s = -s;
}
origin.translate(horizontal ? s : 0, horizontal ? 0 : s);
Point from = origin.getTranslated(horizontal ? 0 : -BAR_HEIGHT, horizontal ? -BAR_HEIGHT : 0);;
Point to = origin.getTranslated(horizontal ? 0 : BAR_HEIGHT, horizontal ? BAR_HEIGHT : 0);
setIllustrationStyle(g);
g.drawLine(from, to);
}
}