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
32f39c68
Commit
32f39c68
authored
13 years ago
by
Florian Hölzl
Browse files
Options
Downloads
Patches
Plain Diff
YELLOW
refs 311
parent
87fed4ba
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/utils/LayoutDataUtils.java
+43
-1
43 additions, 1 deletion
...rc/org/fortiss/tooling/base/ui/utils/LayoutDataUtils.java
with
43 additions
and
1 deletion
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/LayoutDataUtils.java
+
43
−
1
View file @
32f39c68
...
...
@@ -51,8 +51,10 @@ import org.eclipse.gef.EditPart;
import
org.fortiss.tooling.base.layout.LayoutKeyConstants
;
import
org.fortiss.tooling.base.model.layout.Angle
;
import
org.fortiss.tooling.base.model.layout.Dimension
;
import
org.fortiss.tooling.base.model.layout.EOrientation
;
import
org.fortiss.tooling.base.model.layout.ILayoutData
;
import
org.fortiss.tooling.base.model.layout.ILayoutedModelElement
;
import
org.fortiss.tooling.base.model.layout.LayoutFactory
;
import
org.fortiss.tooling.base.model.layout.Offset
;
import
org.fortiss.tooling.base.model.layout.OffsetOrientation
;
import
org.fortiss.tooling.base.model.layout.Point
;
...
...
@@ -75,10 +77,29 @@ import org.fortiss.tooling.base.utils.LayoutModelElementFactory;
* @author hummel
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
BA085FEB69C66332C246D33F24D7D240
* @ConQAT.Rating
YELLOW
Hash:
777A0B24A644B59F3A954FA349436062
*/
public
class
LayoutDataUtils
{
/** Sets node layout. */
public
static
void
setNodeLayoutData
(
ILayoutedModelElement
layouted
,
int
xPos
,
int
yPos
,
int
width
,
int
height
)
{
setNodeBounds
(
layouted
,
new
Rectangle
(
xPos
,
yPos
,
width
,
height
));
}
/** Sets free port layout data. */
public
static
void
setNodeLayoutData
(
ILayoutedModelElement
layouted
,
int
xPos
,
int
yPos
)
{
setNodePosition
(
layouted
,
xPos
,
yPos
);
}
/** Sets sticky connector layout data. */
public
static
void
setStickyConnectorLayoutData
(
ILayoutedModelElement
layouted
,
EOrientation
orientation
,
int
offset
)
{
setOffsetOrientation
(
layouted
,
CONNECTOR_OFFSET_ORIENTATION
,
offset
,
orientation
);
}
/** Returns the bounds rectangle of the given layouted element. */
public
static
Rectangle
getNodeBounds
(
ILayoutedModelElement
layouted
)
{
Rectangle
result
=
new
Rectangle
();
...
...
@@ -331,6 +352,27 @@ public class LayoutDataUtils {
}
}
/**
* Adds a {@link org.eclipse.draw2d.Bendpoint Bendpoint} defined by the x,y
* parameters to a channel
*
* @param conn
* the connection
* @param bendPointX
* the x coordinate of the Bendpoint
* @param bendPointY
* the y coordinate of the Bendpoint
*/
public
static
void
addBendPointToConnection
(
ILayoutedModelElement
conn
,
int
bendPointX
,
int
bendPointY
)
{
// set middle point of transition
Point
bendPoint
=
LayoutFactory
.
eINSTANCE
.
createPoint
();
bendPoint
.
setX
(
bendPointX
);
bendPoint
.
setY
(
bendPointY
);
getConnectionPoints
(
conn
).
getPointsList
().
add
(
bendPoint
);
}
/** Move bend points of self-connections, if theirs parent is resized */
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
public
static
void
bendpointGroupResize
(
ILayoutedModelElement
layouted
,
...
...
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