View Javadoc
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.pane;
18  
19  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIAlignment;
20  import io.github.tonywasher.joceanus.tethys.api.base.TethysUIComponent;
21  
22  /**
23   * Grid Pane Manager.
24   */
25  public interface TethysUIGridPaneManager
26          extends TethysUIComponent {
27      /**
28       * Obtain the Horizontal Grid Gap.
29       *
30       * @return the GridGap.
31       */
32      Integer getHGap();
33  
34      /**
35       * Obtain the Vertical Grid Gap.
36       *
37       * @return the GridGap.
38       */
39      Integer getVGap();
40  
41      /**
42       * Set the Horizontal Grid Gap.
43       *
44       * @param pGap the GridGap.
45       */
46      void setHGap(Integer pGap);
47  
48      /**
49       * Set the Vertical Grid Gap.
50       *
51       * @param pGap the GridGap.
52       */
53      void setVGap(Integer pGap);
54  
55      /**
56       * Adjust to next row.
57       */
58      void newRow();
59  
60      /**
61       * Add cell at current column and increment column #.
62       *
63       * @param pNode the node to add
64       */
65      void addCell(TethysUIComponent pNode);
66  
67      /**
68       * Add cell that spans a number of columns at current column and adjust column #.
69       *
70       * @param pNode    the node to add
71       * @param pNumCols the number of columns to span
72       */
73      void addCell(TethysUIComponent pNode,
74                   int pNumCols);
75  
76      /**
77       * Add cell at position.
78       *
79       * @param pNode   the node to add
80       * @param pRow    the row to add the cell at
81       * @param pColumn the column to add the cell at
82       */
83      void addCellAtPosition(TethysUIComponent pNode,
84                             int pRow,
85                             int pColumn);
86  
87      /**
88       * Set cell column span.
89       *
90       * @param pNode    the node to set column span on
91       * @param pNumCols the number of columns to span
92       */
93      void setCellColumnSpan(TethysUIComponent pNode,
94                             int pNumCols);
95  
96      /**
97       * Set final cell.
98       *
99       * @param pNode the node to set as final cell in row
100      */
101     void setFinalCell(TethysUIComponent pNode);
102 
103     /**
104      * Allow Cell as growth.
105      *
106      * @param pNode the node to allow growth on
107      */
108     void allowCellGrowth(TethysUIComponent pNode);
109 
110     /**
111      * Set cell alignment.
112      *
113      * @param pNode  the node to align
114      * @param pAlign the cell alignment
115      */
116     void setCellAlignment(TethysUIComponent pNode,
117                           TethysUIAlignment pAlign);
118 
119     /**
120      * Add simple Node.
121      *
122      * @param pNode the node to add
123      */
124     void addNode(TethysUIComponent pNode);
125 }