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: EReferenceNameViewFactory.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.preferences.PreferencesHint;
import  org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper;
import  org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory;
import  org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
import  org.eclipse.gmf.runtime.notation.Location;
import  org.eclipse.gmf.runtime.notation.Node;
import  org.eclipse.gmf.runtime.notation.View;

Generated:
public class EReferenceNameViewFactory extends AbstractLabelViewFactory {

Generated:
	public View createView(IAdaptable semanticAdapter, View containerViewString semanticHintint indexboolean persisted, PreferencesHint preferencesHint) {
		Node view = (Node) super.createView(semanticAdaptercontainerViewsemanticHintindexpersistedpreferencesHint);
		Location location = (Location) view.getLayoutConstraint();
		IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView.getDiagram().getMeasurementUnit());
		location.setX(mapMode.DPtoLP(-10));
		location.setY(mapMode.DPtoLP(-10));
		return view;
	}

Generated:
	protected List createStyles(View view) {
		List styles = new ArrayList();
		return styles;
	}
New to GrepCode? Check out our FAQ X