-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOrgChart.fxml
223 lines (195 loc) · 10.4 KB
/
OrgChart.fxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<?xml version="1.0" encoding="UTF-8"?>
<!--
/////////////////////////////////////////////////////////////////////////////
//
// This demo file is part of yFiles for JavaFX 3.6.
//
// Copyright (c) 2000-2023 by yWorks GmbH, Vor dem Kreuzberg 28,
// 72070 Tuebingen, Germany. All rights reserved.
//
// yFiles demo files exhibit yFiles for JavaFX functionalities. Any redistribution
// of demo resource files, with or without modification, is not permitted.
// Owners of a valid software license for a yFiles for JavaFX version that this
// demo is shipped with are allowed to use the resource file as basis for
// their own yFiles for JavaFX powered applications. Use of such programs is
// governed by the rights and conditions as set out in the yFiles for JavaFX
// license agreement.
//
// THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
// NO EVENT SHALL yWorks BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
/////////////////////////////////////////////////////////////////////////////
-->
<?import com.yworks.yfiles.view.GraphControl?>
<?import com.yworks.yfiles.view.GraphOverviewControl?>
<?import com.yworks.yfiles.view.input.ICommand?>
<?import complete.orgchart.ImageProvider?>
<?import complete.orgchart.OrgChartDemo?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.TitledPane?>
<?import javafx.scene.control.ToolBar?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Ellipse?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.web.WebView?>
<?import toolkit.CommandButton?>
<?import toolkit.IconProvider?>
<?import toolkit.TooltipProvider?>
<?import java.net.URL?>
<?import java.lang.Double?>
<!--The visual components of the OrgChart. The screen consists of three parts:
- The main graph view in the center with a ToolBar on top,
- informational widgets on the left side like an overview and a structure view
- a browser on the right that displays a html help file.-->
<BorderPane xmlns:fx="http://javafx.com/fxml"
fx:id="root">
<stylesheets><URL value="@OrgChart.css" /></stylesheets>
<center>
<!--Main screen.-->
<VBox styleClass="orgChartBorder">
<children>
<!--A ToolBar with various buttons to interact with the graph.-->
<ToolBar>
<items>
<CommandButton command="IncreaseZoom" commandTarget="${graphControl}"/>
<CommandButton command="DecreaseZoom" commandTarget="${graphControl}"/>
<CommandButton command="Zoom" commandTarget="${graphControl}" text="">
<commandParameter><Double fx:value="1.0"></Double></commandParameter>
<graphic><IconProvider fx:value="ZOOM_RESET"/></graphic>
<tooltip><TooltipProvider fx:value="ZOOM_RESET"/></tooltip>
</CommandButton>
<CommandButton command="FitGraphBounds" commandTarget="${graphControl}"/>
<Separator orientation="VERTICAL"/>
<CommandButton commandTarget="${graphControl}" text="">
<command><ICommand fx:constant="ZOOM_TO_CURRENT_ITEM"/></command>
<tooltip><Tooltip text="Zoom to current focused employee"/></tooltip>
<graphic><ImageView><image><ImageProvider fx:value="woman1_16"/></image></ImageView></graphic>
</CommandButton>
<CommandButton commandTarget="${graphControl}" commandParameter="${graphControl.currentItem}"
text="">
<command><OrgChartDemo fx:constant="SHOW_PARENT"/></command>
<graphic><IconProvider fx:value="UP"/></graphic>
<tooltip><Tooltip text="Show supervisor of selected employee"/></tooltip>
</CommandButton>
<CommandButton commandTarget="${graphControl}" commandParameter="${graphControl.currentItem}"
text="">
<command><OrgChartDemo fx:constant="HIDE_PARENT"/></command>
<graphic><IconProvider fx:value="DOWN"/></graphic>
<tooltip><Tooltip text="Hide supervisor of selected employee"/></tooltip>
</CommandButton>
<CommandButton commandTarget="${graphControl}" commandParameter="${graphControl.currentItem}"
text="">
<command><OrgChartDemo fx:constant="SHOW_CHILDREN"/></command>
<graphic><IconProvider fx:value="PLUS"/></graphic>
<tooltip><Tooltip text="Show subordinates of selected employee"/></tooltip>
</CommandButton>
<CommandButton commandTarget="${graphControl}" commandParameter="${graphControl.currentItem}"
text="">
<command><OrgChartDemo fx:constant="HIDE_CHILDREN"/></command>
<graphic><IconProvider fx:value="MINUS"/></graphic>
<tooltip><Tooltip text="Hide subordinates of selected employee"/></tooltip>
</CommandButton>
<CommandButton commandTarget="${graphControl}"
text="All">
<command><OrgChartDemo fx:constant="SHOW_ALL"/></command>
<tooltip><Tooltip text="Show all"/></tooltip>
</CommandButton>
</items>
</ToolBar>
<!--The main graph control that takes the major space of the center of the screen.-->
<GraphControl fx:id="graphControl"
prefWidth="${graphControlContainer.width}"
VBox.vgrow="SOMETIMES"
fileIOEnabled="true"
maximumZoom="4"/>
</children>
</VBox>
</center>
<left>
<VBox maxWidth="250">
<!-- The overview that displays the overall structure of the graph simplified.-->
<TitledPane animated="false" collapsible="false" expanded="true" maxHeight="1.7976931348623157E308"
text="Overview">
<content>
<GraphOverviewControl fx:id="overviewControl"
prefHeight="200"
maxHeight="Infinity"
maxWidth="Infinity"/>
</content>
</TitledPane>
<!--The tree view that displays the graph structure in a hierarchical manner.-->
<TitledPane VBox.vgrow="ALWAYS" animated="false" collapsible="false" expanded="true" maxHeight="1.7976931348623157E308"
text="Structure">
<content>
<TreeView fx:id="treeView"
maxWidth="Infinity"/>
</content>
</TitledPane>
<!--Properties box in the lower left corner-->
<TitledPane animated="false" collapsible="false" expanded="true" maxHeight="1.7976931348623157E308"
text="Details">
<content>
<GridPane hgap="10" vgap="5">
<padding><Insets top="5" right="5" bottom="5" left="5"/></padding>
<columnConstraints>
<ColumnConstraints hgrow="NEVER"/>
<ColumnConstraints hgrow="NEVER" maxWidth="155"/>
</columnConstraints>
<!--Left side: description-->
<!--The displayed text should not be cropped by the pane, so the elements are texts rather than labels.-->
<Text GridPane.columnIndex="0" GridPane.rowIndex="0" text="Name"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="1" text="Position"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="2" text="Phone"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="3" text="Fax"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="4" text="Email"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="5" text="Business Unit"/>
<Text GridPane.columnIndex="0" GridPane.rowIndex="6" text="Status"/>
<!--Right side: data. These get updated in the controller when the current item changes.-->
<!--<Label GridPane.columnIndex="1" GridPane.rowIndex="0" text="${graphControl.currentItem}"/>-->
<HBox GridPane.columnIndex="1" GridPane.rowIndex="0" spacing="5"
alignment="CENTER_LEFT">
<Label text="${graphControl.currentItem.tag.employee.firstName}" />
<Label text="${graphControl.currentItem.tag.employee.name}" />
</HBox>
<Label GridPane.columnIndex="1" GridPane.rowIndex="1" text="${graphControl.currentItem.tag.employee.position}"/>
<Label GridPane.columnIndex="1" GridPane.rowIndex="2" text="${graphControl.currentItem.tag.employee.phone}"/>
<Label GridPane.columnIndex="1" GridPane.rowIndex="3" text="${graphControl.currentItem.tag.employee.fax}"/>
<Label GridPane.columnIndex="1" GridPane.rowIndex="4" text="${graphControl.currentItem.tag.employee.email}"/>
<Label GridPane.columnIndex="1" GridPane.rowIndex="5" text="${graphControl.currentItem.tag.employee.businessUnit}"/>
<HBox GridPane.columnIndex="1" GridPane.rowIndex="6" spacing="5"
alignment="CENTER_LEFT">
<Ellipse radiusX="4" radiusY="4" fill="${root.properties.currentEmployeeStatusColor}"></Ellipse>
<Label text="${graphControl.currentItem.tag.employee.status}" />
</HBox>
</GridPane>
</content>
</TitledPane>
</VBox>
</left>
<right>
<!--The help panel on the right side.-->
<TitledPane animated="false" collapsible="false" expanded="true" maxHeight="1.7976931348623157E308"
text="Help">
<content>
<WebView prefWidth="300.0" fx:id="webView" fontScale="1"/>
</content>
</TitledPane>
</right>
</BorderPane>