Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
EDAF55
workspace_student
Commits
f514e152
Commit
f514e152
authored
Aug 24, 2017
by
Mathias Haage
Browse files
Add repaint timer
parent
7dc2438b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lift/src/lift/LiftView.java
View file @
f514e152
...
...
@@ -10,6 +10,7 @@ public class LiftView {
private
FixedSizePanel
entryPane
,
shaftPane
;
private
FloorExit
exitPane
;
private
Basket
basket
;
private
Timer
repaintTimer
;
private
static
int
FLOOR_HEIGHT
=
100
;
private
static
int
ENTRY_WIDTH
=
300
;
private
static
int
EXIT_WIDTH
=
200
;
...
...
@@ -45,6 +46,12 @@ public class LiftView {
basket
=
new
Basket
(
SHAFT_WIDTH
,
NO_OF_FLOORS
,
FLOOR_HEIGHT
,
shaftPane
);
view
.
pack
();
view
.
setVisible
(
true
);
repaintTimer
=
new
Timer
(
20
,
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
view
.
repaint
();
}
});
repaintTimer
.
start
();
}
public
void
drawLift
(
int
floor
,
int
load
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment