Search in sources :

Example 1 with PaletteStack

use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.

the class ArchimateDiagramEditorPalette method createControlsGroup.

/**
 * Create a Group of Controls
 */
private void createControlsGroup() {
    PaletteContainer group = new PaletteToolbar(Messages.ArchimateDiagramEditorPalette_0);
    // The selection tool
    ToolEntry tool = new PanningSelectionToolEntry();
    tool.setToolClass(PanningSelectionExtendedTool.class);
    group.add(tool);
    // Use selection tool as default entry
    setDefaultEntry(tool);
    PaletteStack stack = createMarqueeSelectionStack();
    group.add(stack);
    // Format Painter
    formatPainterEntry = new FormatPainterToolEntry();
    group.add(formatPainterEntry);
    add(group);
    // Relations group will be inserted before this
    // $NON-NLS-1$
    add(new PaletteSeparator("relations"));
}
Also used : PaletteToolbar(org.eclipse.gef.palette.PaletteToolbar) PaletteSeparator(org.eclipse.gef.palette.PaletteSeparator) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ExtConnectionCreationToolEntry(com.archimatetool.editor.diagram.tools.ExtConnectionCreationToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) PaletteContainer(org.eclipse.gef.palette.PaletteContainer) PaletteStack(org.eclipse.gef.palette.PaletteStack)

Example 2 with PaletteStack

use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.

the class CanvasEditorPalette method createControlsGroup.

/**
 * Create a Group of Controls
 */
private PaletteContainer createControlsGroup() {
    PaletteContainer group = new PaletteToolbar(Messages.CanvasEditorPalette_0);
    add(group);
    // The selection tool
    ToolEntry tool = new PanningSelectionToolEntry();
    tool.setToolClass(PanningSelectionExtendedTool.class);
    group.add(tool);
    // Use selection tool as default entry
    setDefaultEntry(tool);
    PaletteStack stack = createMarqueeSelectionStack();
    group.add(stack);
    // Format Painter
    formatPainterEntry = new FormatPainterToolEntry();
    group.add(formatPainterEntry);
    return group;
}
Also used : PaletteToolbar(org.eclipse.gef.palette.PaletteToolbar) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ExtConnectionCreationToolEntry(com.archimatetool.editor.diagram.tools.ExtConnectionCreationToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) PaletteContainer(org.eclipse.gef.palette.PaletteContainer) PaletteStack(org.eclipse.gef.palette.PaletteStack)

Example 3 with PaletteStack

use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.

the class AbstractPaletteRoot method createMarqueeSelectionStack.

/**
 * Create a PaletteStack containing the Marquee selection tools
 */
protected PaletteStack createMarqueeSelectionStack() {
    PaletteStack stack = new PaletteStack(Messages.AbstractPaletteRoot_0, Messages.AbstractPaletteRoot_1, null);
    MarqueeToolEntry marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_2);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_CONTAINED_AND_RELATED_CONNECTIONS));
    stack.add(marquee);
    marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_3);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_TOUCHED_AND_RELATED_CONNECTIONS));
    stack.add(marquee);
    marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_4);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_CONNECTIONS_CONTAINED));
    stack.add(marquee);
    marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_5);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_CONNECTIONS_TOUCHED));
    stack.add(marquee);
    marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_6);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_CONTAINED));
    stack.add(marquee);
    marquee = new MarqueeToolEntry(Messages.AbstractPaletteRoot_7);
    marquee.setToolProperty(MarqueeSelectionTool.PROPERTY_MARQUEE_BEHAVIOR, Integer.valueOf(MarqueeSelectionTool.BEHAVIOR_NODES_TOUCHED));
    stack.add(marquee);
    return stack;
}
Also used : PaletteStack(org.eclipse.gef.palette.PaletteStack) MarqueeToolEntry(org.eclipse.gef.palette.MarqueeToolEntry)

Example 4 with PaletteStack

use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.

