|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator
Stands between a set of viper metadata and the user interface, providing information about user focus and limiting the scope that the user has to pay attention to. This is pretty ad hoc; it is certainly conceivable that the user would want multiple focii, or provide multiple filters. Later, we may move to a stream transformation type view, but this is just to test out some ideas.
Constructor Summary | |
ViperViewMediator()
Creates a new ViperViewMediator without any data |
Method Summary | |
void |
addViperMediatorChangeListener(ViperMediatorChangeListener l)
Adds a listener for ui notifications. |
void |
displayHotkeyBindings()
Displays the current hotkey bindings in a new window. |
Descriptor |
duplicateDescriptor(Descriptor instance)
Copies the given descriptor and adds it to the descriptor's parent sourcefile node. |
void |
fireCurrFileChange()
Indicate that the currently selected sourcefile is no longer selected, and that another one might be. |
void |
fireDataChange(ViperChangeEvent vce)
Indicate that the instance data of viper has changed. |
void |
fireFrameChange()
Indicate that the there is a new current frame of interest. |
void |
fireMediaChange()
Indicate that the underlying media has changed, although the metadata has not. |
void |
fireSchemaChange(ViperChangeEvent vce)
Indicate that the schema of the file, and possibly wide sections of the instance data, has changed. |
ActionHistoryPane |
getActionHistory()
Gets the undo/redo action history. |
java.awt.event.ActionListener |
getCreateInstanceActionListener()
|
Frame |
getCurrentFrame()
Gets the major moment as
a Frame . |
Sourcefile |
getCurrFile()
Gets the data associated with the current Sourcefile of interest. |
java.net.URI |
getCurrFileName()
Gets the current media file name as a URI |
InstantInterval |
getCurrInterval(boolean frameBased)
Gets a single frame interval surrounding the current instant of interest. |
ViperDataFactory |
getDataFactory()
Gets the type factory, used for associating data types with attributes, that is currently in use. |
DataPlayer |
getDataPlayer()
Gets the view of the media that currently has focus. |
java.awt.event.ActionListener |
getDeleteInstanceActionListener()
Gets an action listener that tries to delete the currently selected descriptor, if it exists. |
java.awt.event.ActionListener |
getDisplayHotkeyBindingsActionListener()
Gets an action that displays the current hotkey bindings. |
DisplayWithRespectToManager |
getDisplayWRTManager()
Use this method to access the display wrt manager, and then you can add listeners to it. |
java.awt.event.ActionListener |
getDuplicateInstanceActionListener()
Gets an action listener that tries to copy the selected object descriptor, if it exists. |
java.awt.event.ActionListener |
getExportCurrentFileActionListener()
Gets an action object for the 'export current file as a .gtf file' option. |
java.net.URI |
getFileName()
Gets the URI of the currently displayed metadata file. |
java.lang.String |
getFocalFile()
Gets the current source media file that the user is annotating. |
InstantInterval |
getFocusInterval()
Gets the span of interest. |
NodeVisibilityManager |
getHiders()
Gets the manager of the set of hidden items. |
FileHistoryManager |
getHistoryManager()
Gets the MRU file history manager. |
java.awt.event.ActionListener |
getImportConfigActionListener()
Gets an action object that will import the viper schema of an existing file. |
java.awt.event.ActionListener |
getImportGTFFileActionListener()
Gets an action object for the 'Import GTF into Current Media File' menu option. |
java.net.URI |
getLocalPathToFile(java.net.URI canonical)
Finds the local version of the file. |
Instant |
getMajorMoment()
Gets the current frame/time of interest. |
ChronicleMarkerModel |
getMarkerModel()
Returns the model that should be used to display markers on a chronicle view, if one is attatched |
edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.MoveAttributeActionListener |
getMoveAttributeActionListener()
|
java.awt.event.ActionListener |
getNewFileActionListener()
Gets an action that will open a new, empty metadata file. |
java.awt.event.ActionListener |
getOpenFileActionListener()
Gets the 'open file' action. |
PrefsManager |
getPrefs()
Gets the associated application loader preference manager. |
ViperSubTree |
getPrimarySelection()
Gets the current top-selection of the user. |
PropagateInterpolateModule |
getPropagator()
Gets the propagation object. |
java.awt.event.ActionListener |
getRecentlyViewedFileActionListener()
Gets an action that will open the recently viewed file referenced in the action command. |
edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.RedoActionListener |
getRedoActionListener()
Gets an action that will redo the last undone action that hasn't been redone, if one exists. |
java.awt.event.ActionListener |
getSaveActionListener()
Gets the 'Save Current File' action object. |
java.awt.event.ActionListener |
getSaveAsActionListener()
Gets the 'Save File As...' action object. |
AttemptToPerformAction |
getSaveDiscardOrCancelDialogVeto()
Gets a 'Save, Discard, or Cancel' dialog up. |
java.awt.event.ActionListener |
getSelectAttributeActionListener()
|
java.awt.event.ActionListener |
getSelectDescriptorConfigActionListener()
|
java.awt.event.ActionListener |
getSelectDescriptorInstanceActionListener()
|
ViperSelectionSet |
getSelection()
Gets the currently selected metadata item. |
java.awt.event.ActionListener |
getToggleDisplayInvalidActionListener()
Gets an action that toggles the 'showing invalid' property. |
edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.UndoActionListener |
getUndoActionListener()
Gets an action that will undo the last action. |
ViperData |
getViperData()
Gets the underlying annotation information. |
boolean |
isShowingInvalid()
Tests to see if the user should care about descriptors that are invalid at the current frame of interest. |
boolean |
isThisValidNow(Descriptor d)
Tests to see if the descriptor is valid at the current frame/time of user interest. |
void |
modifyMostRecentlyUsed(java.net.URI filename)
Indicate that the given file has been used, moving it to the top of the MRU list. |
void |
openCanonicalFileAsLocalFile(java.net.URI canonical,
java.net.URI local,
MediaElement fileInfo)
Opens the file. |
void |
putCanonicalToLocalMapping(java.net.URI canonical,
java.net.URI local)
Adds the given mapping from canonical file name to local file name. |
void |
removeViperMediatorChangeListener(ViperMediatorChangeListener l)
Removes a listener. |
void |
saveDiscardOrCancel(java.lang.Runnable ok)
Prompts the user if she would like to save the changes, discard the changes, or cancel the current action. |
void |
saveDiscardOrCancelIfChanged(java.lang.Runnable ok)
Brings up the save/discard/cancel prompt if there are any items in the action history (ie the file has been altered since it was opened/created); otherwise, just runs the Runnable. |
void |
setActionHistory(ActionHistoryPane ahp)
Sets the action history panel. |
void |
setAttributeValueAtCurrentFrame(java.lang.Object val,
Attribute a)
Sets the value of an attribute (or the default value of an attribute, if val is an AttrConfig). |
void |
setAttributeValueAtSpan(java.lang.Object val,
Attribute a,
InstantInterval span)
Sets the value of an attribute (or the default value of an attribute, if val is an AttrConfig). |
void |
setDataFactory(ViperDataFactory fact)
Sets the attribute type factory. |
void |
setFileName(java.net.URI f)
Load the metadata file from the given URI and set it to be the currently editing file. |
void |
setFocalFile(java.net.URI fname)
Sets the media file the user is currently annotating. |
void |
setHistoryManager(FileHistoryManager manager)
Sets the file history manager to use with the application. |
void |
setMajorMoment(Instant majorMoment)
Sets the majorMoment. |
void |
setMarkerModel(ChronicleMarkerModel model)
Sets the marker model. |
void |
setPrefs(PrefsManager manager)
Sets the associated preference manager. |
void |
setPropagator(PropagateInterpolateModule propagator)
|
void |
setShowingInvalid(boolean showingInvalid)
Turns on/off the invalid descriptors in the spreadsheet view. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ViperViewMediator()
Method Detail |
public ViperDataFactory getDataFactory()
public void setDataFactory(ViperDataFactory fact)
fact
- the new data type factorypublic java.net.URI getFileName()
LOCAL_HISTORY.Untitled
public void openCanonicalFileAsLocalFile(java.net.URI canonical, java.net.URI local, MediaElement fileInfo)
canonical
- the name of the media file found in the
viper data filelocal
- the actual location the file is stored on
the user's diskpublic void putCanonicalToLocalMapping(java.net.URI canonical, java.net.URI local)
canonical
- the name that is found in the sourcefile
element of the viper data filelocal
- the local name of the filepublic java.net.URI getLocalPathToFile(java.net.URI canonical)
canonical
- the file to look up
public void setFileName(java.net.URI f) throws java.io.IOException
f
- The file t load
java.io.IOException
- If the file cannot load, or if has errors. If the focal file
cannot be loaded, no exception is thrown.public void addViperMediatorChangeListener(ViperMediatorChangeListener l)
l
- the ui listenerpublic void removeViperMediatorChangeListener(ViperMediatorChangeListener l)
l
- the listener to removepublic void fireMediaChange()
public void fireCurrFileChange()
public void fireFrameChange()
public void fireDataChange(ViperChangeEvent vce)
vce
- the change event that caused this
to be called.public void fireSchemaChange(ViperChangeEvent vce)
vce
- the wrapped viper api change event,
if anypublic void modifyMostRecentlyUsed(java.net.URI filename)
filename
- the file to touchpublic java.lang.String getFocalFile()
null
.public void setFocalFile(java.net.URI fname) throws java.io.IOException
fname
- the name of the file to view
java.io.IOException
- if there is an error while loading
the filepublic Sourcefile getCurrFile()
public java.net.URI getCurrFileName()
public ViperData getViperData()
public DataPlayer getDataPlayer()
public InstantInterval getFocusInterval()
public Instant getMajorMoment()
public Frame getCurrentFrame()
major moment
as
a Frame
.
public InstantInterval getCurrInterval(boolean frameBased)
frameBased
- true asks for the interval in terms of
frames, while false will give the interval in time.
public void setMajorMoment(Instant majorMoment)
majorMoment
- The majorMoment to setpublic java.awt.event.ActionListener getNewFileActionListener()
public void saveDiscardOrCancelIfChanged(java.lang.Runnable ok)
ok
- To execute if the user doesn't cancel.public void saveDiscardOrCancel(java.lang.Runnable ok)
ok
- to run if the user selects 'okay'public java.awt.event.ActionListener getRecentlyViewedFileActionListener()
public edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.RedoActionListener getRedoActionListener()
public edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.UndoActionListener getUndoActionListener()
public java.awt.event.ActionListener getOpenFileActionListener()
public Descriptor duplicateDescriptor(Descriptor instance)
instance
- the descriptor to copy
public AttemptToPerformAction getSaveDiscardOrCancelDialogVeto()
public java.awt.event.ActionListener getSaveActionListener()
public java.awt.event.ActionListener getSaveAsActionListener()
public java.awt.event.ActionListener getExportCurrentFileActionListener()
public java.awt.event.ActionListener getImportGTFFileActionListener()
public java.awt.event.ActionListener getImportConfigActionListener()
public PrefsManager getPrefs()
public void setPrefs(PrefsManager manager)
manager
- a set of preferences that describes
the applications and the user preferences for itpublic FileHistoryManager getHistoryManager()
public void setHistoryManager(FileHistoryManager manager)
manager
- the file historypublic ActionHistoryPane getActionHistory()
public void setActionHistory(ActionHistoryPane ahp)
ahp
- the new event history panelpublic java.awt.event.ActionListener getCreateInstanceActionListener()
public java.awt.event.ActionListener getDeleteInstanceActionListener()
public java.awt.event.ActionListener getDuplicateInstanceActionListener()
public java.awt.event.ActionListener getSelectAttributeActionListener()
public java.awt.event.ActionListener getSelectDescriptorConfigActionListener()
public java.awt.event.ActionListener getSelectDescriptorInstanceActionListener()
public edu.umd.cfar.lamp.viper.gui.core.ViperViewMediator.MoveAttributeActionListener getMoveAttributeActionListener()
public void setAttributeValueAtCurrentFrame(java.lang.Object val, Attribute a)
val
- the new valuea
- the attribute on which to set the valuepublic void setAttributeValueAtSpan(java.lang.Object val, Attribute a, InstantInterval span)
val
- the new valuea
- the attribute on which to set the valuespan
- the instant interval at which to set the valuepublic boolean isThisValidNow(Descriptor d)
d
- the descriptor
public PropagateInterpolateModule getPropagator()
public NodeVisibilityManager getHiders()
public ViperSelectionSet getSelection()
public ViperSubTree getPrimarySelection()
getSelection()
public ChronicleMarkerModel getMarkerModel()
public void setMarkerModel(ChronicleMarkerModel model)
model
- the model that is the reference marker modelpublic DisplayWithRespectToManager getDisplayWRTManager()
public void displayHotkeyBindings()
public java.awt.event.ActionListener getDisplayHotkeyBindingsActionListener()
public boolean isShowingInvalid()
public void setShowingInvalid(boolean showingInvalid)
showingInvalid
- the new valuepublic java.awt.event.ActionListener getToggleDisplayInvalidActionListener()
public void setPropagator(PropagateInterpolateModule propagator)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |