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("}"); s.append("}");
return s.toString(); return s.toString();
} }

View file

@ -98,19 +98,11 @@ public class UMLClassView {
}); });
defaultEncapsulationField.addKeyListener(new KeyAdapter() { 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 @Override
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
UMLManager.setDefaultEncapsulation(defaultEncapsulationField.getText() + " "); UMLManager.setDefaultEncapsulation(defaultEncapsulationField.getText() + " ");
refreshTextArea();
} }
}); });
} }

View file

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