]> git.basschouten.com Git - openhab-addons.git/blob
2562bcac290baa76bfc04e7d9a835ac999dadc01
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.nanoleaf.internal.layout.shape;
14
15 import java.awt.Graphics2D;
16 import java.util.Arrays;
17 import java.util.List;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.openhab.binding.nanoleaf.internal.layout.DrawingSettings;
21 import org.openhab.binding.nanoleaf.internal.layout.PanelState;
22 import org.openhab.binding.nanoleaf.internal.layout.Point2D;
23 import org.openhab.binding.nanoleaf.internal.layout.ShapeType;
24
25 /**
26  * A panel that shouldn't be drawn (power connector, controller, ...).
27  *
28  * Especially lines can have controllers and power connectors etc on top of each other.
29  *
30  * @author Jørgen Austvik - Initial contribution
31  */
32 @NonNullByDefault
33 public class NoDraw extends Panel {
34
35     private final Point2D position;
36
37     public NoDraw(ShapeType shapeType, int panelId, Point2D position) {
38         super(shapeType);
39         this.position = position;
40     }
41
42     @Override
43     public List<Point2D> generateOutline() {
44         return Arrays.asList(position);
45     }
46
47     @Override
48     public void draw(Graphics2D graphics, DrawingSettings settings, PanelState state) {
49     }
50 }