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 classPixel.PixelValueTypeEnumeration that determines what value to use for the pixel.
-
Field Summary
Fields Modifier and Type Field Description protected intm_RGBAthe RGBA value of the pixel.protected Pixel.PixelValueTypem_Typewhat type of value to use for the pixel.protected intm_Xthe X position of the pixel (1-based).protected intm_Ythe 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 Stringcheck(BufferedImageContainer image)Checks the image.voiddefineOptions()Adds options to the internal list of options.protected StringdoDraw(BufferedImageContainer image)Performs the actual draw operation.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.intgetRGBA()Returns the RGBA value of the pixel.Pixel.PixelValueTypegetType()Returns the type of value to use.intgetX()Returns the X position of the pixel.intgetY()Returns the Y position of the pixel.StringglobalInfo()Returns a string describing the object.StringRGBATipText()Returns the tip text for this property.voidsetRGBA(int value)Sets the RGBA value of the pixel.voidsetType(Pixel.PixelValueType value)Sets the type of value to use.voidsetX(int value)Sets the X position of the pixel.voidsetY(int value)Sets the Y position of the pixel.StringtypeTipText()Returns the tip text for this property.StringXTipText()Returns the tip text for this property.StringYTipText()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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractColorDrawOperation
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin 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:
checkin 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:
doDrawin classAbstractDrawOperation- Parameters:
image- the image to draw on- Returns:
- null if OK, otherwise error message
-
-