abstract class OutputManager extends Object
Modifier and Type | Field and Description |
---|---|
protected double |
privateKey |
protected static String |
SCENE_TAG |
protected Viewer |
viewer |
Constructor and Description |
---|
OutputManager() |
Modifier and Type | Method and Description |
---|---|
private String |
addPngFileBytes(String name,
byte[] ret,
int iFile,
Hashtable<Object,String> crcMap,
boolean isSparDir,
String newName,
int ptSlash,
javajs.util.List<Object> v) |
(package private) abstract String |
clipImageOrPasteText(String text) |
protected abstract String |
createSceneSet(String sceneFile,
String type,
int width,
int height) |
private boolean |
createTheImage(Object objImage,
String type,
javajs.util.OC out,
Map<String,Object> params,
String[] errRet) |
private String |
createZipSet(String script,
String[] scripts,
boolean includeRemoteFiles,
javajs.util.OC out) |
(package private) abstract String |
getClipboardText() |
(package private) byte[] |
getImageAsBytes(String type,
int width,
int height,
int quality,
String[] errMsg)
Called when a simple image is required -- from x=getProperty("image") or
for a simple preview PNG image for inclusion in a ZIP file from write
xxx.zip or xxx.jmol, or for a PNGJ or PNG image that is being posted
because of a URL that contains "?POST?_PNG_" or
?POST?_PNGJ_" or ?POST?_PNGJBIN_".
|
private static int |
getInt(Map<String,Object> params,
String key,
int def) |
protected abstract String |
getLogPath(String fileName) |
private Object |
getOrSaveImage(Map<String,Object> params)
Creates an image of params.type form -- PNG, PNGJ, PNGT, JPG, JPG64, PDF,
PPM.
|
(package private) javajs.util.OC |
getOutputChannel(String fileName,
String[] fullPath) |
private String |
getOutputFileNameFromDialog(String fileName,
int quality) |
(package private) String |
getOutputFromExport(Map<String,Object> params) |
(package private) Object |
getWrappedState(String fileName,
String[] scripts,
Object objImage,
javajs.util.OC out) |
protected String |
handleOutputToFile(Map<String,Object> params,
boolean doCheck)
general routine for creating an image or writing data to a file
passes request to statusManager to pass along to app or applet
jmolStatusListener interface
|
(package private) void |
logToFile(String data) |
(package private) abstract javajs.util.OC |
openOutputChannel(double privateKey,
String fileName,
boolean asWriter,
boolean asAppend) |
(package private) String |
outputToFile(Map<String,Object> params) |
private String |
processMultiFrameOutput(String fileName,
BS bsFrames,
int nVibes,
Map<String,Object> params) |
(package private) String |
processWriteOrCapture(Map<String,Object> params) |
private String |
setFullPath(Map<String,Object> params,
String fileName) |
(package private) String |
setLogFile(String value) |
(package private) OutputManager |
setViewer(Viewer viewer,
double privateKey) |
protected String |
wrapPathForAllFiles(String cmd,
String strCatch) |
(package private) String |
writeFileData(String fileName,
String type,
int modelIndex,
Object[] parameters)
Generates file data and passes it on either to a FileOuputStream (Java) or
via POSTing to a url using a ByteOutputStream (JavaScript)
|
private boolean |
writeFrame(int n,
String froot,
String fext,
Map<String,Object> params,
javajs.util.SB sb) |
private String |
writeToOutputChannel(Map<String,Object> params)
From handleOutputToFile, write text, byte[], or image data to a
file;
|
private String |
writeZipFile(double privateKey,
FileManager fm,
Viewer viewer,
javajs.util.OC out,
javajs.util.List<Object> fileNamesAndByteArrays,
String msg)
generic method to create a zip file based on
http://www.exampledepot.com/egs/java.util.zip/CreateZip.html
|
protected Viewer viewer
protected double privateKey
protected static final String SCENE_TAG
abstract String getClipboardText()
abstract javajs.util.OC openOutputChannel(double privateKey, String fileName, boolean asWriter, boolean asAppend) throws IOException
IOException
protected abstract String createSceneSet(String sceneFile, String type, int width, int height)
OutputManager setViewer(Viewer viewer, double privateKey)
private String writeToOutputChannel(Map<String,Object> params)
params
- private Object getOrSaveImage(Map<String,Object> params) throws Exception
params
- include fileName, type, text, bytes, image, scripts, appendix,
quality, outputStream, and type-specific parameters. If
params.outputChannel != null, then we are passing back the data, and
the channel will not be closed.Exception
Object getWrappedState(String fileName, String[] scripts, Object objImage, javajs.util.OC out)
fileName
- scripts
- objImage
- out
- private boolean createTheImage(Object objImage, String type, javajs.util.OC out, Map<String,Object> params, String[] errRet) throws IOException
objImage
- type
- out
- params
- errRet
- IOException
String processWriteOrCapture(Map<String,Object> params)
params
- include fileName, type, text, bytes, scripts, quality, width,
height, bsFrames, nVibes, fullPathprivate String processMultiFrameOutput(String fileName, BS bsFrames, int nVibes, Map<String,Object> params)
byte[] getImageAsBytes(String type, int width, int height, int quality, String[] errMsg)
type
- width
- height
- quality
- errMsg
- String writeFileData(String fileName, String type, int modelIndex, Object[] parameters)
fileName
- type
- one of: PDB PQR FILE PLOTmodelIndex
- parameters
- private boolean writeFrame(int n, String froot, String fext, Map<String,Object> params, javajs.util.SB sb)
private String getOutputFileNameFromDialog(String fileName, int quality)
protected String handleOutputToFile(Map<String,Object> params, boolean doCheck)
params
- include: fileName: starts with ? --> use file dialog; type: PNG,
JPG, etc.; text: String to output; bytes: byte[] or null if an
image; scripts for scenes; quality: for JPG and PNG; width: image
width; height: image height; fullPath: String[] returndoCheck
- void logToFile(String data)
private String createZipSet(String script, String[] scripts, boolean includeRemoteFiles, javajs.util.OC out)
private String addPngFileBytes(String name, byte[] ret, int iFile, Hashtable<Object,String> crcMap, boolean isSparDir, String newName, int ptSlash, javajs.util.List<Object> v)
private String writeZipFile(double privateKey, FileManager fm, Viewer viewer, javajs.util.OC out, javajs.util.List<Object> fileNamesAndByteArrays, String msg)
privateKey
- fm
- viewer
- out
- fileNamesAndByteArrays
- Vector of [filename1, bytes|null, filename2, bytes|null, ...]msg
-