Skip to content

Commit

Permalink
Fixed drag'n'drop notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaring committed Dec 28, 2013
1 parent 22af73b commit 352de2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -3,25 +3,26 @@
import de.lessvoid.nifty.NiftyEvent;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class DroppableDroppedEvent implements NiftyEvent {
@Nonnull
@Nullable
private final Droppable source;
@Nonnull
private final Draggable draggable;
@Nonnull
private final Droppable target;

public DroppableDroppedEvent(
@Nonnull final Droppable source,
@Nullable final Droppable source,
@Nonnull final Draggable draggable,
@Nonnull final Droppable target) {
this.source = source;
this.draggable = draggable;
this.target = target;
}

@Nonnull
@Nullable
public Droppable getSource() {
return source;
}
Expand Down
Expand Up @@ -126,7 +126,7 @@ private void drop(
final Droppable source = droppedDraggable.getDroppable();
droppedDraggable.setDroppable(this);

if (notifyObservers && source != null) {
if (notifyObservers) {
notifyObservers(source, droppedDraggable);
}
}
Expand All @@ -136,7 +136,7 @@ public DraggableControl getDraggable() {
return draggable;
}

private void notifyObservers(@Nonnull final Droppable source, @Nonnull final Draggable droppedDraggable) {
private void notifyObservers(@Nullable final Droppable source, @Nonnull final Draggable droppedDraggable) {
if (nifty == null) {
return;
}
Expand Down

0 comments on commit 352de2f

Please sign in to comment.