Package adams.gui.print
Class BufferedImageBasedWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
BMPWriter
,JPEGWriter
,PDFWriter
,PNGWriter
,TIFFWriter
public abstract class BufferedImageBasedWriter extends ScalableComponentWriter
Ancestor for writers that write a BufferedImage to disk.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BufferedImageBasedWriter.Type
The type of the picture to generate.
-
Field Summary
Fields Modifier and Type Field Description protected Color
m_Background
the background color.protected BufferedImageBasedWriter.Type
m_Type
the color format of the image.-
Fields inherited from class adams.gui.print.ScalableComponentWriter
m_ScalingEnabled, m_xScale, m_yScale
-
Fields inherited from class adams.gui.print.JComponentWriter
m_Component, m_CustomHeight, m_CustomWidth, m_Enabled, m_OutputFile, m_UseCustomDimensions
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description BufferedImageBasedWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
backgroundTipText()
Returns the tip text for this property.protected BufferedImage
createBufferedImage()
Generates the BufferedImage to write to disk.void
defineOptions()
Adds options to the internal list of options.Color
getBackground()
Returns the current background color.BufferedImageBasedWriter.Type
getType()
Returns the type of the image to create.protected BufferedImage
newImage(int width, int height)
Creates a new BufferedImage with the given dimensions.void
setBackground(Color value)
Sets the background color to use in creating the image.void
setType(BufferedImageBasedWriter.Type value)
Sets the type of image to create.String
typeTipText()
Returns the tip text for this property.-
Methods inherited from class adams.gui.print.ScalableComponentWriter
getScalingEnabled, getXScale, getYScale, scalingEnabledTipText, setScalingEnabled, setXScale, setYScale, XScaleTipText, YScaleTipText
-
Methods inherited from class adams.gui.print.JComponentWriter
customHeightTipText, customWidthTipText, enabledTipText, fileTipText, forCommandLine, forName, generateOutput, getComponent, getCustomHeight, getCustomWidth, getDescription, getEnabled, getExtensions, getFile, getFileFilters, getUseCustomDimensions, getWriterForExtension, getWriterForFile, getWriterForFile, getWriters, main, setComponent, setCustomHeight, setCustomWidth, setEnabled, setFile, setUseCustomDimensions, toOutput, toOutput, toOutput, useCustomDimensionsTipText
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Background
protected Color m_Background
the background color.
-
m_Type
protected BufferedImageBasedWriter.Type m_Type
the color format of the image.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classScalableComponentWriter
-
setBackground
public void setBackground(Color value)
Sets the background color to use in creating the image.- Parameters:
value
- the color to use for background
-
getBackground
public Color getBackground()
Returns the current background color.- Returns:
- the current background color
-
backgroundTipText
public String backgroundTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setType
public void setType(BufferedImageBasedWriter.Type value)
Sets the type of image to create.- Parameters:
value
- the type
-
getType
public BufferedImageBasedWriter.Type getType()
Returns the type of the image to create.- Returns:
- the current background color
-
typeTipText
public String typeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
newImage
protected BufferedImage newImage(int width, int height)
Creates a new BufferedImage with the given dimensions.- Parameters:
width
- the widthheight
- the height- Returns:
- the image
-
createBufferedImage
protected BufferedImage createBufferedImage()
Generates the BufferedImage to write to disk.- Returns:
- the created image
-
-