## org.autoplot.dom.DomOps

Many operations are defined within the DOM object controllers that needn't be. This class is a place for operations that are performed on the DOM independent of the controllers. For example, the operation to swap the position of two plots is easily implemented by changing the rowid and columnid properties of the two plots.

## DomOps( )

## OPTION_FIX_LAYOUT_HIDE_TITLES

See https://sourceforge.net/p/autoplot/feature-requests/811/

## OPTION_FIX_LAYOUT_HIDE_TIME_AXES

## OPTION_FIX_LAYOUT_HIDE_Y_AXES

## OPTION_FIX_LAYOUT_MOVE_LEGENDS_TO_OUTSIDE_NE

## OPTION_FIX_LAYOUT_VERTICAL_SPACING

## OPTION_FIX_LAYOUT_HORIZONTAL_SPACING

## aggregateAll

aggregateAll( org.autoplot.dom.Application dom ) → void

aggregate all the URIs within the dom.

### Parameters

dom - an Application

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## bottomAndTopMostPlot

bottomAndTopMostPlot( org.autoplot.dom.Application dom, java.util.List plots ) → org.autoplot.dom.Plot[]

return the bottom-most and top-most plot of a list of plots. This does use controllers.

### Parameters

dom - an Application
plots - a java.util.List

### Returns:

an org.autoplot.dom.Plot[]
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## bottomAndTopMostPlot

bottomAndTopMostPlot( org.autoplot.dom.Application dom, org.autoplot.dom.Plot[] plots ) → org.autoplot.dom.Plot[]

return the bottom-most and top-most plot of a list of plots. This does use controllers.

### Parameters

dom - an Application
plots - an org.autoplot.dom.Plot[]

### Returns:

an org.autoplot.dom.Plot[]
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## copyPlot

