public class JPEGWriter extends JComponentWriter
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
m_Background
the background color.
|
protected float |
m_Quality
the quality of the image.
|
DEBUG, m_CustomHeight, m_CustomWidth, m_ScalingEnabled, m_UseCustomDimensions, m_xScale, m_yScale| Constructor and Description |
|---|
JPEGWriter()
initializes the object.
|
JPEGWriter(javax.swing.JComponent c)
initializes the object with the given Component.
|
JPEGWriter(javax.swing.JComponent c,
java.io.File f)
initializes the object with the given Component and filename.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateOutput()
generates the actual output.
|
java.awt.Color |
getBackground()
returns the current background color.
|
java.lang.String |
getDescription()
returns the name of the writer, to display in the FileChooser. must be
overridden in the derived class.
|
java.lang.String |
getExtension()
returns the extension (incl. ".") of the output format, to use in the
FileChooser. must be overridden in the derived class.
|
float |
getQuality()
returns the quality the JPEG will be stored in.
|
void |
initialize()
further initialization.
|
static void |
main(java.lang.String[] args)
for testing only.
|
void |
setBackground(java.awt.Color c)
sets the background color to use in creating the JPEG.
|
void |
setQuality(float q)
sets the quality the JPEG is saved in.
|
getComponent, getCustomHeight, getCustomWidth, getFile, getScalingEnabled, getUseCustomDimensions, getXScale, getYScale, setComponent, setCustomHeight, setCustomWidth, setFile, setScale, setScalingEnabled, setUseCustomDimensions, toOutput, toOutput, toOutputprotected float m_Quality
protected java.awt.Color m_Background
public JPEGWriter()
public JPEGWriter(javax.swing.JComponent c)
c - the component to print in the output formatpublic JPEGWriter(javax.swing.JComponent c,
java.io.File f)
c - the component to print in the output formatf - the file to store the output inpublic void initialize()
initialize in class JComponentWriterpublic java.lang.String getDescription()
getDescription in class JComponentWriterpublic java.lang.String getExtension()
getExtension in class JComponentWriterpublic java.awt.Color getBackground()
public void setBackground(java.awt.Color c)
c - the color to use for backgroundpublic float getQuality()
public void setQuality(float q)
q - the quality to usepublic void generateOutput()
throws java.lang.Exception
generateOutput in class JComponentWriterjava.lang.Exception - if something goes wrongpublic static void main(java.lang.String[] args)
throws java.lang.Exception
args - the commandline argumentsjava.lang.Exception - if something goes wrong