package external;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import org.autoplot.ScriptContext;
import org.autoplot.dom.Application;
import org.autoplot.dom.DomOps;
import org.python.core.Py;
import org.python.core.PyObject;
import org.python.core.PyString;
/**
* Jython command for fixLayout.
* @author jbf
*/
public class FixLayoutCommand extends PyObject {
private static final Logger logger= org.das2.util.LoggerManager.getLogger("autoplot");
public static final PyString __doc__ =
new PyString("
fixLayout([named parameters])
"
+ "fixLayout cleans up the layout of the canvas.\n"
+ "See https://autoplot.org/fixlayout
\n"
+ "
named parameters:\n"
+ ""
+ " horizontalSpacing=1em | Spacing between plots, such as 1em |
\n"
+ " verticalSpacing=1em | Spacing between plots, such as 1em |
\n"
+ " hideTitles=True | turn off all but the top title\n |
"
+ " hideTimeAxes=True | turn off all but the bottom axis\n |
"
+ " hideYAxes=True | turn off y-axes between plots |
"
+ " moveLegendsToOutsideNE=True | move legends from default inside position to outside, when there is no colorbar. |
"
+ "
"
+ "");
public static final PyString __completions__;
static {
String text = new BufferedReader(
new InputStreamReader( FixLayoutCommand.class.getResourceAsStream("FixLayoutCommand.json"), StandardCharsets.UTF_8) )
.lines().collect(Collectors.joining("\n"));
__completions__= new PyString( text );
}
/**
* implement the python call.
* @param args the "rightmost" elements are the keyword values.
* @param keywords the names for the keywords.
* @return None
*/
@Override
public PyObject __call__(PyObject[] args, String[] keywords) {
FunctionSupport fs= new FunctionSupport( "annotation",
new String[] {
"horizontalSpacing", "verticalSpacing",
"hideTitles", "hideTimeAxes", "hideYAxes"
},
new PyObject[] {
Py.None, Py.None,
Py.None, Py.None, Py.None
} );
fs.args( args, keywords );
int nparm= args.length - keywords.length;
HashMap controls= new HashMap();
for ( int i=nparm; i