send Methods

In this section:

This section contains information on the available send methods. The methods are listed in alphabetical order.


Top of page

x
sendChartToFTP()

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:

strHost

Is the host name string.

strUser

Is the user name string.

strPass

Is the password string.

strDir

Is the directory name string.

strDestFile

Is the destination file name string.

See getChartFromFTP(), sendGIFToFile(), sendGIFToFTP(), sendGIFToStream().


Top of page

x
sendGIFToFile()

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:

os

Is the output stream.

Return: void;

Example:

String gifFile = new String("SaveChartGIFDemo.gif");  sendGIFToFile new FileOutputStream(gifFile));

See sendChartToFTP(), sendGIFToFTP(), sendGIFToStream().


Top of page

x
sendGIFToFileExc()

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:

outS

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().


Top of page

x
sendGIFToFTP()

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:

strHost

Is the host name string.

strUser

Is the user name string.

strPass

Is the password string.

strDir

Is the directory name string.

strDestFile

Is the destination file name string.

Return: void;

See sendChartToFTP(), sendGIFToFile(), sendGIFToStream().


Top of page

x
sendGIFToStream()

This method sends the current graph to an output stream as a GIF image.

Syntax:

void sendGIFToStream (os OutputStream);

where:

os

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);
 } 
}

See sendChartToFTP(), sendGIFToFile(), sendGIFToFTP().


Top of page

x
sendImageMapToStream()

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:

outWriter

Is a Java I/O PrinterWriter object.

mapName

Is the name of the ImageMap.

pathName

Is the name of the path to write the ImageMap to.

bPage

Can be one of the following values:

true (pageable)

false (non-pageable)

Return: void;

See sendGIFToStream().


Top of page

x
sendJPEGToStream()

This method sends the graph to an output stream in JPEG format.

Syntax:

void sendJPEGToStream(
    OutputStream outS, int nJPEGQuality)

where:

outS

Is the output stream.

nJPEGQuality

Is the JPEG quality number.

Return: void;

See sendChartToFTP(), sendGIFToFile(), sendGIFToFileExc(), sendGIFToFTP(), sendPNGToFileExc(), sendPNGToStreamExc(), sendGIFToFTP(), sendGIFToStream().


Top of page

x
sendPNGToFile()

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:

pngFile

Is the file to write the graph image to.

Return: void;

See sendPNGToFileExc(), sendPNGToStream().


Top of page

x
sendPNGToFileExc()

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:

pngFile

Is the file where the graph image will be stored.

Return: void;

See sendPNGToFile(), sendPNGToStream(), sendPNGToStreamExc().


Top of page

x
sendPNGToStream()

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:

pngStream

Is the stream to write the graph image to.

Return: void;

See sendPNGToFile().


Top of page

x
sendPNGToStreamExc()

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:

pngStream

Is the output to stream.

Return: void;

See sendPNGToFileExc().


WebFOCUS