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


Java Point.setX方法代碼示例

本文整理匯總了Java中org.eclipse.draw2d.geometry.Point.setX方法的典型用法代碼示例。如果您正苦於以下問題:Java Point.setX方法的具體用法?Java Point.setX怎麽用?Java Point.setX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.draw2d.geometry.Point的用法示例。


在下文中一共展示了Point.setX方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(ModuleInstancePropertyNode.class) && getHost().getModel() instanceof ModuleInstanceNode) {
		ModuleInstancePropertyCreateCommand cmd = new ModuleInstancePropertyCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		p = node.getAnchor(p, 2);
		cmd.setNode((ModuleInstancePropertyNode) node);
		cmd.setParent((ModuleInstanceNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, ModuleInstancePropertyNode.DEF_WIDTH, ModuleInstancePropertyNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:21,代碼來源:ModuleInstanceLayoutPolicy.java

示例2: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(ModuleOperationParameterNode.class) && (getHost().getModel() instanceof ModuleOperationNode)) {
		ModuleOperationNode par = (ModuleOperationNode) getHost().getModel();
		if (!(par.getType().equalsIgnoreCase(Enums.ModuleOperationTypes.DATA_READ.name()) || par.getType().equalsIgnoreCase(Enums.ModuleOperationTypes.DATA_WRITE.name()))) {
			ModuleOperationParameterCreateCommand cmd = new ModuleOperationParameterCreateCommand();
			Node node = (Node) request.getNewObject();
			node.setParent((Node) getHost().getModel());
			Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
			Point viewSize = vp.getViewLocation();
			Point p = request.getLocation();
			p.setX(p.x + viewSize.x);
			p.setY(p.y + viewSize.y);
			p = node.getAnchor(p, 2);
			cmd.setNode((ModuleOperationParameterNode) node);
			cmd.setParent((ModuleOperationNode) node.getParent());
			cmd.setLocation(new Rectangle(p.x, p.y, ModuleOperationParameterNode.DEF_WIDTH, ModuleOperationParameterNode.DEF_HEIGHT));
			ret = cmd;
		}
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:24,代碼來源:ModuleOperationLayoutPolicy.java

示例3: getMoveBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointMoveCommand cmd = new BendpointMoveCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setIndex(request.getIndex());
	cmd.setNewLocation(p);
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java

示例4: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(ComputingNodeConfigurationNode.class) && (getHost().getModel() instanceof PlatformConfigurationNode)) {
		ComputingNodeConfigurationCreateCommand cmd = new ComputingNodeConfigurationCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		p = node.getAnchor(p, 1);
		cmd.setNode((ComputingNodeConfigurationNode) node);
		cmd.setParent((PlatformConfigurationNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, ComputingNodeConfigurationNode.DEF_WIDTH, ComputingNodeConfigurationNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:21,代碼來源:PlatformConfigurationLayoutPolicy.java

示例5: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(LogicalComputingPlatformNode.class) && (getHost().getModel() instanceof LogicalSystemNode)) {
		LogicalComputingPlatformCreateCommand cmd = new LogicalComputingPlatformCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		cmd.setNode((LogicalComputingPlatformNode) node);
		cmd.setParent((LogicalSystemNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, LogicalComputingPlatformNode.DEF_WIDTH, LogicalComputingPlatformNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:20,代碼來源:LogicalSystemLayoutPolicy.java

示例6: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(LogicalProcessorsNode.class) && (getHost().getModel() instanceof LogicalComputingNode)) {
		LogicalProcessorsCreateCommand cmd = new LogicalProcessorsCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		p = node.getAnchor(p, 2);
		cmd.setNode((LogicalProcessorsNode) node);
		cmd.setParent((LogicalComputingNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, LogicalProcessorsNode.DEF_WIDTH, LogicalProcessorsNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:21,代碼來源:LogicalComputingLayoutPolicy.java

示例7: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(LogicalComputingNode.class) && (getHost().getModel() instanceof LogicalComputingPlatformNode)) {
		LogicalComputingCreateCommand cmd = new LogicalComputingCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		p = node.getAnchor(p, 1);
		cmd.setNode((LogicalComputingNode) node);
		cmd.setParent((LogicalComputingPlatformNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, LogicalComputingNode.DEF_WIDTH, LogicalComputingNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:21,代碼來源:LogicalComputingPlatformLayoutPolicy.java

示例8: getCreateCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateCommand(CreateRequest request) {
	Command ret = null;
	if (request.getNewObjectType().equals(ComponentPropertyNode.class) && (getHost().getModel() instanceof ComponentNode)) {
		ComponentPropertyNodeCreateCommand cmd = new ComponentPropertyNodeCreateCommand();
		Node node = (Node) request.getNewObject();
		node.setParent((Node) getHost().getModel());
		Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
		Point viewSize = vp.getViewLocation();
		Point p = request.getLocation();
		p.setX(p.x + viewSize.x);
		p.setY(p.y + viewSize.y);
		p = node.getAnchor(p, 1);
		cmd.setNode((ComponentPropertyNode) node);
		cmd.setParent((ComponentNode) node.getParent());
		cmd.setLocation(new Rectangle(p.x, p.y, ComponentPropertyNode.DEF_WIDTH, ComponentPropertyNode.DEF_HEIGHT));
		ret = cmd;
	}
	return ret;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:21,代碼來源:ComponentNodeLayoutPolicy.java

示例9: getCreateBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointCreateCommand cmd = new BendpointCreateCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setLocation(p);
	cmd.setIndex(request.getIndex());
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java

示例10: getDeleteBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) getHost().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointDeleteCommand cmd = new BendpointDeleteCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setLocation(p);
	cmd.setIndex(request.getIndex());
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java

示例11: getCreateBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getCreateBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointCreateCommand cmd = new BendpointCreateCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setLocation(p);
	cmd.setIndex(request.getIndex());
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java

示例12: getDeleteBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getDeleteBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointDeleteCommand cmd = new BendpointDeleteCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setLocation(p);
	cmd.setIndex(request.getIndex());
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java

示例13: getMoveBendpointCommand

import org.eclipse.draw2d.geometry.Point; //導入方法依賴的package包/類
@Override
protected Command getMoveBendpointCommand(BendpointRequest request) {
	Viewport vp = ((FigureCanvas) request.getSource().getViewer().getControl()).getViewport();
	Point viewSize = vp.getViewLocation();
	Point p = request.getLocation();
	p.setX(p.x + viewSize.x);
	p.setY(p.y + viewSize.y);
	BendpointMoveCommand cmd = new BendpointMoveCommand();
	cmd.setLink((Link) request.getSource().getModel());
	cmd.setIndex(request.getIndex());
	cmd.setNewLocation(p);
	return cmd;
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:14,代碼來源:BendpointPolicy.java


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