Class TextEditDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class TextEditDialog extends JDialog
See Also:
  • Field Details

  • Constructor Details

    • TextEditDialog

      public TextEditDialog()
      Create a dialog for editing text with default title, empty initial text, default style, and default font.
    • TextEditDialog

      public TextEditDialog(ITextEditable item)
      Create a dialog pre-populated from any text-editable item.
      Parameters:
      item - the item to edit; must not be null
    • TextEditDialog

      public TextEditDialog(String title, String inText, IStyled inStyle, Font inFont)
      Create a dialog for editing text with the given initial text and style.
      Parameters:
      title - the dialog title
      inText - the initial text content
      inStyle - the initial style to apply
      inFont - the initial font to apply
  • Method Details

    • getSelectedFont

      public Font getSelectedFont()
      Get the selected font.
      Returns:
      the selected font
    • getSelectedStyle

      public IStyled getSelectedStyle()
      Get the selected style.
      Returns:
      the selected style
    • getFillColor

      public Color getFillColor()
      Get the selected fill color.
      Returns:
      the selected fill color
    • getTextColor

      public Color getTextColor()
      Get the selected text color.
      Returns:
      the selected text color
    • getLineColor

      public Color getLineColor()
      Get the selected line color.
      Returns:
      the selected line color
    • getText

      public String getText()
      Get the edited text.
      Returns:
      the edited text.
    • isCancelled

      public boolean isCancelled()
      Check if the dialog was cancelled.
      Returns:
      true if cancelled, false otherwise.
    • updateTextItem

      public void updateTextItem(ITextEditable item)
      Apply the edited text, font, and style back to the given item.
      Parameters:
      item - the item to update; a no-op if null