org.autoplot.dom.ApplicationController

The ApplicationController, one per dom, is in charge of managing the application as a whole, for example, adding and deleting plots, managing bindings, and managing focus.

ApplicationController( org.autoplot.ApplicationModel model, org.autoplot.dom.Application application )


VALUE_BLUR_FOCUS

use this value to blur the focus.


PROP_STATUS


PROP_FOCUSURI

property focusUri is the uri that has gained focus. This can be the datasource uri, or the location of the .vap file.


PROP_PLOT_ELEMENT


PROP_PLOT


PROP_CANVAS


PROP_DATASOURCEFILTER

focus dataSourceFilter.


PROP_PENDINGCHANGECOUNT


addActionListener

addActionListener( java.awt.event.ActionListener list ) → void

Parameters

list - an ActionListener

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


addAnnotation

addAnnotation( org.autoplot.dom.Annotation annotation ) → Annotation

experiment with Jython-friendly method where the annotation is instantiated within the script. This allows code like:


 ann= Annotation( text='Feature', pointAtX=datum(tt), pointAtY=datum('100nT'), showArrow=True )

Parameters

annotation - an Annotation

Returns:

the annotation, configured.

[search for examples] [view on GitHub] [view on old javadoc] [view source]

addAnnotation( org.autoplot.dom.Plot p, String text ) → Annotation
addAnnotation( org.autoplot.dom.Row row, org.autoplot.dom.Column column, String text ) → Annotation

addCanvas

addCanvas( ) → DasCanvas

add a canvas to the application. Currently, only one canvas is supported, so this will have unanticipated effects if called more than once. This must be public to provide access to org.autoplot.ApplicationModel

Returns:

an org.das2.graph.DasCanvas

[search for examples] [view on GitHub] [view on old javadoc] [view source]


addConnector

addConnector( org.autoplot.dom.Plot upperPlot, org.autoplot.dom.Plot lowerPlot ) → void

adds a context overview plotId below the plotId.

Parameters

upperPlot - the upper plot
lowerPlot - the lower plot

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


addDas2PeerChangeListener

addDas2PeerChangeListener( java.beans.PropertyChangeListener listener ) → void

kludgy way to decouple the context menus from the DOM tree.

Parameters

listener - a PropertyChangeListener

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


addDataSourceFilter

addDataSourceFilter( ) → DataSourceFilter

add a DataSourceFilter to the dom.

Returns:

the new DataSourceFilter

[search for examples] [view on GitHub] [view on old javadoc] [view source]


addPlot

addPlot( Object direction ) → Plot

add a plot to the canvas. Direction is with respect to the current focus plot, and currently only LayoutConstants.ABOVE and LayoutConstants.BELOW are supported.

Parameters

direction - LayoutConstants.ABOVE, LayoutConstants.BELOW, or null. Null indicates the layout will be done elsewhere, and the new plot will be on top of the old.

Returns:

an org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]

addPlot( org.autoplot.dom.Plot focus, Object direction ) → Plot
addPlot( org.autoplot.dom.Row row, org.autoplot.dom.Column column ) → Plot
addPlot( String xpos, String ypos ) → Plot

addPlotElement

addPlotElement( org.autoplot.dom.Plot domPlot, org.autoplot.dom.DataSourceFilter dsf ) → PlotElement

add a plotElement to the application, attaching it to the given Plot and DataSourceFilter.

Parameters

domPlot - if null, create a Plot, if non-null, add the plotElement to this plot.
dsf - if null, create a DataSourceFilter. If non-null, connect the plotElement to this data source.

Returns:

an org.autoplot.dom.PlotElement

[search for examples] [view on GitHub] [view on old javadoc] [view source]

addPlotElement( org.autoplot.dom.Plot domPlot, org.autoplot.dom.PlotElement parent, org.autoplot.dom.DataSourceFilter dsf ) → PlotElement

addPlots

addPlots( int nrow, int ncol, Object dir ) → List

adds a block of plots to the canvas below the focus plot. A plotElement is added for each plot as well.

Parameters

nrow - number of rows
ncol - number of columns
dir - LayoutConstants.ABOVE, LayoutConstants.BELOW or null. Null means use the current row. RIGHT and LEFT for the margin column.

Returns:

a list of the newly added plots.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


bind

bind( org.autoplot.dom.DomNode src, String srcProp, Object dst, String dstProp, Converter converter ) → void

binds two bean properties together. Bindings are bidirectional, but the initial copy is from src to dst. In MVC terms, src should be the model and dst should be a view. The properties must fire property change events for the binding mechanism to work. A converter object can be provided that converts the object type between the two nodes. BeansBinding library is apparently not thread-safe. Example:


 model= getApplicationModel()
 bind( model.getPlotDefaults(), "title", model.getPlotDefaults().getXAxis(), "label" )

Parameters

src - java bean such as model.getPlotDefaults()
srcProp - a property name such as "title"
dst - java bean such as model.getPlotDefaults().getXAxis()
dstProp - a property name such as "label"
converter - a converter object for the binding. (e.g. Color name to Color object)

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

bind( org.autoplot.dom.DomNode src, String srcProp, Object dst, String dstProp ) → void

cancelAllPendingTasks

cancelAllPendingTasks( ) → void

go through the monitors we keep track of, and cancel each one.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


copyPlot

copyPlot( org.autoplot.dom.Plot srcPlot, boolean bindx, boolean bindy, boolean addPlotElement ) → Plot

Copy the plot and its axis settings, optionally binding the axes. Whether the axes are bound or not, the duplicate plot is initially synchronized to the source plot.

Parameters

srcPlot - The plot to be copied
bindx - If true, X axes are bound. If the srcPlot x axis is bound to the application timerange, then bind to that instead (kludge--handle higher)
bindy - If true, Y axes are bound
addPlotElement - add a plotElement attached to the new plot as well.

Returns:

The duplicate plot

See Also:

DomOps#copyPlotAndPlotElements(org.autoplot.dom.Plot, boolean, boolean, boolean, java.lang.Object)


[search for examples] [view on GitHub] [view on old javadoc] [view source]


copyPlotAndPlotElements

copyPlotAndPlotElements( org.autoplot.dom.Plot domPlot, org.autoplot.dom.DataSourceFilter dsf, boolean bindx, boolean bindy ) → Plot

copy plot and plotElements into a new plot.

Parameters

domPlot - copy this plot.
dsf - if non-null, then use this dataSourceFilter
bindx - If true, X axes are bound. If the srcPlot x axis is bound to the application timerange, then bind to that instead (kludge--handle higher)
bindy - If true, Y axes are bound

Returns:

the new plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]


delete

delete( String id ) → void

delete the named plot, plotElement, annotation, or dataSource

Parameters

id - node name like "plot_5", see dom.plots[0].id.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

delete( org.autoplot.dom.DomNode n ) → void

deleteAnnotation

deleteAnnotation( org.autoplot.dom.Annotation c ) → void

delete the annotation

Parameters

c - the annotation

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


deleteBinding

Deprecated: see removeBinding(binding)

deleteConnector

deleteConnector( org.autoplot.dom.Connector connector ) → void

delete the connector between two plot X axes.

Parameters

connector - a Connector

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


deleteDataSourceFilter

deleteDataSourceFilter( org.autoplot.dom.DataSourceFilter dsf ) → void

delete the dsf and any parents that deleting it leaves orphaned. (??? maybe they should be called children...)

Parameters

dsf - a DataSourceFilter

Returns:

void (returns nothing)

See Also:

DomUtil#deleteDataSourceFilter(org.autoplot.dom.Application, org.autoplot.dom.DataSourceFilter)


[search for examples] [view on GitHub] [view on old javadoc] [view source]


deletePlot

deletePlot( org.autoplot.dom.Plot domPlot ) → void

delete the plot from the application. TODO: this should really call the plot.controller.deleteDasPeer()

Parameters

domPlot - a Plot

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


deletePlotElement

deletePlotElement( org.autoplot.dom.PlotElement pelement ) → void

delete the plot element completely, or if it is the last, then empty the data source. Earlier versions of this would throw an exception if the last plotElement was deleted.

Parameters

pelement - a PlotElement

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


doplot

doplot( org.autoplot.dom.Plot plot, org.autoplot.dom.PlotElement pele, String secondaryUri, String teriaryUri, String primaryUri ) → PlotElement

Parameters

plot - a Plot
pele - a PlotElement
secondaryUri - a String
teriaryUri - a String
primaryUri - a String

Returns:

org.autoplot.dom.PlotElement

[search for examples] [view on GitHub] [view on old javadoc] [view source]

doplot( org.autoplot.dom.Plot plot, org.autoplot.dom.PlotElement pele, String secondaryUri, String primaryUri ) → PlotElement
doplot( org.autoplot.dom.Plot plot, org.autoplot.dom.PlotElement pele, String primaryUri ) → PlotElement

fillEditPlotMenu

fillEditPlotMenu( javax.swing.JMenu editPlotMenu, org.autoplot.dom.Plot domPlot ) → void

Parameters

editPlotMenu - a JMenu
domPlot - a Plot

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


findBinding

findBinding( org.autoplot.dom.DomNode src, String srcProp, org.autoplot.dom.DomNode dst, String dstProp ) → BindingModel

Find the binding, if it exists. All bindingImpls are symmetric, so the src and dst order is ignored in this search.

Parameters

src - the node (e.g. an Axis)
srcProp - the property name (e.g. "range")
dst - the other node
dstProp - the other node's property name (e.g. "range")

Returns:

the BindingModel or null if it doesn't exist.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


findBindings

findBindings( org.autoplot.dom.DomNode src, String srcProp ) → List

returns a list of bindings of the node for the property

Parameters

src - a DomNode
srcProp - a String

Returns:

a java.util.List

[search for examples] [view on GitHub] [view on old javadoc] [view source]

findBindings( org.autoplot.dom.DomNode src, String srcProp, org.autoplot.dom.DomNode dst, String dstProp ) → List

getApplication

getApplication( ) → Application

Returns:

org.autoplot.dom.Application

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getApplicationModel

getApplicationModel( ) → ApplicationModel

Returns:

org.autoplot.ApplicationModel

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getBindingsFor

getBindingsFor( org.autoplot.dom.DomNode node ) → BindingModel

Parameters

node - a DomNode

Returns:

org.autoplot.dom.BindingModel[]

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getCanvas

getCanvas( ) → Canvas

focus canvas. Note there is only one canvas allowed (for now).

Returns:

the focus canvas.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getColumn

getColumn( ) → DasColumn

get the DasColumn implementation for the marginRow.

Returns:

the DasColumn implementation for the marginColumn.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDasCanvas

getDasCanvas( ) → DasCanvas

return the das canvas.

Returns:

the das canvas.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDataSourceFilter

getDataSourceFilter( ) → DataSourceFilter

return focus dataSourceFilter, or null. This will return the first dataSourceFilter when nothing is in focus.

Returns:

the focus dataSourceFilter.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getDataSourceFilterFor

getDataSourceFilterFor( org.autoplot.dom.PlotElement element ) → DataSourceFilter

return the DataSourceFilter for the plotElement, or null if none exists.

Parameters

element - a PlotElement

Returns:

the DataSourceFilter to which the plot element refers, or null.

See Also:

getFirstPlotFor(org.autoplot.dom.DataSourceFilter)


[search for examples] [view on GitHub] [view on old javadoc] [view source]


getElementById

getElementById( String id ) → DomNode

return the dom element (plot,axis,etc) with this id.

Parameters

id - a String

Returns:

the DomNode with this id.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFirstPlotFor

getFirstPlotFor( org.autoplot.dom.DataSourceFilter dsf ) → Plot

find the first plot that is connected to this data, following vap+internal links. This is used, for example, to get a timerange to control the DSF.

Parameters

dsf - a DataSourceFilter

Returns:

an org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getFocusUri

