kapstok / NHL-DePa2 (public) (License: Unspecified) (since 2018-11-09) (hash sha1)
Design Patterns school project; a GUI using multiple Design Patterns.
List of commits:
Subject Hash Author Date (UTC)
Revert commit '5678eb6'. 6225242719b2cfc5ee0de9f8d05edbc7a69007a7 Jan Allersma 2018-11-01 14:10:27
Make groups movable and resizable. 1ca7c18ab103a8d1055b27f63192038fd75aef3e Jan Allersma 2018-10-17 14:51:32
Use translations instead of positions for moving shapes. 9551c7d2608f01c3950743fd97bd217aab8f5766 Jan Allersma 2018-10-16 16:11:03
Implement Visitor pattern for Groups. bd30477ce616362d3f58cef072d1ebc78077fa85 Jan Allersma 2018-10-16 13:28:37
Implement Visitor pattern for Shapes. e52412c3059c1ee5fa9abdf4a32db0f47981eee1 Jan Allersma 2018-10-16 12:43:17
Setup 'Decorator' and 'Ornament' class. 5678eb6257bcf88502078d08395a394a1c24568b Jan Allersma 2018-10-09 09:29:50
Use different strats instead of seperate Shapes. a56e1e665a0292d15139eddfd8ebdeb8c95251b4 Jan Allersma 2018-10-01 11:37:45
Make ornament interface compatible with Entities. 21383d5f200a338f8255d7d33b6989937c19fed6 Jan Allersma 2018-10-08 20:36:23
Fix bug in Rect from commit 6c91140 in other Shapes as well. 4165a5da98dd9a548a222c6160390e4e54026d48 Jan Allersma 2018-09-28 14:53:40
Build interface for ornament creation. adcf22a4e878edc45ac0775a5e15ebf0bb1a937d Jan Allersma 2018-10-08 13:53:52
Fully implement File I/O. 45cbb48489a24857cfc76144b38b12ccebfd9e61 Jan Allersma 2018-09-27 16:03:40
Fix GroupMenu bug. be41e51819be1a23e7761ea0662eb188ac641aca Jan Allersma 2018-09-27 14:55:20
Fix TODO's from previous commit. 89d8172b77336a6c18f30521147eb81287961f11 Jan Allersma 2018-09-27 14:06:30
Add groups as preparation for step 3. a91368128e7444f69b3a30ee4d17f9063c8846b8 Jan Allersma 2018-09-26 18:31:49
Fix minor bug. Small cleanup 'ellipse' code. 6c911405eb8e48ffe2d63aaff5255adbd4aec889 Jan Allersma 2018-09-21 18:10:01
Implement file I/O. 6219eca932d454a7dab5fe8679f07865ce3cf49d Jan Allersma 2018-09-21 15:52:45
Add shape 'ellipse'. 99d8b029c769bc291af73df3fd445da3cbf5bef4 Jan Allersma 2018-09-21 10:44:36
Add shape 'circle'. 092cb3c3f788b461192a6e164955c53acaf58720 Jan Allersma 2018-09-21 09:35:27
Add resize option (again). 08c95e97268cf9d74bcb963503eec512e528edfe Jan Allersma 2018-09-20 18:09:03
Fix undo bug. 6ab126be633075923cdcce53044e2468f967db41 Jan Allersma 2018-09-20 10:46:50
Commit 6225242719b2cfc5ee0de9f8d05edbc7a69007a7 - Revert commit '5678eb6'.
Author: Jan Allersma
Author date (UTC): 2018-11-01 14:10
Committer name: Jan Allersma
Committer date (UTC): 2018-11-01 14:10
Parent(s): dbfe9d32c0ff76df0e44e0850b335f6d50c24b52
Signing key:
Tree: 3b5bfb6df4cc3657186cd0bef4d0c3b92f840c39
File Lines added Lines deleted
source/decorator.d 0 71
source/entities/ornament.d 0 57
source/frontend/shapeOptions.d 1 0
File source/decorator.d deleted (index 9cca0ea..0000000)
1 module dp.decorator;
2
3 import dp.ent.shape;
4 import dp.ent.ornament;
5
6 class Decorator : Shape {
7 Shape s;
8 Ornament o;
9
10 this(int x, int y, Context context, Strategy strategy, double size = 0) {
11 s = new Shape(x,y,context,strategy,size);
12 o = null;
13 }
14
15 @property
16 public override string type() {
17 string result = s.type;
18
19 if(o !is null)
20 result ~= "\n" ~ o.type;
21
22 return result;
23 }
24
25 @property
26 public override string to_string() {
27 string result = s.to_string;
28
29 if(o !is null)
30 result ~= "\n" ~ o.to_string;
31
32 return result;
33 }
34
35 @property
36 public override int[2] position() {
37 return s.position;
38 }
39
40 @property
41 public override double[2][2] getBounds() {
42 return s.getBounds;
43 }
44
45 @property
46 public override double getSize() {
47 return s.getSize;
48 }
49
50 public override void checkBounds(int x, int y) {
51 s.checkBounds(x,y);
52 }
53
54 public override void render() {
55 s.render();
56 if(o !is null)
57 o.render();
58 }
59
60 public override void move(int x, int y) {
61 s.move(x,y);
62 }
63
64 public override void resize(int amount) {
65 s.resize(amount);
66 }
67
68 public void setOrnament(Ornament ornament) {
69 o = ornament;
70 }
71 }
File source/entities/ornament.d deleted (index 9cdab84..0000000)
1 module dp.ent.ornament;
2
3 import dp.ent.shape;
4 import dp.ent.ent;
5
6 class Ornament : Entity {
7 Shape shape;
8 string position;
9 string value;
10 double[2][2] bounds;
11
12 this(Shape shape, string position, string value) {
13 this.shape = shape;
14 this.position = position;
15 this.value = value;
16 this.bounds = calcBounds();
17 }
18
19 @property
20 public override string type() {
21 return "ornament";
22 }
23
24 @property
25 public override string to_string() {
26 return type ~ " " ~ position ~ " " ~ value;
27 }
28
29 public override void checkBounds(int x, int y) {}
30
31 public override void render() {
32 // render text.
33 }
34
35 private void calcBounds() {
36 bounds = s.getBounds;
37
38 final switch(position) {
39 case "Top":
40 bounds[0][1] -= 30 + s.getSize;
41 bounds[1][1] -= 30 + s.getSize;
42 break;
43 case "Bottom":
44 bounds[0][1] += 30 + s.getSize;
45 bounds[1][1] += 30 + s.getSize;
46 break;
47 case "Left":
48 bounds[0][0] -= 30 + s.getSize;
49 bounds[0][1] -= 30 + s.getSize;
50 break;
51 case "Right":
52 bounds[0][0] += 30 + s.getSize;
53 bounds[0][1] += 30 + s.getSize;
54 break;
55 }
56 }
57 }
File source/frontend/shapeOptions.d changed (mode: 100644) (index 6888686..a5b6f35)
... ... protected class AddOrnament : MenuItem {
81 81
82 82 private bool relCallback (Event event, Widget widget) { private bool relCallback (Event event, Widget widget) {
83 83 od = new OrnamentDialog(s); od = new OrnamentDialog(s);
84 return false;
84 85 } }
85 86 } }
86 87 protected class MoveGroup : MenuItem { protected class MoveGroup : MenuItem {
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-DePa2

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main