diff --git a/README.md b/README.md
index 126f4e2..5f1349f 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Arguments-enhanced IR
-![version](https://img.shields.io/badge/version-0.7.0-blue)
-![last-update](https://img.shields.io/badge/last_update-2/9/2022-orange)
+![version](https://img.shields.io/badge/version-0.8.0-blue)
+![last-update](https://img.shields.io/badge/last_update-2/10/2022-orange)
![license](https://img.shields.io/badge/license-Apache_2.0-brightgreen)
Argument-enhanced information retrieval project repository. A case study in the Decide Madrid database.
diff --git a/code/ArgumentIR/Resources/views/proposal-info.html b/code/ArgumentIR/Resources/views/proposal-info.html
index 0676b31..30a6fa5 100644
--- a/code/ArgumentIR/Resources/views/proposal-info.html
+++ b/code/ArgumentIR/Resources/views/proposal-info.html
@@ -8,7 +8,7 @@
- Districts: $DISTRICTS$
- Categories: $CATEGORIES$
- Topics: $TOPICS$
-
Link: $URL$
+ Decide Madrid link
Comments:
$COMMENTS$
diff --git a/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.form b/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.form
index 8640d57..af5e223 100644
--- a/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.form
+++ b/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.form
@@ -91,7 +91,7 @@
-
+
@@ -126,7 +126,7 @@
-
+
@@ -159,10 +159,10 @@
-
-
-
-
+
+
+
+
diff --git a/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.java b/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.java
index c337af8..3c45080 100644
--- a/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.java
+++ b/code/ArgumentIR/src/es/uam/irg/ir/gui/ArgumentIRForm.java
@@ -18,9 +18,13 @@
package es.uam.irg.ir.gui;
import es.uam.irg.utils.FunctionUtils;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
+import javax.swing.event.HyperlinkEvent;
import javax.swing.text.BadLocationException;
/**
@@ -40,6 +44,7 @@ public class ArgumentIRForm extends javax.swing.JFrame {
public ArgumentIRForm() {
initComponents();
this.txtResult.setContentType(HTML_CONTENT_TYPE);
+ this.txtResult.setEditable(false);
this.model = new ArgumentIRModel(DECIMAL_FORMAT, DATE_FORMAT);
}
@@ -86,7 +91,7 @@ private void initComponents() {
txtQuery = new javax.swing.JTextField();
btnSearch = new javax.swing.JButton();
scrollPane = new javax.swing.JScrollPane();
- txtResult = new javax.swing.JTextPane();
+ txtResult = new javax.swing.JEditorPane();
lblTop = new javax.swing.JLabel();
cmbTop = new javax.swing.JComboBox<>();
lblRerankBy = new javax.swing.JLabel();
@@ -117,7 +122,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
- txtResult.setEditable(false);
+ txtResult.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
+ public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
+ txtResultHyperlinkUpdate(evt);
+ }
+ });
scrollPane.setViewportView(txtResult);
lblTop.setText("Top:");
@@ -178,7 +187,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(lblRerankBy)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(cmbReranks, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(200, Short.MAX_VALUE))
+ .addContainerGap(743, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(txtQuery)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -203,7 +212,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(lblRerankBy)
.addComponent(cmbReranks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
- .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
+ .addComponent(scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 466, Short.MAX_VALUE)
.addGap(20, 20, 20))
);
@@ -272,6 +281,24 @@ private void mItemExportTextActionPerformed(java.awt.event.ActionEvent evt) {//G
}
}//GEN-LAST:event_mItemExportTextActionPerformed
+ /**
+ * Event: Catch events of hyperlinks.
+ *
+ * @param evt
+ */
+ private void txtResultHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {//GEN-FIRST:event_txtResultHyperlinkUpdate
+ // TODO add your handling code here:
+ if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ if (Desktop.isDesktopSupported()) {
+ try {
+ Desktop.getDesktop().browse(evt.getURL().toURI());
+ } catch (URISyntaxException | IOException ex) {
+ Logger.getLogger(ArgumentIRForm.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ }
+ }//GEN-LAST:event_txtResultHyperlinkUpdate
+
/**
*
* @return
@@ -302,7 +329,7 @@ private String selectExportFile(String ext) {
private javax.swing.JPopupMenu.Separator menuSeparator;
private javax.swing.JScrollPane scrollPane;
private javax.swing.JTextField txtQuery;
- private javax.swing.JTextPane txtResult;
+ private javax.swing.JEditorPane txtResult;
// End of variables declaration//GEN-END:variables
}