|
@@ -19,11 +19,14 @@ import javax.swing.JMenuItem;
|
|
|
import javax.swing.JPanel;
|
|
|
import javax.swing.JPopupMenu;
|
|
|
|
|
|
+
|
|
|
+ * A Console is a Pane where text can be Printed on.
|
|
|
+ *
|
|
|
+ * @author Gruppe14
|
|
|
+ *
|
|
|
+ */
|
|
|
public class Console extends JScrollPane {
|
|
|
|
|
|
-
|
|
|
- *
|
|
|
- */
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
private final JTextPane consoleText = new JTextPane();
|
|
|
private final JPanel panel = new JPanel();
|
|
@@ -35,6 +38,9 @@ public class Console extends JScrollPane {
|
|
|
private JMenuItem itemCopy = new JMenuItem("Copy");
|
|
|
private JMenuItem itemClear = new JMenuItem("Clear Console");
|
|
|
|
|
|
+
|
|
|
+ * Constructor.
|
|
|
+ */
|
|
|
public Console() {
|
|
|
super();
|
|
|
this.setBackground(Color.WHITE);
|
|
@@ -85,7 +91,7 @@ public class Console extends JScrollPane {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Print Text on the console
|
|
|
+ * Print Text on the console.
|
|
|
*
|
|
|
* @param text
|
|
|
* String the Text
|
|
@@ -97,10 +103,9 @@ public class Console extends JScrollPane {
|
|
|
* bold or not
|
|
|
* @param italic
|
|
|
* italic or not
|
|
|
- * @param ln
|
|
|
+ * @param nl
|
|
|
* new line or not
|
|
|
*
|
|
|
- * @return selected CpsObject
|
|
|
*/
|
|
|
public void addText(String text, Color color, int p, boolean bold, boolean italic, boolean nl) {
|
|
|
StyleConstants.setForeground(style, color);
|
|
@@ -118,7 +123,7 @@ public class Console extends JScrollPane {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Print Text on the console in black and font size 12
|
|
|
+ * Print Text on the console in black and font size 12.
|
|
|
*
|
|
|
* @param text
|
|
|
* String the Text
|
|
@@ -136,7 +141,7 @@ public class Console extends JScrollPane {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Clears the console
|
|
|
+ * Clears the console.
|
|
|
*/
|
|
|
public void clearConsole() {
|
|
|
consoleText.setText("");
|