Commit a116e8e2 authored by tu's avatar tu

changed pos of ID; added warning message if an ID was assigned twice;

changed pos of the ID column
parent 9f1a25cd
Pipeline #12044 passed with stage
in 5 minutes and 5 seconds
......@@ -995,33 +995,55 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
}
public void speakerOutsideFrame(AnnotationFS selected)
public void createSpeakerOutsideFrame(AnnotationFS selected)
{
List<AnnotationFS> speakerSelection = editor.getCurrentSelectionOfType(speakerType);
List<AnnotationFS> expSelection = editor.getCurrentSelectionOfType(expressionType);
String concatenatedId = "";
if (speakerSelection != null && speakerSelection.size() > 0)
{
{
AnnotationFS anno = speakerSelection.get(0);
updateAnnotation(anno, speakerIDFeat, selected.getFeatureValueAsString(frameIDFeat), true);
if (anno.getFeatureValueAsString(speakerIDFeat) == null)
{
concatenatedId = selected.getFeatureValueAsString(frameIDFeat);
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}else if (anno.getFeatureValueAsString(speakerIDFeat).matches(".*" + " " + selected.getFeatureValueAsString(frameIDFeat) + " " + ".*")
|| anno.getFeatureValueAsString(speakerIDFeat).matches(selected.getFeatureValueAsString(frameIDFeat) + " " + ".*" )
|| anno.getFeatureValueAsString(speakerIDFeat).matches(".*" + " " + selected.getFeatureValueAsString(frameIDFeat))
|| anno.getFeatureValueAsString(speakerIDFeat).matches(selected.getFeatureValueAsString(frameIDFeat))){
JFrame jFrame = new JFrame("Information");
JOptionPane.showMessageDialog(jFrame, "The speaker already has the ID " + selected.getFeatureValueAsString(frameIDFeat) + ".", "Attention", JOptionPane.WARNING_MESSAGE);
}else {
concatenatedId = anno.getFeatureValueAsString(speakerIDFeat) + " " + selected.getFeatureValueAsString(frameIDFeat);
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}
}
if (expSelection != null && expSelection.size() > 0)
{
AnnotationFS anno = expSelection.get(0);
updateAnnotation(anno, expressionIDFeat, selected.getFeatureValueAsString(frameIDFeat), true);
}
}
public void speakerOutsideStwr(AnnotationFS selected)
public void createSpeakerOutsideStwr(AnnotationFS selected)
{
List<AnnotationFS> speakerSelection = editor.getCurrentSelectionOfType(speakerType);
String concatenatedId = "";
if (speakerSelection != null && speakerSelection.size() > 0)
{
AnnotationFS anno = speakerSelection.get(0);
updateAnnotation(anno, speakerIDFeat, selected.getFeatureValueAsString(stwrIDFeat), true);
if (anno.getFeatureValueAsString(speakerIDFeat) == null)
{
concatenatedId = selected.getFeatureValueAsString(stwrIDFeat);
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}else if (anno.getFeatureValueAsString(speakerIDFeat).matches(".*" + " " + selected.getFeatureValueAsString(stwrIDFeat) + " " + ".*")
|| anno.getFeatureValueAsString(speakerIDFeat).matches(selected.getFeatureValueAsString(stwrIDFeat) + " " + ".*" )
|| anno.getFeatureValueAsString(speakerIDFeat).matches(".*" + " " + selected.getFeatureValueAsString(stwrIDFeat))
|| anno.getFeatureValueAsString(speakerIDFeat).matches(selected.getFeatureValueAsString(stwrIDFeat))){
JFrame jFrame = new JFrame("Information");
JOptionPane.showMessageDialog(jFrame, "The speaker already has the ID " + selected.getFeatureValueAsString(stwrIDFeat) + ".", "Attention", JOptionPane.WARNING_MESSAGE);
}else {
concatenatedId = anno.getFeatureValueAsString(speakerIDFeat) + " " + selected.getFeatureValueAsString(stwrIDFeat);
updateAnnotation(anno, speakerIDFeat, concatenatedId, true);
}
}
}
......@@ -1089,7 +1111,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
if (repCounter == repAnnoList.size() && frameCounter == frameList.size())
{
JFrame jFrame = new JFrame("Information");
JOptionPane.showMessageDialog(jFrame, "Please mark a string in a frame or a reported STWR.", "Attention", JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(jFrame, "Please mark a string in a frame or in a reported STWR.", "Attention", JOptionPane.WARNING_MESSAGE);
}
}
renewPage();
......
......@@ -201,7 +201,7 @@ public class RwFrameTableComposite extends Composite{
{
IStructuredSelection sel = (IStructuredSelection) frameViewer.getSelection();
AnnotationFS selected = (AnnotationFS) sel.getFirstElement();
part.speakerOutsideFrame(selected);
part.createSpeakerOutsideFrame(selected);
}
// small utility method
......
......@@ -80,7 +80,9 @@ public class RwSpeakerDrawingStrategy implements IAnnotationDrawingStrategy {
String feat = anno.getFeatureValueAsString(f);
if (feat != null && feat.trim().length() > 0) {
// Only draw if String not empty.
gc.drawString(anno.getFeatureValueAsString(f) + s, lastRect.x + lastRect.width - 1,
//gc.drawString(anno.getFeatureValueAsString(f) + s, lastRect.x + lastRect.width - 1,
// lastRect.y - FONTSIZE - 7);
gc.drawString(anno.getFeatureValueAsString(f) + s, lastRect.x-10 + lastRect.width - 1,
lastRect.y - FONTSIZE - 7);
}
}
......
......@@ -109,12 +109,12 @@ public class RwStwrTableComposite extends Composite{
createTableViewerColumn("Stwr", 45, 1, part::determineStwr);
createTableViewerColumn("Medium", 45, 2, part::determineMedium);
createTableViewerColumn("Type", 45, 3, part::determineRType);
createTableViewerColumn("Level", 45, 4, part::determineLevel);
createTableViewerColumn("NonFact", 45, 5, part::determineNonFact);
createTableViewerColumn("Prag", 45, 6, part::determinePrag);
createTableViewerColumn("Border", 45, 7, part::determineBorder);
createTableViewerColumn("Metaph", 45, 8, part::determineMetaph);
createTableViewerColumn("ID", 45, 9, part::determineStwrID);
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);
}
......@@ -259,7 +259,7 @@ public class RwStwrTableComposite extends Composite{
{
IStructuredSelection sel = (IStructuredSelection) stwrViewer.getSelection();
AnnotationFS selected = (AnnotationFS) sel.getFirstElement();
part.speakerOutsideStwr(selected);
part.createSpeakerOutsideStwr(selected);
}
// small utility method
......
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