From 7dbde48298daecc0ac0671e6c88635a02394aa31 Mon Sep 17 00:00:00 2001 From: Jonathan-Kalmbach Date: Wed, 10 Jul 2024 05:55:55 +0000 Subject: [PATCH] Dateien nach "visualization" hochladen --- visualization/ParameterArea.class | Bin 0 -> 449 bytes visualization/ParameterArea.java | 41 ++++++++++ visualization/TextArea.class | Bin 0 -> 2014 bytes visualization/TextArea.java | 124 ++++++++++++++++++++++++++++++ visualization/package.html | 1 + 5 files changed, 166 insertions(+) create mode 100644 visualization/ParameterArea.class create mode 100644 visualization/ParameterArea.java create mode 100644 visualization/TextArea.class create mode 100644 visualization/TextArea.java create mode 100644 visualization/package.html diff --git a/visualization/ParameterArea.class b/visualization/ParameterArea.class new file mode 100644 index 0000000000000000000000000000000000000000..9e87f3387ec8720497c162ee84a7612abca798d3 GIT binary patch literal 449 zcmaJ-O-sW-5Ph4ZiH)iK@S}?O(UVCI2EA4UDR__~g-XHWwk~BQ*+`PM;;&Lr1O8Tu!2)NUr!WB&ISJ*{_gc+x7l& zwfpfT8Hsb5OB+3&@JM7LIZFgT%x7^>hRx9YW3Ig1bYNkLKAOsO!bADMGa0L3!Hc{X z9P)KTvUQ8m0zS)vP8{9EN~o;u4U86@$fVQJp1C + * University of Cooperative Education Stuttgart, + * Campus Horb
+ * Department of Information Technology
+ * it2003
+ */ +public abstract class ParameterArea extends JPanel{ + + /** The parameter area's scroll pane. */ + protected JScrollPane scrollPane; + + /** + * Standard constructor. + * Creates an empty parameter area with scroll pane. + */ + public ParameterArea() { + scrollPane=new JScrollPane(this); + } + + /** + * Returns the parameter area's scroll pane. + * @return the parameter area's scroll pane + */ + public JScrollPane getScrollPane(){ + return scrollPane; + } +} diff --git a/visualization/TextArea.class b/visualization/TextArea.class new file mode 100644 index 0000000000000000000000000000000000000000..c1298f8f5be34ce2c17139b065bc10a11c80192f GIT binary patch literal 2014 zcmbVNT~ixn6n-`&Y_cp6)ACsnn`#ZglGe7iC78B+wbW41U|aBmE@4fVZg$gT1C0Mf z|A04MsAHEIopHSOH#v^a*-apTc;U_2v+wzO&U4Pb`{&=k{tn;+>}nXtZ54MkL@=Ge zTgWFcgO4<71<~$`c2C585wj}h;+WUag9UkCl#mCaJ=Cy-M=Cy+mtq{t8XjXsLkg>M z@`;L1H4Njnh*BJD^88FJPgFcr@l1i%DA!%vUNsz3!ANn(*fsWZjXle$ zY&TJ>TaH)q%$kB&pa+0An6%^><(JDwEx^es(4lObMqR(X6)$vH*in!=J$4;0VJm=& zstyOPjv8zouRsa{usPe{o|HUNSeb2F_O@9Ub3=im>F~t4Db9ntR-r7mvNM7fQr^o!&(c__yG@7O zoI93Pd}MiImAYv69xai0~OZ*6hN^2*kZS(dL*rBRqV=@5>A4#|L`4mA80%~#}~ zkOx{g0&6Sf1ed*!N#{-87FJD0#0aBSGljHc5v>~1^_9*{?elO39i>}aK~!1h-QCA z%ttpLs*iZK%SR%c9Py#isb@W zOcKodxI!sl#`qK>V%c91{gF!8Q^?LL-=@&UohE9*-F>3G{GEVjh+(~>MDCF5bgM*n z)<^Q`5$rH-lX1`K!7GGPAbp3fAmb(>_4|0^52T6=J(oJ~W8ho#WhZ?M`WX5i1rB9+ z{Qx6k_A#2eKoMF;eZ1*otnF~hG8FxRr6R!qM>!Cn!r$f#a<{{QR>`2ltFgv$g6u~A mLR!W3X(GIF*w-b73w3H%kd2*eOvb!Vmv8}ZauKB7t$zTp_Q9S2 literal 0 HcmV?d00001 diff --git a/visualization/TextArea.java b/visualization/TextArea.java new file mode 100644 index 0000000..ee0a5c8 --- /dev/null +++ b/visualization/TextArea.java @@ -0,0 +1,124 @@ +/** + * + */ +package visualization; + +import java.awt.Color; +import java.awt.Font; + +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + +import logging.LogElement; +import logging.LogElementList; + +/** + * This class provides the basic text output area for a HybridWindow. + * Use it in assoziation with packages logging and visualization. + * Just overwrite the print method to get a textual output of a log list element. + * Parameters for algorithm processing are read from member parameterArea that ist part of the user interface. + * @see logging.Algorithm + * @see LogElement + * @see LogElementList + * @see visualization.DrawArea + * @see visualization.HybridWindow + * @see visualization.ParameterArea + * @see visualization.TextArea + * @see javax.swing.JTextArea + * @author Björn Strobel
+ * University of Cooperative Education Stuttgart, + * Campus Horb
+ * Department of Information Technology
+ * it2003
+ */ +public abstract class TextAreaextends JTextArea{ + + /** The text area's scroll pane. */ + protected JScrollPane scrollPane; + /** The log element list where the text area gets the log elements. */ + protected LogElementListlogList; + + /** + * Standard constructor. + * Creates an empty text area with scroll pane. + */ + public TextArea() { + super(); + + scrollPane=new JScrollPane(this); + + setBackground(Color.black); + setForeground(Color.green); + setEditable(false); + setColumns(25); + setRows(5); + setFont(new Font("Monospaced",Font.PLAIN,12)); + } + + /** + * Creates an empty text area with scroll pane and sets the specified log list. + * @param logList the text area's log list + */ + public TextArea(LogElementListlogList){ + super(); + + scrollPane=new JScrollPane(this); + + setBackground(Color.black); + setForeground(Color.green); + setEditable(false); + setColumns(25); + setRows(5); + setFont(new Font("Monospaced",Font.PLAIN,12)); + + this.logList=logList; + } + + /** + * Returns the text area's scroll pane. + * @return the text area's scroll pane + */ + public JScrollPane getScrollPane(){ + return scrollPane; + } + + /** + * Sets the text area's logList. + * @param logList the text area's logList + */ + public void setLogList(LogElementListlogList){ + this.logList=logList; + } + + /** + * Provided for convenience. Calls print(); + */ + public void printStep(){ + print(); + } + + /** + * Prints the actual algorithm step's description. + * It is suggested to overwrite this method. + */ + //public void print(){ + public boolean print(){ + LogElement logElement=(LogElement)logList.get(); + if(getText().equals("")){ + //setText(logElement.getDescription()); + append(logElement.getDescription()); + } + else{ + setText(getText()+"\n"+logElement.getDescription()); + append("\n"+logElement.getDescription()); + } + return true; + } + + /** + * Clears the text area + */ + public void clear(){ + setText(""); + } +} diff --git a/visualization/package.html b/visualization/package.html new file mode 100644 index 0000000..266e37d --- /dev/null +++ b/visualization/package.html @@ -0,0 +1 @@ +Provides the classes necessary to create a visualization of a logged algorithm. \ No newline at end of file