74 lines
18 KiB
Markdown
74 lines
18 KiB
Markdown
#Texteditor
|
|
Texteditor is a program to edit a text by using the input and is then able to output it as desired via the console.
|
|
##Usermanual
|
|
###ADD a paragraph
|
|
```ADD```
|
|
Adds a paragraph with custom text.<br/> <br/>
|
|
Enter the command add to add a new paragraph at the end of text. After submitting the add command you will be prompted to enter the text to add as last paragraph.
|
|
|
|
```ADD [n]```
|
|
Adds a paragraph with custom text at a specific position in text.<br/> <br/>
|
|
Enter the command add with the paragraph number where it should be added.
|
|
After submitting the add [n] command you will be prompted to enter the text to add in the corresponding paragraph.
|
|
|
|
###DUMMY Text
|
|
```DUMMY```
|
|
Inserts a paragraph with dummy text at the end of the text.<br/> <br/>
|
|
Enter the command dummy to enter a pre-written paragraph into the text as your last paragraph.
|
|
|
|
```DUMMY [n]```
|
|
Inserts a paragraph with dummy text at a specific position.<br/> <br/>
|
|
Enter the command dummy with a paragraph number to insert a pre-written dummy text paragraph to a spcific position.
|
|
|
|
###REPLACE a Text
|
|
```REPLACE```
|
|
Replaces desired words in the last paragraph with a desired replacement.<br/> <br/>
|
|
Enter the command replace, after submitting the command replace enter the characters that should be replaced. After submitting the characters you will be
|
|
need to input the characters wich will replace the previous characters.
|
|
|
|
```REPLACE [n]```
|
|
Replaces desired words in the chosen paragraph [n] text with a desired replacement.<br/> <br/>
|
|
Enter the command replace with a desired paragraph where the characters should be replaced,
|
|
after submitting the command replace enter the characters that should be replaced. After submitting the characters you will be
|
|
need to input the characters wich will replace the previous characters.
|
|
|
|
###DELETE a Text
|
|
```DEL```
|
|
Deletes the last paragraph.<br/> <br/>
|
|
Enter the command del to delete the last paragraph.
|
|
|
|
```DEL [n]```
|
|
Deletes the selected paragraph.<br/> <br/>
|
|
Enter the command del with a paragraph number, the corresponding paragraph will then be deleted.
|
|
|
|
###INDEX the words
|
|
```INDEX```
|
|
Diplays the index of words used 3 times or more.<br/> <br/>
|
|
Enter the command index to display the words that are displayed more than three times in the text with their corresponding paragraphs.
|
|
|
|
###Print the Text
|
|
```PRINT```
|
|
Prints the text with the previously set format option.<br/> <br/>
|
|
Enter the command print to print out the current text you have. The Text will be printed with the settings set before (see FORMAT the Text).
|
|
If no settings have been set the standard to output is the FIX format and a line length of 20.
|
|
|
|
###FORMAT the Text
|
|
```FORMAT RAW```
|
|
Sets the format to raw.<br/> <br/>
|
|
Enter the command format raw to change the print format to raw. After you changed the format to raw you can use the command ```PRINT``` again
|
|
and each paragraph will be printed on one line with its corresponding paragraph number.
|
|
|
|
```FORMAT FIX [n]```
|
|
Sets the format fix with the maximum line length.<br/> <br/>
|
|
Enter the command format fix and the max line length which will be used. After you changed the format to fix you can use the command ```PRINT``` again
|
|
and the text will be displayed with the max length in mind and a new line will be created if no space is left for a paragraph.
|
|
If a word is too long to fit the line length, it will be displayed as whole, ignoring the max length.
|
|
|
|
|
|
##Classdiagramm
|
|
|
|
<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="{"highlight":"#0000ff","nav":true,"resize":true,"toolbar":"zoom layers lightbox","edit":"_blank","xml":"<mxfile host=\"drawio-plugin\" modified=\"2021-11-12T16:51:33.181Z\" agent=\"5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36\" etag=\"UV4OUhXHOZGBUB76x4mF\" version=\"14.7.4\" type=\"embed\"><diagram id=\"eWy9IwHxbh3JgAdMnOEg\" name=\"Seite-1\"><mxGraphModel dx=\"2606\" dy=\"774\" grid=\"1\" gridSize=\"10\" guides=\"1\" tooltips=\"1\" connect=\"1\" arrows=\"1\" fold=\"1\" page=\"1\" pageScale=\"1\" pageWidth=\"827\" pageHeight=\"1169\" math=\"0\" shadow=\"0\"><root><mxCell id=\"0\"/><mxCell id=\"1\" parent=\"0\"/><mxCell id=\"9L6EbMpzsWciNYXeLQUw-5\" value=\"TextEditor\" style=\"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;\" parent=\"1\" vertex=\"1\"><mxGeometry x=\"50\" y=\"350\" width=\"220\" height=\"60\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-7\" value=\"\" style=\"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-5\" vertex=\"1\"><mxGeometry y=\"26\" width=\"220\" height=\"8\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-8\" value=\"private static void Main(String[] args)\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-5\" vertex=\"1\"><mxGeometry y=\"34\" width=\"220\" height=\"26\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-12\" value=\"Text\" style=\"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;\" parent=\"1\" vertex=\"1\"><mxGeometry x=\"690\" y=\"210\" width=\"310\" height=\"198\" as=\"geometry\"/></mxCell><mxCell id=\"3\" value=\"- text:ArrayList&lt;String&gt;{final}\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontStyle=0\" parent=\"9L6EbMpzsWciNYXeLQUw-12\" vertex=\"1\"><mxGeometry y=\"26\" width=\"310\" height=\"20\" as=\"geometry\"/></mxCell><mxCell id=\"2\" value=\"- dummyText{final}\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontStyle=4\" parent=\"9L6EbMpzsWciNYXeLQUw-12\" vertex=\"1\"><mxGeometry y=\"46\" width=\"310\" height=\"20\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-14\" value=\"\" style=\"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-12\" vertex=\"1\"><mxGeometry y=\"66\" width=\"310\" height=\"8\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-15\" value=\"+ add(int:n, String):boolean&#10;+ dummy(int:n):boolean&#10;+ replace(int:n, String, String):boolean&#10;+ index():ArrayList&lt;String&gt;&#10;+ getText():ArrayList&lt;String&gt;&#10;+ del(int:n):boolean&#10;- createWordlist(HashMap&lt;String, ArrayList&lt;Integer&gt;&gt;)&#10;- paragraphExists(int):boolean\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;shadow=0;\" parent=\"9L6EbMpzsWciNYXeLQUw-12\" vertex=\"1\"><mxGeometry y=\"74\" width=\"310\" height=\"124\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-16\" value=\"TextLogic\" style=\"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;\" parent=\"1\" vertex=\"1\"><mxGeometry x=\"380\" y=\"347\" width=\"170\" height=\"114\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-17\" value=\"- text Text{final}&#10;- textOutput Textoutput{final}\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-16\" vertex=\"1\"><mxGeometry y=\"26\" width=\"170\" height=\"30\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-18\" value=\"\" style=\"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-16\" vertex=\"1\"><mxGeometry y=\"56\" width=\"170\" height=\"8\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-19\" value=\"+ TextLogik&#10;- isNumeric(String):boolean&#10;- checkIfSuccess(boolean)\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-16\" vertex=\"1\"><mxGeometry y=\"64\" width=\"170\" height=\"50\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-20\" value=\"TextOutput\" style=\"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;\" parent=\"1\" vertex=\"1\"><mxGeometry x=\"690\" y=\"433\" width=\"210\" height=\"217\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-21\" value=\"- formatRaw: boolean&#10;- columnWidth: int\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-20\" vertex=\"1\"><mxGeometry y=\"26\" width=\"210\" height=\"30\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-22\" value=\"\" style=\"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-20\" vertex=\"1\"><mxGeometry y=\"56\" width=\"210\" height=\"8\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-23\" value=\"+ print(ArrayList&lt;String&gt;)&#10;+ formatRaw():boolean&#10;+ formatFix(int)&#10;+ userInfoOutput(String)&#10;+ indexOutput(ArrayList&lt;String&gt;)&#10;+ errorInvalidParagraph()&#10;+ errorInvalidCommand()&#10;+ errorMissingText&#10;- printFormated(ArrayList&lt;String&gt;)&#10;- toFormat(ArrayList&lt;String&gt;)\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-20\" vertex=\"1\"><mxGeometry y=\"64\" width=\"210\" height=\"153\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-24\" value=\"TextInput\" style=\"swimlane;fontStyle=1;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;\" parent=\"1\" vertex=\"1\"><mxGeometry x=\"690\" y=\"670\" width=\"160\" height=\"128\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-25\" value=\"- sc Scanner{final}\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontStyle=4\" parent=\"9L6EbMpzsWciNYXeLQUw-24\" vertex=\"1\"><mxGeometry y=\"26\" width=\"160\" height=\"44\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-26\" value=\"\" style=\"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;\" parent=\"9L6EbMpzsWciNYXeLQUw-24\" vertex=\"1\"><mxGeometry y=\"70\" width=\"160\" height=\"8\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-27\" value=\"+ checkForInput: String[]&#10;+ getTextInput: String\" style=\"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontStyle=4\" parent=\"9L6EbMpzsWciNYXeLQUw-24\" vertex=\"1\"><mxGeometry y=\"78\" width=\"160\" height=\"50\" as=\"geometry\"/></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-36\" value=\"\" style=\"endArrow=classic;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;\" parent=\"1\" source=\"9L6EbMpzsWciNYXeLQUw-21\" target=\"9L6EbMpzsWciNYXeLQUw-17\" edge=\"1\"><mxGeometry width=\"50\" height=\"50\" relative=\"1\" as=\"geometry\"><mxPoint x=\"760\" y=\"480\" as=\"sourcePoint\"/><mxPoint x=\"810\" y=\"430\" as=\"targetPoint\"/></mxGeometry></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-37\" value=\"\" style=\"endArrow=classic;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;\" parent=\"1\" source=\"9L6EbMpzsWciNYXeLQUw-15\" target=\"9L6EbMpzsWciNYXeLQUw-17\" edge=\"1\"><mxGeometry width=\"50\" height=\"50\" relative=\"1\" as=\"geometry\"><mxPoint x=\"700\" y=\"482\" as=\"sourcePoint\"/><mxPoint x=\"550\" y=\"410\" as=\"targetPoint\"/></mxGeometry></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-38\" value=\"\" style=\"endArrow=classic;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;\" parent=\"1\" source=\"9L6EbMpzsWciNYXeLQUw-27\" target=\"9L6EbMpzsWciNYXeLQUw-17\" edge=\"1\"><mxGeometry width=\"50\" height=\"50\" relative=\"1\" as=\"geometry\"><mxPoint x=\"700\" y=\"370\" as=\"sourcePoint\"/><mxPoint x=\"550\" y=\"410\" as=\"targetPoint\"/></mxGeometry></mxCell><mxCell id=\"9L6EbMpzsWciNYXeLQUw-40\" value=\"\" style=\"endArrow=classic;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;\" parent=\"1\" source=\"9L6EbMpzsWciNYXeLQUw-17\" target=\"9L6EbMpzsWciNYXeLQUw-8\" edge=\"1\"><mxGeometry width=\"50\" height=\"50\" relative=\"1\" as=\"geometry\"><mxPoint x=\"700\" y=\"480\" as=\"sourcePoint\"/><mxPoint x=\"750\" y=\"430\" as=\"targetPoint\"/></mxGeometry></mxCell></root></mxGraphModel></diagram></mxfile>"}"></div>
|
|
<script type="text/javascript" src="https://viewer.diagrams.net/js/viewer-static.min.js"></script>
|
|
|
|
![Classdiagramm](docs/PM2_ClassDiagram.drawio.svg)
|