Ejemplo n.º 1
0
  private static PaletteContainer createComplexPartsDrawer() {
    PaletteDrawer drawer =
        new PaletteDrawer(
            LogicMessages.LogicPlugin_Category_ComplexParts_Label,
            ImageDescriptor.createFromFile(Circuit.class, "icons/can.gif")); // $NON-NLS-1$

    List entries = new ArrayList();

    CombinedTemplateCreationEntry combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_HalfAdder_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_HalfAdder_Description,
            LogicDiagramFactory.getHalfAdderFactory(),
            ImageDescriptor.createFromFile(Circuit.class, "icons/halfadder16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/halfadder24.gif") // $NON-NLS-1$
            );
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_FullAdder_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_FullAdder_Description,
            LogicDiagramFactory.getFullAdderFactory(),
            ImageDescriptor.createFromFile(Circuit.class, "icons/fulladder16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/fulladder24.gif") // $NON-NLS-1$
            );
    entries.add(combined);

    drawer.addAll(entries);
    return drawer;
  }
Ejemplo n.º 2
0
  private static PaletteContainer createComponentsDrawer() {

    PaletteDrawer drawer =
        new PaletteDrawer(
            LogicMessages.LogicPlugin_Category_Components_Label,
            ImageDescriptor.createFromFile(Circuit.class, "icons/comp.gif")); // $NON-NLS-1$

    List entries = new ArrayList();

    CombinedTemplateCreationEntry combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_FlowContainer_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_FlowContainer_Description,
            new SimpleFactory(LogicFlowContainer.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/logicflow16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/logicflow24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_Circuit_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_Circuit_Description,
            new SimpleFactory(Circuit.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/circuit16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/circuit24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    entries.add(new PaletteSeparator());

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_Label_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_Label_Description,
            new SimpleFactory(LogicLabel.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/label16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/label24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_LED_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_LED_Description,
            new SimpleFactory(LED.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/ledicon16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/ledicon24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_ORGate_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_ORGate_Description,
            new SimpleFactory(OrGate.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/or16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/or24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_XORGate_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_XORGate_Description,
            new SimpleFactory(XORGate.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/xor16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/xor24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_ANDGate_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_ANDGate_Description,
            new SimpleFactory(AndGate.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/and16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/and24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    entries.add(combined);

    PaletteStack liveGroundStack =
        new PaletteStack(
            LogicMessages.LogicPlugin_Tool_CreationTool_LiveGroundStack_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_LiveGroundStack_Description,
            null);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_LiveOutput_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_LiveOutput_Description,
            new SimpleFactory(LiveOutput.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/live16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/live24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    liveGroundStack.add(combined);

    combined =
        new CombinedTemplateCreationEntry(
            LogicMessages.LogicPlugin_Tool_CreationTool_Ground_Label,
            LogicMessages.LogicPlugin_Tool_CreationTool_Ground_Description,
            new SimpleFactory(GroundOutput.class),
            ImageDescriptor.createFromFile(Circuit.class, "icons/ground16.gif"), // $NON-NLS-1$
            ImageDescriptor.createFromFile(Circuit.class, "icons/ground24.gif") // $NON-NLS-1$
            );
    combined.setToolClass(LogicCreationTool.class);
    liveGroundStack.add(combined);

    entries.add(liveGroundStack);

    drawer.addAll(entries);
    return drawer;
  }