Integration

Now that we have defined our adapter class, we must make some changes to Araucaria so that it can use Dungine. There are two changes to make.

  1. Add menu item to turn on Dungine
  2. Add indicator of accepted status to main arguments in diagrams.

The first is straightforward - we include a flag, say "dungineEvaluate" in the Araucaria class and add a menu item to control it. The second is more complex. Probably the least efficient way of adding an indicator of accepted status to main arguments is to calculate whether each node is accepted every time it's drawn, but this is what we'll do. You need to add the following code to the FullTextPanel.drawTree(Graphics2D gg) method:

if (argument.getDungEvaluate()) { // check if dung evaluation is intended
      Dungine<TreeVertex> engine = new Dungine<TreeVertex>(new AraucariaArgumentSource(argument));
      List<Dialogue<TreeVertex>> results = engine.createQuery(vertex).getDialogues();
      if (results.size()>0) { // no result means that the AraucariaArgumentSource doesnt think this vertex represents a main argumentI'm sure
            Rectangle bounds = vertex.getShape(this).getBounds();
            Image icon;
            if (results.get(0).isSubjectDefended()) {
                  // draw tick
                  icon = new ImageIcon("images/accepted.gif").getImage();
            } else {
                  // draw cross
                  icon = new ImageIcon("images/notaccepted.gif").getImage();
            }
            gg.drawImage(icon, corner.x + (bounds.width/2)- 18, corner.y + bounds.height - 20, null);		      
      }
}

This method works in the examples that I've tried, but it's computational efficiency could be improved with some more work. From a coding perspective, we've tested whether or not an argument is accepted or not in a very few lines of code. The next screen shot shows the original screenshot, after Dungine integration.

a screenshot of Araucaria
Screenshot 3: Text view of the original example argument map with icons indicating the accepted status of main arguments

From a Dung perspective, the network is very simple, there is one main argument attacking another one. In any semantics, the attacking argument wins. To demonstrate a slightly more complex argument network, the final screenshot shows a different view of a larger argument map annotated with Dungine acceptability.

a screenshot of Araucaria
Screenshot 3: Scaled standard view with green/red halos indicating the accepted status of main arguments in a more complex argument map.

This article provides an example of how straightforward it can be to integrate Dungine with another application. Many thanks are due to the Araucaria team for producing a tool that was so easy to use, and apologies are due in advance if I have misrepresented any of Araucaria's features. The code needed for this Dungine/Araucaria mashup can be found here.