本文整理汇总了Java中org.eclipse.gef.requests.LocationRequest类的典型用法代码示例。如果您正苦于以下问题:Java LocationRequest类的具体用法?Java LocationRequest怎么用?Java LocationRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocationRequest类属于org.eclipse.gef.requests包,在下文中一共展示了LocationRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showTargetFeedback
import org.eclipse.gef.requests.LocationRequest; //导入依赖的package包/类
@Override
public void showTargetFeedback(Request request) {
// Do not be fooled, the REQ_SELECTION is poorly named
// nothing is actually getting selected here, maybe
// TimelineTool should change this to reflect something
// more accurate (inspect?)
if (request.getType() == REQ_SELECTION
&& request instanceof LocationRequest
) {
LocationRequest loc = (LocationRequest) request;
Point pt = loc.getLocation().getCopy();
PlanTimelineDataRowEditPart rowData = getRowData();
if (rowData != null) {
pt = pt.translate(-rowData.getFigure().getBounds().x, 0);
update(pt.x);
}
}
}
示例2: eraseTargetFeedback
import org.eclipse.gef.requests.LocationRequest; //导入依赖的package包/类
@Override
public void eraseTargetFeedback(Request request) {
super.eraseTargetFeedback(request);
if (request instanceof LocationRequest
&& tooltipShell != null
&& !tooltipShell.isDisposed()) {
Timeline activeEditPart = TimelineUtils.getTimeline(this);
if (activeEditPart != null) {
EditDomain editDomain = activeEditPart.getEditDomain();
Tool tool = editDomain.getActiveTool();
if(tool instanceof TimelineTool) {
TimelineTool timelineTool = (TimelineTool)tool;
if(timelineTool != null
&& timelineTool.getTargetUnderMouse() != null
&& !timelineTool.getTargetUnderMouse().equals(this.getHost())) {
tooltipShell.dispose();
tooltipShell = null;
}
}
}
}
}
示例3: showTargetFeedback
import org.eclipse.gef.requests.LocationRequest; //导入依赖的package包/类
/**
* When asked to show target feedback, figure out where to display the tooltip.
* Next, get the tooltip (maybe a new one will need to be created), and display
* it at the calculated location.
*
* @param request the request
*/
@Override
public void showTargetFeedback(Request request) {
if (understandsRequest(request)) {
if (request instanceof LocationRequest) {
LocationRequest locationRequest = (LocationRequest)request;
Point location = locationRequest.getLocation();
GraphicalEditPart host = (GraphicalEditPart)getHost();
TOOLTIP_SHELL_MANAGER.display(host, location);
}
}
}
示例4: createHoverRequest
import org.eclipse.gef.requests.LocationRequest; //导入依赖的package包/类
/**
* Creates the hover request (a {@link LocationRequest}) and sets its type
* to {@link RequestConstants#REQ_SELECTION_HOVER}.
*/
protected void createHoverRequest() {
hoverRequest = new LocationRequest();
hoverRequest.setType(RequestConstants.REQ_SELECTION_HOVER);
}
示例5: updateHoverRequest
import org.eclipse.gef.requests.LocationRequest; //导入依赖的package包/类
/**
* Updates the location of the hover request.
*/
protected void updateHoverRequest() {
LocationRequest request = (LocationRequest) getTargetHoverRequest();
request.setLocation(getLocation());
}