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
Show 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 {
...
@@ -106,18 +106,10 @@ public final class CurrentAnalysisEditorBeanV2 {
* This is the javascript command for a port object.
* This is the javascript command for a port object.
*/
*/
private
static
final
String
JS_CMD_PORT
=
"{\"name\":\"%s\",\"id\":\"%s\", \"tooltip\":\"%s\"}"
;
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.
* This is the javascript type name for an input port.
*/
*/
private
static
final
String
JS_CMD_PORT_TYPE_INPUT
=
"inputPort"
;
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.
* This is the javascript command to add a filter to the graph.
*/
*/
...
@@ -646,7 +638,6 @@ public final class CurrentAnalysisEditorBeanV2 {
...
@@ -646,7 +638,6 @@ public final class CurrentAnalysisEditorBeanV2 {
}
}
// TODO Now the connections between filters and repositories
// TODO Now the connections between filters and repositories
}
}
/**
/**
...
@@ -674,73 +665,98 @@ public final class CurrentAnalysisEditorBeanV2 {
...
@@ -674,73 +665,98 @@ public final class CurrentAnalysisEditorBeanV2 {
for
(
final
MIPlugin
plugin
:
this
.
project
.
getPlugins
())
{
for
(
final
MIPlugin
plugin
:
this
.
project
.
getPlugins
())
{
final
int
pos
=
posCounter
*
100
;
final
int
pos
=
posCounter
*
100
;
if
(
plugin
instanceof
MIReader
)
{
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
{
}
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
++;
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
* @param ports
* The parent plugin of the port.
* The ports to be used within the string command.
* @param port
* @return A string containing the JS commands to create the ports.
* The port itself.
* @return The ID for the port within the graph
*/
*/
private
String
assembleGraphPortID
(
final
MIPlugin
plugin
,
final
MIPort
port
)
{
private
String
assembleGraphPortString
(
final
EList
<?
extends
MIPort
>
ports
)
{
return
this
.
pluginMap
.
get
(
plugin
)
+
"_"
+
this
.
portMap
.
get
(
port
);
final
StringBuilder
builder
=
new
StringBuilder
();
final
int
len
=
ports
.
size
();
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
* @param plugin
* The plugin whose
list of input ports should be deliver
ed.
* The plugin whose
repository ports will be us
ed.
* @return A
list with the input
port
ID
s.
* @return A
string containing the JS commands to create the repository
ports.
*/
*/
private
String
assemble
InputPortsGraph
String
(
final
MIPlugin
plugin
)
{
private
String
assemble
GraphRepositoryPort
String
(
final
MIPlugin
plugin
)
{
final
StringBuilder
builder
=
new
StringBuilder
();
final
StringBuilder
builder
=
new
StringBuilder
();
final
int
len
=
plugin
.
getRepositories
().
size
();
boolean
first
=
true
;
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
plugin
instanceof
MIFilter
)
{
final
MIRepositoryConnector
port
=
plugin
.
getRepositories
().
get
(
i
);
for
(
final
MIInputPort
port
:
((
MIFilter
)
plugin
).
getInputPorts
())
{
if
(
first
)
{
if
(
i
!=
0
)
{
first
=
false
;
}
else
{
builder
.
append
(
','
);
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
();
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 input ports of the given filter
.
*
*
* @param
plugin
* @param
filter
* The
plugin
whose
list of output ports should be deliver
ed.
* The
filter
whose
input ports will be us
ed.
* @return A
list with the out
put port
ID
s.
* @return A
string containing the JS commands to create the in
put ports.
*/
*/
private
String
assembleOutputPortsGraphString
(
final
MIPlugin
plugin
)
{
private
String
assembleGraphInputPortString
(
final
MIFilter
filter
)
{
final
StringBuilder
builder
=
new
StringBuilder
();
return
this
.
assembleGraphPortString
(
filter
.
getInputPorts
());
boolean
first
=
true
;
for
(
final
MIOutputPort
port
:
plugin
.
getOutputPorts
())
{
if
(
first
)
{
first
=
false
;
}
else
{
builder
.
append
(
','
);
}
}
builder
.
append
(
'\"'
).
append
(
this
.
portMap
.
get
(
port
)).
append
(
'\"'
);
/**
* 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
());
}
}
return
builder
.
toString
();
/**
* 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
);
}
}
/**
/**
...
@@ -751,7 +767,9 @@ public final class CurrentAnalysisEditorBeanV2 {
...
@@ -751,7 +767,9 @@ public final class CurrentAnalysisEditorBeanV2 {
* @return A human readable ID.
* @return A human readable ID.
*/
*/
private
String
assembleGraphString
(
final
MIRepository
repository
)
{
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 {
...
@@ -762,7 +780,9 @@ public final class CurrentAnalysisEditorBeanV2 {
* @return A human readable ID.
* @return A human readable ID.
*/
*/
private
String
assembleGraphString
(
final
MIPlugin
plugin
)
{
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