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
e5fe468b
Commit
e5fe468b
authored
Oct 29, 2015
by
Eric Tobias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.1.2 - Finalized SpatialMatrix's basic position management
parent
e90a6339
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
CHANGELOG.txt
CHANGELOG.txt
+4
-0
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
+9
-6
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
...lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
+31
-2
No files found.
CHANGELOG.txt
View file @
e5fe468b
2.1.2
+ Added ShapeCorona and related builders.
2.1.0
+ Adding event broadcaster for TUI context events.
...
...
TULIP/src/lu/list/itis/dkd/tui/space/SpatialMatrix.java
View file @
e5fe468b
...
...
@@ -160,7 +160,10 @@ public class SpatialMatrix {
* object (by ID). The method will return a new list build from the sublist of the horizontal
* space.<br />
* To determine whether something is "left", the method will make a sub-list of all elements
* with a lower index in the list than the parameterized object.
* with a lower index in the list than the parameterized object.<br />
* The returned list is to be read from left to right, that is, to be treated as if the object
* was added to the end. Hence, the first element is furthest away while the last element is
* closest.
*
* @param objectId
* The object for which to retrieve all objects to the left of.
...
...
@@ -169,12 +172,12 @@ public class SpatialMatrix {
*/
public
synchronized
List
<
TangibleObject
>
leftOf
(
int
objectId
)
{
int
index
=
findHorizontalIndexFor
(
objectId
);
return
new
ArrayList
<>(
horizontal
.
subList
(
index
,
horizontal
.
size
()
));
return
new
ArrayList
<>(
horizontal
.
subList
(
0
,
index
));
}
public
synchronized
List
<
TangibleObject
>
rightOf
(
int
objectId
)
{
int
index
=
findHorizontalIndexFor
(
objectId
);
return
new
ArrayList
<>(
horizontal
.
subList
(
0
,
index
));
int
index
=
findHorizontalIndexFor
(
objectId
)
+
1
;
return
new
ArrayList
<>(
horizontal
.
subList
(
index
,
horizontal
.
size
()
));
}
public
synchronized
List
<
TangibleObject
>
above
(
int
objectId
)
{
...
...
@@ -183,8 +186,8 @@ public class SpatialMatrix {
}
public
synchronized
List
<
TangibleObject
>
below
(
int
objectId
)
{
int
index
=
findHorizontalIndexFor
(
objectId
);
return
new
ArrayList
<>(
horizont
al
.
subList
(
index
,
vertical
.
size
()));
int
index
=
findHorizontalIndexFor
(
objectId
)
+
1
;
return
new
ArrayList
<>(
vertic
al
.
subList
(
index
,
vertical
.
size
()));
}
String
printLists
()
{
...
...
TULIP/src/lu/list/itis/dkd/tui/space/SpatialPositioningManager.java
View file @
e5fe468b
...
...
@@ -16,6 +16,7 @@
*/
package
lu.list.itis.dkd.tui.space
;
import
lu.list.itis.dkd.tui.TangibleObjectManager
;
import
lu.list.itis.dkd.tui.event.SpatialEvent
;
import
lu.list.itis.dkd.tui.event.SpatialEventListener
;
import
lu.list.itis.dkd.tui.utility.PropertiesFetcher
;
...
...
@@ -68,6 +69,15 @@ public class SpatialPositioningManager implements SpatialEventListener {
return
INSTANCE
;
}
/**
* Simple getter method for spatialMatrix.
*
* @return The value of spatialMatrix.
*/
public
SpatialMatrix
getSpatialMatrix
()
{
return
spatialMatrix
;
}
/**
* Method for configuring a {@link Logger} with several properties as given by the loader
* properties file.
...
...
@@ -89,10 +99,20 @@ public class SpatialPositioningManager implements SpatialEventListener {
unconfiguredLogger
.
setLevel
(
Level
.
parse
(
properties
.
getProperty
(
"logger.level"
)));
//$NON-NLS-1$
}
/** {@inheritDoc} */
/**
* {@inheritDoc} <br/>
* <br/>
*
* The event will not be registered if the if of the tangible is not recognized by the
* {@link TangibleObjectManager}.
*/
@Override
public
void
spaceUpdated
(
SpatialEvent
event
)
{
if
(
TangibleObjectManager
.
getWidget
(
event
.
getSource
().
getObjectId
())
==
null
)
{
return
;
}
switch
(
event
.
getType
())
{
case
UPDATE:
spatialMatrix
.
update
(
event
.
getSource
());
...
...
@@ -107,6 +127,15 @@ public class SpatialPositioningManager implements SpatialEventListener {
logger
.
log
(
Level
.
SEVERE
,
"Spatial event type \""
+
event
.
getType
()
+
"\" not recognized!"
);
//$NON-NLS-1$ //$NON-NLS-2$
break
;
}
System
.
out
.
println
(
spatialMatrix
.
printLists
());
// System.out.println(spatialMatrix.printLists());
// System.out.println("Left of " + event.getSource().getObjectId() + ": " +
// spatialMatrix.leftOf(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Right of " + event.getSource().getObjectId() + ": " +
// spatialMatrix.rightOf(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Above " + event.getSource().getObjectId() + ": " +
// spatialMatrix.above(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
// System.out.println("Below " + event.getSource().getObjectId() + ": " +
// spatialMatrix.below(event.getSource().getObjectId())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
\ No newline at end of file
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