Last change
on this file since 256 was 253, checked in by Faria Nassiri Mofakham, 5 years ago |
Commit #1 of:
+ negotiator.onetomany package refactored into onetomany package.
+ info created for all contained the packages.
+ current work defined under onetomany.bargainingchipsgame.
+ in this package, onetomany.bargainingchipsgame.players package includes packages for utility function, coordinator, negotiatior, and buyer and seller.
+ negotiator.onetomany package now contains nothing, can be deleted.
+ Interaction thread
|
File size:
909 bytes
|
Line | |
---|
1 | package onetomany.etc;
|
---|
2 |
|
---|
3 | import java.awt.Canvas;
|
---|
4 | import java.awt.Graphics;
|
---|
5 | import java.awt.Image;
|
---|
6 | import java.awt.MediaTracker;
|
---|
7 | import java.awt.Toolkit;
|
---|
8 |
|
---|
9 |
|
---|
10 | /**
|
---|
11 | * @author Faria Nassiri-Mofakham
|
---|
12 | *
|
---|
13 | */
|
---|
14 | public class DrawImage extends Canvas{
|
---|
15 |
|
---|
16 | /**
|
---|
17 | *
|
---|
18 | */
|
---|
19 | private static final long serialVersionUID = 1L;
|
---|
20 | /**
|
---|
21 | *
|
---|
22 | */
|
---|
23 |
|
---|
24 | Image image;
|
---|
25 |
|
---|
26 | public DrawImage(String filename)
|
---|
27 | {
|
---|
28 | loadImage(filename);
|
---|
29 | }
|
---|
30 |
|
---|
31 | public void paint(Graphics g)
|
---|
32 | {
|
---|
33 | g.drawImage(image, g.getClipBounds().x,g.getClipBounds().y, this);
|
---|
34 | }
|
---|
35 |
|
---|
36 | public void loadImage(String f)
|
---|
37 | {
|
---|
38 | MediaTracker tracker = new MediaTracker(this);
|
---|
39 | image = Toolkit.getDefaultToolkit().getImage(f);
|
---|
40 | tracker.addImage(image, 0);
|
---|
41 | try
|
---|
42 | {
|
---|
43 | tracker.waitForID(0);
|
---|
44 | }
|
---|
45 | catch(InterruptedException ie)
|
---|
46 | {
|
---|
47 | System.out.println(ie.getMessage());
|
---|
48 | }
|
---|
49 | }
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.