1 /* 2 * Copyright (c) 2017 Helmut Neemann 3 * Use of this source code is governed by the GPL v3 license 4 * that can be found in the LICENSE file. 5 */ 6 package de.neemann.digital.draw.library; 7 8 import de.neemann.digital.core.element.ElementTypeDescription; 9 import de.neemann.digital.draw.shapes.ShapeFactory; 10 11 /** 12 * Used to add components to the library 13 */ 14 public interface ComponentManager { 15 16 /** 17 * Called to add a component 18 * 19 * @param nodePath the path in the components tree/menu 20 * @param description the description of the component 21 * @throws InvalidNodeException thrown if a node is chosen which is a component 22 */ addComponent(String nodePath, ElementTypeDescription description)23 void addComponent(String nodePath, ElementTypeDescription description) throws InvalidNodeException; 24 25 /** 26 * Called to add a component with a custom shape 27 * 28 * @param nodePath the path in the components tree/menu 29 * @param description the description of the component 30 * @param shape the shape of the component 31 * @throws InvalidNodeException thrown if a node is chosen which is a component 32 */ addComponent(String nodePath, ElementTypeDescription description, ShapeFactory.Creator shape)33 void addComponent(String nodePath, ElementTypeDescription description, ShapeFactory.Creator shape) throws InvalidNodeException; 34 35 } 36