本文整理汇总了Java中org.eclipse.gef.EditPolicy类的典型用法代码示例。如果您正苦于以下问题:Java EditPolicy类的具体用法?Java EditPolicy怎么用?Java EditPolicy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EditPolicy类属于org.eclipse.gef包,在下文中一共展示了EditPolicy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
*/
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {
/**
* {@inheritDoc}
*
* @see org.eclipse.gef.editpolicies.LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
*/
@Override
protected Command getCreateCommand(CreateRequest request) {
return null;
}
});
}
示例2: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
super.createEditPolicies();
installEditPolicy(EditPolicy.CONNECTION_ROLE, new DwParentChildConnectionEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DwFeatureGraphicalNodeEditPolicy(editor, model));
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new DwParentChildConnectionEndpointEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SelectionEditPolicy(){
DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();
@Override
protected void hideSelection() {
((DwParentChildConnectionFigure)getFigure()).setColor(theme.getLineColor());
getFigure().repaint();
}
@Override
protected void showSelection() {
((DwParentChildConnectionFigure)getFigure()).setColor(theme.getSelectionSecondaryColor());
getFigure().repaint();
}
});
}
示例3: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
stackEditPolicy = new AddStackElementEditPolicy(validator);
installEditPolicy(AddStackElementEditPolicy.KEY, stackEditPolicy);
super.createEditPolicies();
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContainerHighlightEditPolicy(){
@Override
public void showTargetFeedback(Request request) {
if (request instanceof CreateRequest) {
CreateRequest createRequest = (CreateRequest) request;
if (stackEditPolicy.acceptCreate(createRequest)){
eraseTargetFeedback(createRequest);
return;//this will be handled by the stackEditPolicy
}
}
super.showTargetFeedback(request);
}
});
installEditPolicy(ContainerEditPolicy.KEY, new TableViewSectionEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE, NullEditPolicy.getInstance());
}
示例4: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
// TODO: implement
// 1. do not use this scatter set in the current chart
// 2. if scatter set used only here, then delete scatter set from shared axis
return new DeleteScatterSetCommand(getModel(), getChart());
}
});
}
示例5: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.CONTAINER_ROLE, new AxisContainerEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
DependentAxis dataset = (DependentAxis) getHost().getModel();
Chart parent = (Chart) dataset.eContainer();
DeleteAxisFromChartCommand cmd =
new DeleteAxisFromChartCommand(parent, dataset);
return cmd;
}
});
}
示例6: createSizeableEditPolicy
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
/**
* createSizeableEditPolicy
*
* @return EditPolicy
*/
private EditPolicy createSizeableEditPolicy() {
return new LabelFeedbackEditPolicy() {
@Override
protected void setSelectedState(int type) {
if (getHost().getParent().getParent().getSelected() == EditPart.SELECTED
|| getHost().getParent().getParent().getSelected() == EditPart.SELECTED_PRIMARY) {
super.setSelectedState(EditPart.SELECTED_NONE);
} else {
super.setSelectedState(type);
}
}
};
}
示例7: eraseSourceFeedback
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#eraseSourceFeedback(org.eclipse.gef.Request)
*/
public void eraseSourceFeedback(Request request) {
if (isActive()) {
EditPolicyIterator iter = getEditPolicyIterator();
while (iter.hasNext()) {
EditPolicy nextEditPolicy = iter.next();
if(nextEditPolicy instanceof ResizableEditPolicy) {
List<Object> feedbackList = getLayer(LayerConstants.FEEDBACK_LAYER).getChildren();
if(null == feedbackList || feedbackList.isEmpty()){
continue;
}
}
nextEditPolicy.eraseSourceFeedback(request);
}
}
}
示例8: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
Dataset dataset = (Dataset) getHost().getModel();
DependentAxis parent = (DependentAxis) getHost().getParent().getModel();
DeleteDatasetsFromAxisCommand cmd =
new DeleteDatasetsFromAxisCommand(parent, dataset);
return cmd;
}
});
}
示例9: createDefaultEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
// Disables deletion of the text compartment view if additional elements
// are selected too
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new SemanticEditPolicy() {
@Override
protected boolean shouldProceed(DestroyRequest destroyRequest) {
return false;
}
});
// Disables deletion of the text compartment view via keyboard
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
removeEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE);
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new PreferredSizeHandlerEditPolicy() {
@Override
protected IFigure getPreferredSizeFigure() {
return getChildBySemanticHint(SemanticHints.STATECHART_NAME).getFigure();
}
});
}
示例10: createDefaultEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.COMPONENT_ROLE, new TransitionExpressionComponentEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(
HelpContextIds.SC_PROPERTIES_TRANSITION_EXPRESSION));
// BUGFIX:
// https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=26
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
@Override
protected void replaceHandleDragEditPartsTracker(Handle handle) {
if (handle instanceof AbstractHandle) {
AbstractHandle h = (AbstractHandle) handle;
h.setDragTracker(new DragEditPartsTrackerEx(getHost()) {
protected boolean isMove() {
return true;
};
});
}
}
});
}
示例11: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies()
{
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
new NonResizableEditPolicy());
installEditPolicy(EditPolicy.CONTAINER_ROLE, new ChartContainerEditPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy()
{
protected Command createDeleteCommand(GroupRequest deleteRequest)
{
Chart chart = getModel();
ChartSet parent = chart.getParent();
DeleteChartCommand deleteChartCommand =
new DeleteChartCommand(parent, chart);
return deleteChartCommand;
}
});
}
示例12: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.COMPONENT_ROLE, new GW4EdgeDeletePolicy());
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ConnectionEndpointEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ROLE, new GW4EdgeDeletePolicy());
installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new GW4EEdgeDirectEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_BENDPOINTS_ROLE, new GW4ELinkBendpointEditPolicy());
}
示例13: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.LAYOUT_ROLE, new GW4EEditLayoutPolicy());
installEditPolicy(EditPolicy.COMPONENT_ROLE, new GW4EVertexDeletePolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new GW4ENodeGraphicalNodeEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
}
示例14: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
installEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {
@Override
protected Command getCreateCommand(CreateRequest request) {
// TODO Auto-generated method stub
return null;
}
});
}
示例15: createEditPolicies
import org.eclipse.gef.EditPolicy; //导入依赖的package包/类
@Override
protected void createEditPolicies() {
// disallows the removal of this edit part from its parent
installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
// handles constraint changes (e.g. moving and/or resizing) of model elements
// and creation of new model elements
shapeXYLayoutEditPolicyInstance = new ShapesXYLayoutEditPolicy();
installEditPolicy(EditPolicy.LAYOUT_ROLE, shapeXYLayoutEditPolicyInstance);
}