In this section: |
This section contains information on the available send methods. The methods are listed in alphabetical order.
This method sends a graph to an FTP server as an ASCII text file. This method returns true (success) or false (failed).
Syntax:
boolean sendChartToFTP( String strHost, String strUser, String strPass, String strDir, String strDestFile);
where:
Is the host name string.
Is the user name string.
Is the password string.
Is the directory name string.
Is the destination file name string.
See getChartFromFTP(), sendGIFToFile(), sendGIFToFTP(), sendGIFToStream().
This method sends the current graph to a file as a GIF image.
Note: When running graphs in GIF format on a UNIX platform with the HEADLESS configuration, the graph may not display properly. You may see a red X instead of your image. This is due to Sun's methodology of creating images without a head, which does not currently support GIF images.
Syntax:
void sendGIFToFile(os OutputStream);
where:
Is the output stream.
Return: void;
Example:
String gifFile = new String("SaveChartGIFDemo.gif"); sendGIFToFile new FileOutputStream(gifFile));
This method sends the current graph to a file as a GIF image and throws the appropriate exception(s).
Syntax:
void sendGIFToFileExc(OutputStream outS)
where:
Is the output stream.
Return: void;
Note: Exceptions are not caught in this version of code.
See sendChartToFTP(), sendGIFToFile(), sendGIFToFile(), sendJPEGToStream(), sendPNGToFileExc(), sendPNGToStreamExc(), sendGIFToFTP(), sendGIFToStream().
This method sends the current graph to an FTP server as a GIF image.
Syntax:
void sendGIFToFTP( String strHost, String strUser, String strPass, String strDir, String strDestFile);
where:
Is the host name string.
Is the user name string.
Is the password string.
Is the directory name string.
Is the destination file name string.
Return: void;
This method sends the current graph to an output stream as a GIF image.
Syntax:
void sendGIFToStream (os OutputStream);
where:
Is the output stream.
Return: void;
Example:
//
// Save a Perspective graphtype to a GIF filestream
//
private void saveGIFStream(int nGraphType, String strFilename)
{
TDGErrorManager errMgr =
m_Perspective.getErrorManager();
try {
FileOutputStream fos =
new FileOutputStream(strFilename);
m_Perspective.setGraphType(nGraphType);
m_Perspective.sendGIFToStream(fos);
fos.close();
} catch (FileNotFoundException fnf) {
errMgr.notifyErrorListener(this,
TDGError.FTP_MESSAGES,
"File Not Found Exception:" +
fnf.toString(), null);
} catch (IOException e) {
errMgr.notifyErrorListener(this,
TDGError.FTP_MESSAGES, "I/O Exception:" +
e.toString(), null);
}
}
This method creates a map of the image that forms a graph and sends it to a Java I/O PrinterWriter object.
Syntax:
void sendImageMapToStream( java.io.PrintWriter outWriter, String mapName, String pathName, boolean bPage)
where:
Is a Java I/O PrinterWriter object.
Is the name of the ImageMap.
Is the name of the path to write the ImageMap to.
Can be one of the following values:
true (pageable)
false (non-pageable)
Return: void;
See sendGIFToStream().
This method sends the graph to an output stream in JPEG format.
Syntax:
void sendJPEGToStream( OutputStream outS, int nJPEGQuality)
where:
Is the output stream.
Is the JPEG quality number.
Return: void;
See sendChartToFTP(), sendGIFToFile(), sendGIFToFileExc(), sendGIFToFTP(), sendPNGToFileExc(), sendPNGToStreamExc(), sendGIFToFTP(), sendGIFToStream().
This method writes the graph image to the specified file in Portable Network Graphics (.png) format. Any errors are passed to TDGErrorListeners with an ID of TDGError.WRITE_ERROR.
Syntax:
void sendPNGToFile (java.io.File pngFile)
where:
Is the file to write the graph image to.
Return: void;
This method saves the graph in a file in Portable Network Graphics (.png) format and throws the appropriate exception(s).
Syntax:
void sendPNGToFileExc (File pngFile)
where:
Is the file where the graph image will be stored.
Return: void;
See sendPNGToFile(), sendPNGToStream(), sendPNGToStreamExc().
This method writes the graph image to the specified output stream in Portable Network Graphics (.png) format. Any errors are passed to TDGErrorListeners with an ID of TDGError.WRITE_ERROR.
Syntax:
void sendPNGToStream (java.io.OutputStream pngStream)
where:
Is the stream to write the graph image to.
Return: void;
See sendPNGToFile().
This method writes the graph image to the specified stream in Portable Network Graphics (.png) format and throws the appropriate exception(s).
Syntax:
void sendPNGToStreamExc (OutputStream pngStream)
where:
Is the output to stream.
Return: void;
See sendPNGToFileExc().
WebFOCUS |