Class Anchored
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.object.objectannotations.label.AbstractLabelPlotter
-
- adams.gui.visualization.object.objectannotations.label.Anchored
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,LabelPlotter
,Serializable
public class Anchored extends AbstractLabelPlotter
Plots the label relative to the anchor.- 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
Anchored.AnchorReference
what to use as reference for the anchor.
-
Field Summary
Fields Modifier and Type Field Description protected ImageAnchor
m_Anchor
the label anchor.protected Font
m_Font
the label font.protected String
m_Format
the label for the rectangles.protected String
m_MetaDataKey
the key in the meta-data that contains the type.protected int
m_OffsetX
the x offset for the label.protected int
m_OffsetY
the y offset for the label.protected Anchored.AnchorReference
m_Reference
the anchor reference.-
Fields inherited from class adams.gui.visualization.object.objectannotations.label.AbstractLabelPlotter
m_Enabled
-
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 Anchored()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
anchorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doPlotLabel(LocatedObject object, Color color, Graphics2D g)
Plots the label.String
fontTipText()
Returns the tip text for this property.String
formatTipText()
Returns the tip text for this property.protected String
generateQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.ImageAnchor
getAnchor()
Returns the anchor for the label.Font
getFont()
Returns the label font.String
getFormat()
Returns the label format.String
getMetaDataKey()
Returns the key in the meta-data of the object that contains the type.int
getOffsetX()
Returns the X offset for the label.int
getOffsetY()
Returns the Y offset for the label.Anchored.AnchorReference
getReference()
Returns the reference for the anchor.String
globalInfo()
Returns a string describing the object.String
metaDataKeyTipText()
Returns the tip text for this property.String
offsetXTipText()
Returns the tip text for this property.String
offsetYTipText()
Returns the tip text for this property.String
referenceTipText()
Returns the tip text for this property.void
setAnchor(ImageAnchor value)
Sets the anchor for the label.void
setFont(Font value)
Sets the label font.void
setFormat(String value)
Sets the label format.void
setMetaDataKey(String value)
Sets the key in the meta-data of the object that contains the type.void
setOffsetX(int value)
Sets the X offset for the label.void
setOffsetY(int value)
Sets the Y offset for the label.void
setReference(Anchored.AnchorReference value)
Sets the reference for the anchor.-
Methods inherited from class adams.gui.visualization.object.objectannotations.label.AbstractLabelPlotter
enabledTipText, getEnabled, getQuickInfo, plotLabel, setEnabled
-
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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_MetaDataKey
protected String m_MetaDataKey
the key in the meta-data that contains the type.
-
m_Format
protected String m_Format
the label for the rectangles.
-
m_Font
protected Font m_Font
the label font.
-
m_Reference
protected Anchored.AnchorReference m_Reference
the anchor reference.
-
m_Anchor
protected ImageAnchor m_Anchor
the label anchor.
-
m_OffsetX
protected int m_OffsetX
the x offset for the label.
-
m_OffsetY
protected int m_OffsetY
the y offset for the label.
-
-
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 classAbstractLabelPlotter
-
setMetaDataKey
public void setMetaDataKey(String value)
Sets the key in the meta-data of the object that contains the type.- Parameters:
value
- the key
-
getMetaDataKey
public String getMetaDataKey()
Returns the key in the meta-data of the object that contains the type.- Returns:
- the key
-
metaDataKeyTipText
public String metaDataKeyTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFormat
public void setFormat(String value)
Sets the label format.- Parameters:
value
- the label format
-
getFormat
public String getFormat()
Returns the label format.- Returns:
- the label format
-
formatTipText
public String formatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFont
public void setFont(Font value)
Sets the label font.- Parameters:
value
- the label font
-
getFont
public Font getFont()
Returns the label font.- Returns:
- the label font
-
fontTipText
public String fontTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReference
public void setReference(Anchored.AnchorReference value)
Sets the reference for the anchor.- Parameters:
value
- the reference
-
getReference
public Anchored.AnchorReference getReference()
Returns the reference for the anchor.- Returns:
- the reference
-
referenceTipText
public String referenceTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAnchor
public void setAnchor(ImageAnchor value)
Sets the anchor for the label.- Parameters:
value
- the anchor
-
getAnchor
public ImageAnchor getAnchor()
Returns the anchor for the label.- Returns:
- the anchor
-
anchorTipText
public String anchorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetX
public void setOffsetX(int value)
Sets the X offset for the label.- Parameters:
value
- the X offset
-
getOffsetX
public int getOffsetX()
Returns the X offset for the label.- Returns:
- the X offset
-
offsetXTipText
public String offsetXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOffsetY
public void setOffsetY(int value)
Sets the Y offset for the label.- Parameters:
value
- the Y offset
-
getOffsetY
public int getOffsetY()
Returns the Y offset for the label.- Returns:
- the Y offset
-
offsetYTipText
public String offsetYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
generateQuickInfo
protected String generateQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Overrides:
generateQuickInfo
in classAbstractLabelPlotter
- Returns:
- null if no info available, otherwise short string
-
doPlotLabel
protected void doPlotLabel(LocatedObject object, Color color, Graphics2D g)
Plots the label.- Specified by:
doPlotLabel
in classAbstractLabelPlotter
- Parameters:
object
- the object to plotcolor
- the color to useg
- the graphics context
-
-