Search in sources :

Example 1 with ConnectionCreationToolEntry

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

the class ArchimateDiagramEditorPalette method createArchimateRelationsGroup.

/**
 * Relations Types
 */
private void createArchimateRelationsGroup() {
    PaletteGroup group = new PaletteGroup(Messages.ArchimateDiagramEditorPalette_13);
    add(1, group);
    fEntries.add(group);
    // Magic Connector
    ConnectionCreationToolEntry magicConnectionEntry = new ConnectionCreationToolEntry(Messages.ArchimateDiagramEditorPalette_14, Messages.ArchimateDiagramEditorPalette_15, new MagicConnectionModelFactory(), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MAGIC_CONNECTION), IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MAGIC_CONNECTION));
    magicConnectionEntry.setToolClass(MagicConnectionCreationTool.class);
    magicConnectionEntry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
    group.add(magicConnectionEntry);
    // Relations
    for (EClass eClass : ArchimateModelUtils.getRelationsClasses()) {
        ToolEntry entry = createConnectionCreationToolEntry(eClass, null);
        group.add(entry);
    }
    // Junctions
    for (EClass eClass : ArchimateModelUtils.getConnectorClasses()) {
        ToolEntry entry = createElementCreationToolEntry(eClass, null);
        group.add(entry);
    }
}
Also used : EClass(org.eclipse.emf.ecore.EClass) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) MagicConnectionModelFactory(com.archimatetool.editor.diagram.tools.MagicConnectionModelFactory) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PaletteGroup(org.eclipse.gef.palette.PaletteGroup)

Example 2 with ConnectionCreationToolEntry

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

the class ArchimateDiagramEditorPalette method createConnectionCreationToolEntry.

private ToolEntry createConnectionCreationToolEntry(EClass eClass, String description) {
    ToolEntry entry = new ConnectionCreationToolEntry(ArchiLabelProvider.INSTANCE.getDefaultName(eClass), description, new ArchimateDiagramModelFactory(eClass), ArchiLabelProvider.INSTANCE.getImageDescriptor(eClass), ArchiLabelProvider.INSTANCE.getImageDescriptor(eClass));
    // Ensure Tool gets deselected
    entry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
    return entry;
}
Also used : ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PanningSelectionToolEntry(org.eclipse.gef.palette.PanningSelectionToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) FormatPainterToolEntry(com.archimatetool.editor.diagram.tools.FormatPainterToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry)

Example 3 with ConnectionCreationToolEntry

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

the class SketchEditorPalette method createConnectionsGroup.

private PaletteContainer createConnectionsGroup() {
    PaletteContainer group = new PaletteGroup(Messages.SketchEditorPalette_7);
    add(group);
    ConnectionCreationToolEntry entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.LINE_SOLID, Messages.SketchEditorPalette_8, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_PLAIN));
    group.add(entry);
    entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET, Messages.SketchEditorPalette_9, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_ARROW));
    group.add(entry);
    entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DASHED, Messages.SketchEditorPalette_10, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DASHED_ARROW));
    group.add(entry);
    entry = createConnectionCreationToolEntry(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), IDiagramModelConnection.ARROW_FILL_TARGET | IDiagramModelConnection.LINE_DOTTED, Messages.SketchEditorPalette_11, null, IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_CONNECTION_DOTTED_ARROW));
    group.add(entry);
    return group;
}
Also used : ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PaletteGroup(org.eclipse.gef.palette.PaletteGroup) PaletteContainer(org.eclipse.gef.palette.PaletteContainer)

Example 4 with ConnectionCreationToolEntry

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

the class SketchEditorPalette method createConnectionCreationToolEntry.

private ConnectionCreationToolEntry createConnectionCreationToolEntry(EClass eClass, int type, String name, String description, ImageDescriptor icon) {
    ConnectionCreationToolEntry entry = new ConnectionCreationToolEntry(name, description, new SketchModelFactory(eClass, type), icon, icon);
    // Ensure Tool gets deselected
    entry.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINISHED, true);
    return entry;
}
Also used : ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry)

Example 5 with ConnectionCreationToolEntry

use of org.eclipse.gef.palette.ConnectionCreationToolEntry in project cubrid-manager by CUBRID.

the class PaletteFactory method createControlGroup.

/**
	 * create control group
	 * 
	 * @param root PaletteRoot
	 * @return componentGroup
	 */
private static PaletteContainer createControlGroup(PaletteRoot root) {
    PaletteGroup componentGroup = new PaletteGroup(Messages.lblComponentGrp);
    List<ToolEntry> toolEntries = new ArrayList<ToolEntry>();
    ToolEntry toolEntry = new SelectionToolEntry();
    toolEntry.setLabel(Messages.lblSelectTool);
    toolEntry.setDescription(Messages.descSelectTool);
    toolEntries.add(toolEntry);
    root.setDefaultEntry(toolEntry);
    toolEntry = new ConnectionCreationToolEntry(Messages.lblConnectionTool, Messages.descConnectionTool, null, CubridManagerUIPlugin.getImageDescriptor("icons/replication/arrow.gif"), CubridManagerUIPlugin.getImageDescriptor("icons/replication/arrow.gif"));
    toolEntries.add(toolEntry);
    componentGroup.addAll(toolEntries);
    return componentGroup;
}
Also used : SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) ArrayList(java.util.ArrayList) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) ToolEntry(org.eclipse.gef.palette.ToolEntry) SelectionToolEntry(org.eclipse.gef.palette.SelectionToolEntry) ConnectionCreationToolEntry(org.eclipse.gef.palette.ConnectionCreationToolEntry) PaletteGroup(org.eclipse.gef.palette.PaletteGroup)

Aggregations

ConnectionCreationToolEntry (org.eclipse.gef.palette.ConnectionCreationToolEntry)10 ToolEntry (org.eclipse.gef.palette.ToolEntry)5 PaletteGroup (org.eclipse.gef.palette.PaletteGroup)4 PanningSelectionToolEntry (org.eclipse.gef.palette.PanningSelectionToolEntry)3 FormatPainterToolEntry (com.archimatetool.editor.diagram.tools.FormatPainterToolEntry)2 ArrayList (java.util.ArrayList)2 CombinedTemplateCreationEntry (org.eclipse.gef.palette.CombinedTemplateCreationEntry)2 SelectionToolEntry (org.eclipse.gef.palette.SelectionToolEntry)2 MagicConnectionModelFactory (com.archimatetool.editor.diagram.tools.MagicConnectionModelFactory)1 SQLException (java.sql.SQLException)1 List (java.util.List)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 EClass (org.eclipse.emf.ecore.EClass)1 MarqueeToolEntry (org.eclipse.gef.palette.MarqueeToolEntry)1 PaletteContainer (org.eclipse.gef.palette.PaletteContainer)1 PaletteDrawer (org.eclipse.gef.palette.PaletteDrawer)1 PaletteRoot (org.eclipse.gef.palette.PaletteRoot)1 PaletteToolbar (org.eclipse.gef.palette.PaletteToolbar)1 CreationFactory (org.eclipse.gef.requests.CreationFactory)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1