8 import java.awt.event.*;
13 extends java.rmi.server.UnicastRemoteObject
16 private int x0 = 0, y0 = 0, x1, y1;
17 private static final int WIDTH = 300, HEIGHT = 300;
20 private String
myURL, myCLientURL;
24 myWbClient.pleaseDie();
26 }
catch (Exception e) {e.printStackTrace();}
30 WindowListener destroyWindow =
new WindowAdapter() {
31 public void windowClosing(WindowEvent w) {
36 WindowListener raisedWindow =
new WindowAdapter() {
37 public void windowActivated(WindowEvent w) {
38 try { myWbClient.sendAllLines(); }
39 catch (Exception e) {e.printStackTrace();}
43 MouseListener getCoords =
new MouseAdapter() {
44 public void mouseClicked(MouseEvent m) {
45 if (m.getModifiers() == InputEvent.BUTTON3_MASK)
50 LineCoords ln =
new LineCoords();
57 myWbClient.sendLine(ln);
58 }
catch (Exception e) {e.printStackTrace();}
66 myCLientURL = Invoke.makeURL(
'C', args[4]);
68 frame =
new Frame(args[1] +
"@" + myCLientURL +
"@" + args[3]);
69 frame.setSize(
WIDTH, HEIGHT);
70 frame.setVisible(
true);
71 frame.addWindowListener(destroyWindow);
72 frame.addWindowListener(raisedWindow);
73 frame.addMouseListener(getCoords);
75 myURL = Invoke.makeURL(
'D', args[4]);
77 myWbClient.recvDisplayObj(
this);
78 Invoke.myPrint(
"LinesFrameImpl",
myURL);
79 Invoke.myPrint(
"LinesFrameImpl",
""+
myWbClient);
80 Invoke.myPrint(
"LinesFrameImpl",
"Done");
84 Graphics g = frame.getGraphics();
86 g.drawLine(ln.x1, ln.y1, ln.x2, ln.y2);
89 public static void main(String[] args) {
91 catch (Exception e) {e.printStackTrace();}
static Remote lookup(String url)
void recvOneLine(LineCoords ln)
LinesFrameImpl(String[] args)
static void main(String[] args)