Interface ITextEditable

All Known Implementing Classes:
MapTextItem, TextItem

public interface ITextEditable
Marks an item as having editable text content, font, and style — the minimal contract required by TextEditDialog.

Purpose

TextEditDialog was originally written to accept a concrete TextItem. Introducing this interface breaks that dependency so the dialog can operate on any text-bearing item — in particular both TextItem (world-space anchor) and MapTextItem (geographic anchor) — without knowing about either class.

Implementing classes

Any item that can be edited by TextEditDialog should implement this interface. Typically that means declaring implements ITextEditable on the class; the six methods are usually already present.

Method contract

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the current display font.
    Returns the current style (colors, line style, etc.).
    Returns the current text content.
    void
    setFont(Font font)
    Sets the display font.
    void
    Replaces the current style.
    void
    Replaces the text content.
  • Method Details

    • getText

      String getText()
      Returns the current text content.

      Multi-line text is represented with embedded '\n' characters. Implementations must never return null; an empty string is the correct representation of no content.

      Returns:
      the text; never null
    • setText

      void setText(String text)
      Replaces the text content.
      Parameters:
      text - the new text; implementations should treat null as an empty string
    • getFont

      Font getFont()
      Returns the current display font.
      Returns:
      the font; must not be null in a correctly initialised item
    • setFont

      void setFont(Font font)
      Sets the display font.
      Parameters:
      font - the new font; passing null should restore the implementation's default font
    • getStyle

      IStyled getStyle()
      Returns the current style (colors, line style, etc.).
      Returns:
      the style; may be null on a partially constructed or disposed item, but must not be null during normal use
    • setStyle

      void setStyle(IStyled style)
      Replaces the current style.
      Parameters:
      style - the new style; null is accepted but may cause rendering errors unless getStyleSafe() is used subsequently