aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2013-07-26 10:39:01 (EDT)
committerDirk Fauth2013-07-26 10:39:01 (EDT)
commit8486827c14147aaedfbad2f014ed610216a9b7ac (patch)
tree03ce84252d92231552837a20c16c2110b3b08965
parent272f01ff9d5640c4fa354ebd060da0159a47de4e (diff)
downloadorg.eclipse.nebula-8486827c14147aaedfbad2f014ed610216a9b7ac.zip
org.eclipse.nebula-8486827c14147aaedfbad2f014ed610216a9b7ac.tar.gz
org.eclipse.nebula-8486827c14147aaedfbad2f014ed610216a9b7ac.tar.bz2
Bug 413820 - Removed the selected event from the surrounding ones
-rw-r--r--widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java68
1 files changed, 36 insertions, 32 deletions
diff --git a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
index ef65366..56f69e6 100644
--- a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
+++ b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
@@ -6235,6 +6235,10 @@ public final class GanttComposite extends Canvas implements MouseListener, Mouse
continue;
}
+ if (_selectedEvents.contains(ge)) {
+ continue;
+ }
+
sorted.add(ge);
}
}
@@ -6305,39 +6309,39 @@ public final class GanttComposite extends Canvas implements MouseListener, Mouse
GanttEvent first = null;
if (!sorted.isEmpty()) {
first = (GanttEvent) sorted.get(0);
+ if (first.equals(event) && sorted.size() > 1) {
+ first = (GanttEvent) sorted.get(1);
+ }
+
+ final int topMostY = first.getY();
+ final int botMostY = ((GanttEvent) sorted.get(sorted.size() - 1)).getY();
+
+ if (event.getY() < topMostY) {
+ if (section == null) {
+ nearestUp = null;
+ } else {
+ nearestUp = null;
+ nearestDown = (GanttEvent) allEvents.get(0);
+ }
+ }
+ if ((event.getY() + event.getHeight()) > botMostY) {
+ if (section == null) {
+ nearestDown = null;
+ } else {
+ nearestUp = (GanttEvent) allEvents.get(allEvents.size() - 1);
+ nearestDown = null;
+ }
+ }
+
+ /* if (section != null) {
+ if (nearestDown == null) {
+ nearestDown = (GanttEvent) allEvents.get(allEvents.size()-1);
+ }
+ }
+ */
+ // System.err.println("Up: " + nearestUp);
+ // System.err.println("Down: " + nearestDown);
}
- if (first.equals(event) && sorted.size() > 1) {
- first = (GanttEvent) sorted.get(1);
- }
-
- final int topMostY = first.getY();
- final int botMostY = ((GanttEvent) sorted.get(sorted.size() - 1)).getY();
-
- if (event.getY() < topMostY) {
- if (section == null) {
- nearestUp = null;
- } else {
- nearestUp = null;
- nearestDown = (GanttEvent) allEvents.get(0);
- }
- }
- if ((event.getY() + event.getHeight()) > botMostY) {
- if (section == null) {
- nearestDown = null;
- } else {
- nearestUp = (GanttEvent) allEvents.get(allEvents.size() - 1);
- nearestDown = null;
- }
- }
-
- /* if (section != null) {
- if (nearestDown == null) {
- nearestDown = (GanttEvent) allEvents.get(allEvents.size()-1);
- }
- }
- */
- // System.err.println("Up: " + nearestUp);
- // System.err.println("Down: " + nearestDown);
ret.add(nearestUp);
ret.add(nearestDown);