Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entwurfsmuster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mki-swt2
entwurfsmuster
Commits
17cc2783
Commit
17cc2783
authored
4 years ago
by
Peter Hertkorn
Browse files
Options
Downloads
Patches
Plain Diff
Add history for state
parent
a27ec0af
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/soon/PowerOff.java
+3
-2
3 additions, 2 deletions
src/soon/PowerOff.java
src/soon/PowerOn.java
+2
-0
2 additions, 0 deletions
src/soon/PowerOn.java
src/soon/Soon.java
+10
-0
10 additions, 0 deletions
src/soon/Soon.java
src/soon/SoonTestDrive.java
+2
-0
2 additions, 0 deletions
src/soon/SoonTestDrive.java
with
17 additions
and
2 deletions
src/soon/PowerOff.java
+
3
−
2
View file @
17cc2783
...
...
@@ -7,7 +7,8 @@ public class PowerOff extends Zustand {
}
public
void
powerButton
()
{
s
.
setZustand
(
s
.
getStopZustand
());
exit
();
s
.
setZustand
(
s
.
getPowerOnHistory
());
System
.
out
.
println
(
"Anschalten"
);
}
s
.
getZustand
().
entry
();
}
}
This diff is collapsed.
Click to expand it.
src/soon/PowerOn.java
+
2
−
0
View file @
17cc2783
...
...
@@ -7,6 +7,8 @@ public abstract class PowerOn extends Zustand {
}
public
void
powerButton
()
{
exit
();
s
.
setPowerOnHistory
(
s
.
getZustand
());
s
.
setZustand
(
s
.
getPowerOffZustand
());
System
.
out
.
println
(
"Ausschalten"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/soon/Soon.java
+
10
−
0
View file @
17cc2783
...
...
@@ -4,6 +4,7 @@ public class Soon {
Zustand
stopZustand
;
Zustand
playZustand
;
Zustand
powerOffZustand
;
Zustand
powerOnHistory
;
Zustand
zustand
;
...
...
@@ -12,6 +13,7 @@ public class Soon {
playZustand
=
new
PlayZustand
(
this
);
powerOffZustand
=
new
PowerOff
(
this
);
zustand
=
powerOffZustand
;
powerOnHistory
=
stopZustand
;
}
public
Zustand
getPowerOffZustand
()
{
...
...
@@ -69,6 +71,14 @@ public class Soon {
public
void
volumeDown
()
{
System
.
out
.
println
(
"Leiser"
);
}
public
Zustand
getPowerOnHistory
()
{
return
powerOnHistory
;
}
public
void
setPowerOnHistory
(
Zustand
z
)
{
powerOnHistory
=
z
;
}
public
String
toString
()
{
StringBuffer
result
=
new
StringBuffer
();
...
...
This diff is collapsed.
Click to expand it.
src/soon/SoonTestDrive.java
+
2
−
0
View file @
17cc2783
...
...
@@ -10,6 +10,8 @@ public class SoonTestDrive {
player
.
powerButton
();
player
.
playButton
();
player
.
volumeUpButton
();
player
.
powerButton
();
player
.
powerButton
();
player
.
volumeDownButton
();
player
.
stopButton
();
player
.
powerButton
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment