Documentation of 'CH.ifa.draw.figures.TextTool' Java class
TextTool
CH.ifa.draw.figures

Class TextTool

  • All Implemented Interfaces:
    Tool
    Direct Known Subclasses:
    ConnectedTextTool


    public class TextTool
    extends CreationTool
    Tool to create new or edit existing text figures. The editing behavior is implemented by overlaying the Figure providing the text with a FloatingTextField.

    A tool interaction is done once a Figure that is not a TextHolder is clicked.

    See Also:
    TextHolder, FloatingTextField
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void activate()
      Sets the text cursor.
      void deactivate()
      Terminates the editing of a text figure.
      boolean isActivated()
      Test whether the text tool is currently activated and is displaying a overlay TextFigure for accepting input.
      void mouseDown(java.awt.event.MouseEvent e, int x, int y)
      If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.
      void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
      Adjusts the extent of the created figure
      void mouseUp(java.awt.event.MouseEvent e, int x, int y)
      Checks if the created figure is empty.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • mouseDown

        public void mouseDown(java.awt.event.MouseEvent e,
                              int x,
                              int y)
        If the pressed figure is a TextHolder it can be edited otherwise a new text figure is created.
        Specified by:
        mouseDown in interface Tool
        Overrides:
        mouseDown in class CreationTool
      • mouseDrag

        public void mouseDrag(java.awt.event.MouseEvent e,
                              int x,
                              int y)
        Description copied from class: CreationTool
        Adjusts the extent of the created figure
        Specified by:
        mouseDrag in interface Tool
        Overrides:
        mouseDrag in class CreationTool
      • mouseUp

        public void mouseUp(java.awt.event.MouseEvent e,
                            int x,
                            int y)
        Description copied from class: CreationTool
        Checks if the created figure is empty. If it is, the figure is removed from the drawing.
        Specified by:
        mouseUp in interface Tool
        Overrides:
        mouseUp in class CreationTool
        See Also:
        Figure.isEmpty()
      • isActivated

        public boolean isActivated()
        Test whether the text tool is currently activated and is displaying a overlay TextFigure for accepting input.
        Returns:
        true, if the text tool has a accepting target TextFigure for its input, false otherwise

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.