-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
43 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 5 additions & 16 deletions
21
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeActivityCmd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
package org.mbari.vars.ui.commands; | ||
|
||
import org.mbari.vars.services.model.Annotation; | ||
import org.mbari.vars.services.model.ObservationsUpdate; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Brian Schlining | ||
* @since 2017-09-15T19:32:00 | ||
* @deprecated use {@link ChangeActivityCmd2} instead | ||
*/ | ||
public class ChangeActivityCmd extends UpdateAnnotationsCmd { | ||
public class ChangeActivityCmd extends UpdateObservationsCmd { | ||
|
||
private final String activity; | ||
|
||
|
||
public ChangeActivityCmd(List<Annotation> originalAnnotations, String activity) { | ||
super(originalAnnotations, originalAnnotations.stream() | ||
.map(Annotation::new) | ||
.peek(a -> a.setActivity(activity)) | ||
.collect(Collectors.toList()), false, false); | ||
this.activity = activity; | ||
super(originalAnnotations, ObservationsUpdate.forActivity(observationUuids(originalAnnotations), activity)); | ||
} | ||
|
||
|
||
@Override | ||
public String getDescription() { | ||
return "Changing activity of " + originalAnnotations.size() + " annotations to " + activity; | ||
return "Changing activity of " + originalAnnotations.size() + " annotations to " + observationsUpdate.activity(); | ||
} | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeActivityCmd2.java
This file was deleted.
Oops, something went wrong.
31 changes: 15 additions & 16 deletions
31
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeConceptCmd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
package org.mbari.vars.ui.commands; | ||
|
||
import org.mbari.vars.services.model.Annotation; | ||
import org.mbari.vars.services.model.ObservationsUpdate; | ||
import org.mbari.vars.services.model.User; | ||
import org.mbari.vars.ui.UIToolBox; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Brian Schlining | ||
* @since 2017-09-18T10:46:00 | ||
* @deprecated use {@link ChangeConceptCmd2} instead | ||
*/ | ||
public class ChangeConceptCmd extends UpdateAnnotationsCmd { | ||
|
||
private final String concept; | ||
public class ChangeConceptCmd extends UpdateObservationsCmd { | ||
|
||
public ChangeConceptCmd(List<Annotation> originalAnnotations, String concept) { | ||
super(originalAnnotations, originalAnnotations.stream() | ||
.map(Annotation::new) | ||
.peek(a -> a.setConcept(concept)) | ||
.collect(Collectors.toList()), true, true); | ||
this.concept = concept; | ||
super(originalAnnotations, ObservationsUpdate.forConcept(observationUuids(originalAnnotations), concept)); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Changing concept for " + originalAnnotations.size() + " annotations to " + concept; | ||
public void apply(UIToolBox toolBox) { | ||
final User user = toolBox.getData().getUser(); | ||
if (user != null) { | ||
observationsUpdate = observationsUpdate.withObserver(user.getUsername()); | ||
} | ||
super.apply(toolBox); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Changing concept of " + originalAnnotations.size() + " annotations to " + observationsUpdate.concept(); | ||
} | ||
} |
29 changes: 0 additions & 29 deletions
29
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeConceptCmd2.java
This file was deleted.
Oops, something went wrong.
21 changes: 4 additions & 17 deletions
21
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeGroupCmd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,18 @@ | ||
package org.mbari.vars.ui.commands; | ||
|
||
import org.mbari.vars.services.model.Annotation; | ||
import org.mbari.vars.services.model.ObservationsUpdate; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Brian Schlining | ||
* @since 2017-09-15T19:31:00 | ||
* @deprecated use {@link ChangeGroupCmd2} instead | ||
*/ | ||
public class ChangeGroupCmd extends UpdateAnnotationsCmd { | ||
|
||
private final String group; | ||
|
||
public class ChangeGroupCmd extends UpdateObservationsCmd { | ||
|
||
public ChangeGroupCmd(List<Annotation> originalAnnotations, String group) { | ||
super(originalAnnotations, originalAnnotations.stream() | ||
.map(a -> new Annotation(a)) | ||
.peek(a -> a.setGroup(group)) | ||
.collect(Collectors.toList()), false, false); | ||
this.group = group; | ||
super(originalAnnotations, ObservationsUpdate.forGroup(observationUuids(originalAnnotations), group)); | ||
} | ||
|
||
|
||
@Override | ||
public String getDescription() { | ||
return "Changing group of " + originalAnnotations.size() + " annotations to " + group; | ||
return "Changing group of " + originalAnnotations.size() + " annotations to " + observationsUpdate.group(); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
org.mbari.vars.ui/src/main/java/org/mbari/vars/ui/commands/ChangeGroupCmd2.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters