本文整理汇总了Java中org.eclipse.gef.requests.CreationFactory类的典型用法代码示例。如果您正苦于以下问题:Java CreationFactory类的具体用法?Java CreationFactory怎么用?Java CreationFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreationFactory类属于org.eclipse.gef.requests包,在下文中一共展示了CreationFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFactory
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
@Override
protected CreationFactory getFactory(Object template) {
if (template instanceof Element) {
//how this happened???
return new TitaniumUIElementFactory(
(Class<? extends Element>) template.getClass(), diagram);
} else if (template instanceof Class){
if (Element.class.isAssignableFrom((Class<?>) template)){
return new TitaniumUIElementFactory(
(Class<? extends Element>) template, diagram);
}
}
throw new IllegalArgumentException("Can't create factory for " + template);
}
示例2: getFactory
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* This function is called to return a factory for our create request. A factory is returned depending on the state of the tool.
*
* (non-Javadoc)
*
* @see org.eclipse.gef.tools.CreationTool#getFactory()
*/
protected CreationFactory getFactory() {
ModelCreationFactory factory;
switch (state) {
case ENDPOINT:
factory = new ModelCreationFactory(getURNspec(), EndPoint.class);
break;
case STARTPOINT:
factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
break;
case NOSELECT:
factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
break;
case CONNECTION:
factory = new ModelCreationFactory(getURNspec(), EmptyPoint.class);
break;
default:
factory = new ModelCreationFactory(getURNspec(), StartPoint.class);
}
return factory;
}
示例3: createTransferDropTargetListener
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* Create a transfer drop target listener. When using a
* CombinedTemplateCreationEntry tool in the palette, this will enable model
* element creation by dragging from the palette.
*
* @see #createPaletteViewerProvider()
*/
public TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
@Override
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class) template);
}
};
}
示例4: createTransferDropTargetListener
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class<?>) template);
}
};
}
示例5: applyProperty
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* @see org.eclipse.gef.tools.AbstractTool#applyProperty(java.lang.Object,
* java.lang.Object)
*/
protected void applyProperty(Object key, Object value) {
if (PROPERTY_CREATION_FACTORY.equals(key)) {
if (value instanceof CreationFactory)
setFactory((CreationFactory) value);
return;
}
super.applyProperty(key, value);
}
示例6: applyProperty
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
protected void applyProperty(Object key, Object value) {
if (CreationTool.PROPERTY_CREATION_FACTORY.equals(key)) {
if (value instanceof CreationFactory)
setFactory((CreationFactory) value);
return;
}
super.applyProperty(key, value);
}
示例7: setFactory
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
@Override
public void setFactory(CreationFactory factory)
{
if(factory instanceof InstallOptionsTemplateCreationFactory) {
super.setFactory(factory);
}
}
示例8: PaletteEntryCreationTool
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
public PaletteEntryCreationTool( CreationFactory factory,
PaletteEntryExtension paletteEntry )
{
super( factory, null );
this.factory = factory;
setFactory( factory );
this.paletteEntry = paletteEntry;
}
示例9: getFactory
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
protected CreationFactory getFactory( Object template )
{
if ( handleValidateDrag( template ) )
{
if ( template instanceof String )
{
return new ReportElementFactory( template );
}
return new ReportElementFactory( getSingleTransferData( template ),
template );
}
return null;
}
示例10: ReportCreationTool
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* Constructor
*
* @param factory
* @param preHandle
*/
public ReportCreationTool( CreationFactory factory,
AbstractToolHandleExtends preHandle )
{
super( factory );
this.preHandle = preHandle;
}
示例11: getFactory
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
public CreationFactory getFactory(Object template) {
setEnablementDeterminedByCommand(true);
if (template instanceof CreationFactory)
return (CreationFactory) template;
else
return new ModelCreationFactory(urn, (Class) template);
}
示例12: createTransferDropTargetListener
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* Create a transfer drop target listener. When using a
* CombinedTemplateCreationEntry tool in the palette, this will enable model
* element creation by dragging from the palette.
*
* @see #createPaletteViewerProvider()
*/
private TransferDropTargetListener createTransferDropTargetListener() {
return new TemplateTransferDropTargetListener(getGraphicalViewer()) {
protected CreationFactory getFactory(Object template) {
return new SimpleFactory((Class) template);
}
};
}
示例13: ConnectionCreationToolWithAdditionalInformation
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* @param factory
*/
public ConnectionCreationToolWithAdditionalInformation(CreationFactory factory) {
super(factory);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:7,代码来源:ConnectionCreationToolWithAdditionalInformation.java
示例14: LifeLineCreationToolWithAdditionalInformation
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
/**
* @param factory
*/
public LifeLineCreationToolWithAdditionalInformation(CreationFactory factory) {
super(factory);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:7,代码来源:LifeLineCreationToolWithAdditionalInformation.java
示例15: JDCreationTool
import org.eclipse.gef.requests.CreationFactory; //导入依赖的package包/类
public JDCreationTool(CreationFactory aFactory) {
super(aFactory);
}