Commit b260b07c authored by tu's avatar tu

fixed bug metadata dialog, added "unsure" to text_type

parent 8c001bbe
Pipeline #7502 passed with stage
in 4 minutes and 12 seconds
......@@ -47,7 +47,6 @@ import de.ids.tt.athen.rwview.ui.RwMetadataDialog;
import de.ids.tt.athen.rwview.ui.RwSpeakerDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwExpDrawingStrategy;
import de.ids.tt.athen.rwview.ui.RwViewComposite;
import de.idsma.rw.Metadata;
import de.uniwue.kalimachos.coref.paintingStrategies.BackgroundGCDrawingStrategy;
import de.uniwue.mk.athen.textwidget.struct.AnnoStyle;
import de.uniwue.mk.kall.athen.part.editor.annotations.ATHENEditorDrawingInfo;
......@@ -1971,7 +1970,8 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(metaDataList.get(0), timeStampFeat, timestampValue, true);
String versionValue = metaDataList.get(0).getFeatureValueAsString(versionFeat);
versionValue = "0.0.7_1a 0.0.1s";
//versionValue = "0.0.7_1a 0.0.1s";
versionValue = "0.0.8a 0.0.1s";
updateAnnotation(metaDataList.get(0), versionFeat, versionValue, true);
}
......@@ -1980,6 +1980,7 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
public void onEditorSaved(Event e)
{
createMetadata();
rwViewComposite.refreshMetadataButton();
}
......
......@@ -24,13 +24,13 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
static RedeWiedergabeView part;
private JComboBox<String> titleComboBox;
private JComboBox<String> authorComboBox;
private JTextField titleField = new JTextField(20);
private JTextField authorField = new JTextField(20);
private Color thistle = new Color(216,191,216);
private String corpuspartArray [] = {"not defined", "famz", "erz", "zeit"};
private JComboBox<String> corpuspartComboBox = new JComboBox<String>(corpuspartArray);
private JComboBox<String> corpuspartComboBox= new JComboBox<String>(corpuspartArray);
private String fictionalArray [] = {"not defined", "yes", "no", "unsure"};
private JComboBox<String> fictionalComboBox = new JComboBox<String>(fictionalArray);
......@@ -38,7 +38,7 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
private String narrativeArray [] = {"not defined", "yes", "no", "unsure"};
private JComboBox<String> narrativeComboBox = new JComboBox<String>(narrativeArray);
private String textTypeArray[] = {"", "Erzähltext", "Kommentar", "Anzeige", "Nachrichten", "Rezension", "Reportage", "Biographie",
private String textTypeArray[] = {"unsure", "Erzähltext", "Kommentar", "Anzeige", "Nachrichten", "Rezension", "Reportage", "Biographie",
"Reisebericht/Brief"};
private JComboBox<String> textTypeComboBox = new JComboBox<String>(textTypeArray);
......@@ -67,31 +67,24 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
constraints.gridx = 1;
if (label.getText().equals("Title")){
String titleArray[] = {metadataVal.get(i)};
titleComboBox = new JComboBox<String>(titleArray);
panel.add(titleComboBox, constraints);
titleComboBox.setSelectedItem(metadataVal.get(i));
titleComboBox.setEditable(true);
panel.add(titleField, constraints);
titleField.setText(metadataVal.get(i));
}
if (label.getText().equals("Author")){
String authorArray[] = {metadataVal.get(i)};
authorComboBox = new JComboBox<String>(authorArray);
panel.add(authorComboBox, constraints);
authorComboBox.setSelectedItem(metadataVal.get(i));
authorComboBox.setEditable(true);
panel.add(authorField, constraints);
authorField.setText(metadataVal.get(i));
}
if (label.getText().equals("Id") || label.getText().equals("OrigFile") || label.getText().equals("Year") || label.getText().equals("Decade")
|| label.getText().equals("Textlength") || label.getText().equals("SampleID") || label.getText().equals("Periodical") ||
label.getText().equals("Name") || label.getText().equals("Timestamp") || label.getText().equals("Version"))
{
String valueArray[] = {metadataVal.get(i)};
JComboBox<String> comboBox = new JComboBox<String>(valueArray);
panel.add(comboBox, constraints);
comboBox.setSelectedItem(metadataVal.get(i));
comboBox.setEditable(false);
comboBox.setBackground(thistle);
JTextField field = new JTextField(20);
panel.add(field, constraints);
field.setText(metadataVal.get(i));
field.setEditable(false);
field.setBackground(thistle);
}
else if (label.getText().equals("Corpuspart")){
......@@ -131,7 +124,16 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
narrativeComboBox.setSelectedItem(narrativeArray[0]);
}
}
}
}
/*
else if (label.getText().equals("title") || label.getText().equals("Author")){
JTextField field = new JTextField(50);
field.setText(metadataVal.get(i));
panel.add(field, constraints);
}
*/
}
constraints.gridx = 0;
......@@ -170,9 +172,9 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
String titleInput = titleComboBox.getSelectedItem().toString();
String titleInput = titleField.getText();
part.setTitleInput(titleInput);
String authorInput = authorComboBox.getSelectedItem().toString();
String authorInput = authorField.getText();
part.setAuthorInput(authorInput);
String corpuspartInput = corpuspartComboBox.getSelectedItem().toString();
part.setCorpuspartInput(corpuspartInput);
......
......@@ -3,7 +3,6 @@ package de.ids.tt.athen.rwview.ui;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JSeparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
......@@ -14,7 +13,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import de.ids.tt.athen.rwview.part.RedeWiedergabeView;
......@@ -41,13 +39,14 @@ public class RwViewButtonComposite extends Composite {
private Button buttonMediumAmbig;
//Buttons of the fourth row
private Button buttonEditMetadata;
public Button buttonEditMetadata;
// flags for the rType buttons
private boolean dirFlag = false;
private boolean indirFlag = false;
private boolean freeIndirFlag = false;
private boolean repFlag = false;
public boolean metadataFlag = false;
// the controller
private RedeWiedergabeView part;
......@@ -94,13 +93,6 @@ public class RwViewButtonComposite extends Composite {
buttonExp = new Button(this, SWT.PUSH);
buttonExp.setText("IntExpr");
// needs a dummy because this row has only three buttons
//new Label(this, SWT.NONE).setVisible(false);
// needs a dummy because this row has only three buttons
// new Label(this, SWT.NONE).setVisible(false);
buttonDir = new Button(this, SWT.PUSH);
buttonDir.setText("Direct");
buttonDir.setBackground(new Color(device, 255, 182, 193));
......@@ -161,28 +153,31 @@ public class RwViewButtonComposite extends Composite {
}
public void checkCreateFrameSpeakerExpr() {
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || repFlag == true
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || repFlag == true || metadataFlag == true
|| buttonRwTypeAmbig.getEnabled() == false) {
buttonDir.setEnabled(true);
buttonInd.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
dirFlag = false;
indirFlag = false;
freeIndirFlag = false;
repFlag = false;
metadataFlag = false;
}
}
public void checkCreateDir() {
if (indirFlag == true || freeIndirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false) {
if (indirFlag == true || freeIndirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false || metadataFlag == true) {
buttonInd.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
indirFlag = false;
freeIndirFlag = false;
repFlag = false;
......@@ -190,6 +185,7 @@ public class RwViewButtonComposite extends Composite {
ambigRTypeDialog.indirFlag = false;
ambigRTypeDialog.freeIndFlag = false;
ambigRTypeDialog.repFlag = false;
metadataFlag = false;
}
dirFlag = true;
buttonDir.setEnabled(false);
......@@ -198,14 +194,16 @@ public class RwViewButtonComposite extends Composite {
}
public void checkCreateInd() {
if (dirFlag == true || freeIndirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false) {
if (dirFlag == true || freeIndirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false || metadataFlag == true) {
buttonDir.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
dirFlag = false;
freeIndirFlag = false;
repFlag = false;
metadataFlag = false;
}
indirFlag = true;
buttonInd.setEnabled(false);
......@@ -214,14 +212,16 @@ public class RwViewButtonComposite extends Composite {
}
public void checkCreateFreeInd() {
if (dirFlag == true || indirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false) {
if (dirFlag == true || indirFlag == true || repFlag == true || buttonRwTypeAmbig.getEnabled() == false || metadataFlag == true) {
buttonDir.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
dirFlag = false;
indirFlag = false;
repFlag = false;
metadataFlag = false;
}
freeIndirFlag = true;
buttonFreeInd.setEnabled(false);
......@@ -232,11 +232,12 @@ public class RwViewButtonComposite extends Composite {
}
public void checkCreateRep() {
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || buttonRwTypeAmbig.getEnabled() == false) {
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || buttonRwTypeAmbig.getEnabled() == false || metadataFlag == true) {
buttonDir.setEnabled(true);
buttonInd.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
dirFlag = false;
indirFlag = false;
freeIndirFlag = false;
......@@ -244,6 +245,7 @@ public class RwViewButtonComposite extends Composite {
ambigRTypeDialog.indirFlag = false;
ambigRTypeDialog.freeIndFlag = false;
ambigRTypeDialog.repFlag = false;
metadataFlag = false;
}
repFlag = true;
buttonRep.setEnabled(false);
......@@ -254,15 +256,17 @@ public class RwViewButtonComposite extends Composite {
public void checkCreateRwTypeAmbig() {
buttonRwTypeAmbig.setEnabled(false);
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || repFlag == true) {
if (dirFlag == true || indirFlag == true || freeIndirFlag == true || repFlag == true || metadataFlag == true) {
buttonDir.setEnabled(true);
buttonInd.setEnabled(true);
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonEditMetadata.setEnabled(true);
dirFlag = false;
indirFlag = false;
freeIndirFlag = false;
repFlag = false;
metadataFlag = false;
}
{
part.createTypeAmbig();
......@@ -283,6 +287,8 @@ public class RwViewButtonComposite extends Composite {
repFlag = false;
}
{
metadataFlag = true;
buttonEditMetadata.setEnabled(false);
part.createEditMetadata();
}
}
......@@ -301,6 +307,8 @@ public class RwViewButtonComposite extends Composite {
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
metadataFlag = false;
// buttonSpeech.addListener(SWT.Selection, (Event e) ->
// part.createSpeech());
part.createSpeech();
......@@ -319,6 +327,8 @@ public class RwViewButtonComposite extends Composite {
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
metadataFlag = false;
// buttonThought.addListener(SWT.Selection, (Event e) ->
// part.createThought());
part.createThought();
......@@ -337,6 +347,8 @@ public class RwViewButtonComposite extends Composite {
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
metadataFlag = false;
// buttonWriting.addListener(SWT.Selection, (Event e) ->
// part.createWriting());
part.createWriting();
......@@ -355,6 +367,8 @@ public class RwViewButtonComposite extends Composite {
buttonFreeInd.setEnabled(true);
buttonRep.setEnabled(true);
buttonRwTypeAmbig.setEnabled(true);
buttonEditMetadata.setEnabled(true);
metadataFlag = false;
part.createMediumAmbig();
}
}
......
......@@ -20,7 +20,6 @@ public class RwViewComposite extends Composite {
private RwViewButtonComposite rwViewButtonComposite;
private RwFrameTableComposite rwFrameTableComposite;
private RwStwrTableComposite rwStwrTableComposite;
//private EditMetadataComposite editMetadataComposite;
public RwViewComposite(Composite parent, int style) {
super(parent, style);
......@@ -48,15 +47,6 @@ public class RwViewComposite extends Composite {
rwFrameTableComposite.setInput(part);
GridData gd = new GridData(GridData.GRAB_VERTICAL | GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
rwFrameTableComposite.setLayoutData(gd);
/*
editMetadataComposite = new EditMetadataComposite(this, SWT.BORDER);
editMetadataComposite.setInput(part);
GridData gridData = new GridData(GridData.GRAB_VERTICAL | GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL);
editMetadataComposite.setLayoutData(gridData);
*/
}
public void refresh(List<AnnotationFS> frameList, List<AnnotationFS> stwrList){
......@@ -74,5 +64,12 @@ public class RwViewComposite extends Composite {
{
rwFrameTableComposite.refreshSelection(sel);
}
public void refreshMetadataButton(){
if (rwViewButtonComposite.metadataFlag == true){
rwViewButtonComposite.buttonEditMetadata.setEnabled(true);
rwViewButtonComposite.metadataFlag = false;
}
}
}
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