getFocusUri( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getMonitorFactory

getMonitorFactory( ) → MonitorFactory

return the source of monitors.

Returns:

the source of monitors.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getNextPlotHoriz

getNextPlotHoriz( org.autoplot.dom.Plot p, Object dir ) → Plot

Parameters

p - a Plot
dir - an Object

Returns:

org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getPendingChangeCount

getPendingChangeCount( ) → int

get the number of pending changes. 0 means the application is idle.

Returns:

get the number of pending changes.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getPlot

getPlot( org.autoplot.dom.Plot p, Object dir ) → Plot

Parameters

p - a Plot
dir - an Object

Returns:

org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getPlot( ) → Plot

getPlotAbove

getPlotAbove( org.autoplot.dom.Plot p ) → Plot

return a plot that is immediately above the given plot. This encapsulates the layout model, and implementation should change.

Parameters

p - a Plot

Returns:

an org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getPlotBelow

getPlotBelow( org.autoplot.dom.Plot p ) → Plot

return a plot that is immediately below the given plot. This encapsulates the layout model, and implementation should change.

Parameters

p - a Plot

Returns:

an org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getPlotElement

getPlotElement( ) → PlotElement

return the focus plot element or null

Returns:

the focus plot element

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getPlotElementsFor

getPlotElementsFor( org.autoplot.dom.Plot plot ) → List

return the PlotElements for the plot, if any.

Parameters

plot - a Plot

Returns:

list of PlotElements.

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getPlotElementsFor( org.autoplot.dom.DataSourceFilter dsf ) → List

getPlotFor

getPlotFor( java.awt.Component c ) → Plot

return the Plot corresponding to the das2 component.

Parameters

c - Das2 component such as DasPlot or DasAxis.

Returns:

an org.autoplot.dom.Plot

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getPlotFor( org.autoplot.dom.PlotElement element ) → Plot

getPlotsFor

getPlotsFor( org.autoplot.dom.DataSourceFilter dsf ) → List

return the Plot using the DataSourceFilter, checking for ticksURI as well. This does not return indirect (via vap+internal) references.

Parameters

dsf - the data source filter.

Returns:

return the PlotElements for the data source filter, if any.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getRow

getRow( ) → DasRow

get the DasRow implementation for the marginRow.

Returns:

the DasRow implementation for the marginRow.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getSelectedPlots

getSelectedPlots( ) → String

Returns:

java.lang.String

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getSelectedPlotsArray

getSelectedPlotsArray( ) → Plot

convenient method for setting the selected plots

Returns:

the plots

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getStatus

getStatus( ) → String

clients can get status here.

Returns:

the last status message.

See Also:

waitUntilIdle()


[search for examples] [view on GitHub] [view on old javadoc] [view source]


getStatusAgeMillis

getStatusAgeMillis( ) → long

return the number of milliseconds since the last status update

Returns:

the number of milliseconds since the last status update

[search for examples] [view on GitHub] [view on old javadoc] [view source]


isHeadless

isHeadless( ) → boolean

true if running in headless environment

Returns:

true if running in headless environment

[search for examples] [view on GitHub] [view on old javadoc] [view source]


isTimeSeriesBrowse

isTimeSeriesBrowse( org.autoplot.dom.Plot p ) → boolean

return true if the plot has the time series browse capability, meaning something will go off and load more data if the time range is changed. Note the TSB may be connected to the plot's context property, and the x-axis is not a time axis.

Parameters

p - the plot.

Returns:

true if the plot has the time series browse.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


maybeGetApplicatonGUI

maybeGetApplicatonGUI( ) → AutoplotUI

contain the logic which returns a reference to the AutoplotUI, so that this nasty bit of code is contained.

Returns:

null or the application

[search for examples] [view on GitHub] [view on old javadoc] [view source]


peekBindingSupport

peekBindingSupport( ) → BindingSupport

for debugging in scripts.

Returns:

the BindingSupport object.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


plotUri

plotUri( String suri, boolean resetPlot ) → void

provide method for plotting a URI without any axis resetting.

Parameters

suri - the URI to plot
resetPlot - a boolean

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

plotUri( int position, String suri, boolean resetPlot ) → void
plotUri( int position, QDataSet ds, boolean resetPlot ) → void

removeActionListener

removeActionListener( java.awt.event.ActionListener list ) → void

Parameters

list - an ActionListener

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


removeBinding

removeBinding( org.autoplot.dom.BindingModel binding ) → void

remove the binding and its implementation.

Parameters

binding - a BindingModel

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


reset

reset( ) → void

resets the dom to the initial state by deleting added plotElements, plots and data sources.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setCanvas

setCanvas( org.autoplot.dom.Canvas canvas ) → void

set focus canvas, which must be the one of the canvas the application knows about.

Parameters

canvas - the new focus canvas.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setDataSourceFilter

setDataSourceFilter( org.autoplot.dom.DataSourceFilter dataSourceFilter ) → void

set the focus dataSourceFilter.

Parameters

dataSourceFilter - the focus dataSourceFilter, or null.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setFocusUri

setFocusUri( String focusUri ) → void

Parameters

focusUri - a String

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setPendingChangeCount

setPendingChangeCount( int pendingChangeCount ) → void

Parameters

pendingChangeCount - an int

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setPlot

setPlot( org.autoplot.dom.Plot plot ) → void

This can take a while and should not be called on the event thread.

Parameters

plot - a Plot

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setPlotElement

setPlotElement( org.autoplot.dom.PlotElement plotElement ) → void

set the focus plot element

Parameters

plotElement - the new focus plot element.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setSelectedPlots

setSelectedPlots( String selectedPlots ) → void

Parameters

selectedPlots - a String

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setSelectedPlotsArray

setSelectedPlotsArray( org.autoplot.dom.Plot[] selectedPlots ) → void

convenient method for setting the selected plots

Parameters

selectedPlots - an org.autoplot.dom.Plot[]

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


setStatus

setStatus( String status ) → void

clients can send messages to here. The message may be conventionally prefixed with "busy:" "error:" or "warning:" (And these will be displayed as icons, for example, in the view.)

Parameters

status - a String

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


showBindings

showBindings( ) → void

show the bindings, for debugging purposes.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]


unbind

unbind( org.autoplot.dom.DomNode src, String srcProp, Object dst, String dstProp ) → void

unbind the binding between a dom node and another object.

Parameters

src - a DomNode
srcProp - the property name.
dst - an Object
dstProp - the property name.

Returns:

void (returns nothing)

[search for examples] [view on GitHub] [view on old javadoc] [view source]

unbind( org.autoplot.dom.DomNode src ) → void

waitUntilIdle

waitUntilIdle( ) → void

block the calling thread until the application is idle.

Returns:

void (returns nothing)

See Also:

isPendingChanges.


[search for examples] [view on GitHub] [view on old javadoc] [view source]