Debian Codegraph @

src/h/ST_xlabel_t.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package h;
47
48 import java.util.ArrayList;
49 import java.util.List;
50
51 import smetana.core.UnsupportedArrayOfStruct2;
52 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__array_of_ptr__;
54 import smetana.core.__ptr__;
55 import smetana.core.__struct__;
56 import smetana.core.size_t;
57 import smetana.core.amiga.StarStruct;
58
59 public class ST_xlabel_t extends UnsupportedStructAndPtr {
60
61 private final StarStruct parent;
62
63 public ST_xlabel_t() {
64 this(null);
65 }
66
67 public ST_xlabel_t(StarStruct parent) {
68 this.parent = parent;
69 }
70
71 // "typedef struct",
72 // "{",
73 final public ST_pointf sz = new ST_pointf(this);
74 final public ST_pointf pos = new ST_pointf(this);
75
76 // "void *lbl",
77 public ST_textlabel_t lbl;
78 public int set;
79
80 // "unsigned char set",
81 // "}",
82 // "xlabel_t");
83
84 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{
85
86 private final List<ST_xlabel_t> data;
87 private final int pos_;
88
89 @Override
90 public void setInt(String fieldName, int data) {
91 get(0).setInt(fieldName, data);
92 }
93
94 @Override
95 public void setStruct(__struct__ value) {
96 get(0).___(value);
97 }
98
99 @Override
100 public Array asPtr() {
101 return this;
102 }
103
104 @Override
105 public void setDouble(String fieldName, double value) {
106 get(0).setDouble(fieldName, value);
107 }
108
109 @Override
110 public ST_xlabel_t getStruct() {
111 return get(0).getStruct();
112 }
113
114 @Override
115 public __ptr__ getPtr() {
116 return get(0);
117 }
118
119 public Array(int size) {
120 this.data = new ArrayList<ST_xlabel_t>();
121 this.pos_ = 0;
122 for (int i = 0; i < size; i++) {
123 data.add(new ST_xlabel_t());
124 }
125 }
126
127 public Array reallocJ(int newsize) {
128 while (data.size() < newsize) {
129 data.add(new ST_xlabel_t());
130 }
131 return this;
132 }
133
134 public Array plus(int delta) {
135 return plusJ(delta);
136 }
137
138 private Array(List<ST_xlabel_t> data, int pos) {
139 this.data = data;
140 this.pos_ = pos;
141 }
142
143 public ST_xlabel_t get(int i) {
144 return this.data.get(pos_ + i);
145 }
146
147 public Array plusJ(int i) {
148 return new Array(data, pos_ + i);
149 }
150
151 public int minus(Array other) {
152 if (this.data != other.data) {
153 throw new IllegalArgumentException();
154 }
155 return this.pos_ - other.pos_;
156 }
157
158 public Array move(int delta) {
159 throw new UnsupportedOperationException(getClass().toString());
160 }
161
162
163 public void realloc(size_t nb) {
164 throw new UnsupportedOperationException(getClass().toString());
165 }
166
167 public int comparePointerInternal(__array_of_ptr__ other) {
168 throw new UnsupportedOperationException(getClass().toString());
169 }
170
171
172 }
173
174
175 @Override
176 public void setInt(String fieldName, int data) {
177 if (fieldName.equals("set")) {
178 this.set = data;
179 return;
180 }
181 super.setInt(fieldName, data);
182 }
183
184 @Override
185 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
186 if (fieldName.equals("lbl")) {
187 this.lbl = (ST_textlabel_t) newData;
188 return this.lbl;
189 }
190 return super.setPtr(fieldName, newData);
191 }
192
193 @Override
194 public ST_xlabel_t getStruct() {
195 return this;
196 }
197
198 @Override
199 public void setStruct(String fieldName, __struct__ newData) {
200 if (fieldName.equals("sz")) {
201 this.sz.copyDataFrom(newData);
202 return;
203 }
204 if (fieldName.equals("pos")) {
205 this.pos.copyDataFrom(newData);
206 return;
207 }
208 super.setStruct(fieldName, newData);
209 }
210
211 // public static size_t sizeof(final int nb) {
212 // return new UnsupportedSize_t(nb) {
213 // @Override
214 // public Object malloc() {
215 // return new StarArrayOfPtr(new STArray<ST_xlabel_t>(nb, 0, ST_xlabel_t.class));
216 // }
217 //
218 // @Override
219 // public int getInternalNb() {
220 // return nb;
221 // }
222 //
223 // @Override
224 // public Object realloc(Object old) {
225 // StarArrayOfPtr old2 = (StarArrayOfPtr) old;
226 // old2.realloc(nb);
227 // return old2;
228 // }
229 // };
230 // }
231
232 }
233
234 // typedef struct {
235 // pointf sz; /* Size of label (input) */
236 // pointf pos; /* Position of lower-left corner of label (output) */
237 // void *lbl; /* Pointer to label in the graph */
238 // unsigned char set; /* True if the position has been set (input/output) */
239 // } xlabel_t;