Packages

c

de.sciss.synth.swing.impl

IconLabelRenderer

class IconLabelRenderer extends AbstractShapeRenderer

Renderer that draws a label, which consists of a text string, an icon, or both. This is based on the prefuse LabelRenderer class, but changes image for icon. It was converted from Java to Scala, so the code looks a bit ugly.

When created using the default constructor, the renderer attempts to use text from the "label" field. To use a different field, use the appropriate constructor or use the setTextField method. To perform custom String selection, subclass this Renderer and override the getText method. When the text field is null, no text label will be shown. Labels can span multiple lines of text, determined by the presence of newline characters ('\n') within the text string.

By default, no icon is shown. To show an icon, the icon field needs to be set, either using the appropriate constructor or the setIconField method. The value of the icon field should be an Icon instance to use.

The position of the icon relative to text can be set using the setIconPosition method. Images can be placed to the left, right, above, or below the text. The horizontal and vertical alignments of either the text or the icon can be set explicitly using the appropriate methods of this class (e.g., setHorizontalTextAlignment). By default, both the text and icon are centered along both the horizontal and vertical directions.

Linear Supertypes
AbstractShapeRenderer, Renderer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IconLabelRenderer
  2. AbstractShapeRenderer
  3. Renderer
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new IconLabelRenderer(textField: String, iconField: String)

    Creates a new LabelRenderer.

    Creates a new LabelRenderer. Draws a text label using the given text data field, and draws the icon at the location reported by the given icon data field.

    textField

    the data field for the text label

    iconField

    the data field for the icon location. This value in the data field should be an Icon, or null for no icon. If the iconField parameter is null, no icon at all will be drawn.

  2. new IconLabelRenderer(textField: String)

    Creates a new LabelRenderer.

    Creates a new LabelRenderer. Draws a text label using the given text data field and does not draw an icon.

    textField

    the data field for the text label.

  3. new IconLabelRenderer()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def drawShape(arg0: Graphics2D, arg1: VisualItem, arg2: Shape): Unit
    Attributes
    protected[prefuse.render]
    Definition Classes
    AbstractShapeRenderer
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def getIcon(item: VisualItem): Icon

    Returns the icon to draw.

    Returns the icon to draw. Subclasses can override this class to perform custom icon selection beyond looking up the value from a data field.

    item

    the item for which to select an icon to draw

    returns

    the icon to use, or null for no icon

    Attributes
    protected
  11. def getRawShape(item: VisualItem): Shape

    Attributes
    protected
    Definition Classes
    IconLabelRenderer → AbstractShapeRenderer
    See also

    prefuse.render.AbstractShapeRenderer#getRawShape(prefuse.visual.VisualItem)

  12. def getRenderType(arg0: VisualItem): Int
    Definition Classes
    AbstractShapeRenderer
  13. def getShape(arg0: VisualItem): Shape
    Definition Classes
    AbstractShapeRenderer
  14. def getStroke(arg0: VisualItem): BasicStroke
    Attributes
    protected[prefuse.render]
    Definition Classes
    AbstractShapeRenderer
  15. def getText(item: VisualItem): String

    Returns the text to draw.

    Returns the text to draw. Subclasses can override this class to perform custom text selection.

    item

    the item to represent as a String

    returns

    a String to draw

    Attributes
    protected
  16. def getTransform(arg0: VisualItem): AffineTransform
    Attributes
    protected[prefuse.render]
    Definition Classes
    AbstractShapeRenderer
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def horizontalAlignment: Int

    Gets the horizontal alignment of this node with respect to its x, y coordinates.

    Gets the horizontal alignment of this node with respect to its x, y coordinates.

    returns

    the horizontal alignment, one of { @link prefuse.Constants#LEFT}, { @link prefuse.Constants#RIGHT}, or { @link prefuse.Constants#CENTER}.

  19. def horizontalAlignment_=(value: Int): Unit

    Sets the horizontal alignment of this node with respect to its x, y coordinates.

    Sets the horizontal alignment of this node with respect to its x, y coordinates.

    value

    the horizontal alignment, one of { @link prefuse.Constants#LEFT}, { @link prefuse.Constants#RIGHT}, or { @link prefuse.Constants#CENTER}.

  20. def horizontalIconAlignment: Int

    Gets the horizontal icon alignment within the layout.

    Gets the horizontal icon alignment within the layout. One of Constants.LEFT, Constants.RIGHT, or Constants.CENTER. The default is a centered icon.

    returns

    the horizontal icon alignment

  21. def horizontalIconAlignment_=(value: Int): Unit

    Sets the horizontal icon alignment within the layout.

    Sets the horizontal icon alignment within the layout. One of Constants.LEFT, Constants.RIGHT, or Constants.CENTER. The default is a centered icon.

    value

    the desired horizontal icon alignment

  22. def horizontalPadding: Int

    Returns the amount of padding in pixels between the content and the border of this item along the horizontal dimension.

    Returns the amount of padding in pixels between the content and the border of this item along the horizontal dimension.

    returns

    the horizontal padding

  23. def horizontalPadding_=(value: Int): Unit

    Sets the amount of padding in pixels between the content and the border of this item along the horizontal dimension.

    Sets the amount of padding in pixels between the content and the border of this item along the horizontal dimension.

    value

    the horizontal padding to set

  24. def horizontalTextAlignment: Int

    Gets the horizontal text alignment within the layout.

    Gets the horizontal text alignment within the layout. One of Constants.LEFT, Constants.RIGHT, or Constants.CENTER. The default is centered text.

    returns

    the horizontal text alignment

  25. def horizontalTextAlignment_=(value: Int): Unit

    Sets the horizontal text alignment within the layout.

    Sets the horizontal text alignment within the layout. One of Constants.LEFT, Constants.RIGHT, or Constants.CENTER. The default is centered text.

    value

    the desired horizontal text alignment

  26. def iconField: String

    Gets the data field for icon locations.

    Gets the data field for icon locations. The value stored in the data field should be an Icon, or null for no icon.

    returns

    the data field for icon locations, or null for no icon

  27. def iconField_=(value: String): Unit

    Sets the data field for icon locations.

    Sets the data field for icon locations. The value stored in the data field should be an Icon, or null for no icon. If the iconField parameter is null, no icons at all will be drawn.

    value

    the data field for icon locations, or null for no icons

  28. def iconPosition: Int

    Gets the icon position, determining where the icon is placed with respect to the text.

    Gets the icon position, determining where the icon is placed with respect to the text. One of Constants.LEFT, Constants.RIGHT, Constants.TOP, or Constants.BOTTOM. The default is left.

    returns

    the icon position

  29. def iconPosition_=(value: Int): Unit

    Sets the icon position, determining where the icon is placed with respect to the text.

    Sets the icon position, determining where the icon is placed with respect to the text. One of Constants.LEFT, Constants.RIGHT, Constants.TOP, or Constants.BOTTOM. The default is left.

    value

    the desired icon position

  30. def iconTextPadding: Int

    Gets the padding, in pixels, between an icon and text.

    Gets the padding, in pixels, between an icon and text.

    returns

    the padding between an icon and text

  31. def iconTextPadding_=(value: Int): Unit

    Sets the padding, in pixels, between an icon and text.

    Sets the padding, in pixels, between an icon and text.

    value

    the padding to use between an icon and text

  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def locatePoint(arg0: Point2D, arg1: VisualItem): Boolean
    Definition Classes
    AbstractShapeRenderer → Renderer
  34. var m_arcHeight: Int
    Attributes
    protected
  35. var m_arcWidth: Int
    Attributes
    protected
  36. var m_bBox: RectangularShape

    The holder for the currently computed bounding box

    The holder for the currently computed bounding box

    Attributes
    protected
  37. var m_delim: String
    Attributes
    protected
  38. var m_font: Font
    Attributes
    protected
  39. var m_hIconAlign: Int
    Attributes
    protected
  40. var m_hTextAlign: Int
    Attributes
    protected
  41. var m_horizBorder: Int
    Attributes
    protected
  42. var m_iconMargin: Int
    Attributes
    protected
  43. var m_iconName: String
    Attributes
    protected
  44. var m_iconPos: Int
    Attributes
    protected
  45. var m_labelName: String
    Attributes
    protected
  46. var m_maxTextWidth: Int
    Attributes
    protected
  47. var m_pt: Point2D
    Attributes
    protected
  48. var m_text: String
    Attributes
    protected
  49. var m_textDim: Dimension
    Attributes
    protected
  50. var m_vIconAlign: Int
    Attributes
    protected
  51. var m_vTextAlign: Int
    Attributes
    protected
  52. var m_vertBorder: Int
    Attributes
    protected
  53. var m_xAlign: Int
    Attributes
    protected
  54. var m_yAlign: Int
    Attributes
    protected
  55. def maximumTextWidth: Int
  56. def maximumTextWidth_=(value: Int): Unit

    Sets the maximum width that should be allowed of the text label.

    Sets the maximum width that should be allowed of the text label. A value of -1 specifies no limit (this is the default).

    value

    the maximum width of the text or -1 for no limit

  57. def mkAlignedPoint(p: Point2D, item: VisualItem, w: Double, h: Double, xAlign: Int, yAlign: Int): Unit

    Helper method, which calculates the top-left co-ordinate of an item given the item's alignment.

    Helper method, which calculates the top-left co-ordinate of an item given the item's alignment.

    Attributes
    protected
  58. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  59. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  60. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  61. def render(g: Graphics2D, item: VisualItem): Unit

    Definition Classes
    IconLabelRenderer → AbstractShapeRenderer → Renderer
    See also

    prefuse.render.Renderer#render(java.awt.Graphics2D, prefuse.visual.VisualItem)

  62. def setBounds(arg0: VisualItem): Unit
    Definition Classes
    AbstractShapeRenderer → Renderer
  63. def setManageBounds(arg0: Boolean): Unit
    Definition Classes
    AbstractShapeRenderer
  64. def setRenderType(arg0: Int): Unit
    Definition Classes
    AbstractShapeRenderer
  65. def setRoundedCorner(arcWidth: Int, arcHeight: Int): Unit

    Rounds the corners of the bounding rectangle in which the text string is rendered.

    Rounds the corners of the bounding rectangle in which the text string is rendered. This will only be seen if either the stroke or fill color is non-transparent.

    arcWidth

    the width of the curved corner

    arcHeight

    the height of the curved corner

  66. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  67. def textField: String

    Gets the field name to use for text labels.

    Gets the field name to use for text labels.

    returns

    the data field for text labels, or null for no text

  68. def textField_=(value: String): Unit

    Sets the field name to use for text labels.

    Sets the field name to use for text labels.

    value

    the data field for text labels, or null for no text

  69. def toString(): String
    Definition Classes
    AnyRef → Any
  70. def verticalAlignment: Int

    Gets the vertical alignment of this node with respect to its x, y coordinates.

    Gets the vertical alignment of this node with respect to its x, y coordinates.

    returns

    the vertical alignment, one of { @link prefuse.Constants#TOP}, { @link prefuse.Constants#BOTTOM}, or { @link prefuse.Constants#CENTER}.

  71. def verticalAlignment_=(value: Int): Unit

    Sets the vertical alignment of this node with respect to its x, y coordinates.

    Sets the vertical alignment of this node with respect to its x, y coordinates.

    value

    the vertical alignment, one of { @link prefuse.Constants#TOP}, { @link prefuse.Constants#BOTTOM}, or { @link prefuse.Constants#CENTER}.

  72. def verticalIconAlignment: Int

    Gets the vertical icon alignment within the layout.

    Gets the vertical icon alignment within the layout. One of Constants.TOP, Constants.BOTTOM, or Constants.CENTER. The default is a centered icon.

    returns

    the vertical icon alignment

  73. def verticalIconAlignment_=(value: Int): Unit

    Sets the vertical icon alignment within the layout.

    Sets the vertical icon alignment within the layout. One of Constants.TOP, Constants.BOTTOM, or Constants.CENTER. The default is a centered icon.

    value

    the desired vertical icon alignment

  74. def verticalPadding: Int

    Returns the amount of padding in pixels between the content and the border of this item along the vertical dimension.

    Returns the amount of padding in pixels between the content and the border of this item along the vertical dimension.

    returns

    the vertical padding

  75. def verticalPadding_=(value: Int): Unit

    Sets the amount of padding in pixels between the content and the border of this item along the vertical dimension.

    Sets the amount of padding in pixels between the content and the border of this item along the vertical dimension.

    value

    the vertical padding

  76. def verticalTextAlignment: Int

    Gets the vertical text alignment within the layout.

    Gets the vertical text alignment within the layout. One of Constants.TOP, Constants.BOTTOM, or Constants.CENTER. The default is centered text.

    returns

    the vertical text alignment

  77. def verticalTextAlignment_=(value: Int): Unit

    Sets the vertical text alignment within the layout.

    Sets the vertical text alignment within the layout. One of Constants.TOP, Constants.BOTTOM, or Constants.CENTER. The default is centered text.

    value

    the desired vertical text alignment

  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  79. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  80. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AbstractShapeRenderer

Inherited from Renderer

Inherited from AnyRef

Inherited from Any

Ungrouped