Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007 Anyware Technologies All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Anyware Technologies - initial API and implementation $Id: EDataTypeViewFactory.java,v 1.4 2009/02/02 08:39:07 jlescot Exp $ /
package org.eclipse.emf.ecoretools.diagram.view.factories;
import  org.eclipse.core.runtime.IAdaptable;
import  org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import  org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
import  org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
import  org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import  org.eclipse.gmf.runtime.notation.NotationFactory;
import  org.eclipse.gmf.runtime.notation.NotationPackage;
import  org.eclipse.gmf.runtime.notation.ShapeStyle;
import  org.eclipse.gmf.runtime.notation.View;
import  org.eclipse.swt.graphics.Color;

Generated:
public class EDataTypeViewFactory extends AbstractShapeViewFactory {
	static final Color THIS_FONT = .;
	static final Color THIS_FORE = .;
	static final Color THIS_BACK = new Color(null, 248, 249, 209);
	static final int fontHeight = 10;
	protected void initializeFromPreferences(View view) {
		super.initializeFromPreferences(view);
		ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
		style.setFillColor(FigureUtilities.colorToInteger());
		style.setLineColor(FigureUtilities.colorToInteger());
		style.setFontColor(FigureUtilities.colorToInteger());
		style.setFontHeight();
	}

Generated:
	protected List createStyles(View view) {
		List styles = new ArrayList();
		styles.add(NotationFactory.eINSTANCE.createShapeStyle());
		return styles;
	}

Generated:
	protected void decorateView(View containerView, View view, IAdaptable semanticAdapterString semanticHintint indexboolean persisted) {
		if (semanticHint == null) {
			semanticHint = EcoreVisualIDRegistry.getType(.);
			view.setType(semanticHint);
		}
		super.decorateView(containerViewviewsemanticAdaptersemanticHintindexpersisted);
		if (!..equals(EcoreVisualIDRegistry.getModelID(containerView))) {
			shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
			shortcutAnnotation.getDetails().put("modelID".); //$NON-NLS-1$
			view.getEAnnotations().add(shortcutAnnotation);
		}
		IAdaptable eObjectAdapter = null;
		EObject eObject = (EObjectsemanticAdapter.getAdapter(EObject.class);
		if (eObject != null) {
			eObjectAdapter = new EObjectAdapter(eObject);
		}
		getViewService().createNode(eObjectAdapterview, EcoreVisualIDRegistry.getType(.), ViewUtil.APPENDtrue, getPreferencesHint());
		getViewService().createNode(eObjectAdapterview, EcoreVisualIDRegistry.getType(.), ViewUtil.APPENDtrue, getPreferencesHint());
	}
New to GrepCode? Check out our FAQ X