Commit 7705a4d1 authored by tu's avatar tu

added fI function; added Speaker to table along with some functions

parent fb6454a3
Pipeline #12194 passed with stage
in 4 minutes and 43 seconds
......@@ -733,8 +733,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
for (AnnotationFS speaker : speakerList)
{
if (speaker.getFeatureValueAsString(speakerIDFeat).equals(toId))
{
if (speaker.getFeatureValueAsString(speakerIDFeat).equals(toId)){
updateAnnotation(speaker, speakerIDFeat, fromId, true);
}
}
......@@ -746,6 +745,14 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(expression, expressionIDFeat, fromId, true);
}
}
for (AnnotationFS speaker : speakerList)
{
if (speaker.getFeatureValueAsString(speakerIDFeat).equals(toId))
{
updateAnnotation(speaker, speakerIDFeat, fromId, true);
}
}
}
/*
Display.getCurrent().asyncExec(() -> {
......@@ -772,6 +779,13 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
// update that annotation
updateAnnotation(a, stwrIDFeat, toId, true);
}
for (AnnotationFS speaker : speakerList)
{
if (speaker.getFeatureValueAsString(speakerIDFeat).equals(fromId)){
updateAnnotation(speaker, speakerIDFeat, toId, true);
}
}
}
/*
Display.getCurrent().asyncExec(() -> {
......@@ -1038,7 +1052,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
renewPage();
});
*/
renewPage();
renewPage();
}
}
......@@ -1070,6 +1084,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}
}
renewPage();
}
public void createSpeakerOutsideStwr(AnnotationFS selected)
......@@ -1097,6 +1112,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}
}
renewPage();
}
......@@ -1705,6 +1721,43 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
deleteAnnotations(annos.toArray(new AnnotationFS[0]));
}
public String determineStwrSpeaker(AnnotationFS anno) {
ArrayList<String> speakerArrayList = new ArrayList<String>();
for (AnnotationFS speakerAnno : speakerList){
if (speakerAnno.getFeatureValueAsString(speakerIDFeat).contains(" "))
{
String [] speakerIDList = speakerAnno.getFeatureValueAsString(speakerIDFeat).split(" ");
for (String s : speakerIDList){
if (s.equals(anno.getFeatureValueAsString(stwrIDFeat))){
speakerArrayList.add(speakerAnno.getFeatureValueAsString(speakerFeat));
}
}
} else if (speakerAnno.getFeatureValueAsString(speakerIDFeat).equals(anno.getFeatureValueAsString(stwrIDFeat))) {
speakerArrayList.add(speakerAnno.getFeatureValueAsString(speakerFeat));
}
}
return String.join("/", speakerArrayList);
}
public String determineFrameSpeaker(AnnotationFS anno) {
ArrayList<String> speakerArrayList = new ArrayList<String>();
for (AnnotationFS speakerAnno : speakerList){
if (speakerAnno.getFeatureValueAsString(speakerIDFeat).contains(" "))
{
String [] speakerIDList = speakerAnno.getFeatureValueAsString(speakerIDFeat).split(" ");
for (String s : speakerIDList){
if (s.equals(anno.getFeatureValueAsString(frameIDFeat))){
speakerArrayList.add(speakerAnno.getFeatureValueAsString(speakerFeat));
}
}
} else if (speakerAnno.getFeatureValueAsString(speakerIDFeat).equals(anno.getFeatureValueAsString(frameIDFeat))) {
speakerArrayList.add(speakerAnno.getFeatureValueAsString(speakerFeat));
}
}
return String.join("/", speakerArrayList);
}
/*
* private AnnotationFS getCoveringStwr(int caretPos) {
......@@ -2142,7 +2195,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(metaDataList.get(0), timeStampFeat, timestampValue, true);
String versionValue = metaDataList.get(0).getFeatureValueAsString(versionFeat);
versionValue = "0.0.10a 0.0.1s";
versionValue = "0.0.11a 0.0.1s";
//versionValue = "0.0.8a 0.0.1s";
updateAnnotation(metaDataList.get(0), versionFeat, versionValue, true);
}
......
......@@ -106,7 +106,8 @@ public class RwFrameTableComposite extends Composite{
createTableViewerColumn("Frame", 45, 1, part::determineFrame);
createTableViewerColumn("Pos", 45, 2, part::determinePos);
createTableViewerColumn("ID", 45, 3, part::determineFrameID);
createTableViewerColumn("Note", 45, 4, part::determineFrameNote);
createTableViewerColumn("Speaker", 45, 4, part::determineFrameSpeaker);
createTableViewerColumn("Note", 45, 5, part::determineFrameNote);
}
private TableViewerColumn createTableViewerColumn(String viewer, int bound, final int colNumber,
......@@ -186,7 +187,7 @@ public class RwFrameTableComposite extends Composite{
List<AnnotationFS> selectedAnnos = getSelectedAnnotationsFromTable();
// add a note
if (e.keyCode == SWT.CR) {
if (e.keyCode == '+') {
part.addFrameNote(selectedAnnos);
}
......
......@@ -111,12 +111,14 @@ public class RwStwrTableComposite extends Composite{
createTableViewerColumn("Medium", 45, 2, part::determineMedium);
createTableViewerColumn("Type", 45, 3, part::determineRType);
createTableViewerColumn("ID", 45, 4, part::determineStwrID);
createTableViewerColumn("Level", 45, 5, part::determineLevel);
createTableViewerColumn("NonFact", 45, 6, part::determineNonFact);
createTableViewerColumn("Prag", 45, 7, part::determinePrag);
createTableViewerColumn("Border", 45, 8, part::determineBorder);
createTableViewerColumn("Metaph", 45, 9, part::determineMetaph);
createTableViewerColumn("Note", 45, 10, part::determineStwrNote);
createTableViewerColumn("Speaker", 45, 5, part::determineStwrSpeaker);
createTableViewerColumn("Level", 45, 6, part::determineLevel);
createTableViewerColumn("NonFact", 45, 7, part::determineNonFact);
createTableViewerColumn("Prag", 45, 8, part::determinePrag);
createTableViewerColumn("Border", 45, 9, part::determineBorder);
createTableViewerColumn("Metaph", 45, 10, part::determineMetaph);
createTableViewerColumn("Note", 45, 11, part::determineStwrNote);
}
private TableViewerColumn createTableViewerColumn(String viewer, int bound, final int colNumber,
......@@ -223,6 +225,10 @@ public class RwStwrTableComposite extends Composite{
part.goToAnnotation(getSelectedAnnotationsFromTable());
}
if (e.keyCode == '+'){
part.addStwrNote(selectedAnnos);
}
// change medium feature
if (e.keyCode == 'a') {
part.toggleMedium(selectedAnnos);
......
......@@ -48,7 +48,8 @@ public class RwViewComposite extends Composite {
GridData gd = new GridData(GridData.GRAB_VERTICAL | GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
rwFrameTableComposite.setLayoutData(gd);
}
public void refresh(List<AnnotationFS> frameList, List<AnnotationFS> stwrList){
rwFrameTableComposite.refresh(frameList);
rwStwrTableComposite.refresh(stwrList);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment