X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=spider-web%2Fspiderframe.java;h=90e76acc0de9c15a32408fa141edd93fa00c6b19;hb=refs%2Fheads%2Fip_address;hp=1630f9e7d2f393d988bb33f00207ac6891db4300;hpb=330c78b266bf16b87b01c3fa9e73dd9494f44a40;p=spider.git diff --git a/spider-web/spiderframe.java b/spider-web/spiderframe.java index 1630f9e7..90e76acc 100755 --- a/spider-web/spiderframe.java +++ b/spider-web/spiderframe.java @@ -44,10 +44,11 @@ menubar.add(commands); show = new Menu("Show"); show.add(new MenuItem("Show Last DX")); show.add(new MenuItem("Show Beam Direction")); - show.add(new MenuItem("Show wwv")); - show.add(new MenuItem("Search DX")); + show.add(new MenuItem("Show WWV")); + show.add(new MenuItem("Show WCY")); + show.add(new MenuItem("Search DX")); show.add(new MenuItem("Search Address")); - show.add(new MenuItem("Search QSL Manager")); + show.add(new MenuItem("Search QSL Manager")); show.add(new MenuItem("Search QSL Info")); show.add(new MenuItem("Search DXCC")); show.add(new MenuItem("Status")); @@ -56,9 +57,13 @@ menubar.add(show); set = new Menu("Settings"); set.add(new MenuItem("Set Beep")); + set.add(new MenuItem("Set No Beep")); set.add(new MenuItem("Set QTH / City")); set.add(new MenuItem("Set Name")); set.add(new MenuItem("Set Locator")); + set.add(new MenuItem("Set HomeNode")); + set.add(new MenuItem("Set DX-Grid")); + set.add(new MenuItem("Set No DX-Grid")); set.add(new MenuItem("Show Personal Settings")); menubar.add(set); @@ -68,16 +73,14 @@ menubar.add(set); menubar.add(dxann); mailbox = new Menu("Mailbox"); + mailbox.add(new MenuItem("Last 10 Msgs")); mailbox.add(new MenuItem("Last 50 Msgs")); - mailbox.add(new MenuItem("List DX Bulletins")); + mailbox.add(new MenuItem("New Messages")); + mailbox.add(new MenuItem("Own Messages")); menubar.add(mailbox); - - - - this.setMenuBar(menubar); setLayout(new BorderLayout()); @@ -140,100 +143,94 @@ menubar.add(mailbox); gbc.gridheight = h; gbl.setConstraints(c, gbc); p.add(c); - } + } public void setColors() { output.setBackground(OutBackgroundColor); output.setForeground(OutForegroundColor); input.setBackground(InBackgroundColor); input.setForeground(InForegroundColor); - } + } public void setFonts() { output.setFont(OutFont); input.setFont(InFont); - } + } public void initPrintStream(PrintStream out) { this.out = out; - } + } public void setText(String s) { int i; - for (i=0; i < s.length(); i++) { + for (i=0; i < s.length(); i++) { if (s.charAt(i) == '\007') parent.beep(); - } + } output.appendText(s +'\n'); - idle.resetTimer(); - } + idle.resetTimer(); + } public void setCall(String s) { Call = s; - } + } - public void setPassword(String s) { - Password = s ; - } + public void setNodecall(String s) { + Nodecall = s ; + } + + public void setPassword(String s) { + Password = s ; + } public void setPrefix(String s) { Prefix = s; } - - - + public void setCall2(String s) { Call2 = s; } - public void setFreq(String s) { + public void setFreq(String s) { Freq = s; } - - public void setRemarks(String s) { + public void setRemarks(String s) { Remarks = s; } - - - public void setTime(String s) { DateLabel.setText(s); - } + } public void setIdle(String s) { IdleLabel.setText(s); - } + } public String getCall() { return Call; - } + } - public String getPassword() { - return Password; - } + public String getPassword() { + return Password; + } public String setPrefix(){ - return Prefix; - } + return Prefix; + } public String setCall2(){ - return Call2; - } + return Call2; + } public String setFreq(){ - return Freq; - } + return Freq; + } public String setRemarks(){ - return Remarks; - } - - - - + return Remarks; + } public void setFullname(String s) { Fullname = s; @@ -241,35 +238,35 @@ menubar.add(mailbox); connect_menuitem.disable(); else connect_menuitem.enable(); - } + } public String getFullname() { return Fullname; - } + } public void setHostname(String s) { Hostname = s; - } + } public String getHostname() { return Hostname; - } + } public void setPort(String s) { Port = s; - } + } public String getPort() { return Port; - } + } public void setChannel(String s) { Channel = s; - } + } public String getChannel() { return Channel; - } + } // public void login() { // PersonalPreferences pp = new PersonalPreferences(this, Call, Fullname, OutFont); @@ -277,27 +274,20 @@ menubar.add(mailbox); public void antrichtung () { beam pp = new beam (this, Prefix,OutFont); - } + } - public void dxannounce () { - dxannounce pp = new dxannounce (this, Call2, Freq, Remarks, OutFont); - } +// public void dxannounce () { +// dxannounce pp = new dxannounce (this, Call2, Freq, Remarks, OutFont); +// } - - - - public boolean handleEvent(Event evt) { if (evt.id == Event.KEY_PRESS) { if (evt.key == '\n') { - - idle.resetTimer(); output.appendText(input.getText()+'\n'); out.println(input.getText()); - if (MaxInputPos < 255) { InputPos++; @@ -331,11 +321,9 @@ menubar.add(mailbox); else { input.setText(""); } - } return true; } - return super.handleEvent(evt); } @@ -365,7 +353,7 @@ menubar.add(mailbox); public void connected() { connect_menuitem.setLabel("Disconnect"); - connectState.setText("Connected to "+Hostname+":"+Port); + connectState.setText("Connected to " + Nodecall); input.setEditable(true); copy_menuitem.enable(); Connected = true; @@ -376,7 +364,7 @@ menubar.add(mailbox); public void disconnected() { Connected = false; connect_menuitem.setLabel("Connect"); - connectState.setText("Disconnected from "+Hostname); + connectState.setText("Disconnected from " + Nodecall); input.setEditable(false); copy_menuitem.disable(); paste_menuitem.disable(); @@ -403,6 +391,12 @@ menubar.add(mailbox); } public boolean action(Event evt, Object arg) { + + Prefix = ""; // Make sure that the following variables are empty ! + Call2 = ""; + Freq = ""; + Remarks = ""; + if (evt.target instanceof MenuItem) { if (arg.equals("Quit")) { this.hide(); @@ -415,10 +409,10 @@ menubar.add(mailbox); parent.dodisconnect(); } else if (arg.equals("About")) { InfoDialog id = new InfoDialog(this, "About", - "JAVA Spider Webclient 0.6b\nPA4AB\n" + - "pa4ab@pa4ab.net \n" + - "April 2001\n" + - "Based on source of the CLX Client from dl6dbh" ); + "JAVA Spider Webclient 1.0\n\nModified by PA4AB, M0AZM and OZ1LQH\n" + + "\n" + + "January 2002\n" + + "Based on source of the CLX Client from DL6DBH" ); id.resize(500,300); id.show(); @@ -429,89 +423,93 @@ menubar.add(mailbox); } else if (arg.equals("Bye")) { if (Connected) out.println("bye"); } else if (arg.equals("Help")) { - if (Connected) out.println("help overview"); + if (Connected) out.println("? all"); } else if (arg.equals("Show Last DX")) { if (Connected) out.println("sh/dx"); } else if (arg.equals("Status")) { - if (Connected) out.println("sh/conf"); + if (Connected) out.println("sh/c"); } else if (arg.equals("Show WWV")) { if (Connected) out.println("sh/wwv"); + } else if (arg.equals("Show WCY")) { + if (Connected) out.println("sh/wcy"); } else if (arg.equals("Show Beam Direction")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/heading " + Prefix ); - } else if (arg.equals("search DX")) { + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/heading " + Prefix ); + } else if (arg.equals("Search DX")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/dx " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/dx " + Prefix ); } else if (arg.equals("Search QSL Info")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/qsl " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/qsl " + Prefix ); - } else if (arg.equals("search Adress")) { + } else if (arg.equals("Search Address")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/qrz " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/qrz " + Prefix ); - } else if (arg.equals("search qsl Manager")) { + } else if (arg.equals("Search QSL Manager")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/qsl " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/qsl " + Prefix ); - } else if (arg.equals("search DXCC")) { + } else if (arg.equals("Search DXCC")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("sh/dxcc " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("sh/pr " + Prefix ); - // buttom settings + // button settings } else if (arg.equals("Set Beep")) { - if (Connected) out.println("set/Beep"); + if (Connected) out.println("set/beep"); - }else if (arg.equals("Set QTH / City")) { - beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("set/qth " + Prefix ); + } else if (arg.equals("Set No Beep")) { + if (Connected) out.println("set/nobeep"); - - }else if (arg.equals("Set Name")) { + } else if (arg.equals("Set QTH / City")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("set/name " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("set/qth " + Prefix ); + + } else if (arg.equals("Set Name")) { + beam pp = new beam(this, Prefix, OutFont); + if ((Connected) && !(Prefix.equals(""))) out.println ("set/name " + Prefix ); - } - else if (arg.equals("Set Locator")) { + } else if (arg.equals("Set Locator")) { beam pp = new beam(this, Prefix, OutFont); - if (Connected) out.println ("set/loc " + Prefix ); + if ((Connected) && !(Prefix.equals(""))) out.println ("set/qra " + Prefix ); + } else if (arg.equals("Set HomeNode")) { + beam pp = new beam(this, Prefix, OutFont); + if ((Connected) && !(Prefix.equals(""))) out.println ("set/homenode " + Prefix ); - } - else if (arg.equals("Show Personal Settings")) { - if (Connected) out.println ("show/sta " + Call ); + } else if (arg.equals("Set DX-Grid")) { + if (Connected) out.println("set/dxgrid"); - + } else if (arg.equals("Set No DX-Grid")) { + if (Connected) out.println("set/nodxgrid"); + + } else if (arg.equals("Show Personal Settings")) { + if (Connected) out.println ("sh/sta " + Call ); } // dx announce else if (arg.equals("DXannounce")) { dxannounce pp = new dxannounce(this, Call2, Freq, Remarks, OutFont); - if (Connected) out.println ("dx " + Call2 + " " + Freq + " " + Remarks ); - + if ((Connected) && !(Call2.equals(""))) out.println ("dx " + Freq + " " + Call2 + " " + Remarks ); } - // mailbox - else if (arg.equals("last 50 Msgs")) { - if (Connected) out.println ("dir/50 " ); - } - else if (arg.equals("list DX Bulletins")) { - if (Connected) out.println ("dir/bul " ); - } - else if (arg.equals("new Msgs")) { - if (Connected) out.println ("dir/new " ); - } - else if (arg.equals("own Msgs")) { - if (Connected) out.println ("dir/own " ); - } - - - + + // mailbox + + else if (arg.equals("Last 10 Msgs")) { + if (Connected) out.println ("dir" ); + } else if (arg.equals("Last 50 Msgs")) { + if (Connected) out.println ("dir/50" ); + } else if (arg.equals("New Messages")) { + if (Connected) out.println ("dir/new" ); + } else if (arg.equals("Own Messages")) { + if (Connected) out.println ("dir/own" ); + } else return false; } else if (evt.target instanceof Button) { @@ -524,10 +522,8 @@ menubar.add(mailbox); parent.dodisconnect(); } else return false; } - else return false; } - return true; } @@ -561,8 +557,8 @@ menubar.add(mailbox); private Label connectState = new Label("not connected"); - private Color OutBackgroundColor = new Color(0,0,66); - private Color OutForegroundColor = new Color(255,255,0); + private Color OutBackgroundColor = Color.black; + private Color OutForegroundColor = Color.yellow; private Color OutOwnColor = Color.red; private Color InBackgroundColor = new Color(234,199,135); private Color InForegroundColor = Color.red; @@ -576,7 +572,7 @@ menubar.add(mailbox); private String Hostname = new String("localhost"); private String Port = new String("3600"); private String Channel = new String("0"); - + private String Nodecall = new String("nodecall"); private String Prefix = new String (""); private String Call2 = new String (""); @@ -584,11 +580,6 @@ menubar.add(mailbox); private String Remarks = new String (""); - - - - - private PrintStream out = null; private String InputBuffer[] = new String[256]; @@ -600,7 +591,6 @@ menubar.add(mailbox); private boolean Connected; private spiderclient parent; - } class setDate extends Thread { @@ -619,12 +609,9 @@ class setDate extends Thread { cf.setTime(today.toLocaleString()); } } - private Date today = new Date(); - } - class idleTime extends Thread { spiderframe cf; @@ -641,7 +628,6 @@ class idleTime extends Thread { } public void run() { - for(;;) { try { sleep(1000); } catch (InterruptedException e) {} count++;