Debian Codegraph @

src/h/ST_Agraphinfo_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 smetana.core.CFunction;
49 import smetana.core.HardcodedStruct;
50 import smetana.core.UnsupportedArrayOfStruct;
51 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__ptr__;
53 import smetana.core.__struct__;
54 import smetana.core.amiga.StarStruct;
55
56 public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct {
57
58 public final ST_Agrec_s hdr = new ST_Agrec_s(this);
59 // /* to generate code */
60 public ST_layout_t drawing;
61 public ST_textlabel_t label; /* if the cluster has a title */
62 public final ST_boxf bb = new ST_boxf(this); /* bounding box */
63 // pointf border[4]; /* sizes of margins for graph labels */
64 public final ST_pointf border[] = new ST_pointf[] { new ST_pointf(), new ST_pointf(), new ST_pointf(),
65 new ST_pointf() };
66 // unsigned char gui_state; /* Graph state for GUI ops */
67 public int has_labels;
68 // boolean has_images;
69 public int charset; /* input character set */
70 public int rankdir;
71 public double ht1, ht2; /* below and above extremal ranks */
72 public int flags;
73 // void *alg;
74 public ST_GVC_s gvc; /* context for "globals" over multiple graphs */
75 public CFunction cleanup;
76 // void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
77 //
78 //
79 // /* to place nodes */
80 // node_t **neato_nlist;
81 // int move;
82 // double **dist, **spring, **sum_t, ***t;
83 // unsigned short ndim;
84 // unsigned short odim;
85 //
86 //
87 // /* to have subgraphs */
88 public int n_cluster;
89 // graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
90 public ST_Agraph_s.Array clust;
91 public ST_Agraph_s dotroot;
92 public ST_Agnode_s nlist;
93 public ST_rank_t.Array2 rank;
94 public ST_Agraph_s parent; /* containing cluster (not parent subgraph) */
95 // int level; /* cluster nesting level (not node level!) */
96 // node_t *minrep, *maxrep; /* set leaders for min and max rank */
97 //
98 // /* fast graph node list */
99 public final ST_nlist_t comp = new ST_nlist_t(this);
100 // /* connected components */
101 public ST_Agnode_s minset, maxset; /* set leaders */
102 public int n_nodes;
103 // /* includes virtual */
104 public int minrank, maxrank;
105 //
106 // /* various flags */
107 public int has_flat_edges;
108 // boolean has_sourcerank;
109 // boolean has_sinkrank;
110 public int showboxes;
111 public int fontnames; /* to override mangling in SVG */
112 //
113 public int nodesep, ranksep;
114 public ST_Agnode_s ln, rn; /* left, right nodes of bounding box */
115 //
116 // /* for clusters */
117 // node_t *leader, **rankleader;
118 public ST_Agnode_s leader;
119 public ST_Agnode_s.Array rankleader;
120 public boolean expanded;
121 public int installed;
122 public int set_type;
123 public int label_pos;
124 public int exact_ranksep;
125
126 private final StarStruct parent_;
127
128 public ST_Agraphinfo_t() {
129 this(null);
130 }
131
132 public ST_Agraphinfo_t(StarStruct parent) {
133 this.parent_ = parent;
134 }
135
136 class ArrayOfFour extends UnsupportedArrayOfStruct {
137
138 final private int pos;
139
140 public ArrayOfFour(int pos) {
141 this.pos = pos;
142 }
143
144 public ArrayOfFour plus(int delta) {
145 return new ArrayOfFour(pos + delta);
146 }
147
148 @Override
149 public __struct__ getStruct() {
150 return border[pos];
151 }
152
153 @Override
154 public void setStruct(__struct__ value) {
155 border[pos].copyDataFrom(value);
156 }
157
158 }
159
160 @Override
161 public __ptr__ castTo(Class dest) {
162 if (dest == ST_Agrec_s.class) {
163 return hdr;
164 }
165 return super.castTo(dest);
166 }
167
168 @Override
169 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
170 if (fieldName.equals("gvc")) {
171 this.gvc = (ST_GVC_s) newData;
172 return gvc;
173 }
174 if (fieldName.equals("drawing")) {
175 this.drawing = (ST_layout_t) newData;
176 return drawing;
177 }
178 if (fieldName.equals("dotroot")) {
179 this.dotroot = (ST_Agraph_s) newData;
180 return dotroot;
181 }
182 if (fieldName.equals("parent")) {
183 this.parent = (ST_Agraph_s) newData;
184 return parent;
185 }
186 if (fieldName.equals("clust")) {
187 this.clust = (ST_Agraph_s.Array) newData;
188 return clust;
189 }
190 if (fieldName.equals("label")) {
191 this.label = (ST_textlabel_t) newData;
192 return label;
193 }
194 if (fieldName.equals("maxset")) {
195 this.maxset = (ST_Agnode_s) newData;
196 return maxset;
197 }
198 if (fieldName.equals("minset")) {
199 this.minset = (ST_Agnode_s) newData;
200 return minset;
201 }
202 if (fieldName.equals("nlist")) {
203 this.nlist = (ST_Agnode_s) newData;
204 return nlist;
205 }
206 if (fieldName.equals("leader")) {
207 this.leader = (ST_Agnode_s) newData;
208 return leader;
209 }
210 if (fieldName.equals("rankleader")) {
211 this.rankleader = (ST_Agnode_s.Array) newData;
212 return rankleader;
213 }
214 if (fieldName.equals("rank")) {
215 this.rank = (ST_rank_t.Array2) newData;
216 return rank;
217 }
218 if (fieldName.equals("ln")) {
219 this.ln = (ST_Agnode_s) newData;
220 return ln;
221 }
222 if (fieldName.equals("rn")) {
223 this.rn = (ST_Agnode_s) newData;
224 return rn;
225 }
226 return super.setPtr(fieldName, newData);
227 }
228
229 @Override
230 public void setInt(String fieldName, int data) {
231 if (fieldName.equals("charset")) {
232 this.charset = data;
233 return;
234 }
235 if (fieldName.equals("rankdir")) {
236 this.rankdir = data;
237 return;
238 }
239 if (fieldName.equals("nodesep")) {
240 this.nodesep = data;
241 return;
242 }
243 if (fieldName.equals("ranksep")) {
244 this.ranksep = data;
245 return;
246 }
247 if (fieldName.equals("showboxes")) {
248 this.showboxes = data;
249 return;
250 }
251 if (fieldName.equals("fontnames")) {
252 this.fontnames = data;
253 return;
254 }
255 if (fieldName.equals("flags")) {
256 this.flags = data;
257 return;
258 }
259 if (fieldName.equals("has_labels")) {
260 this.has_labels = data;
261 return;
262 }
263 if (fieldName.equals("n_cluster")) {
264 this.n_cluster = data;
265 return;
266 }
267 if (fieldName.equals("label_pos")) {
268 this.label_pos = data;
269 return;
270 }
271 if (fieldName.equals("n_nodes")) {
272 this.n_nodes = data;
273 return;
274 }
275 if (fieldName.equals("maxrank")) {
276 this.maxrank = data;
277 return;
278 }
279 if (fieldName.equals("minrank")) {
280 this.minrank = data;
281 return;
282 }
283 if (fieldName.equals("installed")) {
284 this.installed = data;
285 return;
286 }
287 super.setInt(fieldName, data);
288 }
289
290
291 @Override
292 public void setDouble(String fieldName, double data) {
293 if (fieldName.equals("ht1")) {
294 this.ht1 = data;
295 return;
296 }
297 if (fieldName.equals("ht2")) {
298 this.ht2 = data;
299 return;
300 }
301 super.setDouble(fieldName, data);
302 }
303
304 // public static List<String> DEFINITION = Arrays.asList(
305 // "typedef struct Agraphinfo_t",
306 // "{",
307 // "Agrec_t hdr",
308 // "layout_t *drawing",
309 // "textlabel_t *label",
310 // "boxf bb",
311 // "pointf border[4]",
312 // "unsigned char gui_state",
313 // "unsigned char has_labels",
314 // "boolean has_images",
315 // "unsigned char charset",
316 // "int rankdir",
317 // "double ht1, ht2",
318 // "unsigned short flags",
319 // "void *alg",
320 // "GVC_t *gvc",
321 // "void (*cleanup) (graph_t * g)",
322 // "node_t **neato_nlist",
323 // "int move",
324 // "double **dist, **spring, **sum_t, ***t",
325 // "unsigned short ndim",
326 // "unsigned short odim",
327 // "int n_cluster",
328 // "graph_t **clust",
329 // "graph_t *dotroot",
330 // "node_t *nlist",
331 // "rank_t *rank",
332 // "graph_t *parent",
333 // "int level",
334 // "node_t *minrep, *maxrep",
335 // "nlist_t comp",
336 // "node_t *minset, *maxset",
337 // "long n_nodes",
338 // "short minrank, maxrank",
339 // "boolean has_flat_edges",
340 // "boolean has_sourcerank",
341 // "boolean has_sinkrank",
342 // "unsigned char showboxes",
343 // "fontname_kind fontnames",
344 // "int nodesep, ranksep",
345 // "node_t *ln, *rn",
346 // "node_t *leader, **rankleader",
347 // "boolean expanded",
348 // "char installed",
349 // "char set_type",
350 // "char label_pos",
351 // "boolean exact_ranksep",
352 // "}",
353 // "Agraphinfo_t");
354 }
355
356 // typedef struct Agraphinfo_t {
357 // Agrec_t hdr;
358 // /* to generate code */
359 // layout_t *drawing;
360 // textlabel_t *label; /* if the cluster has a title */
361 // boxf bb; /* bounding box */
362 // pointf border[4]; /* sizes of margins for graph labels */
363 // unsigned char gui_state; /* Graph state for GUI ops */
364 // unsigned char has_labels;
365 // boolean has_images;
366 // unsigned char charset; /* input character set */
367 // int rankdir;
368 // double ht1, ht2; /* below and above extremal ranks */
369 // unsigned short flags;
370 // void *alg;
371 // GVC_t *gvc; /* context for "globals" over multiple graphs */
372 // void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
373 //
374 //
375 // /* to place nodes */
376 // node_t **neato_nlist;
377 // int move;
378 // double **dist, **spring, **sum_t, ***t;
379 // unsigned short ndim;
380 // unsigned short odim;
381 //
382 //
383 // /* to have subgraphs */
384 // int n_cluster;
385 // graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
386 // graph_t *dotroot;
387 // node_t *nlist;
388 // rank_t *rank;
389 // graph_t *parent; /* containing cluster (not parent subgraph) */
390 // int level; /* cluster nesting level (not node level!) */
391 // node_t *minrep, *maxrep; /* set leaders for min and max rank */
392 //
393 // /* fast graph node list */
394 // nlist_t comp;
395 // /* connected components */
396 // node_t *minset, *maxset; /* set leaders */
397 // long n_nodes;
398 // /* includes virtual */
399 // short minrank, maxrank;
400 //
401 // /* various flags */
402 // boolean has_flat_edges;
403 // boolean has_sourcerank;
404 // boolean has_sinkrank;
405 // unsigned char showboxes;
406 // fontname_kind fontnames; /* to override mangling in SVG */
407 //
408 // int nodesep, ranksep;
409 // node_t *ln, *rn; /* left, right nodes of bounding box */
410 //
411 // /* for clusters */
412 // node_t *leader, **rankleader;
413 // boolean expanded;
414 // char installed;
415 // char set_type;
416 // char label_pos;
417 // boolean exact_ranksep;
418 //
419 //
420 // } Agraphinfo_t;