Web100 Network Diagnostic Tool (NDT) Java Applet

Version 3.7.0.2 (May 20, 2015)
From: https://github.com/ndt-project/ndt/releases
Unmodified, as baseline for future merges.
Will not compile, changes adapted from BiglyBT to follow.
Copyright 2003 University of Chicago.
3-clause license with requirement that:
  Modified copies and works based on the Software must carry prominent
  notices stating that you changed specified portions of the Software.
See LICENSE.txt and licenses/LICENSE-NDT.txt
This commit is contained in:
zzz
2018-11-13 16:58:05 +00:00
parent e326011a93
commit 6f7881c7ea
22 changed files with 7936 additions and 3 deletions

View File

@@ -0,0 +1,54 @@
package edu.internet2.ndt;
import javax.swing.*;
import javax.swing.text.BadLocationException;
import java.awt.*;
/*
* Class that extends TextPane. This Text-pane is used as the chief
* Results window that summarizes the results of all tests
* that have been run.
*
* This class is declared separately so that it can be easily extended
* by users to customize based on individual needs
*
*/
public class ResultsTextPane extends JTextPane {
/**
* Compiler auto-generate value not directly related to class functionality
*/
private static final long serialVersionUID = -2224271202004876654L;
/**
* Method to append String into the current document
*
* @param paramTextStr
* String to be inserted into the document
**/
public void append(String paramTextStr) {
try {
getStyledDocument().insertString(getStyledDocument().getLength(),
paramTextStr, null);
} catch (BadLocationException e) {
System.out
.println("WARNING: failed to append text to the text pane! ["
+ paramTextStr + "]");
}
}
/**
* JTextPane method to insert a component into the document as a replacement
* for currently selected content. If no selection is made, the the
* component is inserted at the current position of the caret.
*
* @param paramCompObj
* the component to insert
* */
public void insertComponent(Component paramCompObj) {
setSelectionStart(this.getStyledDocument().getLength());
setSelectionEnd(this.getStyledDocument().getLength());
super.insertComponent(paramCompObj);
}
}