public class NetMapConnector extends java.lang.Object implements java.awt.event.ActionListener, NetMapConstants, PropertyConsumer
server=hostname of the NetMap server port=port of NetMap server defaultView=default view for NetMap server stream
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
defaultView
The NetMap server has a notion of views that represent nodes
and links, and these are names.
|
static java.lang.String |
DefaultViewProperty |
static java.lang.String |
GetViewsCmd |
static java.lang.String |
LoadViewCmd |
protected java.lang.String |
port |
static java.lang.String |
PortProperty |
protected java.lang.String |
propertyPrefix |
protected java.lang.String |
server |
static java.lang.String |
ServerConnectCmd |
static java.lang.String |
ServerDisconnectCmd |
static java.lang.String |
ServerProperty |
static java.lang.String |
STATUS_CONNECTED |
static java.lang.String |
STATUS_CONNECTING |
static java.lang.String |
STATUS_IDLE |
CLEAR, COMMAND_FIELD, DATABASE_TAG_FIELD, DEFAULT_PORT, DEFAULT_SERVER, ELEVATION_FIELD, ERROR_VALUE_DOUBLE, ERROR_VALUE_FLOAT, ERROR_VALUE_INT, HEIGHT_FIELD, ICON_FIELD, INDEX_FIELD, IP_FIELD, JMAP_VIEW_CMD, JOFFSET_FIELD, LABEL_FIELD, LAT_FIELD, LINE_DELETE, LINE_DELETE_STRING, LINK_NODE1_FIELD, LINK_NODE2_FIELD, LINK_OBJECT, LINK_OBJECT_STATUS, LON_FIELD, MENU_FIELD, NAME_FIELD, NODE_DELETE, NODE_DELETE_STRING, NODE_MOVE, NODE_MOVE_STRING, NODE_OBJECT, NODE_OBJECT_STATUS, POSX_FIELD, POSY_FIELD, REFRESH, SHAPE_FIELD, STATUS_FIELD, TIME_FIELD, UPDATE, WIDTH_FIELD
EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty
Constructor and Description |
---|
NetMapConnector() |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
Act on GUI commands controlling the NetMapReader.
|
void |
addNetMapListener(NetMapListener nml)
Add a NetMapListener to receive NetMapEvents.
|
void |
clearNetMapListeners()
Clear all NetMapListeners from receiving NetMapEvents.
|
void |
connect(java.lang.String view)
Connects to the NetMap server to get messages about the given
view.
|
protected void |
connectionDown()
Callback for the NetMapReader to let it provide the connector
with connection status.
|
protected void |
connectionUp()
Callback for the NetMapReader to let it provide the connector
with connection status.
|
void |
disconnect()
Resets the controls to the disconnected mode.
|
protected void |
distributeEvent(java.util.Properties netmapProps)
Called by the NetMapReader so a parsed line, representing an
event, can be dispersed to the listeners.
|
java.lang.String |
getDefaultView()
Get the defaultView to use for NetMap server queries.
|
java.awt.Component |
getGUI()
Gets the GUI control for the NetMapReader, creates it if it
doesn't exist.
|
java.lang.String |
getPort()
Get the port that the NetMap server is running on.
|
java.util.Properties |
getProperties(java.util.Properties list)
Method to fill in a Properties object, reflecting the current
values of the PropertyConsumer.
|
java.util.Properties |
getPropertyInfo(java.util.Properties list)
Method to fill in a Properties object with values reflecting
the properties able to be set on this PropertyConsumer.
|
java.lang.String |
getPropertyPrefix()
Get the property key prefix that is being used to prepend to
the property keys for Properties lookups.
|
java.lang.String |
getServer()
Get the hostname or IP address of the NetMap server.
|
ChoiceList |
getViews()
Gets a list of possible views.
|
void |
removeNetMapListener(NetMapListener nml)
Remove a NetMapListener from the list to receive NetMapEvents.
|
void |
reset()
Complete disconnect, sends clear command to NetMapListeners,
resets GUI if it's being used.
|
void |
setDefaultView(java.lang.String view)
Set the defaultView to use for NetMap server queries.
|
void |
setPort(java.lang.String port)
Set the port that the NetMap server is running on.
|
void |
setProperties(java.util.Properties setList)
Method to set the properties in the PropertyConsumer.
|
void |
setProperties(java.lang.String prefix,
java.util.Properties setList)
Method to set the properties in the PropertyConsumer.
|
void |
setPropertyPrefix(java.lang.String prefix)
Set the property key prefix that should be used by the
PropertyConsumer.
|
void |
setServer(java.lang.String sName)
Set the hostname or IP address to use to contact the NetMap
server.
|
public static final java.lang.String ServerConnectCmd
public static final java.lang.String ServerDisconnectCmd
public static final java.lang.String LoadViewCmd
public static final java.lang.String GetViewsCmd
public static final java.lang.String ServerProperty
public static final java.lang.String PortProperty
public static final java.lang.String DefaultViewProperty
public static final java.lang.String STATUS_CONNECTING
public static final java.lang.String STATUS_CONNECTED
public static final java.lang.String STATUS_IDLE
protected java.lang.String server
protected java.lang.String port
protected java.lang.String defaultView
protected java.lang.String propertyPrefix
public void setServer(java.lang.String sName)
public java.lang.String getServer()
public void setPort(java.lang.String port)
public java.lang.String getPort()
public void setDefaultView(java.lang.String view)
public java.lang.String getDefaultView()
public void addNetMapListener(NetMapListener nml)
public void removeNetMapListener(NetMapListener nml)
public void clearNetMapListeners()
protected void distributeEvent(java.util.Properties netmapProps)
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
protected void connectionUp()
protected void connectionDown()
public void disconnect()
public ChoiceList getViews()
public void connect(java.lang.String view)
public void reset()
public java.awt.Component getGUI()
public void setProperties(java.util.Properties setList)
setProperties
in interface PropertyConsumer
setList
- a properties object that the PropertyConsumer
can use to retrieve expected properties it can use for
configuration.public void setProperties(java.lang.String prefix, java.util.Properties setList)
setProperties
in interface PropertyConsumer
prefix
- a String used by the PropertyConsumer to prepend
to each property value it wants to look up -
setList.getProperty(prefix.propertyKey). If the prefix
had already been set, then the prefix passed in should
replace that previous value.setList
- a Properties object that the PropertyConsumer
can use to retrieve expected properties it can use for
configuration.public java.util.Properties getProperties(java.util.Properties list)
getProperties
in interface PropertyConsumer
list
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.public java.util.Properties getPropertyInfo(java.util.Properties list)
getPropertyInfo
in interface PropertyConsumer
list
- a Properties object to load the PropertyConsumer
properties into. If getList equals null, then a new
Properties object should be created.public void setPropertyPrefix(java.lang.String prefix)
setPropertyPrefix
in interface PropertyConsumer
prefix
- the prefix String.public java.lang.String getPropertyPrefix()
getPropertyPrefix
in interface PropertyConsumer
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details