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


Java Point.translate方法代碼示例

本文整理匯總了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);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:TransitionLabelLocator.java

示例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);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:10,代碼來源:MoveTransitionLabelCommand.java

示例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);
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:14,代碼來源:IllustrationBorder.java

示例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;
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:11,代碼來源:IllustrationBorder.java

示例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);
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:28,代碼來源:IllustrationBorder.java


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