Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
31e8cdb1
Commit
31e8cdb1
authored
7 years ago
by
Simon Barner
Browse files
Options
Downloads
Patches
Plain Diff
- Tweak some parameters (port height, ...)
refs 2898
parent
1fcd0880
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/layout/auto/KielerAutoLayouter.java
+33
-12
33 additions, 12 deletions
...rtiss/tooling/base/ui/layout/auto/KielerAutoLayouter.java
with
33 additions
and
12 deletions
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/layout/auto/KielerAutoLayouter.java
+
33
−
12
View file @
31e8cdb1
...
...
@@ -76,7 +76,7 @@ import de.cau.cs.kieler.klay.layered.LayeredLayoutProvider;
* @author offtermatt, barner
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 1
6F143B594364B7086DDC34B46E25EA6
* @ConQAT.Rating YELLOW Hash: 1
A25EB9AE5984C3C687BEF6B4566F949
*/
public
class
KielerAutoLayouter
implements
IAutoLayouter
{
...
...
@@ -84,7 +84,7 @@ public class KielerAutoLayouter implements IAutoLayouter {
private
static
final
int
NODE_MIN_WIDTH
=
150
;
/** Height per port (used to derive minimum height of layouted element. */
private
static
final
int
PORT_HEIGHT
=
15
;
private
static
final
int
PORT_HEIGHT
=
20
;
/** Mapping from {@link IHierarchicElement}s to {@link KNode}s. */
private
EMap
<
IHierarchicElement
,
KNode
>
modelElementsToKNodes
;
...
...
@@ -215,7 +215,7 @@ public class KielerAutoLayouter implements IAutoLayouter {
break
;
}
LayoutDataUtils
.
setStickyConnectorLayoutData
((
ILayoutedModelElement
)
port
,
orientation
,
(
int
)
portLayout
.
getYpos
());
(
int
)
(
portLayout
.
getYpos
())
)
;
}
}
...
...
@@ -286,23 +286,19 @@ public class KielerAutoLayouter implements IAutoLayouter {
Dimension
dimension
=
getNodeSize
((
ILayoutedModelElement
)
curElement
);
int
portNmbr
=
Math
.
max
(
inputPorts
.
size
(),
outputPorts
.
size
());
curLayout
.
setHeight
(
Math
.
max
(
portNmbr
*
PORT_HEIGHT
,
dimension
.
getHeight
()));
curLayout
.
setHeight
(
Math
.
max
(
(
1
+
2
*
portNmbr
)
*
PORT_HEIGHT
,
dimension
.
getHeight
()));
curLayout
.
setWidth
(
Math
.
max
(
NODE_MIN_WIDTH
,
dimension
.
getWidth
()));
curKNode
.
setParent
(
parentNode
);
modelElementsToKNodes
.
put
(
curElement
,
curKNode
);
for
(
IConnector
curPort
:
outputPorts
)
{
KPort
k
=
KimlUtil
.
createInitializedPort
();
k
.
setNode
(
curKNode
);
outboundConnectorsToKPorts
.
put
(
curPort
,
k
);
KPort
k
=
createKPortFromIConnector
(
curPort
,
curKNode
,
outboundConnectorsToKPorts
);
if
(
genericPorts
.
contains
(
curPort
))
{
undirectedConnectorsToKPorts
.
put
(
curPort
,
k
);
}
}
for
(
IConnector
curPort
:
inputPorts
)
{
KPort
k
=
KimlUtil
.
createInitializedPort
();
k
.
setNode
(
curKNode
);
inboundConnectorsToKPorts
.
put
(
curPort
,
k
);
createKPortFromIConnector
(
curPort
,
curKNode
,
inboundConnectorsToKPorts
);
}
}
...
...
@@ -313,8 +309,8 @@ public class KielerAutoLayouter implements IAutoLayouter {
for
(
IConnector
curPort
:
hierarchicElement
.
getConnectors
())
{
KNode
virtual
=
KimlUtil
.
createInitializedNode
();
KShapeLayout
virtualLayout
=
virtual
.
getData
(
KShapeLayout
.
class
);
virtualLayout
.
setHeight
(
50
);
virtualLayout
.
setWidth
(
50
);
virtualLayout
.
setHeight
(
PORT_HEIGHT
);
virtualLayout
.
setWidth
(
2
*
PORT_HEIGHT
);
virtual
.
setParent
(
parentNode
);
KPort
k
=
KimlUtil
.
createInitializedPort
();
...
...
@@ -351,4 +347,29 @@ public class KielerAutoLayouter implements IAutoLayouter {
}
return
parentNode
;
}
/**
* Converts a given {@link IConnection} into a {@link KPort}, and registers it with the given
* {@link KNode} (representing the {@link IHierarchicElement} containing the {@link IConnector}
* ) and a {@link IConnector}-to- {@link KPort} map.
*
* @param connector
* {@link IConnector} to be converted to {@link KPort}
* @param knode
* {@link KNode} that will contain the newly created {@link KPort}
* @param connectorsToKPorts
* Map between {@link IConnector}s and {@link KPort}s.
*
* @return {@link KNode} represeting the given {@link IConnector}.
*/
private
KPort
createKPortFromIConnector
(
IConnector
connector
,
KNode
knode
,
EMap
<
IConnector
,
KPort
>
connectorsToKPorts
)
{
KPort
k
=
KimlUtil
.
createInitializedPort
();
k
.
setNode
(
knode
);
KShapeLayout
portLayout
=
k
.
getData
(
KShapeLayout
.
class
);
portLayout
.
setHeight
(
PORT_HEIGHT
);
connectorsToKPorts
.
put
(
connector
,
k
);
return
k
;
}
}
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