本文整理汇总了Java中org.eclipse.gef.palette.CreationToolEntry类的典型用法代码示例。如果您正苦于以下问题:Java CreationToolEntry类的具体用法?Java CreationToolEntry怎么用?Java CreationToolEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CreationToolEntry类属于org.eclipse.gef.palette包,在下文中一共展示了CreationToolEntry类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Module Type", "Add Module Type", new ModuleTypeCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Implementation", "Add Module Implementation", new ModuleImplementationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Instance", "Add Module Instance", new ModuleInstanceCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Instance Property", "Add Module Instance Property", new ModuleInstancePropertyCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Operation", "Add Module Operation", new ModuleOperationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Operation Parameter", "Add Module Operation Parameter", new ModuleOperationParameterCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Trigger Instance", "Add Trigger Instance", new TriggerInstanceNodeCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Dynamic Trigger Instance", "Add Dynamic Trigger Instance", new DynamicTriggerInstanceNodeCreationFactory(), null, null));
manipGroup.add(new ConnectionCreationToolEntry("Add Wire", "Add Wire", new LinkCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例2: createToolEntry
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
private CreationToolEntry createToolEntry(final Class<?> nodeClass,final String name,String desc,final int width,final int height){
SimpleFactory nodeFactory=new SimpleFactory(nodeClass){
@Override
public Object getNewObject() {
AbstractNodeElement node=instanceNode(nodeClass,name,width,height);
return node;
}
};
String nodeName=instanceNode(nodeClass,name,width,height).nodeName();
NodeImageConfig config=Activator.getPreference().getNodeImageConfigByName(nodeName);
if(config==null){
throw new RuntimeException("当前没有为名为"+nodeName+"的节点预定义配置信息!");
}
ImageDescriptor descriptor=ImageDescriptor.createFromImage(config.getSmallImage());
return new CombinedTemplateCreationEntry(name,desc,nodeFactory,descriptor,descriptor);
}
示例3: createComponentPartsDrawer
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
/**
* This method creates the palett entrys for the creation of {@link NamedElement}s (Attributes and
* Operations) and adds them to palett.
*/
private void createComponentPartsDrawer() {
PaletteDrawer drawer = new PaletteDrawer("Parts");
CreationToolEntry entry1 =
new CreationToolEntry("Operation", "Create a new Operation", new ORMOperationFactory(), null, null);
entry1.setToolClass(CreationAndDirectEditTool.class);
entry1.setSmallIcon(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/EOperation.gif"));
drawer.add(entry1);
addEntry("Methode", entry1, true);
CreationToolEntry entry2 =
new CreationToolEntry("Attribute", "Create a new Attribute", new ORMAttributeFactory(),
null, null);
entry2.setToolClass(CreationAndDirectEditTool.class);
entry2.setSmallIcon(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/EAttribute.gif"));
drawer.add(entry2);
addEntry("Attribute", entry2, true);
group.add(drawer);
}
示例4: getPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Computing Platform", "Add Computing Platform Definition", new LogicalComputingPlatformCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Computing Node", "Add Computing Node Definition", new LogicalComputingCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Logical Processor", "Add Logical Processor Definition", new LogicalProcessorsCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例5: getPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Composite Property", "Add Composite Property", new CompositePropertyNodeCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例6: getPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Platform Configuration", "Add Platform Configuration", new PlatformConfigurationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Computing Node Configuration", "Add Computing Node Configuration", new ComputingNodeConfigurationCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Protection Domain", "Add Protection Domain", new ProtectionDomainCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Module Instance", "Add Module Instance", new DeployedModuleInstanceCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Trigger Instance", "Add Trigger Instance", new DeployedTriggerInstanceCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例7: getPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
@Override
protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteDrawer manipGroup = new PaletteDrawer("Definitions");
manipGroup.add(new CreationToolEntry("Add Composite Property", "Add Composite Property", new CompositePropertyNodeCreationFactory(), null, null));
manipGroup.add(new CreationToolEntry("Add Component", "Add Component Definition", new ComponentNodeCreationFactory(), null, null));
manipGroup.add(new ConnectionCreationToolEntry("Add Wire", "Add Wire Definition", new LinkCreationFactory(), null, null));
root.add(manipGroup);
return root;
}
示例8: setupTableViewTool
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
private void setupTableViewTool(final PaletteGroup group) {
group.add(new CreationToolEntry("Table", "Make new table object", new SimpleFactory(ERTable.class),
Activator.getImageDescriptor(ImageKey.TABLE_NEW), Activator.getImageDescriptor(ImageKey.TABLE_NEW)));
if (diagram.getDiagramContents().getSettings().isUseViewObject()) { // #for_erflute view is option
group.add(new CreationToolEntry("View", "Make new view object", new SimpleFactory(ERView.class),
Activator.getImageDescriptor(ImageKey.VIEW), Activator.getImageDescriptor(ImageKey.VIEW)));
}
}
示例9: setupNoteTool
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
private void setupNoteTool(final PaletteGroup group) {
final CreationToolEntry noteToolEntry =
new CreationToolEntry("Note", "Make new note for tables", new SimpleFactory(WalkerNote.class),
Activator.getImageDescriptor(ImageKey.NOTE), Activator.getImageDescriptor(ImageKey.NOTE));
group.add(noteToolEntry);
final ConnectionCreationToolEntry relationNoteTool =
new ConnectionCreationToolEntry("Note Connection", "Connect note to tables", new SimpleFactory(CommentConnection.class),
Activator.getImageDescriptor(ImageKey.COMMENT_CONNECTION),
Activator.getImageDescriptor(ImageKey.COMMENT_CONNECTION));
group.add(relationNoteTool);
}
示例10: ORMGraphicalEditorPalette
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
/**
* The constructor of this class, where the palett is build and entryVisibility and entries
* variables are initialized.
* */
public ORMGraphicalEditorPalette() {
entryVisibility = new HashMap<String, Boolean>();
entries = new HashMap<String, CreationToolEntry>();
addGroup();
addSelectionTool();
createComponentsDrawer();
createComponentPartsDrawer();
createConnectionsDrawer();
}
示例11: setupWalkerGroupTool
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
private void setupWalkerGroupTool(final PaletteGroup group) {
group.add(new CreationToolEntry("Table Group", "Make new group for tables by border", new SimpleFactory(WalkerGroup.class),
Activator.getImageDescriptor(ImageKey.CATEGORY), Activator.getImageDescriptor(ImageKey.CATEGORY)));
}
示例12: addEntry
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
/**
* This method add a palett entry with sting id/name to the entries map.
* */
private void addEntry(final String name, final CreationToolEntry entry, final Boolean visibility) {
entries.put(name, entry);
setEntryVisibility(name, visibility);
}
示例13: BODesignerEditorPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
public BODesignerEditorPaletteRoot() {
PaletteGroup group = new PaletteGroup("");
//增加Select 图标
PanningSelectionToolEntry selectionToolEntry = new PanningSelectionToolEntry(
ConstantResource.LABEL_SELECT);
selectionToolEntry.setToolClass(MovablePanningSelectionTool.class);
selectionToolEntry.setLargeIcon(Activator.getImageDescriptor("icons/arrow16.gif"));
selectionToolEntry.setSmallIcon(Activator.getImageDescriptor("icons/arrow16.gif"));
group.add(selectionToolEntry);
group.add(new CreationToolEntry("Note", "Note",
new SimpleFactory(NoteModel.class),
null,
null));
group.add(new PaletteSeparator());
//增加Table 图标
group.add(new CreationToolEntry(
ConstantResource.LABEL_TABLE,
ConstantResource.LABEL_CREATE_TABLE,
new SimpleFactory(HdbTableModel.class),
Activator.getImageDescriptor("icons/model_new.gif"),
Activator.getImageDescriptor("icons/model_new.gif")));
group.add(new CreationToolEntry(
ConstantResource.LABEL_VIEW,
ConstantResource.LABEL_CREATE_VIEW,
new SimpleFactory(ViewModel.class),
Activator.getImageDescriptor("icons/view.gif"),
Activator.getImageDescriptor("icons/view.gif")));
group.add(new ConnectionCreationToolEntry("Connection",
"Create a connection",
null, null, null));
group.add(new PaletteSeparator());
//添加关系
/*ConnectionCreationToolEntry toolEntry1N = new ConnectionCreationToolEntry(
ConstantResource.label_relation_one_to_many,
ConstantResource.label_create_relation_one_to_many,
new SimpleFactory(null), Activator
.getImageDescriptor(ImageResource.RELATION_1_N), Activator
.getImageDescriptor(ImageResource.RELATION_1_N));
toolEntry1N.setToolClass(null);
group.add(toolEntry1N);
ConnectionCreationToolEntry toolEntryNN = new ConnectionCreationToolEntry(
ConstantResource.label_relation_many_to_many,
ConstantResource.label_create_relation_many_to_many,
new SimpleFactory(null), Activator
.getImageDescriptor(ImageResource.RELATION_N_N), Activator
.getImageDescriptor(ImageResource.RELATION_N_N));
toolEntryNN.setToolClass(null);
group.add(toolEntryNN);
ConnectionCreationToolEntry toolEntrySelf = new ConnectionCreationToolEntry(
ConstantResource.label_relation_self,
ConstantResource.label_create_relation_self,
new SimpleFactory(null), Activator
.getImageDescriptor(ImageResource.RELATION_SELF), Activator
.getImageDescriptor(ImageResource.RELATION_SELF));
toolEntrySelf.setToolClass(null);
group.add(toolEntrySelf);
*/
this.add(group);
this.setDefaultEntry(selectionToolEntry);
}
示例14: ERDiagramPaletteRoot
import org.eclipse.gef.palette.CreationToolEntry; //导入依赖的package包/类
public ERDiagramPaletteRoot() {
final PaletteGroup group = new PaletteGroup("");
// when tooltip equals to label, tooltip is not displayed.
final PanningSelectionToolEntry selectionTool = new PanningSelectionToolEntry(ResourceString.getResourceString("label.select"));
selectionTool.setToolClass(MovablePanningSelectionTool.class);
selectionTool.setLargeIcon(ERDiagramActivator.getImageDescriptor(ImageKey.ARROW));
selectionTool.setSmallIcon(ERDiagramActivator.getImageDescriptor(ImageKey.ARROW));
group.add(selectionTool);
// group.add(new MarqueeToolEntry());
group.add(new CreationToolEntry(ResourceString.getResourceString("label.table"), ResourceString.getResourceString("label.create.table"), new SimpleFactory(ERTable.class), ERDiagramActivator.getImageDescriptor(ImageKey.TABLE_NEW), ERDiagramActivator.getImageDescriptor(ImageKey.TABLE_NEW)));
group.add(new CreationToolEntry(ResourceString.getResourceString("label.view"), ResourceString.getResourceString("label.create.view"), new SimpleFactory(View.class), ERDiagramActivator.getImageDescriptor(ImageKey.VIEW), ERDiagramActivator.getImageDescriptor(ImageKey.VIEW)));
final ConnectionCreationToolEntry oneToManyTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.one.to.many"), ResourceString.getResourceString("label.create.relation.one.to.many"), new SimpleFactory(Relation.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N));
oneToManyTool.setToolClass(RelationCreationTool.class);
group.add(oneToManyTool);
final ConnectionCreationToolEntry relationByExistingTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.by.existing.columns"), ResourceString.getResourceString("label.create.relation.by.existing.columns"), new SimpleFactory(RelationByExistingColumns.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_1_N));
relationByExistingTool.setToolClass(RelationByExistingColumnsCreationTool.class);
group.add(relationByExistingTool);
final ConnectionCreationToolEntry manyToManyTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.many.to.many"), ResourceString.getResourceString("label.create.relation.many.to.many"), new SimpleFactory(RelatedTable.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_N_N), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_N_N));
manyToManyTool.setToolClass(RelatedTableCreationTool.class);
group.add(manyToManyTool);
final ConnectionCreationToolEntry selfRelationTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.self"), ResourceString.getResourceString("label.create.relation.self"), new SimpleFactory(SelfRelation.class), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_SELF), ERDiagramActivator.getImageDescriptor(ImageKey.RELATION_SELF));
selfRelationTool.setToolClass(SelfRelationCreationTool.class);
group.add(selfRelationTool);
group.add(new PaletteSeparator());
final CreationToolEntry noteTool = new CreationToolEntry(ResourceString.getResourceString("label.note"), ResourceString.getResourceString("label.create.note"), new SimpleFactory(Note.class), ERDiagramActivator.getImageDescriptor(ImageKey.NOTE), ERDiagramActivator.getImageDescriptor(ImageKey.NOTE));
group.add(noteTool);
final ConnectionCreationToolEntry commentConnectionTool = new ConnectionCreationToolEntry(ResourceString.getResourceString("label.relation.note"), ResourceString.getResourceString("label.create.relation.note"), new SimpleFactory(CommentConnection.class), ERDiagramActivator.getImageDescriptor(ImageKey.COMMENT_CONNECTION), ERDiagramActivator.getImageDescriptor(ImageKey.COMMENT_CONNECTION));
group.add(commentConnectionTool);
group.add(new PaletteSeparator());
group.add(new CreationToolEntry(ResourceString.getResourceString("label.category"), ResourceString.getResourceString("label.create.category"), new SimpleFactory(Category.class), ERDiagramActivator.getImageDescriptor(ImageKey.CATEGORY), ERDiagramActivator.getImageDescriptor(ImageKey.CATEGORY)));
group.add(new PaletteSeparator());
group.add(new InsertImageTool());
this.add(group);
setDefaultEntry(selectionTool);
}