the class SketchEditorPalette method createControlsGroup.

/**
 * Create a Group of Controls
 */
private PaletteContainer createControlsGroup() {
    PaletteContainer group = new PaletteToolbar(Messages.SketchEditorPalette_0);
    add(group);
    // The selection tool
    ToolEntry tool = new PanningSelectionToolEntry();
    tool.setToolClass(PanningSelectionExtendedTool.class);
    group.add(tool);
    // Use selection tool as default entry
    setDefaultEntry(tool);
    PaletteStack stack = createMarqueeSelectionStack();
    group.add(stack);
    // Format Painter
    formatPainterEntry = new FormatPainterToolEntry();
    group.add(formatPainterEntry);
    return group;
}
Also used : PaletteToolbar(org.eclipse.gef.palette.PaletteToolbar) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ExtConnectionCreationToolEntry(com.archimatetool.editor.diagram.tools.ExtConnectionCreationToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) PaletteContainer(org.eclipse.gef.palette.PaletteContainer) PaletteStack(org.eclipse.gef.palette.PaletteStack)

Example 5 with PaletteStack

use of org.eclipse.gef.palette.PaletteStack in project archi by archimatetool.

the class PaletteStackFactory method createNewEntry.

/**
 * @see org.eclipse.gef.ui.palette.customize.PaletteEntryFactory#createNewEntry(org.eclipse.swt.widgets.Shell,
 *      org.eclipse.gef.palette.PaletteEntry)
 */
@Override
public PaletteEntry createNewEntry(Shell shell, PaletteEntry selected) {
    PaletteContainer parent = determineContainerForNewEntry(selected);
    int index = determineIndexForNewEntry(parent, selected);
    PaletteEntry entry = createNewEntry(shell);
    parent.remove(selected);
    parent.add(index - 1, entry);
    ((PaletteStack) entry).add(selected);
    entry.setUserModificationPermission(PaletteEntry.PERMISSION_FULL_MODIFICATION);
    return entry;
}
Also used : PaletteEntry(org.eclipse.gef.palette.PaletteEntry) PaletteContainer(org.eclipse.gef.palette.PaletteContainer) PaletteStack(org.eclipse.gef.palette.PaletteStack)

Aggregations

PaletteStack (org.eclipse.gef.palette.PaletteStack)7 PaletteContainer (org.eclipse.gef.palette.PaletteContainer)4 ExtConnectionCreationToolEntry (com.archimatetool.editor.diagram.tools.ExtConnectionCreationToolEntry)3 FormatPainterToolEntry (com.archimatetool.editor.diagram.tools.FormatPainterToolEntry)3 ConnectionCreationToolEntry (org.eclipse.gef.palette.ConnectionCreationToolEntry)3 PaletteToolbar (org.eclipse.gef.palette.PaletteToolbar)3 PanningSelectionToolEntry (org.eclipse.gef.palette.PanningSelectionToolEntry)3 ToolEntry (org.eclipse.gef.palette.ToolEntry)3 IPaletteStackEditPart (org.eclipse.gef.internal.ui.palette.editparts.IPaletteStackEditPart)2 PaletteEntry (org.eclipse.gef.palette.PaletteEntry)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Point (org.eclipse.draw2d.geometry.Point)1 EditPart (org.eclipse.gef.EditPart)1 DrawerEditPart (org.eclipse.gef.internal.ui.palette.editparts.DrawerEditPart)1 GroupEditPart (org.eclipse.gef.internal.ui.palette.editparts.GroupEditPart)1 PaletteStackEditPart (org.eclipse.gef.internal.ui.palette.editparts.PaletteStackEditPart)1 PinnablePaletteStackEditPart (org.eclipse.gef.internal.ui.palette.editparts.PinnablePaletteStackEditPart)1 TemplateEditPart (org.eclipse.gef.internal.ui.palette.editparts.TemplateEditPart)1 ToolEntryEditPart (org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart)1