]> git.basschouten.com Git - openhab-addons.git/blob
0ae05dc2b55b2987529a4a18ab600369e17f40b0
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.Point2D;
21 import org.openhab.binding.nanoleaf.internal.layout.ShapeType;
22
23 /**
24  * A shape without any area.
25  *
26  * @author Jørgen Austvik - Initial contribution
27  */
28 @NonNullByDefault
29 public class Point extends Shape {
30     public Point(ShapeType shapeType, int panelId, Point2D position, int orientation) {
31         super(shapeType, panelId, position, orientation);
32     }
33
34     @Override
35     public List<Point2D> generateOutline() {
36         return Arrays.asList(getPosition());
37     }
38
39     @Override
40     public Point2D labelPosition(Graphics2D graphics, List<Point2D> outline) {
41         return outline.get(0);
42     }
43 }