|
||||||||||
| 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.APRSMessagePanel
This is a JeAPRS module/client that provides APRS text messaging. It uses the APRS object from JeAPRS to get information about the APRS environment that it needs.
| Field Summary |
| Fields inherited from class wonderly.jeaprs.ClientImpl |
actions, APRS, dirty, evLis, ins, me, name, outs, stopped, strmLis |
| Constructor Summary | |
APRSMessagePanel()
Construct an instance of this object |
|
| 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)
Public method from APRSClient used to build the UI panel used for this client |
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. |
void |
enqueueMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString str,
java.lang.String to)
|
void |
enqueueNoAckMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString msg,
java.lang.String to)
|
java.lang.String |
getNextAckID()
|
boolean |
isShowingAcks()
|
boolean |
isShowingDelivered()
|
void |
processMessagesTo(java.lang.String call)
|
void |
putPendingMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString msg,
java.lang.String to,
java.lang.String ackid)
|
static java.lang.String |
reversePathFor(java.lang.String path)
|
void |
run()
|
void |
sendMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString str)
|
void |
setShowingAcks(boolean how)
|
void |
setShowingDelivered(boolean how)
|
void |
start()
Starts this client 'running' or whatever it needs when the user opens the client via the menus. |
| Methods inherited from class wonderly.jeaprs.ClientImpl |
addAPRSEventGenerator, addAPRSOutputStream, buildMenu, getAction, getAPRSEventGenerators, getAPRSOutputStreams, getName, getUIFactory, isDirty, isInputUser, isOutputUser, removeAPRSEventGenerator, removeAPRSOutputStream, setDirty, setName, stop, 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 APRSMessagePanel()
| Method Detail |
public boolean isShowingAcks()
public void setShowingAcks(boolean how)
public boolean isShowingDelivered()
public void setShowingDelivered(boolean how)
public void start()
ClientImpl
start in interface Clientstart in class ClientImplpublic java.io.OutputStream createStreamListener()
ClientImplOutputStream 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 ClientImplpublic wonderly.jeaprs.aprs.packet.APRSEventListener createEventListener()
ClientImplAPRSEventListener 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 ClientImplAPRSEventAdapter,
APRSEventListenerpublic java.lang.String getNextAckID()
public void putPendingMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString msg,
java.lang.String to,
java.lang.String ackid)
public void enqueueNoAckMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString msg,
java.lang.String to)
throws java.io.IOException
java.io.IOException
public void enqueueMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString str,
java.lang.String to)
throws java.io.IOException
java.io.IOException
public void sendMessage(wonderly.jeaprs.ByteString from,
wonderly.jeaprs.ByteString path,
wonderly.jeaprs.ByteString str)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String reversePathFor(java.lang.String path)
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 ClientImplClientImpl.getAction(String)public javax.swing.JPanel buildPanel(javax.swing.JFrame parent)
buildPanel in class ClientImplClientImpl.buildMenu()public void run()
run in interface java.lang.Runnablepublic void processMessagesTo(java.lang.String call)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||