Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

cgsuite.plugin
Class ImageOutput  view ImageOutput download ImageOutput.java

java.lang.Object
  extended bycgsuite.plugin.ImageOutput
All Implemented Interfaces:
Output

public class ImageOutput
extends java.lang.Object
implements Output

An image to display as output. This class serves as a wrapper to hold an explicit Image until it needs to be displayed as output. The toScreenImage 55 method just returns the image supplied to the constructor.

An alternate text representation can also be supplied for use in non-graphical environments.


Field Summary
private  java.lang.String alternate
           
private  java.awt.Image image
           
 
Constructor Summary
ImageOutput(java.awt.Image image)
          Constructs a new ImageOutput with the specified image.
ImageOutput(java.awt.Image image, java.lang.String alternate)
          Constructs a new ImageOutput with the specified image and text representation.
 
Method Summary
 java.lang.String toLatexSource()
          Converts this Output to a LaTeX source fragment.
 java.lang.String toPlainText()
          Converts this Output to a String that is readable as-is.
 java.awt.Image toScreenImage(int pixelWidth)
          Converts this Output to an image suitable for screen display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

private java.awt.Image image

alternate

private java.lang.String alternate
Constructor Detail

ImageOutput

public ImageOutput(java.awt.Image image)
Constructs a new ImageOutput with the specified image.


ImageOutput

public ImageOutput(java.awt.Image image,
                   java.lang.String alternate)
Constructs a new ImageOutput with the specified image and text representation.

Method Detail

toPlainText

public java.lang.String toPlainText()
Description copied from interface: Output
Converts this Output to a String that is readable as-is.

Specified by:
toPlainText in interface Output

toLatexSource

public java.lang.String toLatexSource()
Description copied from interface: Output
Converts this Output to a LaTeX source fragment. The resulting String can then be compiled using LaTeX.

Specified by:
toLatexSource in interface Output

toScreenImage

public java.awt.Image toScreenImage(int pixelWidth)
Description copied from interface: Output
Converts this Output to an image suitable for screen display. The Combinatorial Game Suite user interface calls this method to display worksheet output.

The pixelWidth parameter is the desired width of the image, in pixels. It is not an absolute requirement. The Output object will generate an image that fits within pixelWidth provided that this does not otherwise compromise the readability of the display.

Specified by:
toScreenImage in interface Output