本文整理汇总了Java中org.eclipse.gmf.runtime.diagram.core.util.ViewUtil类的典型用法代码示例。如果您正苦于以下问题:Java ViewUtil类的具体用法?Java ViewUtil怎么用?Java ViewUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewUtil类属于org.eclipse.gmf.runtime.diagram.core.util包,在下文中一共展示了ViewUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doExecuteWithResult
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
View childView = (View) child.getAdapter(View.class);
View parentView = (View) parent.getAdapter(View.class);
if (parentView.getPersistedChildren().contains(childView)
&& index != ViewUtil.APPEND) {
parentView.getPersistedChildren().move(index, childView);
} else if (index == ViewUtil.APPEND) {
parentView.insertChild(childView);
} else {
parentView.insertChildAt(childView, index);
}
return CommandResult.newOKCommandResult();
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:CompartmentLayoutEditPolicy.java
示例2: createEntryPoint
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
protected void createEntryPoint(Edge edge, Diagram subdiagram) {
Transition transition = (Transition) edge.getElement();
Region entryPointContainer = getEntryPointContainer(transition);
Entry entryPoint = createSemanticEntryPoint(transition);
// re-wire old transition to targeting the selected state
transition.setTarget((State) subdiagram.getElement());
View oldTarget = edge.getTarget();
edge.setTarget(getContextObject());
// create node for entry point
View entryPointContainerView = helper.getViewForSemanticElement(entryPointContainer, subdiagram);
View entryPointRegionCompartment = ViewUtil.getChildBySemanticHint(entryPointContainerView,
SemanticHints.REGION_COMPARTMENT);
Node entryNode = ViewService.createNode(entryPointRegionCompartment, entryPoint, SemanticHints.ENTRY,
preferencesHint);
ViewService.createEdge(entryNode, oldTarget, entryPoint.getOutgoingTransitions().get(0),
SemanticHints.TRANSITION, preferencesHint);
addEntryPointSpec(transition, entryPoint);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:22,代码来源:ExtractSubdiagramRefactoring.java
示例3: internalExecute
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected void internalExecute() {
BooleanValueStyle inlineStyle = getInlineStyle(getContextObject());
if (inlineStyle == null) {
inlineStyle = createInlineStyle();
getContextObject().getStyles().add(inlineStyle);
}
inlineStyle.setBooleanValue(true);
View contextView = getContextObject();
State contextElement = (State) contextView.getElement();
Diagram diagramToInline = DiagramPartitioningUtil.getSubDiagram(contextElement);
View containerView = ViewUtil.getChildBySemanticHint(contextView, SemanticHints.STATE_FIGURE_COMPARTMENT);
while (diagramToInline.getChildren().size() > 0) {
containerView.insertChild((View) diagramToInline.getChildren().get(0));
}
while (diagramToInline.getEdges().size() > 0) {
containerView.getDiagram().insertEdge((Edge) diagramToInline.getEdges().get(0));
}
getResource().getContents().remove(diagramToInline);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:24,代码来源:InlineSubdiagramRefactoring.java
示例4: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(
View.class);
TransactionUtil.getEditingDomain(view).runExclusive(
new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil
.getIdStr(view) : null;
}
});
} catch (Exception e) {
SimpleBPMN.diagram.part.SimpleBPMNDiagramEditorPlugin
.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:22,代码来源:SimpleBPMNValidationDecoratorProvider.java
示例5: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(
View.class);
TransactionUtil.getEditingDomain(view).runExclusive(
new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil
.getIdStr(view) : null;
}
});
} catch (Exception e) {
edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramDiagramEditorPlugin
.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:22,代码来源:NECSIS14_ClassDiagramValidationDecoratorProvider.java
示例6: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(
View.class);
TransactionUtil.getEditingDomain(view).runExclusive(
new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil
.getIdStr(view) : null;
}
});
} catch (Exception e) {
edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.part.NECSIS14_DatabaseSchemaDiagramEditorPlugin
.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:22,代码来源:NECSIS14_DatabaseSchemaValidationDecoratorProvider.java
示例7: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(View.class);
TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
}
});
}
catch (Exception e) {
MIDDiagramEditorPlugin.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:19,代码来源:MIDValidationDecoratorProvider.java
示例8: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(View.class);
TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
}
});
} catch (Exception e) {
edu.toronto.cs.se.modelepedia.classdiagram_mavo.diagram.part.ClassDiagram_MAVODiagramEditorPlugin
.getInstance().logError("ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:19,代码来源:ClassDiagram_MAVOValidationDecoratorProvider.java
示例9: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(
View.class);
TransactionUtil.getEditingDomain(view).runExclusive(
new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil
.getIdStr(view)
: null;
}
});
} catch (Exception e) {
DcaseDiagramEditorPlugin.getInstance().logError(
"ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:d-case,项目名称:d-case_editor,代码行数:23,代码来源:DcaseValidationDecoratorProvider.java
示例10: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(
View.class);
TransactionUtil.getEditingDomain(view).runExclusive(
new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil
.getIdStr(view) : null;
}
});
} catch (Exception e) {
RelationalDatabaseDiagramEditorPlugin.getInstance().logError(
"ViewID access failure", e); //$NON-NLS-1$
}
}
开发者ID:adisandro,项目名称:MMINT,代码行数:22,代码来源:RelationalDatabaseValidationDecoratorProvider.java
示例11: getNodeEditPartClass
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
@Override
protected Class<?> getNodeEditPartClass(final View view) {
String type = view.getType();
if (type != null) {
EObject resolvedSemanticElement = ViewUtil.resolveSemanticElement(view);
if (resolvedSemanticElement != null) {
if (String.valueOf(WorkspaceImageEditPart.VISUAL_ID).equals(type)) {
if (resolvedSemanticElement instanceof WorkspaceImage) {
final WorkspaceImage customStyle = (WorkspaceImage) resolvedSemanticElement;
if (isRotative(customStyle)) {
return RotativeImageEditPart.class;
}
}
} else if (String.valueOf(DNode4EditPart.VISUAL_ID).equals(type)) {
if (resolvedSemanticElement instanceof DNode) {
DNode spec = (DNode) resolvedSemanticElement;
if (spec.getOwnedStyle() != null && spec.getOwnedStyle() instanceof WorkspaceImage) {
if (isRotative((WorkspaceImage) spec.getOwnedStyle())) {
return RotativeDNode4EditPart.class;
}
}
}
}
}
}
return super.getNodeEditPartClass(view);
}
开发者ID:polarsys,项目名称:time4sys,代码行数:32,代码来源:RotativeImageEditPartProvider.java
示例12: createConnections
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
private Collection<IAdaptable> createConnections(
Collection<StatemachineLinkDescriptor> linkDescriptors,
Domain2Notation domain2NotationMap) {
LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
for (StatemachineLinkDescriptor nextLinkDescriptor : linkDescriptors) {
EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor,
domain2NotationMap);
EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor,
domain2NotationMap);
if (sourceEditPart == null || targetEditPart == null) {
continue;
}
CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(
nextLinkDescriptor.getSemanticAdapter(),
StatemachineVisualIDRegistry.getType(nextLinkDescriptor
.getVisualID()), ViewUtil.APPEND, false,
((IGraphicalEditPart) getHost())
.getDiagramPreferencesHint());
CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(
descriptor);
ccr.setType(RequestConstants.REQ_CONNECTION_START);
ccr.setSourceEditPart(sourceEditPart);
sourceEditPart.getCommand(ccr);
ccr.setTargetEditPart(targetEditPart);
ccr.setType(RequestConstants.REQ_CONNECTION_END);
Command cmd = targetEditPart.getCommand(ccr);
if (cmd != null && cmd.canExecute()) {
executeCommand(cmd);
IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject();
if (viewAdapter != null) {
adapters.add(viewAdapter);
}
}
}
return adapters;
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:40,代码来源:StatemachineCanonicalEditPolicy.java
示例13: createState_2001
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
public Node createState_2001(EObject domainElement, View containerView,
int index, boolean persisted, PreferencesHint preferencesHint) {
Node node = NotationFactory.eINSTANCE.createNode();
node.getStyles()
.add(NotationFactory.eINSTANCE.createDescriptionStyle());
node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
node.setType(StatemachineVisualIDRegistry
.getType(StateEditPart.VISUAL_ID));
ViewUtil.insertChildView(containerView, node, index, persisted);
node.setElement(domainElement);
stampShortcut(containerView, node);
// initializeFromPreferences
final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
.getPreferenceStore();
FontStyle nodeFontStyle = (FontStyle) node
.getStyle(NotationPackage.Literals.FONT_STYLE);
if (nodeFontStyle != null) {
FontData fontData = PreferenceConverter.getFontData(prefStore,
IPreferenceConstants.PREF_DEFAULT_FONT);
nodeFontStyle.setFontName(fontData.getName());
nodeFontStyle.setFontHeight(fontData.getHeight());
nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
.intValue());
}
Node label5001 = createLabel(node,
StatemachineVisualIDRegistry
.getType(StateNameEditPart.VISUAL_ID));
return node;
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:38,代码来源:StatemachineViewProvider.java
示例14: createLabel
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* @generated
*/
private Node createLabel(View owner, String hint) {
DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
rv.setType(hint);
ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
return rv;
}
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:10,代码来源:StatemachineViewProvider.java
示例15: getInnerEdges
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
protected List<Edge> getInnerEdges(List views) {
List<Edge> innerEdges = new LinkedList<Edge>();
for (Iterator itr = views.iterator(); itr.hasNext();) {
View view = (View) itr.next();
if (!(view instanceof Diagram)) {
innerEdges.addAll(ViewUtil.getAllInnerEdges(view));
}
}
return innerEdges;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:11,代码来源:SubdiagramAwareCopyCommand.java
示例16: createLabel
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* Creates a Label view
*
* @param owner
* @param hint
* @return
*/
@SuppressWarnings("unchecked")
public static Node createLabel(View owner, String hint) {
DecorationNode nameLabel = NotationFactory.eINSTANCE.createDecorationNode();
nameLabel.setType(hint);
ShapeStyle style = NotationFactory.eINSTANCE.createShapeStyle();
style.setFontColor(FigureUtilities.RGBToInteger(ColorConstants.black.getRGB()));
nameLabel.getStyles().add(style);
ViewUtil.insertChildView(owner, nameLabel, ViewUtil.APPEND, true);
nameLabel.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
return nameLabel;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:21,代码来源:FactoryUtils.java
示例17: StatusDecorator
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
public StatusDecorator(IDecoratorTarget decoratorTarget) {
super(decoratorTarget);
try {
final View view = (View) getDecoratorTarget().getAdapter(View.class);
TransactionUtil.getEditingDomain(view).runExclusive(new Runnable() {
public void run() {
StatusDecorator.this.viewId = view != null ? ViewUtil.getIdStr(view) : null;
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:14,代码来源:AbstractMarkerBasedDecorationProvider.java
示例18: doExecuteWithResult
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
@Override
public CommandResult doExecuteWithResult(IProgressMonitor progressMonitor,
IAdaptable info) throws ExecutionException {
CommandResult rs = super.doExecuteWithResult(progressMonitor, info);
EditPart compartment = childToMove.getParent();
ViewUtil.repositionChildAt((View) compartment.getModel(),
(View) childToMove.getModel(), newIndex);
compartment.refresh();
return rs;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:14,代码来源:CompartmentRepositionEObjectCommand.java
示例19: createExitPoint
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
protected void createExitPoint(Edge edge, Diagram subdiagram) {
Transition transition = (Transition) edge.getElement();
// create semantic exit point
Region exitPointContainer = getExitPointContainer(transition);
Exit exitPoint = createSemanticExitPoint(transition);
// create node for exit point
View exitPointContainerView = helper.getViewForSemanticElement(exitPointContainer, subdiagram);
View exitPointRegionCompartment = ViewUtil.getChildBySemanticHint(exitPointContainerView,
SemanticHints.REGION_COMPARTMENT);
Node exitNode = ViewService.createNode(exitPointRegionCompartment, exitPoint, SemanticHints.EXIT,
preferencesHint);
// re-wire existing transition to new exit point
Vertex oldTransitionTarget = transition.getTarget();
transition.setTarget(exitPoint);
View oldEdgeTarget = edge.getTarget();
edge.setTarget(exitNode);
// create transition from selected state to former transition target
Transition exitPointTransition = SGraphFactory.eINSTANCE.createTransition();
exitPointTransition.setSource((State) subdiagram.getElement());
exitPointTransition.setTarget(oldTransitionTarget);
ViewService.createEdge(getContextObject(), oldEdgeTarget, exitPointTransition, SemanticHints.TRANSITION,
preferencesHint);
addExitPointSpec(exitPointTransition, exitPoint);
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:29,代码来源:ExtractSubdiagramRefactoring.java
示例20: createSubdiagram
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; //导入依赖的package包/类
/**
* Creates a new {@link Diagram} and copies child elements
*/
protected Diagram createSubdiagram() {
View contextView = getContextObject();
State contextElement = (State) contextView.getElement();
Diagram subdiagram = ViewService.createDiagram(contextElement, StatechartDiagramEditor.ID, preferencesHint);
View figureCompartment = ViewUtil.getChildBySemanticHint(contextView, SemanticHints.STATE_FIGURE_COMPARTMENT);
getResource().getContents().add(subdiagram);
while (figureCompartment.getChildren().size() > 0) {
subdiagram.insertChild((View) figureCompartment.getChildren().get(0));
}
return subdiagram;
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:15,代码来源:ExtractSubdiagramRefactoring.java
注:本文中的org.eclipse.gmf.runtime.diagram.core.util.ViewUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论