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