1 /*
2  * Copyright (c) 2016 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.gui.components.data;
7 
8 import de.neemann.digital.core.Model;
9 import de.neemann.digital.core.NodeException;
10 import de.neemann.digital.core.ObservableValues;
11 import de.neemann.digital.core.element.Element;
12 import de.neemann.digital.core.element.ElementAttributes;
13 import de.neemann.digital.core.element.ElementTypeDescription;
14 import de.neemann.digital.core.element.Keys;
15 
16 /**
17  * Only a placeholder.
18  * Has no connections to the model!
19  */
20 public class DummyElement implements Element {
21 
22     /**
23      * The DataElement description
24      */
25     public static final ElementTypeDescription DATADESCRIPTION = new ElementTypeDescription("Data", DummyElement.class)
26             .addAttribute(Keys.MICRO_STEP)
27             .addAttribute(Keys.MAX_STEP_COUNT)
28             .addAttribute(Keys.SNAP_TO_GRID);
29 
30     /**
31      * The TextElement description
32      */
33     public static final ElementTypeDescription TEXTDESCRIPTION = new ElementTypeDescription("Text", DummyElement.class)
34             .addAttribute(Keys.DESCRIPTION)
35             .addAttribute(Keys.ROTATE)
36             .addAttribute(Keys.TEXT_ORIENTATION)
37             .addAttribute(Keys.FONT_SIZE)
38             .addAttribute(Keys.SNAP_TO_GRID);
39 
40     /**
41      * The shape for the rectangle
42      */
43     public static final ElementTypeDescription RECTDESCRIPTION = new ElementTypeDescription("Rectangle", DummyElement.class)
44             .addAttribute(Keys.LABEL)
45             .addAttribute(Keys.RECT_WIDTH)
46             .addAttribute(Keys.RECT_HEIGHT)
47             .addAttribute(Keys.RECT_INSIDE)
48             .addAttribute(Keys.RECT_BOTTOM)
49             .addAttribute(Keys.RECT_RIGHT)
50             .addAttribute(Keys.FONT_SIZE)
51             .addAttribute(Keys.SNAP_TO_GRID);
52 
53     /**
54      * Creates a new dummy element
55      *
56      * @param attr the attributes
57      */
DummyElement(ElementAttributes attr)58     public DummyElement(ElementAttributes attr) {
59     }
60 
61     @Override
setInputs(ObservableValues inputs)62     public void setInputs(ObservableValues inputs) throws NodeException {
63     }
64 
65     @Override
getOutputs()66     public ObservableValues getOutputs() {
67         return ObservableValues.EMPTY_LIST;
68     }
69 
70     @Override
registerNodes(Model model)71     public void registerNodes(Model model) {
72     }
73 
74 }
75