SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Chapter:
Object-oriented Design
Exercise:
Exercises
Question:3 | ISBN:9781118771334 | Edition: 6

Question

Describe a component from a text-editor GUI and the methods that it encapsulates.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

 

File Operations is one of the core components in every text editor.

This component encapsulates the methods such as 

 

1 Opening existing files
2 Saving files to the disk
3 Printing the page
4 Creating new files
5 Mouse cursor movements and clicks

 

1. Opening existing files:

 

As the name implies, this method opens the existing files by reading its path in the disk and converts the stream of zeros and one's to readable text.

 

2. Saving files to the disk:

 

This method takes the path and stores the new document at a specified location by giving it a unique name.

 

3. Printing the page:

 

This method reads the text and streams the information such as plain text, indentations, images, properties of text to the printer. 

 

4. Creating new files:

 

This method creates a new instance of the file and allots space for the file.

 

5. Mouse cursor movements and clicks:

 

This method takes an instance of Action class and calls various methods in that class to perform the mouse actions such as clicks, double clicks, right clicks, etc.

0 0

Discussions

Post the discussion to improve the above solution.