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 { ...@@ -1967,8 +1967,8 @@ public class RedeWiedergabeView extends AEditorSubordinateViewPart {
updateAnnotation(metaDataList.get(0), timeStampFeat, timestampValue, true); updateAnnotation(metaDataList.get(0), timeStampFeat, timestampValue, true);
String versionValue = metaDataList.get(0).getFeatureValueAsString(versionFeat); String versionValue = metaDataList.get(0).getFeatureValueAsString(versionFeat);
//versionValue = "0.0.7_1a 0.0.1s"; versionValue = "0.0.8_1a 0.0.1s";
versionValue = "0.0.8a 0.0.1s"; //versionValue = "0.0.8a 0.0.1s";
updateAnnotation(metaDataList.get(0), versionFeat, versionValue, true); updateAnnotation(metaDataList.get(0), versionFeat, versionValue, true);
} }
......
...@@ -24,13 +24,13 @@ public class EditMetadataDialog extends JFrame implements ActionListener { ...@@ -24,13 +24,13 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
static RedeWiedergabeView part; static RedeWiedergabeView part;
private JTextField titleField = new JTextField(20); private JComboBox<String> titleComboBox;
private JTextField authorField = new JTextField(20); private JComboBox<String> authorComboBox;
private Color thistle = new Color(216,191,216); private Color thistle = new Color(216,191,216);
private String corpuspartArray [] = {"not defined", "famz", "erz", "zeit"}; 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 String fictionalArray [] = {"not defined", "yes", "no", "unsure"};
private JComboBox<String> fictionalComboBox = new JComboBox<String>(fictionalArray); private JComboBox<String> fictionalComboBox = new JComboBox<String>(fictionalArray);
...@@ -67,24 +67,31 @@ public class EditMetadataDialog extends JFrame implements ActionListener { ...@@ -67,24 +67,31 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
constraints.gridx = 1; constraints.gridx = 1;
if (label.getText().equals("Title")){ if (label.getText().equals("Title")){
panel.add(titleField, constraints); String titleArray[] = {metadataVal.get(i)};
titleField.setText(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")){ if (label.getText().equals("Author")){
panel.add(authorField, constraints); String authorArray[] = {metadataVal.get(i)};
authorField.setText(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") 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("Textlength") || label.getText().equals("SampleID") || label.getText().equals("Periodical") ||
label.getText().equals("Name") || label.getText().equals("Timestamp") || label.getText().equals("Version")) label.getText().equals("Name") || label.getText().equals("Timestamp") || label.getText().equals("Version"))
{ {
JTextField field = new JTextField(20); String valueArray[] = {metadataVal.get(i)};
panel.add(field, constraints); JComboBox<String> comboBox = new JComboBox<String>(valueArray);
field.setText(metadataVal.get(i)); panel.add(comboBox, constraints);
field.setEditable(false); comboBox.setSelectedItem(metadataVal.get(i));
field.setBackground(thistle); comboBox.setEditable(false);
comboBox.setBackground(thistle);
} }
else if (label.getText().equals("Corpuspart")){ else if (label.getText().equals("Corpuspart")){
...@@ -125,15 +132,6 @@ public class EditMetadataDialog extends JFrame implements ActionListener { ...@@ -125,15 +132,6 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
} }
} }
} }
/*
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; constraints.gridx = 0;
...@@ -172,9 +170,9 @@ public class EditMetadataDialog extends JFrame implements ActionListener { ...@@ -172,9 +170,9 @@ public class EditMetadataDialog extends JFrame implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String titleInput = titleField.getText(); String titleInput = titleComboBox.getSelectedItem().toString();
part.setTitleInput(titleInput); part.setTitleInput(titleInput);
String authorInput = authorField.getText(); String authorInput = authorComboBox.getSelectedItem().toString();
part.setAuthorInput(authorInput); part.setAuthorInput(authorInput);
String corpuspartInput = corpuspartComboBox.getSelectedItem().toString(); String corpuspartInput = corpuspartComboBox.getSelectedItem().toString();
part.setCorpuspartInput(corpuspartInput); 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