Commit 28d56ca2 authored by Christos Christodoulopoulos's avatar Christos Christodoulopoulos
Browse files

Version 3.24 released

Brought back the incremental number IDs (as a menu option)
parent a56d94e9
Manifest-Version: 1.0
Main-Class: jubilee.toolkit.Jubilee
......@@ -41,6 +41,7 @@ public class JBMenuBar extends JMenuBar {
private JMenu mn_args;
JMenuItem fileOpen, fileSave, fileSaveAs, fileQuit;
JCheckBoxMenuItem shownIncrementalIDs;
JMenuItem tbPrev, tbNext, tbJump, tbView;
JMenuItem fsPrev, fsNext, fsViewExample, fsViewArgument, fsViewRolesetComment;
JMenuItem[] argArgs, argFunc;
......@@ -58,6 +59,7 @@ public class JBMenuBar extends JMenuBar {
this.menuShortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
initMenuFile();
initMenuView();
initMenuTreebank();
initMenuFrameset();
initMenuArgument();
......@@ -116,6 +118,21 @@ public class JBMenuBar extends JMenuBar {
add(mFile);
}
private void initMenuView() {
JMenu mView = new JMenu("View");
mView.setMnemonic(KeyEvent.VK_V);
shownIncrementalIDs = new JCheckBoxMenuItem("Show incremental IDs");
//Enable the incremental IDs by default
shownIncrementalIDs.setState(true);
shownIncrementalIDs.setMnemonic(KeyEvent.VK_I);
shownIncrementalIDs.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, menuShortcutKeyMask));
shownIncrementalIDs.addActionListener(jbtk);
mView.add(shownIncrementalIDs);
add(mView);
}
private void initMenuTreebank() {
JMenu mTreebank = new JMenu("Treebank");
......
......@@ -306,6 +306,7 @@ public class JBToolkit extends JFrame implements ActionListener, ItemListener, L
else if (e.getSource() == mbar.fileSave) menuFileSave();
else if (e.getSource() == mbar.fileSaveAs) menuFileSaveAs();
else if (e.getSource() == mbar.fileQuit) System.exit(0);
else if (e.getSource() == mbar.shownIncrementalIDs) toggleShowIDs();
else if (e.getSource() == mbar.tbPrev || e.getSource() == bt_prev) actionBtPrev();
else if (e.getSource() == mbar.tbNext || e.getSource() == bt_next) actionBtNext();
else if (e.getSource() == mbar.tbJump) menuTbJump();
......@@ -473,12 +474,15 @@ public class JBToolkit extends JFrame implements ActionListener, ItemListener, L
}
private void buildComboBox() {
boolean showIDs = mbar.shownIncrementalIDs.getState();
comboJump.removeAllItems();
for (int i = 0; i < corpus.getSize(); i++) {
JBDataStructure annotation = corpus.getAnnotation(i);
String contextId = corpus.getContext(annotation.getIndexInContext());
String predicate = annotation.getRoleset().split("\\.")[0];
comboJump.insertItemAt(contextId.substring(0, contextId.indexOf(":")) + " - " + predicate, i);
String item = contextId.substring(0, contextId.indexOf(":")) + " - " + predicate;
if (showIDs) item = "(" + i + ") " + item;
comboJump.insertItemAt(item, i);
}
}
......@@ -516,6 +520,13 @@ public class JBToolkit extends JFrame implements ActionListener, ItemListener, L
menuFileSave(filename);
}
// -------------------- Menu-View Action --------------------
private void toggleShowIDs() {
buildComboBox();
comboJump.setSelectedIndex(corpus.getLastEditIndex());
}
// ------------------ Menu-Treebank Action ------------------
private void actionBtPrev() {
......
......@@ -33,7 +33,7 @@ import javax.swing.UnsupportedLookAndFeelException;
* @since 5/11/2014
*/
public class Jubilee {
public static final String VERSION = "3.23";
public static final String VERSION = "3.24";
static public void main(String[] args) {
try {
// Set cross-platform Java L&F (also called "Metal")
......
Supports Markdown
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