public class CollabManager extends IdvManager implements SharableListener
Modifier and Type | Field and Description |
---|---|
static CollabMsgType |
MSG_ACKNEWUSER
Message type to acknowledge the acceptance or rejection of a new user
|
static CollabMsgType |
MSG_ACTION
Message type for some ui action (not used now)
|
static CollabMsgType |
MSG_BUNDLE
Message type for xml idv bundles
|
static CollabMsgType |
MSG_CLOSE
Message type to tell others we are closing
|
static CollabMsgType |
MSG_DATASOURCE
Message type for announcing new data sources
|
static java.lang.String |
MSG_DELIMITER
The de,limiter between the msg id and the body of the message
|
static CollabMsgType |
MSG_DISPLAY
Message type for announcing new displays
|
static CollabMsgType |
MSG_MESSAGE
Message type for chat text message
|
static CollabMsgType |
MSG_NEWUSER
Message type for new users
|
static CollabMsgType |
MSG_NEWWINDOW
Message type for when a new window is created
|
static CollabMsgType |
MSG_REMOVEDATASOURCE
Message type for when a datasource is removed
|
static CollabMsgType |
MSG_REMOVEDISPLAYCONTROL
Message type for when a display is removed
|
static CollabMsgType |
MSG_STATE
Message type for when an objects state changes
|
static java.lang.String |
PREF_ACCEPTALL
Will identify the accept all.
|
static java.lang.String |
PREF_HOSTNAME
Will identify the hostname preference.
|
static java.lang.String |
PREF_PORT
Will identify the port preference.
|
contents, dialog, frame, window
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV
Constructor and Description |
---|
CollabManager(IntegratedDataViewer idv)
Create the CollabManager
|
Modifier and Type | Method and Description |
---|---|
void |
checkShareData(Sharable from,
java.lang.Object dataId,
java.lang.Object[] data)
The implementation of the SharableListener interface.
|
protected void |
clientAdded(CollabClient client)
We have a new client
|
protected void |
clientRemoved(CollabClient client)
Client is goen
|
void |
connect()
Try to connect to the class member hostname.
|
protected boolean |
connectTo(java.lang.String collabHostName)
Try to connect to the given host
|
void |
controlHasBeenInitialized(DisplayControl control)
This gets called when the given
DisplayControl
has been initialized. |
void |
disconnectAll()
Close down all connections
|
protected javax.swing.JComponent |
doMakeContents()
Make the GUI
|
protected Sharable |
findSharable(java.lang.String id)
Find the
Sharable object
identified by the given id. |
protected Sharable |
findSharable(java.lang.String id,
java.util.List sharables)
Find the
Sharable object
identified by the given id in the list of sharables |
boolean |
getOkToRelay()
Is it ok for the server to relay messages that have been sent
by another client to any other clients we may be connected to.
|
protected java.lang.String |
getUserName()
Get our user's name
|
java.lang.String |
getWindowTitle()
Get the window title to use
|
protected void |
handleMessage(CollabClient from,
java.lang.String msg)
Process the given message from the given client.
|
protected void |
handleMessage(CollabClient from,
java.lang.String msg,
boolean checkIfMessageHasBeenSeen)
Process the given message from the given client.
|
protected void |
handleMessageInner(CollabClient fromClient,
java.lang.String msg,
boolean checkIfMessageHasBeenSeen)
Handle the incoming message.
|
protected void |
handleMessageInnerInner(CollabClient fromClient,
CollabMsgType msgType,
java.lang.String from,
java.lang.String contents)
Really handle the incoming message.
|
protected boolean |
haveClients()
Are there any clients we are connected to
|
boolean |
haveDisplayControl(DisplayControl displayControl)
Is this an existing
DisplayControl |
protected boolean |
isEnabled()
Are we doing an event capture and/or do we have any connected clients
|
protected java.lang.String |
makeMsg(CollabMsgType type,
java.lang.String body1)
Construct the message.
|
void |
newWindow(ViewManager vm)
Send the MSG_NEWWINDOW message.
|
void |
runCaptureFile(java.lang.String filename)
Execute the events in the given capture file
|
void |
sendText(java.lang.String msg)
Send the MSG_MESSAGE text message (the chat text)
|
protected void |
serverStarted()
The server has started.
|
protected void |
serverStopped()
The server has stopped.
|
void |
showCapture()
Bring up the event capture window
|
void |
showChat()
Show the chat pane
|
void |
showClients()
Show the clients pane
|
void |
showConnect()
Show the connect pane
|
void |
showLog()
Show the log pane
|
void |
showWindow()
Create the GUI if needed and popup the window.
|
void |
write(CollabMsgType type,
java.lang.String message)
Write to all clients the given message of the
given message type.
|
protected void |
writeChatText(java.lang.String from,
java.lang.String msg)
Add the given chat text to the text area
|
void |
writeRemoveDataSource(DataSource dataSource)
Send the MSG_REMOVEDATASOURCE message for the given data source
|
void |
writeRemoveDisplayControl(DisplayControl display)
Send the MSG_REMOVEDISPLAYCONTROL message for the given display control
|
void |
writeState()
Send the MSG_BUNDLE message.
|
protected void |
writeState(CollabClient client)
Write the current state of the application to the given client.
|
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDone
actionPerformed, close, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
public static java.lang.String PREF_HOSTNAME
public static java.lang.String PREF_PORT
public static java.lang.String PREF_ACCEPTALL
public static final java.lang.String MSG_DELIMITER
public static final CollabMsgType MSG_NEWUSER
public static final CollabMsgType MSG_ACKNEWUSER
public static final CollabMsgType MSG_CLOSE
public static final CollabMsgType MSG_BUNDLE
public static final CollabMsgType MSG_DATASOURCE
public static final CollabMsgType MSG_DISPLAY
public static final CollabMsgType MSG_MESSAGE
public static final CollabMsgType MSG_STATE
public static final CollabMsgType MSG_NEWWINDOW
public static final CollabMsgType MSG_REMOVEDATASOURCE
public static final CollabMsgType MSG_REMOVEDISPLAYCONTROL
public static final CollabMsgType MSG_ACTION
public CollabManager(IntegratedDataViewer idv)
idv
- Reference to the IDVpublic void connect()
protected void writeState(CollabClient client)
client
- The client to write toprotected boolean connectTo(java.lang.String collabHostName)
collabHostName
- The host to connect topublic void checkShareData(Sharable from, java.lang.Object dataId, java.lang.Object[] data)
checkShareData
in interface SharableListener
from
- The object that changeddataId
- An identifier (typically a String name) of what changeddata
- Array of things that changedpublic boolean getOkToRelay()
protected boolean isEnabled()
protected boolean haveClients()
public void showConnect()
public void showClients()
public void showChat()
public void showLog()
public void showCapture()
public void runCaptureFile(java.lang.String filename)
filename
- Filename of the capture filepublic void disconnectAll()
protected void clientAdded(CollabClient client)
client
- The new clientprotected void clientRemoved(CollabClient client)
client
- The goner clientprotected void serverStopped()
protected void serverStarted()
public void showWindow()
protected javax.swing.JComponent doMakeContents()
doMakeContents
in class WindowHolder
public java.lang.String getWindowTitle()
getWindowTitle
in class WindowHolder
public void sendText(java.lang.String msg)
msg
- The message to sendpublic void writeRemoveDataSource(DataSource dataSource)
dataSource
- The data source that was removedpublic void writeRemoveDisplayControl(DisplayControl display)
display
- The display control that was removedpublic void writeState()
public void newWindow(ViewManager vm)
vm
- The new ViewManagerpublic void write(CollabMsgType type, java.lang.String message)
type
- The message typemessage
- The messageprotected java.lang.String getUserName()
protected java.lang.String makeMsg(CollabMsgType type, java.lang.String body1)
UNIQUEID:MESSAGETYPE:USERNAME:MESSAGEBODY
type
- The type of the messagebody1
- The message textprotected void handleMessage(CollabClient from, java.lang.String msg)
from
- The CollabClient
this message is from . This
may be the replayClientmsg
- the messageprotected void handleMessage(CollabClient from, java.lang.String msg, boolean checkIfMessageHasBeenSeen)
from
- The CollabClient
this message is from . This may be the replayClientmsg
- the messagecheckIfMessageHasBeenSeen
- Only process unique messagesprotected void handleMessageInner(CollabClient fromClient, java.lang.String msg, boolean checkIfMessageHasBeenSeen) throws java.lang.Exception
fromClient
- Who sent itmsg
- The messagecheckIfMessageHasBeenSeen
- Should we check if we have seen this.
Normal collaboration message we always check. This flag is there
so the CaptureManager
can replay messages even though we may
have already seen them.java.lang.Exception
- the exceptionprotected void handleMessageInnerInner(CollabClient fromClient, CollabMsgType msgType, java.lang.String from, java.lang.String contents) throws java.lang.Exception
fromClient
- From wheremsgType
- Typefrom
- From whomcontents
- Message bodyjava.lang.Exception
- the exceptionprotected void writeChatText(java.lang.String from, java.lang.String msg)
from
- From whommsg
- The textpublic boolean haveDisplayControl(DisplayControl displayControl)
DisplayControl
displayControl
- The display control to checkprotected Sharable findSharable(java.lang.String id, java.util.List sharables)
Sharable
object
identified by the given id in the list of sharablesid
- Id to search forsharables
- The haystackprotected Sharable findSharable(java.lang.String id)
Sharable
object
identified by the given id. This looks in the
list of display controls, the data sources, the view managers
and the animation widgets. (Which are the different classes of
of objects that we share state for.id
- Id to search forpublic void controlHasBeenInitialized(DisplayControl control)
DisplayControl
has been initialized. When we get this, if we are enabled, we send
the MSG_DISPLAY message with the xml encoding of the display.control
- The display control that has been initialized