本文整理汇总了Java中org.eclipse.gef.palette.ConnectionCreationToolEntry类的典型用法代码示例。如果您正苦于以下问题:Java ConnectionCreationToolEntry类的具体用法?Java ConnectionCreationToolEntry怎么用?Java ConnectionCreationToolEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionCreationToolEntry类属于org.eclipse.gef.palette包,在下文中一共展示了ConnectionCreationToolEntry类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaletteRoot
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的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: GraphicalPalette
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的package包/类
public GraphicalPalette(){
PaletteDrawer tools=new PaletteDrawer("节点列表");
PanningSelectionToolEntry selectionTool=new PanningSelectionToolEntry();
tools.add(selectionTool);
this.setDefaultEntry(selectionTool);
ImageDescriptor transitionDescriptor=ImageDescriptor.createFromImage(Activator.getImageFromPlugin(Constants.TRANSITION_NODE_ICON_SMALL));
ConnectionCreationToolEntry connection=new ConnectionCreationToolEntry("Transition","Create a Transition",null,transitionDescriptor,transitionDescriptor);
tools.add(connection);
tools.add(this.createToolEntry(StartNode.class,"Start","Create a start node",70,40));
tools.add(this.createToolEntry(EndNode.class,"End","Create a end node",70,40));
tools.add(this.createToolEntry(TaskNode.class,"Task","Create a task node",80,40));
tools.add(this.createToolEntry(ForkNode.class,"Fork","Create a fork node",80,40));
tools.add(this.createToolEntry(JoinNode.class,"Join","Create a join node",80,40));
tools.add(this.createToolEntry(ForeachNode.class,"Foreach","Create a foreach node",80,40));
tools.add(this.createToolEntry(DecisionNode.class,"Decision","Create a decision node",80,40));
tools.add(this.createToolEntry(SubprocessNode.class,"Subprocess","Create a subprocess node",100,40));
tools.add(this.createToolEntry(EndCancelNode.class,"End Cancel","Create a end cancel node",100,40));
tools.add(this.createToolEntry(EndErrorNode.class,"End Error","Create a end error node",100,40));
tools.add(this.createToolEntry(StateNode.class,"State","Create a state node",80,40));
tools.add(this.createToolEntry(CustomNode.class,"Custom","Create a custom node",80,40));
this.add(tools);
}
示例3: getPaletteRoot
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的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;
}
示例4: createPaletteDrawer
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的package包/类
private static PaletteDrawer createPaletteDrawer() {
PaletteDrawer drawer = new PaletteDrawer("Elements");
CombinedTemplateCreationEntry table = new CombinedTemplateCreationEntry("Table", "This is table tool", Table.class, new SimpleFactory(
Table.class), Activator.getImageDescriptor(Activator.IMAGE_TABLE_16), Activator.getImageDescriptor(Activator.IMAGE_TABLE_24));
drawer.add(table);
CombinedTemplateCreationEntry column = new CombinedTemplateCreationEntry("Column", "This is column tool", Column.class, new SimpleFactory(
Column.class), Activator.getImageDescriptor(Activator.IMAGE_COLUMN_16), Activator.getImageDescriptor(Activator.IMAGE_COLUMN_24));
drawer.add(column);
ConnectionCreationToolEntry connection = new ConnectionCreationToolEntry("Connection", "this is table connection", new SimpleFactory(
Connection.class), Activator.getImageDescriptor(Activator.IMAGE_CONNECTION_16),
Activator.getImageDescriptor(Activator.IMAGE_CONNECTION_24));
drawer.add(connection);
return drawer;
}
示例5: setupNoteTool
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的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);
}
示例6: createTaskDrawer
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的package包/类
private PaletteContainer createTaskDrawer(PaletteRoot root) {
String group = "流程组件";
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
PaletteDrawer drawer = new PaletteDrawer(group,
ImageDescriptor.createFromFile(TaskFigure.class,
"icons/home.png"));
ConnectionCreationToolEntry connectionToolEntry = new ConnectionCreationToolEntry(
"transition", "创建连接", new ModelCreationFactory(null,
Transition.class), ImageDescriptor.createFromFile(
TaskFigure.class, "icons/flow_sequence.png"),
ImageDescriptor.createFromFile(TaskFigure.class,
"icons/flow_sequence.png"));
drawer.add(connectionToolEntry);
List<Component> listComp = ConfigManager.getComponents();
for (int i = 0; i < listComp.size(); i++) {
Component comp = (Component) listComp.get(i);
if (!validate(ConfigManager.COMPONENT_TYPE_PROCESS, comp)) {
continue;
}
PaletteEntry paletteEntry = createCombinedEntry(comp);
if (paletteEntry == null) {
continue;
}
entries.add(paletteEntry);
}
drawer.addAll(entries);
return drawer;
}
示例7: ERDiagramPaletteRoot
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的package包/类
public ERDiagramPaletteRoot(ERDiagram diagram) {
this.diagram = diagram;
final PaletteGroup group = new PaletteGroup("");
final PanningSelectionToolEntry selectionToolEntry = setupSelectionTool(group);
// what is this? by jflute
// group.add(new MarqueeToolEntry());
setupTableViewTool(group);
// #deleted relationship creating new column is implemented as option of "1:n relationship"
//final ConnectionCreationToolEntry toolEntry1 =
// new ConnectionCreationToolEntry("1:n new column", DisplayMessages.getMessage("label.create.relation.one.to.many"),
// new SimpleFactory(Relationship.class), Activator.getImageDescriptor(ImageKey.RELATION_1_N),
// Activator.getImageDescriptor(ImageKey.RELATION_1_N));
//toolEntry1.setToolClass(RelationCreationTool.class);
//group.add(toolEntry1);
final ConnectionCreationToolEntry toolEntry2 =
new ConnectionCreationToolEntry("1:n Relationship", "Make relationship of tables", new SimpleFactory(
RelationByExistingColumns.class), Activator.getImageDescriptor(ImageKey.RELATION_1_N),
Activator.getImageDescriptor(ImageKey.RELATION_1_N));
toolEntry2.setToolClass(RelationByExistingColumnsCreationTool.class);
group.add(toolEntry2);
// #deleted unneeded by jflute
//final ConnectionCreationToolEntry toolEntry3 =
// new ConnectionCreationToolEntry(DisplayMessages.getMessage("label.relation.many.to.many"),
// DisplayMessages.getMessage("label.create.relation.many.to.many"), new SimpleFactory(RelatedTable.class),
// Activator.getImageDescriptor(ImageKey.RELATION_N_N), Activator.getImageDescriptor(ImageKey.RELATION_N_N));
//toolEntry3.setToolClass(RelatedTableCreationTool.class);
//group.add(toolEntry3);
final ConnectionCreationToolEntry seflRelationshipToolEntry =
new ConnectionCreationToolEntry("Self Relationship", "Make relationship in same table", new SimpleFactory(
SelfRelation.class), Activator.getImageDescriptor(ImageKey.RELATION_SELF),
Activator.getImageDescriptor(ImageKey.RELATION_SELF));
seflRelationshipToolEntry.setToolClass(SelfRelationCreationTool.class);
group.add(seflRelationshipToolEntry);
setupSeparator(group);
setupNoteTool(group);
setupSeparator(group);
setupWalkerGroupTool(group);
setupSeparator(group);
setupImageTool(group);
add(group);
setDefaultEntry(selectionToolEntry);
}
示例8: BODesignerEditorPaletteRoot
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的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);
}
示例9: ERDiagramPaletteRoot
import org.eclipse.gef.palette.ConnectionCreationToolEntry; //导入依赖的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);
}