1 /*
2 * Tethys: GUI Utilities
3 * Copyright 2012-2026. Tony Washer
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy
7 * of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17 package io.github.tonywasher.joceanus.tethys.api.base;
18
19 /**
20 * Component definition.
21 */
22 public interface TethysUIComponent {
23 /**
24 * Obtain the underlying component (if any).
25 *
26 * @return the underlying component
27 */
28 TethysUIComponent getUnderlying();
29
30 /**
31 * Obtain the Id.
32 *
33 * @return the id
34 */
35 default Integer getId() {
36 return getUnderlying().getId();
37 }
38
39 /**
40 * Obtain the Node.
41 *
42 * @return the node
43 */
44 default TethysUINode getNode() {
45 return getUnderlying().getNode();
46 }
47
48 /**
49 * Set Enabled status.
50 *
51 * @param pEnabled true/false
52 */
53 default void setEnabled(final boolean pEnabled) {
54 getUnderlying().setEnabled(pEnabled);
55 }
56
57 /**
58 * Set Visible.
59 *
60 * @param pVisible true/false
61 */
62 default void setVisible(final boolean pVisible) {
63 getUnderlying().setVisible(pVisible);
64 }
65
66 /**
67 * Obtain the Border Padding.
68 *
69 * @return the Padding.
70 */
71 default Integer getBorderPadding() {
72 return getUnderlying().getBorderPadding();
73 }
74
75 /**
76 * Obtain the Border Title.
77 *
78 * @return the Title.
79 */
80 default String getBorderTitle() {
81 return getUnderlying().getBorderTitle();
82 }
83
84 /**
85 * Set the Border Padding.
86 *
87 * @param pPadding the border padding
88 */
89 default void setBorderPadding(final Integer pPadding) {
90 getUnderlying().setBorderPadding(pPadding);
91 }
92
93 /**
94 * Set the Border Title.
95 *
96 * @param pTitle the border title
97 */
98 default void setBorderTitle(final String pTitle) {
99 getUnderlying().setBorderTitle(pTitle);
100 }
101
102 /**
103 * Set the Preferred Width.
104 *
105 * @param pWidth the width
106 */
107 default void setPreferredWidth(final Integer pWidth) {
108 getUnderlying().setPreferredWidth(pWidth);
109 }
110
111 /**
112 * Set the Preferred Height.
113 *
114 * @param pHeight the height
115 */
116 default void setPreferredHeight(final Integer pHeight) {
117 getUnderlying().setPreferredHeight(pHeight);
118 }
119 }