BrightSide Workbench Full Report + Source Code
VertexStripeLanes.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2022 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.dossier.graph;
20 
21 import org.zkoss.zul.Div;
22 import org.zkoss.zul.Hlayout;
23 import org.zkoss.zul.Vlayout;
24 
29 public class VertexStripeLanes extends Div {
30 
31  private IssueVertex target;
32  private boolean top = true;
33 
35  return target;
36  }
37 
38  public void setTarget(IssueVertex target) {
39  this.target = target;
40  getChildren().clear();
41  if(target != null) appendChild(fillTarget(target));
42  }
43 
44  private Hlayout fillTarget(IssueVertex target) {
45  Hlayout layout = new Hlayout();
46  if(top) {
47  layout.setStyle("overflow:visible");
48  top = false;
49  }
50  layout.setSclass("vertex-stripe vertex-group");
51  if(!target.getIncoming().isEmpty()) layout.appendChild(fillSources(target));
52  layout.appendChild(new VertexLabel(target));
53  return layout;
54  }
55 
56  private Vlayout fillSources(IssueVertex target) {
57  Vlayout lane = new Vlayout();
58  lane.setSclass("vertex-stripe vertex-lane");
59  for(IssueVertex source : target.getIncoming()) {
60  lane.appendChild(fillTarget(source));
61  }
62  return lane;
63  }
64 
65 }
Set< IssueVertex > getIncoming()