copyPlot( org.autoplot.dom.Plot srcPlot, boolean bindx, boolean bindy, Object direction ) → org.autoplot.dom.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. See {@link org.autoplot.dom.ApplicationController#copyPlot(org.autoplot.dom.Plot, boolean, boolean, boolean) copyPlot}

### Parameters

srcPlot - a Plot
bindx - a boolean
bindy - a boolean
direction - an Object

### Returns:

the new plot
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## copyPlotAndPlotElements

copyPlotAndPlotElements( org.autoplot.dom.Plot srcPlot, boolean copyPlotElements, boolean bindx, boolean bindy, Object direction ) → org.autoplot.dom.Plot

copyPlotAndPlotElements. This does not appear to be used. See {@link org.autoplot.dom.ApplicationController#copyPlotAndPlotElements(org.autoplot.dom.Plot, org.autoplot.dom.DataSourceFilter, boolean, boolean) copyPlotAndPlotElements}

### Parameters

srcPlot - a Plot
copyPlotElements - a boolean
bindx - a boolean
bindy - a boolean
direction - an Object

### Returns:

an org.autoplot.dom.Plot
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## copyPlotElements

copyPlotElements( org.autoplot.dom.Plot srcPlot, org.autoplot.dom.Plot dstPlot ) → java.util.List

copy the plot elements from srcPlot to dstPlot. This does not appear to be used. See {@link org.autoplot.dom.ApplicationController#copyPlotElement(org.autoplot.dom.PlotElement, org.autoplot.dom.Plot, org.autoplot.dom.DataSourceFilter) copyPlotElement}

### Parameters

srcPlot - plot containing zero or more plotElements.
dstPlot - destination for the plotElements.

### Returns:

a java.util.List
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixHorizontalLayout

fixHorizontalLayout( org.autoplot.dom.Application dom ) → void

This is the new layout mechanism (fixLayout), but changed from vertical layout to horizontal. This one:

- Removes extra whitespace
- Preserves relative size weights.
- Preserves em heights, to support components which should not be rescaled. (Not yet supported.)
- Preserves space taken by strange objects, to support future canvas components.
- Renormalizes the margin row, so it is nice. (Not yet supported. This should consider font size, where large fonts don't need so much space.)

This should also be idempotent, where calling this a second time should have no effect.

### Parameters

dom - an application state, with controller nodes.

### Returns:

void (returns nothing)

### See Also:

fixLayout(org.autoplot.dom.Application)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixHorizontalLayout

fixHorizontalLayout( org.autoplot.dom.Application dom, java.util.Map options ) → void

This is the new layout mechanism (fixLayout), but changed from vertical layout to horizontal. This one:

- Renormalizes the margin column, so it is nice.
- Removes extra whitespace
- Preserves relative size weights.
- Preserves em widths, to support components which should not be rescaled.
- Try to make each column's em offsets similar, using the marginColumn, so that fonts can be scaled.

This should also be idempotent, where calling this a second time should have no effect.

### Parameters

dom - an application state, with controller nodes.
options - a java.util.Map

### Returns:

void (returns nothing)

### See Also:

fixLayout(org.autoplot.dom.Application)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixLayout

fixLayout( org.autoplot.dom.Application dom ) → void

New layout mechanism which fixes a number of shortcomings of the old layout mechanism, newCanvasLayout. This one:

- Removes extra whitespace
- Preserves relative size weights.
- Preserves em heights, to support components which should not be rescaled. (Not yet supported.)
- Preserves space taken by strange objects, to support future canvas components.
- Renormalizes the margin row, so it is nice. (Not yet supported. This should consider font size, where large fonts don't need so much space.)

This should also be idempotent, where calling this a second time should have no effect.

### Parameters

dom - an application state.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixLayout

fixLayout( org.autoplot.dom.Application dom, java.util.Map options ) → void

New layout mechanism which fixes a number of shortcomings of the old layout mechanism, newCanvasLayout. This one:

- Removes extra whitespace
- Preserves relative size weights.
- Preserves em heights, to support components which should not be rescaled. (Not yet supported.)
- Preserves space taken by strange objects, to support future canvas components.
- Renormalizes the margin row, so it is nice. (Not yet supported. This should consider font size, where large fonts don't need so much space.)

This should also be idempotent, where calling this a second time should have no effect. Additional options include:

- interPlotVerticalSpacing - 1em

### Parameters

dom - an application state.
options - additional options, including interPlotVerticalSpacing.

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixVerticalLayout

fixVerticalLayout( org.autoplot.dom.Application dom ) → void

This is the new layout mechanism (fixLayout), correcting the layout in the vertical direction. This one:

- Removes extra whitespace
- Preserves relative size weights.
- Preserves em heights, to support components which should not be rescaled. (Not yet supported.)
- Preserves space taken by strange objects, to support future canvas components.
- Renormalizes the margin row, so it is nice. (Not yet supported. This should consider font size, where large fonts don't need so much space.)

This should also be idempotent, where calling this a second time should have no effect.

### Parameters

dom - an application state, with controller nodes.

### Returns:

void (returns nothing)

### See Also:

fixLayout(org.autoplot.dom.Application)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## fixVerticalLayout

fixVerticalLayout( org.autoplot.dom.Application dom, java.util.Map options ) → void

This is the new layout mechanism (fixLayout), correcting the layout in the vertical direction. This one:

- Renormalizes the margin row, so it is nice.
- Removes extra whitespace
- Preserves relative size heights.
- Preserves em heights, to support components which should not be rescaled.
- Try to make each row's em offsets similar, using the marginRow, so that fonts can be scaled.

This should also be idempotent, where calling this a second time should have no effect.

### Parameters

dom - an application state, with controller nodes.
options - a java.util.Map

### Returns:

void (returns nothing)

### See Also:

fixLayout(org.autoplot.dom.Application, java.util.Map)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getOrCreateSelectedColumn

getOrCreateSelectedColumn( org.autoplot.dom.Application dom, java.util.List selectedPlots, boolean create ) → org.autoplot.dom.Column

Used in the LayoutPanel's add hidden plot, get the column of the selected plot or create a new column if several plots are selected.

### Parameters

dom - the application.
selectedPlots - the selected plots.
create - allow a new column to be created.

### Returns:

an org.autoplot.dom.Column
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getOrCreateSelectedRow

getOrCreateSelectedRow( org.autoplot.dom.Application dom, java.util.List selectedPlots, boolean create ) → org.autoplot.dom.Row

Used in the LayoutPanel's add hidden plot, get the row of the selected plot or create a new row if several plots are selected.

### Parameters

dom - the application.
selectedPlots - the selected plots.
create - allow a new column to be created.

### Returns:

an org.autoplot.dom.Row
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getPlotsFor

getPlotsFor( org.autoplot.dom.Application dom, org.autoplot.dom.Row row, boolean visible ) → java.util.List

return a list of the plots using the given row. This does not use controllers.

### Parameters

dom - a dom
row - the row to search for.
visible - if true, then the plot must also be visible. (Note its colorbar visible is ignored.)

### Returns:

a list of plots.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getPlotsFor

getPlotsFor( org.autoplot.dom.Application dom, org.autoplot.dom.Column column, boolean visible ) → java.util.List

return a list of the plots using the given row. This does not use controllers.

### Parameters

dom - a dom
column - the column to search for.
visible - if true, then the plot must also be visible. (Note its colorbar visible is ignored.)

### Returns:

a list of plots.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## leftAndRightMostPlot

leftAndRightMostPlot( org.autoplot.dom.Application dom, java.util.List plots ) → org.autoplot.dom.Plot[]

return the left-most and right-most plot of a list of plots. This does use controllers.

### Parameters

dom - an Application
plots - a java.util.List

### Returns:

two-element array of leftmost and rightmost plot.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## leftAndRightMostPlot

leftAndRightMostPlot( org.autoplot.dom.Application dom, org.autoplot.dom.Plot[] plots ) → org.autoplot.dom.Plot[]

return the left-most and right-most plot of a list of plots. This does use controllers.

### Parameters

dom - an Application
plots - an org.autoplot.dom.Plot[]

### Returns:

two-element array of leftmost and rightmost plot.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## newCanvasLayout

newCanvasLayout( org.autoplot.dom.Application dom ) → void

play with new canvas layout. This started as a Jython Script, but it's faster to implement here. See http://autoplot.org/developer.autolayout#Algorithm

### Parameters

dom - an Application

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## swapPosition

swapPosition( org.autoplot.dom.Plot a, org.autoplot.dom.Plot b ) → void

swap the position of the two plots. If one plot has its tick labels hidden, then this is swapped as well.

### Parameters

a - a Plot
b - a Plot

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]