private void canvasClick ( int x , int y ) { //always called listeners for ( CanvasClickListener listener : canvasClickAlwaysListeners ) listener . canvasClicked ( x , y ) ; //selected listener by toggle buttons for ( JToggleButton button : canvasClickToggleListeners . keySet ( ) ) { if ( button . isSelected ( ) ) canvasClickToggleListeners . get ( button ) . canvasClicked ( x , y ) ; } /*if (lookupButton.isSelected()) { if (proc.getAreaTree() != null) { Area node = proc.getAreaTree().getAreaAt(x, y); if (node != null) { showAreaInTree(node); showAreaInLogicalTree(node); } } //lookupButton.setSelected(false); } if (boxLookupButton.isSelected()) { Box node = proc.getPage().getBoxAt(x, y); if (node != null) showBoxInTree(node); //boxLookupButton.setSelected(false); } if (sepLookupButton.isSelected()) { showSeparatorAt(x, y); } if (extractButton.isSelected()) { AreaNode node = proc.getAreaTree().getAreaAt(x, y); if (node != null) { proc.getExtractor().findArticleBounds(node); try { PrintStream exs = new PrintStream(new FileOutputStream("test/extract.html")); proc.getExtractor().dumpTo(exs); exs.close(); } catch (java.io.IOException e) { System.err.println("Output failed: " + e.getMessage()); } //String s = ex.getDescriptionX(node, 2); //System.out.println("Extracted: " + s); } extractButton.setSelected(false); }*/ }
This is called when the browser canvas is clicked