Package adams.flow.transformer.draw
Class Pixel
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Serializable
public class Pixel extends AbstractColorDrawOperation
Draws a pixel with the specified color at the specified location.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-color <java.awt.Color> (property: color) The color of the pixel. default: #000000
-x <int> (property: X) The X position of the pixel (1-based). default: 1 minimum: 1
-y <int> (property: Y) The Y position of the pixel (1-based). default: 1 minimum: 1
-type <RGBA|COLOR> (property: type) The type of value to use for the pixel. default: RGBA
-rgba <int> (property: RGBA) The RGBA value (>= 0). default: 0 minimum: 0
- 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
Pixel.PixelValueType
Enumeration that determines what value to use for the pixel.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_RGBA
the RGBA value of the pixel.protected Pixel.PixelValueType
m_Type
what type of value to use for the pixel.protected int
m_X
the X position of the pixel (1-based).protected int
m_Y
the Y position of the pixel (1-based).-
Fields inherited from class adams.flow.transformer.draw.AbstractColorDrawOperation
m_Color
-
Fields inherited from class adams.flow.transformer.draw.AbstractDrawOperation
m_Owner
-
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 Pixel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
check(BufferedImageContainer image)
Checks the image.void
defineOptions()
Adds options to the internal list of options.protected String
doDraw(BufferedImageContainer image)
Performs the actual draw operation.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.int
getRGBA()
Returns the RGBA value of the pixel.Pixel.PixelValueType
getType()
Returns the type of value to use.int
getX()
Returns the X position of the pixel.int
getY()
Returns the Y position of the pixel.String
globalInfo()
Returns a string describing the object.String
RGBATipText()
Returns the tip text for this property.void
setRGBA(int value)
Sets the RGBA value of the pixel.void
setType(Pixel.PixelValueType value)
Sets the type of value to use.void
setX(int value)
Sets the X position of the pixel.void
setY(int value)
Sets the Y position of the pixel.String
typeTipText()
Returns the tip text for this property.String
XTipText()
Returns the tip text for this property.String
YTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.draw.AbstractColorDrawOperation
colorTipText, getColor, setColor
-
Methods inherited from class adams.flow.transformer.draw.AbstractDrawOperation
draw, getOwner, setOwner
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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_X
protected int m_X
the X position of the pixel (1-based).
-
m_Y
protected int m_Y
the Y position of the pixel (1-based).
-
m_Type
protected Pixel.PixelValueType m_Type
what type of value to use for the pixel.
-
m_RGBA
protected int m_RGBA
the RGBA value of the pixel.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractColorDrawOperation
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractDrawOperation
- Returns:
- null if no info available, otherwise short string
-
setX
public void setX(int value)
Sets the X position of the pixel.- Parameters:
value
- the position, 1-based
-
getX
public int getX()
Returns the X position of the pixel.- Returns:
- the position, 1-based
-
XTipText
public String XTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setY
public void setY(int value)
Sets the Y position of the pixel.- Parameters:
value
- the position, 1-based
-
getY
public int getY()
Returns the Y position of the pixel.- Returns:
- the position, 1-based
-
YTipText
public String YTipText()
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(Pixel.PixelValueType value)
Sets the type of value to use.- Parameters:
value
- the type
-
getType
public Pixel.PixelValueType getType()
Returns the type of value to use.- Returns:
- the type
-
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.
-
setRGBA
public void setRGBA(int value)
Sets the RGBA value of the pixel.- Parameters:
value
- the RGBA value
-
getRGBA
public int getRGBA()
Returns the RGBA value of the pixel.- Returns:
- the RGBA value
-
RGBATipText
public String RGBATipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
protected String check(BufferedImageContainer image)
Checks the image.- Overrides:
check
in classAbstractDrawOperation
- Parameters:
image
- the image to check- Returns:
- null if OK, otherwise error message
-
doDraw
protected String doDraw(BufferedImageContainer image)
Performs the actual draw operation.- Specified by:
doDraw
in classAbstractDrawOperation
- Parameters:
image
- the image to draw on- Returns:
- null if OK, otherwise error message
-
-