本文整理汇总了Java中org.eclipse.gef.palette.PaletteDrawer类的典型用法代码示例。如果您正苦于以下问题:Java PaletteDrawer类的具体用法?Java PaletteDrawer怎么用?Java PaletteDrawer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PaletteDrawer类属于org.eclipse.gef.palette包,在下文中一共展示了PaletteDrawer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPaletteRoot
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的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: refreshThePaletteBasedOnSearchString
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
private void refreshThePaletteBasedOnSearchString(final PaletteRoot paletteRoot,
final ELTGraphicalEditor editor, final Map<String, PaletteDrawer> categoryPaletteContainer,
final Text text, final List<Component> componentsConfig, final Composite container) {
text.addVerifyListener(new VerifyListener() {
@Override
public void verifyText(VerifyEvent e) {
boolean matchFound = false;
final List<Component> matchingComponents = new ArrayList<>();
paletteRoot.getChildren().clear();
String currentText = ((Text) e.widget).getText();
createPaletteContainers(paletteRoot, categoryPaletteContainer, editor);
String searchedString = (currentText.substring(0, e.start) + e.text + currentText.substring(e.end))
.toUpperCase();
if (StringUtils.isEmpty(searchedString)) {
showAllContainers(paletteRoot, editor, categoryPaletteContainer, componentsConfig);
} else {
showOpenPaletteContainers(paletteRoot.getChildren());
matchFound = checkSearchedComponentFoundInPalette(editor, categoryPaletteContainer, componentsConfig,
matchingComponents, searchedString);
showMessageWhenComponentNotFound(container, matchFound);
showMatchingContainers(paletteRoot, categoryPaletteContainer, matchingComponents);
}
}
});
}
示例3: checkSearchedComponentFoundInPalette
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
private boolean checkSearchedComponentFoundInPalette(final ELTGraphicalEditor editor,
final Map<String, PaletteDrawer> categoryPaletteContainer, final List<Component> componentsConfig,
List<Component> matchingComponents, String searchedString) {
boolean matchFound = false;
for (Component componentConfig : componentsConfig) {
String componentName = componentConfig.getNameInPalette().toUpperCase();
if (Constants.UNKNOWN_COMPONENT.equalsIgnoreCase(componentConfig.getName()))
continue;
if (componentName.contains(searchedString.trim())) {
CombinedTemplateCreationEntry component = getComponentToAddInContainer(editor, componentConfig);
categoryPaletteContainer.get(componentConfig.getCategory().name()).add(component);
matchingComponents.add(componentConfig);
matchFound = true;
if (label != null) {
label.dispose();
}
}
}
return matchFound;
}
示例4: showMatchingContainers
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
private void showMatchingContainers(PaletteRoot paletteRoot,
Map<String, PaletteDrawer> categoryPaletteContainer, List<Component> matchingComponents) {
List<PaletteContainer> children = paletteRoot.getChildren();
for (PaletteContainer paletteContainer : children) {
paletteContainer.setVisible(false);
}
for (Component component : matchingComponents) {
for (int i = 0; i < children.size(); i++) {
if (children.get(i).equals(categoryPaletteContainer.get(component.getCategory().name()))) {
children.get(i).setVisible(true);
}
}
}
}
示例5: GraphicalPalette
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的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);
}
示例6: createElements
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
public static PaletteDrawer createElements(PaletteRoot paletteRoot, List<String> ignore, PaletteGroup p,
Map<String, List<PaletteEntry>> map) {
PaletteDrawer drawer = createGroup(paletteRoot, ignore, p.getName(), p.getImage());
// drawer.add(createJDEntry(MCallout.getIconDescriptor(), MCallout.class));
drawer.add(createJDEntry(MTextField.getIconDescriptor(), MTextField.class));
drawer.add(createJDEntry(MStaticText.getIconDescriptor(), MStaticText.class));
drawer.add(createJDEntry(MImage.getIconDescriptor(), MImage.class));
drawer.add(createJDEntry(MBreak.getIconDescriptor(), MBreak.class));
drawer.add(createJDEntry(MRectangle.getIconDescriptor(), MRectangle.class));
drawer.add(createJDEntry(MEllipse.getIconDescriptor(), MEllipse.class));
drawer.add(createJDEntry(MLine.getIconDescriptor(), MLine.class));
// drawer.add(createJDEntry(MGenericElement.getIconDescriptor(), MGenericElement.class));
drawer.add(createJDEntry(MFrame.getIconDescriptor(), MFrame.class));
drawer.add(createJDEntry(MSubreport.getIconDescriptor(), MSubreport.class));
getEntries4Key(drawer, ignore, p.getId(), map);
return drawer;
}
示例7: createEditPart
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
/**
* @see org.eclipse.gef.EditPartFactory#createEditPart(EditPart, Object)
*/
public EditPart createEditPart(EditPart parentEditPart, Object model) {
if (model instanceof PaletteRoot)
return createMainPaletteEditPart(parentEditPart, model);
if (model instanceof PaletteStack)
return createStackEditPart(parentEditPart, model);
if (model instanceof PaletteContainer) {
Object type = ((PaletteContainer) model).getType();
if (PaletteDrawer.PALETTE_TYPE_DRAWER.equals(type))
return createDrawerEditPart(parentEditPart, model);
if (PaletteGroup.PALETTE_TYPE_GROUP.equals(type)
|| PaletteContainer.PALETTE_TYPE_UNKNOWN.equals(type))
return createGroupEditPart(parentEditPart, model);
if (PaletteToolbar.PALETTE_TYPE_TOOLBAR_GROUP.equals(type))
return createToolbarEditPart(parentEditPart, model);
}
if (model instanceof PaletteTemplateEntry)
return createTemplateEditPart(parentEditPart, model);
if (model instanceof PaletteSeparator)
return createSeparatorEditPart(parentEditPart, model);
if (model instanceof PaletteEntry)
return createEntryEditPart(parentEditPart, model);
return null;
}
示例8: createComponentPartsDrawer
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的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);
}
示例9: createFieldDrawer
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
private PaletteContainer createFieldDrawer() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
String group = "表单控件";
PaletteDrawer drawer = new PaletteDrawer(group,
ImageDescriptor.createFromFile(TaskFigure.class,
"icons/home.png"));
List<Component> listComp = ConfigManager.getComponents();
for (int i = 0; i < listComp.size(); i++) {
Component comp = (Component) listComp.get(i);
if (!validate(ConfigManager.COMPONENT_TYPE_FIELD, comp)) {
continue;
}
PaletteEntry paletteEntry = createCombinedEntry(comp);
if (paletteEntry == null) {
continue;
}
entries.add(paletteEntry);
}
drawer.addAll(entries);
drawer.setInitialState(2);
return drawer;
}
示例10: createObjects1Group
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
/**
* Creates "Objects" palette tool group
* @generated
*/
private PaletteContainer createObjects1Group() {
PaletteDrawer paletteContainer = new PaletteDrawer(
SimpleBPMN.diagram.part.Messages.Objects1Group_title);
paletteContainer.setId("createObjects1Group"); //$NON-NLS-1$
paletteContainer.add(createANDGateway1CreationTool());
paletteContainer.add(createActivity2CreationTool());
paletteContainer.add(createDataObject3CreationTool());
paletteContainer.add(createEndEvent4CreationTool());
paletteContainer.add(createGroup5CreationTool());
paletteContainer.add(createIntermediateEvent6CreationTool());
paletteContainer.add(createLane7CreationTool());
paletteContainer.add(createORGateway8CreationTool());
paletteContainer.add(createPool9CreationTool());
paletteContainer.add(createStartEvent10CreationTool());
paletteContainer.add(createXORGateway11CreationTool());
return paletteContainer;
}
示例11: dispose
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
public void dispose() {
for (Iterator iterator = getChildren().iterator(); iterator.hasNext();) {
PaletteEntry elem = (PaletteEntry) iterator.next();
if (elem instanceof PaletteDrawer) {
PaletteDrawer drawer = (PaletteDrawer) elem;
Vector v2 = new Vector();
v2.addAll(drawer.getChildren());
for (Iterator iterator2 = v2.iterator(); iterator2.hasNext();) {
PaletteEntry elem2 = (PaletteEntry) iterator2.next();
if (elem2 instanceof URNElementCreationEntry) {
URNElementCreationEntry entry = (URNElementCreationEntry) elem2;
entry.setFactory(null);
}
elem2.setParent(null);
}
}
}
setChildren(new Vector());
parent = null;
keyboardMapping.clear();
keyboardMapping = null;
}
示例12: createNodes1Group
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
/**
* Creates "Nodes" palette tool group
* @generated
*/
private PaletteContainer createNodes1Group() {
PaletteDrawer paletteContainer = new PaletteDrawer(
Messages.Nodes1Group_title);
paletteContainer.setId("createNodes1Group"); //$NON-NLS-1$
paletteContainer.setDescription(Messages.Nodes1Group_desc);
paletteContainer.add(createGoal1CreationTool());
paletteContainer.add(createEvidence3CreationTool());
paletteContainer.add(createStrategy2CreationTool());
paletteContainer.add(createContext6CreationTool());
paletteContainer.add(createJustification7CreationTool());
paletteContainer.add(createUserdef0044CreationTool()); // Assumption
paletteContainer.add(createUndeveloped5CreationTool());
paletteContainer.add(createUserdef0055CreationTool()); // Module
paletteContainer.add(createUserdef0066CreationTool()); // Contract
return paletteContainer;
}
示例13: createOptionNodes2Group
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的package包/类
/**
* Creates "Option Nodes" palette tool group
* @generated
*/
private PaletteContainer createOptionNodes2Group() {
PaletteDrawer paletteContainer = new PaletteDrawer(
Messages.OptionNodes2Group_title);
paletteContainer.setId("createOptionNodes2Group"); //$NON-NLS-1$
paletteContainer.setDescription(Messages.OptionNodes2Group_desc);
paletteContainer.add(createMonitor4CreationTool());
paletteContainer.add(createSystem8CreationTool());
paletteContainer.add(createPolicy9CreationTool());
paletteContainer.add(createUserdef0011CreationTool());
paletteContainer.add(createUserdef0022CreationTool());
paletteContainer.add(createUserdef0033CreationTool());
return paletteContainer;
}
示例14: getPaletteRoot
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的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;
}
示例15: getPaletteRoot
import org.eclipse.gef.palette.PaletteDrawer; //导入依赖的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;
}