@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; }
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); } } }); }
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; }
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); } } } }
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); }
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; }
/** * @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; }
/** * 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); }
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; }
/** * 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; }
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; }
/** * 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; }
/** * 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; }
@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; }
@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; }
@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; }
@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; }
@Override protected EditPart createDrawerEditPart(EditPart parentEditPart, Object model) { return new DrawerEditPart((PaletteDrawer) model) { @Override public IFigure createFigure() { DrawerFigure drawerFigure = (DrawerFigure) super.createFigure(); drawerFigure.getContentPane().setBackgroundColor(palatteBackgroundColor); drawerFigures.add(drawerFigure); return drawerFigure; } }; }
/** * create searchTextBox and show components according to text entered in search box * @param parent * @param paletteRoot * @param editor * @return Control */ public Control creatSearchTextBox(Composite parent, final PaletteRoot paletteRoot, final ELTGraphicalEditor editor) { final Map<String, PaletteDrawer> categoryPaletteContainer = new HashMap<>(); Composite container = createCompositeForSearchTextBox(parent); final Text text = createSearchTextBox(container,SWT.BORDER); try { final List<Component> componentsConfig = XMLConfigUtil.INSTANCE.getComponentConfig(); refreshThePaletteBasedOnSearchString(paletteRoot, editor, categoryPaletteContainer, text, componentsConfig, container); } catch (RuntimeException|SAXException|IOException exception) { LOGGER.error(exception.getMessage(),exception); } return container; }
private void showAllContainers(final PaletteRoot paletteRoot, final ELTGraphicalEditor editor, final Map<String, PaletteDrawer> categoryPaletteContainer, final List<Component> componentsConfig) { for (Component componentConfig : componentsConfig) { if (Constants.UNKNOWN_COMPONENT.equalsIgnoreCase(componentConfig.getName())) continue; CombinedTemplateCreationEntry component = getComponentToAddInContainer(editor, componentConfig); categoryPaletteContainer.get(componentConfig.getCategory().name()).add(component); showClosedPaletteContainersWhenSearchTextBoxIsEmpty(paletteRoot.getChildren()); } if (label != null) { label.dispose(); } }
private void showClosedPaletteContainersWhenSearchTextBoxIsEmpty(List list) { for (int i = 0; i < list.size(); i++) { PaletteDrawer paletteDrawer = (PaletteDrawer) list.get(i); paletteDrawer.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED); paletteDrawer.setVisible(true); } }
private void showOpenPaletteContainers(List list) { for (int i = 0; i < list.size(); i++) { PaletteDrawer paletteDrawer = (PaletteDrawer) list.get(i); paletteDrawer.setInitialState(PaletteDrawer.INITIAL_STATE_OPEN); paletteDrawer.setVisible(true); } }
private void createPaletteContainers(PaletteRoot paletteRoot, Map<String, PaletteDrawer> categoryPaletteContainer, ELTGraphicalEditor eLEtlGraphicalEditor) { for (CategoryType category : CategoryType.values()) { if (Constants.UNKNOWN_COMPONENT_CATEGORY.equalsIgnoreCase(category.name())) continue; PaletteDrawer paletteDrawer = eLEtlGraphicalEditor.createPaletteContainer(category.name()); eLEtlGraphicalEditor.addContainerToPalette(paletteRoot, paletteDrawer); categoryPaletteContainer.put(category.name(), paletteDrawer); } }
/** * Creates the palette container. * * @param CategoryName * the category name * @return the palette drawer */ public PaletteDrawer createPaletteContainer(String CategoryName) { String name = CategoryName.substring(0, 1).toUpperCase() + CategoryName.substring(1).toLowerCase(); PaletteDrawer p = new PaletteDrawer(name, ImageDescriptor.createFromURL(prepareIconPathURL("/icons/"+ name + "_categoryIcon.png"))); p.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED); return p; }
private void createShapesDrawer(PaletteRoot palette) throws RuntimeException, SAXException, IOException { Map<String, PaletteDrawer> categoryPaletteConatiner = new HashMap<>(); for (CategoryType category : CategoryType.values()) { if(category.name().equalsIgnoreCase(Constants.UNKNOWN_COMPONENT_CATEGORY)){ continue; } PaletteDrawer p = createPaletteContainer(category.name()); addContainerToPalette(palette, p); categoryPaletteConatiner.put(category.name(), p); } List<Component> componentsConfig = XMLConfigUtil.INSTANCE.getComponentConfig(); //To show the components in sorted order in palette Collections.sort(componentsConfig, new Comparator<Component>() { public int compare(Component component1, Component component2) { return component1.getNameInPalette().compareToIgnoreCase(component2.getNameInPalette()); }; }); for (Component componentConfig : componentsConfig) { Class<?> clazz = DynamicClassProcessor.INSTANCE.createClass(componentConfig); if(componentConfig.getName().equalsIgnoreCase(Constants.UNKNOWN_COMPONENT)){ continue; } CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry( componentConfig.getNameInPalette(), null, clazz, new SimpleFactory(clazz), ImageDescriptor.createFromURL( prepareIconPathURL(componentConfig.getPaletteIconPath())), ImageDescriptor.createFromURL( prepareIconPathURL(componentConfig.getPaletteIconPath()))); categoryPaletteConatiner.get(componentConfig.getCategory().name()).add(component); } }
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; }
public static PaletteDrawer createContainers(PaletteRoot paletteRoot, List<String> ignore, PaletteGroup p, Map<String, List<PaletteEntry>> map) { PaletteDrawer drawer = createGroup(paletteRoot, ignore, p.getName(), p.getImage()); drawer.add(createJDEntry(MFrame.getIconDescriptor(), MFrame.class)); drawer.add(createJDEntry(MSubreport.getIconDescriptor(), MSubreport.class)); getEntries4Key(drawer, ignore, p.getId(), map); return drawer; }
/** * Creates a new JDPalette object. * * @param paletteRoot * the palette root */ public static void createFields(PaletteRoot paletteRoot, List<String> ignore, PaletteGroup p, Map<String, List<PaletteEntry>> map) { PaletteDrawer drawer = createGroup(paletteRoot, ignore, p.getName(), p.getImage()); drawer.add(createJDEntry(MPageNumber.getIconDescriptor(), MPageNumber.class)); drawer.add(createJDEntry(MTotalPages.getIconDescriptor(), MTotalPages.class)); drawer.add(createJDEntry(MDate.getIconDescriptor(), MDate.class)); drawer.add(createJDEntry(MTime.getIconDescriptor(), MTime.class)); drawer.add(createJDEntry(MPercentage.getIconDescriptor(), MPercentage.class)); drawer.add(createJDEntry(MPageXofY.getIconDescriptor(), MPageXofY.class)); getEntries4Key(drawer, ignore, p.getId(), map); }
private static void getEntries4Key(PaletteDrawer drawer, List<String> ignore, String id, Map<String, List<PaletteEntry>> map) { List<PaletteEntry> plist = map.get(id); if (plist != null) for (PaletteEntry entry : plist) { if (ignore != null && ignore.contains(entry.getType())) continue; drawer.add(entry); } }
/** * This method is invoked when the selection state of the option to open * drawer at start-up is toggled. * <p> * It sets the initial state of the drawer accordingly. * * @param selection * <code>true</code> if that option is now selected */ protected void handleOpenSelected(boolean selection) { int status = selection ? PaletteDrawer.INITIAL_STATE_OPEN : PaletteDrawer.INITIAL_STATE_CLOSED; getDrawer().setInitialState(status); pinDrawerOption.setEnabled(selection); if (!selection) { pinDrawerOption.setSelection(false); } }
/** * Creates "Node" palette tool group * @generated */ private PaletteContainer createNode1Group() { PaletteDrawer paletteContainer = new PaletteDrawer( Messages.Node1Group_title); paletteContainer.setId("createNode1Group"); //$NON-NLS-1$ paletteContainer.add(createSMC1CreationTool()); paletteContainer.add(createRole2CreationTool()); paletteContainer.add(createContract3CreationTool()); paletteContainer.add(createFact4CreationTool()); paletteContainer.add(createPlayer5CreationTool()); return paletteContainer; }
/** * Creates "Connection" palette tool group * @generated */ private PaletteContainer createConnection2Group() { PaletteDrawer paletteContainer = new PaletteDrawer( Messages.Connection2Group_title); paletteContainer.setId("createConnection2Group"); //$NON-NLS-1$ paletteContainer.add(createContractRoleA1CreationTool()); paletteContainer.add(createContractRoleB2CreationTool()); paletteContainer.add(createPlayerBinding3CreationTool()); paletteContainer.add(createFactLink4CreationTool()); paletteContainer.add(createExternalFactLink5CreationTool()); return paletteContainer; }
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; }
/** * Creates "Connections" palette tool group * @generated */ private PaletteContainer createConnections2Group() { PaletteDrawer paletteContainer = new PaletteDrawer( SimpleBPMN.diagram.part.Messages.Connections2Group_title); paletteContainer.setId("createConnections2Group"); //$NON-NLS-1$ paletteContainer.add(createAssociation1CreationTool()); paletteContainer.add(createMessageFlow2CreationTool()); paletteContainer.add(createSequenceFlow3CreationTool()); return paletteContainer; }
/** * Add KPI entries to the palette */ public void addKpi() { if (!contains(Messages.getString("GrlPaletteRoot.kpiModel"))) { //$NON-NLS-1$ ToolEntry entry; // Add KPI model elements and links PaletteDrawer kpiModelDrawer = new PaletteDrawer(Messages.getString("GrlPaletteRoot.kpiModel")); //$NON-NLS-1$ // Add Indicator entry = new URNElementCreationEntry( Messages.getString("GrlPaletteRoot.indicator"), Messages.getString("GrlPaletteRoot.createIndicator"), IntentionalElementRef.class, new ModelCreationFactory(getURNspec(), IntentionalElementRef.class, //$NON-NLS-1$ //$NON-NLS-2$ IntentionalElementType.INDICATOR), JUCMNavPlugin.getImageDescriptor("icons/Indicator16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/Indicator24.gif")); //$NON-NLS-1$ kpiModelDrawer.add(entry); keyboardMapping.put("i", entry); //$NON-NLS-1$ // Add Dimension entry = new URNElementCreationEntry(Messages.getString("GrlPaletteRoot.dimension"), Messages.getString("GrlPaletteRoot.createDimension"), //$NON-NLS-1$ //$NON-NLS-2$ KPIInformationElementRef.class, new ModelCreationFactory(getURNspec(), KPIInformationElementRef.class), JUCMNavPlugin .getImageDescriptor("icons/Dimension16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/Dimension24.gif")); //$NON-NLS-1$ kpiModelDrawer.add(entry); keyboardMapping.put("j", entry); //$NON-NLS-1$ // Add KPIModelLink entry = new BaseConnectionCreationToolEntry( Messages.getString("GrlPaletteRoot.kpiModelLink"), Messages.getString("GrlPaletteRoot.createKPIModelLink"), new ModelCreationFactory(getURNspec(), KPIModelLink.class), //$NON-NLS-1$ //$NON-NLS-2$ JUCMNavPlugin.getImageDescriptor("icons/KPIModelLink16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/KPIModelLink24.gif")); //$NON-NLS-1$ kpiModelDrawer.add(entry); keyboardMapping.put("k", entry); //$NON-NLS-1$ add(kpiModelDrawer); } }
/** * Find a palette entry from a label name * * @param label * @return */ protected PaletteEntry getEntry(String label) { for (Iterator iterator = getChildren().iterator(); iterator.hasNext();) { Object o = (Object) iterator.next(); if (o instanceof PaletteDrawer) { if (((PaletteDrawer) o).getLabel().equals(label)) return (PaletteDrawer) o; } } return null; }
/** Create the "Shapes" drawer. */ private static PaletteContainer createShapesDrawer() { PaletteDrawer componentsDrawer = new PaletteDrawer("Shapes"); CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry("Rectangle", "Create a rectangular shape", RectangularShape.class, new SimpleFactory(RectangularShape.class), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/rectangle16.gif"), ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/rectangle24.gif")); componentsDrawer.add(component); return componentsDrawer; }
/** * Creates "Objects" palette tool group * @generated */ private PaletteContainer createObjects1Group() { PaletteDrawer paletteContainer = new PaletteDrawer( edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.Messages.Objects1Group_title); paletteContainer.setId("createObjects1Group"); //$NON-NLS-1$ paletteContainer.add(createClass1CreationTool()); paletteContainer.add(createLifeline2CreationTool()); paletteContainer.add(createMessage3CreationTool()); paletteContainer.add(createOperation4CreationTool()); return paletteContainer; }