Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP
Commits
b2d45017
Commit
b2d45017
authored
Nov 04, 2015
by
Valérie Maquil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added method for rightmostWidget of a certain class
parent
7b304a28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
...lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
+31
-0
No files found.
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
View file @
b2d45017
...
@@ -294,6 +294,37 @@ public class SpatialPositioningManager implements SpatialEventListener {
...
@@ -294,6 +294,37 @@ public class SpatialPositioningManager implements SpatialEventListener {
return
TangibleObjectManager
.
getWidget
(
getRightMostObject
().
getObjectId
());
return
TangibleObjectManager
.
getWidget
(
getRightMostObject
().
getObjectId
());
}
}
/**
* The method will return the right-most widget, that is, the last widget found based based on
* its x-axis coordinate that is of the provided class. The retrieval is based on the underlying
* handles.
*
* @param <T>
*
* @param _class
* The {@link Class} of the widget that should be returned.
*
* @return The widget with the largest x-axis coordinate that is of the given class. Returns the
* last if more than one are tied. Will return <code>null</code> if no object is
* present.
*/
@SuppressWarnings
(
"unchecked"
)
public
@Nullable
<
T
>
T
getRightMostWidget
(
Class
<
T
>
_class
)
{
if
(
getRightMostObject
()
==
null
)
{
return
null
;
}
for
(
int
i
=
spatialMatrix
.
getHorizontal
().
size
()
-
1
;
i
>=
0
;
i
--)
{
TangibleObject
object
=
spatialMatrix
.
getHorizontal
().
get
(
i
);
BaseWidget
widget
=
TangibleObjectManager
.
getWidget
(
object
.
getObjectId
());
if
(
widget
.
getClass
().
equals
(
_class
))
{
return
(
T
)
widget
;
}
}
return
null
;
}
/**
/**
* The method will return the right-most tangible object.
* The method will return the right-most tangible object.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment