コード例 #1
0
  /**
   * given an AgentID, find the text span associated with this Agent and highlight the appropriate
   * areas in the raw text panel
   *
   * @param agentRef the AgentID
   */
  public void highlightText(Annotation an, Color highlightTextColor) {

    if (an != null) {
      // highlight the annotation
      // also define color to the highlight
      tvPanel.highlightSpan(
          an.getStartOffset(), an.getEndOffset() - an.getStartOffset(), highlightTextColor);
    }
  }
コード例 #2
0
  public void setDoc(Document document) {
    predictionPanel.clear();

    doc = document;

    tvPanel.clearHighlights();
    displayRawText();

    predictionPanel.redraw();
    fileNameField.setText(doc.getDocumentId());
  }
コード例 #3
0
  /**
   * This constructor sets up much of the functionality of the GUI, including the actual layout of
   * the components of the GUI, as well as handling the graph implementation.
   */
  public MainWindow(Iterable<Document> corp) {

    corpus = corp;
    corpusIndex = corpus.iterator();
    doc = corpusIndex.next();
    /*
     * GUI Layout Creation
     */

    // create the OverviewPanel which shows a reduced size snapshot of the entire graph
    predictionPanel = new PredictionListPanel(this);
    predictionPanel.setFont(font);
    tvPanel = new TextViewPanel(this);
    tvPanel.setFont(font);

    textSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, predictionPanel, tvPanel);
    textSplitPane.setDividerLocation(300);

    buttonPanel = createForwardBackPanel(doc);
    buttonPanel.setFont(font);
    editPanel = new PredictionEditPanel(this);
    editPanel.setFont(font);

    JSplitPane bottomSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, editPanel, buttonPanel);
    bottomSplitPane.setDividerLocation(120);
    mainSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, textSplitPane, bottomSplitPane);
    mainSplitPane.setDividerLocation(700);

    getContentPane().add(mainSplitPane);
    // splitPane1.setDividerLocation(0.8);
    this.setTitle("Prediction Viewer");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    displayRawText();
    pack();
    setSize(1200, 900);
    setVisible(true);
  }
コード例 #4
0
 /** clears the raw text panel of all highlights */
 public void clearHighlights() {
   tvPanel.clearHighlights();
 }
コード例 #5
0
 /**
  * highlights text
  *
  * @param start the offset at which to start highlighting
  * @param end the offset at which to finish highlighting
  */
 public void highlightText(int start, int end, Color highlightTextColor) {
   // also define color to the highlight
   tvPanel.highlightSpan(start, end - start, highlightTextColor);
 }
コード例 #6
0
 /**
  * displays the raw text of the document in the text panel
  *
  * @param xmlFile the XML Summary File
  */
 public void displayRawText() {
   tvPanel.clearPanel();
   tvPanel.setInitialText(doc.getText());
   fileDisplayed = true;
 }