当前位置: 首页>>代码示例>>Java>>正文


Java EditPolicy类代码示例

本文整理汇总了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;
		}
	});
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:21,代码来源:PossibleStepEditPart.java

示例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();
		}
	});
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:DwParentChildConnectionEditorEditPart.java

示例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());
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:22,代码来源:TableViewSectionEditPart.java

示例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());
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:ScatterSetEditPart.java

示例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;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:21,代码来源:AxisEditPart.java

示例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);
            }

        }

    };
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:22,代码来源:AbstractLabelCompartmentEditPart.java

示例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);
        }
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:19,代码来源:CombinedFragmentEditPart.java

示例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;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:18,代码来源:DatasetEditPart.java

示例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();
		}

	});
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:25,代码来源:StatechartTextEditPart.java

示例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;
					};
				});
			}
		}
	});
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:23,代码来源:TransitionExpressionEditPart.java

示例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;
    }
  });
}
 
开发者ID:debrief,项目名称:limpet,代码行数:20,代码来源:ChartEditPart.java

示例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());
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:EdgePart.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:GraphPart.java

示例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;
		}
	});
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:12,代码来源:TimelineWindowEditPart.java

示例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);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:ContainerEditPart.java


注:本文中的org.eclipse.gef.EditPolicy类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。