Package adams.flow.transformer.draw
Class Line
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,AntiAliasingDrawOperation
,Serializable
public class Line extends AbstractColorStrokeDrawOperation
Draws a line between the given start and end coordinates.
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
-stroke-thickness <float> (property: strokeThickness) The thickness of the stroke. default: 1.0 minimum: 0.01
-anti-aliasing-enabled (property: antiAliasingEnabled) If enabled, uses anti-aliasing for drawing.
-x1 <int> (property: X1) The X position of the start of the line (1-based). default: 1 minimum: 1
-y1 <int> (property: Y1) The Y position of the start of the line (1-based). default: 1 minimum: 1
-x2 <int> (property: X2) The X position of the end of the line (1-based). default: 10 minimum: 1
-y2 <int> (property: Y2) The Y position of the end of the line (1-based). default: 10 minimum: 1
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_X1
the X position of the start of the line (1-based).protected int
m_X2
the X position of the end of the line (1-based).protected int
m_Y1
the Y position of the start of the line (1-based).protected int
m_Y2
the Y position of the end of the line (1-based).-
Fields inherited from class adams.flow.transformer.draw.AbstractColorStrokeDrawOperation
m_AntiAliasingEnabled, m_StrokeThickness
-
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 Line()
-
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
getX1()
Returns the X position of the start of the line.int
getX2()
Returns the X position of the end of the line.int
getY1()
Returns the Y position of the start of the line.int
getY2()
Returns the Y position of the end of the line.String
globalInfo()
Returns a string describing the object.void
setX1(int value)
Sets the X position of the start of the line.void
setX2(int value)
Sets the X position of the end of the line.void
setY1(int value)
Sets the Y position of the start of the line.void
setY2(int value)
Sets the Y position of the end of the line.String
X1TipText()
Returns the tip text for this property.String
X2TipText()
Returns the tip text for this property.String
Y1TipText()
Returns the tip text for this property.String
Y2TipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.transformer.draw.AbstractColorStrokeDrawOperation
antiAliasingEnabledTipText, getStrokeThickness, isAntiAliasingEnabled, setAntiAliasingEnabled, setStrokeThickness, strokeThicknessTipText
-
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_X1
protected int m_X1
the X position of the start of the line (1-based).
-
m_Y1
protected int m_Y1
the Y position of the start of the line (1-based).
-
m_X2
protected int m_X2
the X position of the end of the line (1-based).
-
m_Y2
protected int m_Y2
the Y position of the end of the line (1-based).
-
-
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 classAbstractColorStrokeDrawOperation
-
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
-
setX1
public void setX1(int value)
Sets the X position of the start of the line.- Parameters:
value
- the position, 1-based
-
getX1
public int getX1()
Returns the X position of the start of the line.- Returns:
- the position, 1-based
-
X1TipText
public String X1TipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setY1
public void setY1(int value)
Sets the Y position of the start of the line.- Parameters:
value
- the position, 1-based
-
getY1
public int getY1()
Returns the Y position of the start of the line.- Returns:
- the position, 1-based
-
Y1TipText
public String Y1TipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setX2
public void setX2(int value)
Sets the X position of the end of the line.- Parameters:
value
- the position, 1-based
-
getX2
public int getX2()
Returns the X position of the end of the line.- Returns:
- the position, 1-based
-
X2TipText
public String X2TipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setY2
public void setY2(int value)
Sets the Y position of the end of the line.- Parameters:
value
- the position, 1-based
-
getY2
public int getY2()
Returns the Y position of the end of the line.- Returns:
- the position, 1-based
-
Y2TipText
public String Y2TipText()
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
-
-