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
5ff4cc20
Commit
5ff4cc20
authored
Nov 02, 2015
by
Eric Tobias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor modification, added Null Analysis related annotations
parent
03974785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
17 deletions
+34
-17
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
+19
-6
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
...lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
+15
-11
No files found.
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
View file @
5ff4cc20
...
...
@@ -17,6 +17,7 @@
package
lu.list.itis.dkd.tui.space
;
import
lu.list.itis.dkd.dbc.annotation.NonNullByDefault
;
import
lu.list.itis.dkd.dbc.annotation.Nullable
;
import
lu.list.itis.dkd.tui.TangibleObjectManager
;
import
lu.list.itis.dkd.tui.adapter.TangibleObject
;
import
lu.list.itis.dkd.tui.widget.BaseWidget
;
...
...
@@ -316,8 +317,11 @@ public class SpatialMatrix {
* @return The object with the smallest x-axis coordinate. Returns the first if more than one
* are tied.
*/
public
TangibleObject
getLeftMostObject
()
{
return
horizontal
.
get
(
0
);
public
@Nullable
TangibleObject
getLeftMostObject
()
{
if
(
horizontal
.
size
()
>
0
)
{
return
horizontal
.
get
(
0
);
}
return
null
;
}
/**
...
...
@@ -327,8 +331,11 @@ public class SpatialMatrix {
* @return The object with the largest x-axis coordinate. Returns the last if more than one are
* tied.
*/
public
TangibleObject
getRightMostObject
()
{
return
horizontal
.
get
(
horizontal
.
size
()
-
1
);
public
@Nullable
TangibleObject
getRightMostObject
()
{
if
(
horizontal
.
size
()
>
0
)
{
return
horizontal
.
get
(
horizontal
.
size
()
-
1
);
}
return
null
;
}
/**
...
...
@@ -339,7 +346,10 @@ public class SpatialMatrix {
* are tied.
*/
public
TangibleObject
getTopObject
()
{
return
vertical
.
get
(
0
);
if
(
vertical
.
size
()
>
0
)
{
return
vertical
.
get
(
0
);
}
return
null
;
}
/**
...
...
@@ -350,7 +360,10 @@ public class SpatialMatrix {
* tied.
*/
public
TangibleObject
getBottomObject
()
{
return
vertical
.
get
(
vertical
.
size
()
-
1
);
if
(
vertical
.
size
()
>
0
)
{
return
vertical
.
get
(
vertical
.
size
()
-
1
);
}
return
null
;
}
/**
...
...
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
View file @
5ff4cc20
...
...
@@ -16,6 +16,8 @@
*/
package
lu.list.itis.dkd.tui.space
;
import
lu.list.itis.dkd.dbc.annotation.NonNullByDefault
;
import
lu.list.itis.dkd.dbc.annotation.Nullable
;
import
lu.list.itis.dkd.tui.TangibleObjectManager
;
import
lu.list.itis.dkd.tui.adapter.TangibleObject
;
import
lu.list.itis.dkd.tui.event.SpatialEvent
;
...
...
@@ -54,6 +56,7 @@ import java.util.logging.Logger;
* @since 2.1
* @version 2.1.3
*/
@NonNullByDefault
public
class
SpatialPositioningManager
implements
SpatialEventListener
{
private
static
final
Logger
logger
=
Logger
.
getLogger
(
SpatialPositioningManager
.
class
.
getSimpleName
());
...
...
@@ -66,6 +69,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
* Enumeration showing all alignment types this class supports.
*
* @author Eric Tobias [eric.tobias@list.lu]
* @author Valérie Maquil [valerie.maquil@list.lu]
* @since 2.1
* @version 2.1.3
*/
...
...
@@ -172,7 +176,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
* @return The widget with the smallest x-axis coordinate. Returns the first if more than one
* are tied. Will return <code>null</code> if no object is present.
*/
public
BaseWidget
getLeftMostWidget
()
{
public
@Nullable
BaseWidget
getLeftMostWidget
()
{
if
(
getLeftMostObject
()
==
null
)
{
return
null
;
}
...
...
@@ -185,7 +189,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
*
* @return The object with the smallest x coordinate.
*/
public
TangibleObject
getLeftMostObject
()
{
public
@Nullable
TangibleObject
getLeftMostObject
()
{
return
spatialMatrix
.
getLeftMostObject
();
}
...
...
@@ -197,9 +201,10 @@ public class SpatialPositioningManager implements SpatialEventListener {
* @return The widget with the largest x-axis coordinate. Returns the last if more than one are
* tied. Will return <code>null</code> if no object is present.
*/
public
BaseWidget
getRightMostWidget
()
{
if
(
getRightMostObject
()
==
null
)
public
@Nullable
BaseWidget
getRightMostWidget
()
{
if
(
null
==
getRightMostObject
())
{
return
null
;
}
return
TangibleObjectManager
.
getWidget
(
getRightMostObject
().
getObjectId
());
}
...
...
@@ -209,7 +214,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
*
* @return The object with the largest x coordinate.
*/
public
TangibleObject
getRightMostObject
()
{
public
@Nullable
TangibleObject
getRightMostObject
()
{
return
spatialMatrix
.
getRightMostObject
();
}
...
...
@@ -220,8 +225,8 @@ public class SpatialPositioningManager implements SpatialEventListener {
* @return The widget with the smallest y-axis coordinate. Returns the first if more than one
* are tied. Will return <code>null</code> if no object is present.
*/
public
BaseWidget
getTopWidget
()
{
if
(
getTopObject
()
==
null
)
{
public
@Nullable
BaseWidget
getTopWidget
()
{
if
(
null
==
getTopObject
()
)
{
return
null
;
}
...
...
@@ -233,7 +238,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
*
* @return The object with the smallest y coordinate.
*/
public
TangibleObject
getTopObject
()
{
public
@Nullable
TangibleObject
getTopObject
()
{
return
spatialMatrix
.
getTopObject
();
}
...
...
@@ -244,7 +249,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
* @return The widget with the largest y-axis coordinate. Returns the last if more than one are
* tied. Will return <code>null</code> if no object is present.
*/
public
BaseWidget
getBottomWidget
()
{
public
@Nullable
BaseWidget
getBottomWidget
()
{
if
(
getBottomObject
()
==
null
)
{
return
null
;
}
...
...
@@ -257,7 +262,7 @@ public class SpatialPositioningManager implements SpatialEventListener {
*
* @return The object with the largest y coordinate.
*/
public
TangibleObject
getBottomObject
()
{
public
@Nullable
TangibleObject
getBottomObject
()
{
return
spatialMatrix
.
getBottomObject
();
}
...
...
@@ -284,7 +289,6 @@ public class SpatialPositioningManager implements SpatialEventListener {
public
List
<
TangibleObject
>
getObjectToLeftOf
(
BaseWidget
widget
)
{
return
spatialMatrix
.
leftOf
(
TangibleObjectManager
.
getIdentifier
(
widget
));
}
/**
...
...
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