Class GText

    • Field Detail

      • textArea

        public JTextArea textArea
        the JTextArea to type in text
      • isSelected

        private boolean isSelected
        whether the objects is selected
    • Method Detail

      • draw

        public void draw​(Graphics2D g)
        draw a rectangle with dash lines to represent the actual area of the JTextArea
        Specified by:
        draw in class GObject
        Parameters:
        g - the Graphics to paint
      • inShape

        public boolean inShape​(double mx,
                               double my)
        whether selected by the mouse
        Overrides:
        inShape in class GObject
        Parameters:
        mx - mouse x
        my - mouse y
        Returns:
        true if the mouse is at the peripheral area of the actual JTextArea
      • updateTextArea

        private void updateTextArea()
        update information for JTextArea component
      • updateTextString

        public void updateTextString()
        update the text content of the JTextArea