Class SAM
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.gui.visualization.object.tools.AbstractTool
-
- adams.gui.visualization.object.tools.AbstractToolWithParameterPanel
-
- adams.gui.visualization.object.tools.AbstractRedisTool<String,String>
-
- adams.gui.visualization.object.tools.SAM
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.SizeOfHandler
,adams.gui.visualization.object.tools.CustomizableTool
,adams.gui.visualization.object.tools.Tool
,Serializable
public class SAM extends AbstractRedisTool<String,String>
Uses SAN (via docker and redis) to aid human in annotating.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SAMMarkers
m_Annotator
the internally used annotator.protected String
m_BaseImageBase64
the cached base image as base64 JPEG.protected adams.gui.core.BaseCheckBox
m_CheckBoxForeground
whether foreground or background.protected boolean
m_Foreground
whether foreground.protected Color
m_MarkerColor
the marker color.protected int
m_MarkerSize
the marker size.protected int
m_MaxObjectSize
the maximum object size (width/height).protected int
m_MinObjectSize
the minimum object size (width/height).protected adams.gui.chooser.ColorChooserPanel
m_PanelColor
the marker color.protected List<Point>
m_Points
the points to send.protected adams.gui.core.NumberTextField
m_TextMarkerSize
the marker size.protected adams.gui.core.NumberTextField
m_TextMaxObjectSize
the maximum object size (width/height).protected adams.gui.core.NumberTextField
m_TextMinObjectSize
the minimum object size (width/height).-
Fields inherited from class adams.gui.visualization.object.tools.AbstractRedisTool
m_Client, m_Connection, m_PubSubConnection, m_PubSubListener, m_ReceivedData, m_RedisDB, m_RedisHost, m_RedisPort, m_RedisReceive, m_RedisSend, m_RedisTimeout, m_TextRedisHost, m_TextRedisReceive, m_TextRedisSend, m_TextRedisTimeout
-
Fields inherited from class adams.gui.visualization.object.tools.AbstractToolWithParameterPanel
m_ButtonApply
-
-
Constructor Summary
Constructors Constructor Description SAM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate()
Gets called to activate the tool.protected void
addOptions(adams.gui.core.ParameterPanel paramPanel)
Fills the parameter panel with the options.protected String
assembleSendData(adams.core.MessageCollection errors)
Method that assembles the data to send.protected String
checkBeforeApply()
Checks the parameters before applying them.protected Cursor
createCursor()
Creates the mouse cursor to use.protected adams.gui.visualization.object.tools.ToolKeyAdapter
createKeyListener()
Creates the key listener to use.protected adams.gui.visualization.object.tools.ToolMouseAdapter
createMouseListener()
Creates the mouse listener to use.protected adams.gui.visualization.object.tools.ToolMouseMotionAdapter
createMouseMotionListener()
Creates the mouse motion listener to use.protected void
finishedRequest()
Finishes up the request.protected int
getDefaultTimeout()
Returns the default timeout in msec.Icon
getIcon()
The icon of the tool.String
getName()
The name of the tool.List<Point>
getPoints()
Returns the points to send.protected String
getReceiveChannel()
The channel to receive the data on.protected RedisDataType
getReceiveType()
Returns the type of data to receive.protected String
getSendChannel()
The channel to send the data on.protected RedisDataType
getSendType()
Returns the type of data to send.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the members.protected void
parseReceivedData(String data, adams.core.MessageCollection errors)
Parses the received data and updates the GUI.protected void
retrieveParameters()
Retrieves the parameters from the GUI.void
setPoints(List<Point> value)
Sets the points to send.-
Methods inherited from class adams.gui.visualization.object.tools.AbstractRedisTool
cleanUp, doApply, newBytesListener, newStringListener, sendData, update
-
Methods inherited from class adams.gui.visualization.object.tools.AbstractToolWithParameterPanel
applyOptions, createOptionPanel
-
Methods inherited from class adams.gui.visualization.object.tools.AbstractTool
apply, createApplyButton, deactivate, getCanvas, getCursor, getImage, getKeyListener, getMouseListener, getMouseMotionListener, getOptionPanel, getZoom, hasImage, isModified, setApplyButtonState, setCanvas
-
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, toString, wait, wait, wait
-
-
-
-
Field Detail
-
m_TextMarkerSize
protected adams.gui.core.NumberTextField m_TextMarkerSize
the marker size.
-
m_PanelColor
protected adams.gui.chooser.ColorChooserPanel m_PanelColor
the marker color.
-
m_TextMinObjectSize
protected adams.gui.core.NumberTextField m_TextMinObjectSize
the minimum object size (width/height).
-
m_TextMaxObjectSize
protected adams.gui.core.NumberTextField m_TextMaxObjectSize
the maximum object size (width/height).
-
m_CheckBoxForeground
protected adams.gui.core.BaseCheckBox m_CheckBoxForeground
whether foreground or background.
-
m_MarkerSize
protected int m_MarkerSize
the marker size.
-
m_MarkerColor
protected Color m_MarkerColor
the marker color.
-
m_MinObjectSize
protected int m_MinObjectSize
the minimum object size (width/height).
-
m_MaxObjectSize
protected int m_MaxObjectSize
the maximum object size (width/height).
-
m_Foreground
protected boolean m_Foreground
whether foreground.
-
m_BaseImageBase64
protected transient String m_BaseImageBase64
the cached base image as base64 JPEG.
-
m_Annotator
protected SAMMarkers m_Annotator
the internally used annotator.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.gui.visualization.object.tools.AbstractTool
-
getName
public String getName()
The name of the tool.- Returns:
- the name
-
getIcon
public Icon getIcon()
The icon of the tool.- Returns:
- the icon
-
createCursor
protected Cursor createCursor()
Creates the mouse cursor to use.- Specified by:
createCursor
in classadams.gui.visualization.object.tools.AbstractTool
- Returns:
- the cursor
-
createMouseListener
protected adams.gui.visualization.object.tools.ToolMouseAdapter createMouseListener()
Creates the mouse listener to use.- Specified by:
createMouseListener
in classadams.gui.visualization.object.tools.AbstractTool
- Returns:
- the listener, null if not applicable
-
createMouseMotionListener
protected adams.gui.visualization.object.tools.ToolMouseMotionAdapter createMouseMotionListener()
Creates the mouse motion listener to use.- Specified by:
createMouseMotionListener
in classadams.gui.visualization.object.tools.AbstractTool
- Returns:
- the listener, null if not applicable
-
createKeyListener
protected adams.gui.visualization.object.tools.ToolKeyAdapter createKeyListener()
Creates the key listener to use.- Overrides:
createKeyListener
in classadams.gui.visualization.object.tools.AbstractTool
- Returns:
- the listener, null if not applicable
-
checkBeforeApply
protected String checkBeforeApply()
Checks the parameters before applying them.- Overrides:
checkBeforeApply
in classAbstractRedisTool<String,String>
- Returns:
- null if checks passed, otherwise error message (gets displayed in GUI)
-
retrieveParameters
protected void retrieveParameters()
Retrieves the parameters from the GUI.- Overrides:
retrieveParameters
in classAbstractRedisTool<String,String>
-
getSendChannel
protected String getSendChannel()
The channel to send the data on.- Specified by:
getSendChannel
in classAbstractRedisTool<String,String>
- Returns:
- the redis channel
-
getReceiveChannel
protected String getReceiveChannel()
The channel to receive the data on.- Specified by:
getReceiveChannel
in classAbstractRedisTool<String,String>
- Returns:
- the redis channel
-
getDefaultTimeout
protected int getDefaultTimeout()
Returns the default timeout in msec.- Overrides:
getDefaultTimeout
in classAbstractRedisTool<String,String>
- Returns:
- the timeout
-
addOptions
protected void addOptions(adams.gui.core.ParameterPanel paramPanel)
Fills the parameter panel with the options.- Overrides:
addOptions
in classAbstractRedisTool<String,String>
- Parameters:
paramPanel
- for adding the options to
-
getSendType
protected RedisDataType getSendType()
Returns the type of data to send.- Specified by:
getSendType
in classAbstractRedisTool<String,String>
- Returns:
- the type of data
-
getReceiveType
protected RedisDataType getReceiveType()
Returns the type of data to receive.- Specified by:
getReceiveType
in classAbstractRedisTool<String,String>
- Returns:
- the type of data
-
setPoints
public void setPoints(List<Point> value)
Sets the points to send.- Parameters:
value
- the points
-
getPoints
public List<Point> getPoints()
Returns the points to send.- Returns:
- the point, null if none set
-
assembleSendData
protected String assembleSendData(adams.core.MessageCollection errors)
Method that assembles the data to send.- Specified by:
assembleSendData
in classAbstractRedisTool<String,String>
- Parameters:
errors
- for collecting errors- Returns:
- the data to send (String or byte[])
-
parseReceivedData
protected void parseReceivedData(String data, adams.core.MessageCollection errors)
Parses the received data and updates the GUI.- Specified by:
parseReceivedData
in classAbstractRedisTool<String,String>
- Parameters:
data
- the data to parse (String or byte[])errors
- for collecting errors
-
finishedRequest
protected void finishedRequest()
Finishes up the request.- Overrides:
finishedRequest
in classAbstractRedisTool<String,String>
-
activate
public void activate()
Gets called to activate the tool.- Specified by:
activate
in interfaceadams.gui.visualization.object.tools.Tool
- Overrides:
activate
in classadams.gui.visualization.object.tools.AbstractTool
-
-