Commit 2324e537 authored by Markus Krug's avatar Markus Krug
Browse files

Merge branch 'redeWiedergabe_dev' into 'master'

macOS version of athen with comboBoxes

See merge request !73
parents c8b35780 b93295e8
Pipeline #9915 passed with stages
in 20 minutes and 25 seconds
......@@ -1967,8 +1967,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.8a 0.0.1s";
versionValue = "0.0.8_1a 0.0.1s";
//versionValue = "0.0.8a 0.0.1s";
updateAnnotation(metaDataList.get(0), versionFeat, versionValue, true);
}
......
......@@ -24,13 +24,13 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
static RedeWiedergabeView part;
private JTextField titleField = new JTextField(20);
private JTextField authorField = new JTextField(20);
private JComboBox<String> titleComboBox;
private JComboBox<String> authorComboBox;
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);
......@@ -67,24 +67,31 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
constraints.gridx = 1;
if (label.getText().equals("Title")){
panel.add(titleField, constraints);
titleField.setText(metadataVal.get(i));
String titleArray[] = {metadataVal.get(i)};
titleComboBox = new JComboBox<String>(titleArray);
panel.add(titleComboBox, constraints);
titleComboBox.setSelectedItem(metadataVal.get(i));
titleComboBox.setEditable(true);
}
if (label.getText().equals("Author")){
panel.add(authorField, constraints);
authorField.setText(metadataVal.get(i));
String authorArray[] = {metadataVal.get(i)};
authorComboBox = new JComboBox<String>(authorArray);
panel.add(authorComboBox, constraints);
authorComboBox.setSelectedItem(metadataVal.get(i));
authorComboBox.setEditable(true);
}
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"))
{
JTextField field = new JTextField(20);
panel.add(field, constraints);
field.setText(metadataVal.get(i));
field.setEditable(false);
field.setBackground(thistle);
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);
}
else if (label.getText().equals("Corpuspart")){
......@@ -124,16 +131,7 @@ 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;
......@@ -172,9 +170,9 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
String titleInput = titleField.getText();
String titleInput = titleComboBox.getSelectedItem().toString();
part.setTitleInput(titleInput);
String authorInput = authorField.getText();
String authorInput = authorComboBox.getSelectedItem().toString();
part.setAuthorInput(authorInput);
String corpuspartInput = corpuspartComboBox.getSelectedItem().toString();
part.setCorpuspartInput(corpuspartInput);
......
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