Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebGUI
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kieker
WebGUI
Commits
2e29f74e
Commit
2e29f74e
authored
12 years ago
by
Nils Christian Ehmke
Browse files
Options
Downloads
Patches
Plain Diff
Continued with the flow editor integration
parent
07bda4d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
+70
-50
70 additions, 50 deletions
...kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
with
70 additions
and
50 deletions
Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBeanV2.java
+
70
−
50
View file @
2e29f74e
...
...
@@ -106,18 +106,10 @@ public final class CurrentAnalysisEditorBeanV2 {
* This is the javascript command for a port object.
*/
private
static
final
String
JS_CMD_PORT
=
"{\"name\":\"%s\",\"id\":\"%s\", \"tooltip\":\"%s\"}"
;
/**
* This is the javascript type name for a repository port.
*/
private
static
final
String
JS_CMD_PORT_TYPE_REPOSITORY
=
"repoPort"
;
/**
* This is the javascript type name for an input port.
*/
private
static
final
String
JS_CMD_PORT_TYPE_INPUT
=
"inputPort"
;
/**
* This is the javascript type name for an output port.
*/
private
static
final
String
JS_CMD_PORT_TYPE_OUTPUT
=
"outputPort"
;
/**
* This is the javascript command to add a filter to the graph.
*/
...
...
@@ -646,7 +638,6 @@ public final class CurrentAnalysisEditorBeanV2 {
}
// TODO Now the connections between filters and repositories
}
/**
...
...
@@ -674,75 +665,100 @@ public final class CurrentAnalysisEditorBeanV2 {
for
(
final
MIPlugin
plugin
:
this
.
project
.
getPlugins
())
{
final
int
pos
=
posCounter
*
100
;
if
(
plugin
instanceof
MIReader
)
{
context
.
execute
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_ADD_READER
,
pos
,
pos
,
this
.
assembleGraphString
(
plugin
),
""
,
""
));
context
.
execute
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_ADD_READER
,
pos
,
pos
,
this
.
assembleGraphString
(
plugin
),
this
.
assembleGraphRepositoryPortString
(
plugin
),
this
.
assembleGraphOuputPortString
(
plugin
)));
}
else
{
context
.
execute
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_ADD_FILTER
,
pos
,
pos
,
this
.
assembleGraphString
(
plugin
),
""
,
""
,
""
));
context
.
execute
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_ADD_FILTER
,
pos
,
pos
,
this
.
assembleGraphString
(
plugin
),
this
.
assembleGraphRepositoryPortString
(
plugin
),
this
.
assembleGraphInputPortString
((
MIFilter
)
plugin
),
this
.
assembleGraphOuputPortString
(
plugin
)));
}
posCounter
++;
}
}
/**
* This method assembles the
ID of the port for the graph based on
the given p
arameter
s.
* This method assembles the
string containing
the given p
ort
s.
*
* @param plugin
* The parent plugin of the port.
* @param port
* The port itself.
* @return The ID for the port within the graph
* @param ports
* The ports to be used within the string command.
* @return A string containing the JS commands to create the ports.
*/
private
String
assembleGraphPortID
(
final
MIPlugin
plugin
,
final
MIPort
port
)
{
return
this
.
pluginMap
.
get
(
plugin
)
+
"_"
+
this
.
portMap
.
get
(
port
);
}
/**
* This method assembles the (simple) IDs for the ports of the given plugin and delivers them as a list as requested by the javascript commands.
*
* @param plugin
* The plugin whose list of input ports should be delivered.
* @return A list with the input port IDs.
*/
private
String
assembleInputPortsGraphString
(
final
MIPlugin
plugin
)
{
private
String
assembleGraphPortString
(
final
EList
<?
extends
MIPort
>
ports
)
{
final
StringBuilder
builder
=
new
StringBuilder
();
final
int
len
=
ports
.
size
();
boolean
first
=
true
;
if
(
plugin
instanceof
MIFilter
)
{
for
(
final
MIInputPort
port
:
((
MIFilter
)
plugin
).
getInputPorts
())
{
if
(
first
)
{
first
=
false
;
}
else
{
builder
.
append
(
','
);
}
builder
.
append
(
'\"'
).
append
(
this
.
portMap
.
get
(
port
)).
append
(
'\"'
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
final
MIPort
port
=
ports
.
get
(
i
);
if
(
i
!=
0
)
{
builder
.
append
(
','
);
}
builder
.
append
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_PORT
,
port
.
getName
(),
this
.
portMap
.
get
(
port
),
port
.
getName
()));
}
return
builder
.
toString
();
}
/**
* This method assembles the
(simple) IDs for the ports of the given plugin and delivers them as a list as requested by the javascript commands
.
* This method assembles the
string containing the available repository ports of the given plugin
.
*
* @param plugin
* The plugin whose
list of output ports should be deliver
ed.
* @return A
list with the output
port
ID
s.
* The plugin whose
repository ports will be us
ed.
* @return A
string containing the JS commands to create the repository
ports.
*/
private
String
assemble
OutputPortsGraph
String
(
final
MIPlugin
plugin
)
{
private
String
assemble
GraphRepositoryPort
String
(
final
MIPlugin
plugin
)
{
final
StringBuilder
builder
=
new
StringBuilder
();
final
int
len
=
plugin
.
getRepositories
().
size
();
boolean
first
=
true
;
for
(
final
MIOutputPort
port
:
plugin
.
getOutputPorts
())
{
if
(
first
)
{
first
=
false
;
}
else
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
final
MIRepositoryConnector
port
=
plugin
.
getRepositories
().
get
(
i
);
if
(
i
!=
0
)
{
builder
.
append
(
','
);
}
builder
.
append
(
'\"'
).
append
(
this
.
portMap
.
get
(
port
)).
append
(
'\"'
);
builder
.
append
(
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_PORT
,
port
.
getName
(),
port
.
getName
(),
port
.
getName
()));
}
return
builder
.
toString
();
}
/**
* This method assembles the string containing the available input ports of the given filter.
*
* @param filter
* The filter whose input ports will be used.
* @return A string containing the JS commands to create the input ports.
*/
private
String
assembleGraphInputPortString
(
final
MIFilter
filter
)
{
return
this
.
assembleGraphPortString
(
filter
.
getInputPorts
());
}
/**
* This method assembles the string containing the available output ports of the given plugin.
*
* @param plugin
* The plugin whose output ports will be used.
* @return A string containing the JS commands to create the output ports.
*/
private
String
assembleGraphOuputPortString
(
final
MIPlugin
plugin
)
{
return
this
.
assembleGraphPortString
(
plugin
.
getOutputPorts
());
}
/**
* This method assembles the ID of the port for the graph based on the given parameters.
*
* @param plugin
* The parent plugin of the port.
* @param port
* The port itself.
* @return The ID for the port within the graph
*/
private
String
assembleGraphPortID
(
final
MIPlugin
plugin
,
final
MIPort
port
)
{
return
this
.
pluginMap
.
get
(
plugin
)
+
"_"
+
this
.
portMap
.
get
(
port
);
}
/**
* Assembles a human-readable string of the given repository, which can also be used as a graph ID.
*
...
...
@@ -751,7 +767,9 @@ public final class CurrentAnalysisEditorBeanV2 {
* @return A human readable ID.
*/
private
String
assembleGraphString
(
final
MIRepository
repository
)
{
return
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_NODE
,
this
.
repositoryMap
.
get
(
repository
),
repository
.
getName
(),
repository
.
getClassname
(),
"N/A"
);
final
String
className
=
repository
.
getClassname
();
final
String
shortName
=
className
.
substring
(
className
.
lastIndexOf
(
'.'
)
+
1
);
return
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_NODE
,
this
.
repositoryMap
.
get
(
repository
),
repository
.
getName
(),
shortName
,
className
);
}
/**
...
...
@@ -762,7 +780,9 @@ public final class CurrentAnalysisEditorBeanV2 {
* @return A human readable ID.
*/
private
String
assembleGraphString
(
final
MIPlugin
plugin
)
{
return
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_NODE
,
this
.
pluginMap
.
get
(
plugin
),
plugin
.
getName
(),
plugin
.
getClassname
(),
"N/A"
);
final
String
className
=
plugin
.
getClassname
();
final
String
shortName
=
className
.
substring
(
className
.
lastIndexOf
(
'.'
)
+
1
);
return
String
.
format
(
CurrentAnalysisEditorBeanV2
.
JS_CMD_NODE
,
this
.
pluginMap
.
get
(
plugin
),
plugin
.
getName
(),
shortName
,
className
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment