/** * Creates a new JDPalette object. * * @param paletteRoot * the palette root */ public static void createToolBar(PaletteRoot paletteRoot) { PaletteToolbar paletteToolbar = new PaletteToolbar("toolbar"); //$NON-NLS-1$ paletteToolbar.add(new SelectionToolEntry()); paletteToolbar.add(new JDMarqueeToolEntry()); paletteRoot.add(paletteToolbar); }
private static PaletteContainer createControlGroup(PaletteRoot root) { PaletteGroup controlGroup = new PaletteGroup("Control Group"); List<PaletteEntry> tools = new ArrayList<PaletteEntry>(); ToolEntry selectionTool = new SelectionToolEntry(); tools.add(selectionTool); root.setDefaultEntry(selectionTool); controlGroup.addAll(tools); return controlGroup; }
private static PaletteContainer createControlGroup(PaletteRoot root) { PaletteGroup controlGroup = new PaletteGroup("Control Group"); List<PaletteEntry> tools = new ArrayList<PaletteEntry>(); ToolEntry selectionTool = new SelectionToolEntry(); tools.add(selectionTool); root.setDefaultEntry(selectionTool); // ToolEntry connectionCreationTool = new ConnectionCreationToolEntry("Connection", // "Create a connection", null, null, null); // tools.add(connectionCreationTool); controlGroup.addAll(tools); return controlGroup; }
private void addSelectionTool() { SelectionToolEntry entry = new SelectionToolEntry(); group.add(entry); group.add(new MarqueeToolEntry()); setDefaultEntry(entry); }
private static PaletteGroup createPaletteGroup() { PaletteGroup selectionGroup = new PaletteGroup("Selections"); selectionGroup.add(new SelectionToolEntry()); return selectionGroup; }
/** This method add the {@link SelectionTool} to the palett. */ private void addSelectionTool() { SelectionToolEntry entry = new SelectionToolEntry(); group.add(entry); setDefaultEntry(entry); }
/** * Builds the palette entries. */ protected void buildPalette() { keyboardMapping = new HashMap(); // a group of default control tools PaletteGroup controls = new PaletteGroup(Messages.getString("FmdPaletteRoot.controls")); //$NON-NLS-1$ // the selection tool; default tool ToolEntry tool = new SelectionToolEntry(); controls.add(tool); setDefaultEntry(tool); ToolEntry entry = new URNElementCreationEntry( "Comment", Messages.getString("FmdPaletteRoot.CreateAComment"), Comment.class, new ModelCreationFactory(getURNspec(), Comment.class), JUCMNavPlugin.getImageDescriptor("icons/Comment16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ JUCMNavPlugin.class, "icons/Comment24.gif")); //$NON-NLS-1$ controls.add(entry); keyboardMapping.put("q", entry); //$NON-NLS-1$ add(controls); //A group of links PaletteDrawer linksDrawer = new PaletteDrawer(Messages.getString("FmdPaletteRoot.links")); //$NON-NLS-1$ // Add a decomposition entry = new BaseConnectionCreationToolEntry( Messages.getString("FmdPaletteRoot.decomposition"), Messages.getString("FmdPaletteRoot.createDecomposition"), new ModelCreationFactory(getURNspec(), Decomposition.class), //$NON-NLS-1$ //$NON-NLS-2$ JUCMNavPlugin.getImageDescriptor("icons/Decomposition16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/Decomposition24.gif")); //$NON-NLS-1$ linksDrawer.add(entry); keyboardMapping.put("d", entry); //$NON-NLS-1$ // Add a mandatory entry = new BaseConnectionCreationToolEntry( Messages.getString("FmdPaletteRoot.mandatory"), Messages.getString("FmdPaletteRoot.createMandatory"), new ModelCreationFactory(getURNspec(), Dependency.class), //$NON-NLS-1$ //$NON-NLS-2$ JUCMNavPlugin.getImageDescriptor("icons/Mandatory16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/Mandatory24.gif")); //$NON-NLS-1$ linksDrawer.add(entry); add(linksDrawer); //A group of elements PaletteDrawer elementsDrawer = new PaletteDrawer(Messages.getString("FmdPaletteRoot.elements")); //$NON-NLS-1$ entry = new URNElementCreationEntry( Messages.getString("FmdPaletteRoot.task"), Messages.getString("FmdPaletteRoot.createTask"), IntentionalElementRef.class, new ModelCreationFactory(getURNspec(), IntentionalElementRef.class, //$NON-NLS-1$ //$NON-NLS-2$ IntentionalElementType.TASK), JUCMNavPlugin.getImageDescriptor("icons/Task16.gif"), ImageDescriptor.createFromFile( //$NON-NLS-1$ JUCMNavPlugin.class, "icons/Task24.gif")); //$NON-NLS-1$ elementsDrawer.add(entry); keyboardMapping.put("t", entry); //$NON-NLS-1$ add(elementsDrawer); }