This commit is contained in:
nora 2020-11-23 21:29:38 +01:00
parent f8e81462a5
commit c6bb0c2cbd
3 changed files with 6 additions and 14 deletions

View file

@ -82,7 +82,6 @@ public class UMLClass {
s.append("}");
return s.toString();
}

View file

@ -98,19 +98,11 @@ public class UMLClassView {
});
defaultEncapsulationField.addKeyListener(new KeyAdapter() {
@Override
public void keyTyped(KeyEvent e) {
UMLManager.setDefaultEncapsulation(defaultEncapsulationField.getText() + " ");
}
@Override
public void keyPressed(KeyEvent e) {
UMLManager.setDefaultEncapsulation(defaultEncapsulationField.getText() + " ");
}
@Override
public void keyReleased(KeyEvent e) {
UMLManager.setDefaultEncapsulation(defaultEncapsulationField.getText() + " ");
refreshTextArea();
}
});
}

View file

@ -42,6 +42,7 @@ public class UMLMethod {
};
} else {
this.encapsulation = UMLManager.DEFAULT_ENCAPSULATION;
System.out.println(UMLManager.DEFAULT_ENCAPSULATION);
}
this.name = parts[2];
@ -94,7 +95,7 @@ public class UMLMethod {
}
}
returnString.append(") {\n ");
returnString.append(") {\n");
if(isConstructor && manager.isAutoFillConstructor()){
for (String argsName : argsNames) {
@ -124,10 +125,10 @@ public class UMLMethod {
* @param line The line (not containing any linebreaks)
*/
public void addBodyLine(String line) {
if (methodBody.contains("\n")) {
methodBody += "\n " + line;
if (methodBody.equals("")) {
methodBody += " " + line;
} else {
methodBody += " " + line;
methodBody += "\n " + line;
}
}
}