|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--wonderly.jeaprs.ClientImpl | +--wonderly.jeaprs.aprs.APRSDigi
This is a Digipeating module meant to be used for KISS enabled TNCs. When the TNC is not in KISS mode, then this module will work in a since. It will rewrite the path, to remove used path elements, and then forward the packet with the remaining path. It rewrites WIDEN-n and TRACEN-n paths stripping any leading elements and then goes on to decrement the count. This module still needs work and really has never been used on a true KISS TNC.
Field Summary |
Fields inherited from class wonderly.jeaprs.ClientImpl |
actions, APRS, dirty, evLis, ins, me, name, outs, stopped, strmLis |
Constructor Summary | |
APRSDigi()
|
Method Summary | |
void |
buildActions()
Put code in here to register all of the actions that you want to use. |
javax.swing.JPanel |
buildPanel(javax.swing.JFrame parent)
Builds the applications user interface. |
wonderly.jeaprs.aprs.packet.APRSEventListener |
createEventListener()
This method needs to be implemented by subclasses and should return an APRSEventListener implementation that is applicable
for their client. |
java.io.OutputStream |
createStreamListener()
This method needs to be implemented by subclasses and should return an OutputStream implementation that is applicable
for their client. |
protected void |
digiPacket(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
|
java.lang.String |
getIgnoredCalls()
|
protected boolean |
haveHeard(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
|
boolean |
isDigiActive()
|
boolean |
isDirty()
|
boolean |
isRelay()
|
boolean |
isWaveAt()
|
boolean |
isWide()
|
protected java.lang.String |
keyFor(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
|
static void |
main(java.lang.String[] args)
|
void |
run()
|
void |
setDigiActive(boolean how)
|
void |
setIgnoredCalls(java.lang.String ignored)
|
void |
setRelay(boolean how)
|
void |
setWaveAt(boolean how)
|
void |
setWide(boolean how)
|
void |
start()
Starts this client 'running' or whatever it needs when the user opens the client via the menus. |
void |
stop()
Stops the client when the user closes the window or deactivates it via the menus |
Methods inherited from class wonderly.jeaprs.ClientImpl |
addAPRSEventGenerator, addAPRSOutputStream, buildMenu, getAction, getAPRSEventGenerators, getAPRSOutputStreams, getName, getUIFactory, isInputUser, isOutputUser, removeAPRSEventGenerator, removeAPRSOutputStream, setDirty, setName, toString, write, write, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public APRSDigi()
Method Detail |
public void start()
ClientImpl
start
in interface Client
start
in class ClientImpl
public boolean isDigiActive()
public void setDigiActive(boolean how)
public boolean isRelay()
public void setRelay(boolean how)
public boolean isWide()
public void setWide(boolean how)
public boolean isWaveAt()
public void setWaveAt(boolean how)
public java.lang.String getIgnoredCalls()
public void setIgnoredCalls(java.lang.String ignored)
public void stop()
ClientImpl
stop
in interface Client
stop
in class ClientImpl
public java.io.OutputStream createStreamListener()
ClientImpl
OutputStream
implementation that is applicable
for their client. This stream will be written to as data comes through
a TNC
implementatation, receiving copies of the text lines
received by the TNC
implementation. A simple mechanism is
typically to use a thread and a PipedInputStream
and PipedOutputStream
pair to receive the data and process it.
Just return null if you don't need raw stream events.
public OutputStream createStreamListener() throws IOException { final PipedOutputStream pipe = new PipedOutputStream(); final PipedInputStream is = new PipedInputStream(pipe); new Thread("TNC Stream listener") { public void run() { try { BufferedReader rd = new BufferedReader( new InputStreamReader(is) ); String str; while( (str = rd.readLine()) != null ) { System.out.println( "Got TNC line: "+str ); } System.out.println("End of TNC Stream, exiting"); } finally { try { is.close(); pipe.close(); } catch( Exception ex ) { JeAPRS.getUI().reportException(ex); } } } }.start(); return pipe; }
createStreamListener
in class ClientImpl
public static void main(java.lang.String[] args)
protected boolean haveHeard(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
protected java.lang.String keyFor(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
protected void digiPacket(wonderly.jeaprs.aprs.packet.APRSPacket pkt)
public wonderly.jeaprs.aprs.packet.APRSEventListener createEventListener()
ClientImpl
APRSEventListener
implementation that is applicable
for their client. Many times, a simple inner class is all that is
needed as in.
return new APRSEventAdapter() { public void message( APRSPacket pkt, APRSMessage msg ) { // Do something with message } };This will create a new object that is an instance of the
APRSEventAdapter
class. That class implements the APRSEventListener
interface
with empty methods so that you can just override the methods that you want
APRS packets for, and not have to deal with implementing all methods.
Just return null here if you don't need an event listener.
createEventListener
in class ClientImpl
APRSEventAdapter
,
APRSEventListener
public void run()
run
in interface java.lang.Runnable
public boolean isDirty()
isDirty
in interface Client
isDirty
in class ClientImpl
public javax.swing.JPanel buildPanel(javax.swing.JFrame parent)
ClientImpl
buildMenu()
method can be used to create a menu bar
if neededed.
buildPanel
in class ClientImpl
ClientImpl.buildMenu()
public void buildActions()
ClientImpl
actions.put( "MyAction", act = new AbstractAction( "MyAction" ) { public void actionPerformed( ActionEvent ev ) { //...do something here } }); act.putValue( Action.NAME, "MyAction" );
buildActions
in class ClientImpl
ClientImpl.getAction(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |