2015-2016-2 "Java Programming" team blog 2

Source: Internet
Author: User

Simple drawing Board Introduction

I. Functional structure diagram

Two. Main class design

1. Overall design: In the design of simple drawing board, according to the program function classification, contains 12 files, including Simpledraw.java,menucontainer.java,drawpanel.java,drawings.java, Drawbtnlistener.java,toolbtnlistener.java,newfilelistener.java,loadfilelistener.java

Savefilelistener.java,checkboxlist.java,mousea.java,mouseb.java.

2.simpledraw.java

The file contains a public Simpledraw class that encapsulates the interface of the drawing board and the listener events for the buttons.

3.menucontainer.java

The file contains a public Menucontainer class that encapsulates the various methods created by the menu bar.

4.drawpanel.java

The file contains a public Drawpanel drawing panel class that encapsulates the initial state of the paint area and adds mouse event snooping for drawing.

5.drawings.java

The file contains a public drawings class, implements the serialization interface, encapsulates the common properties of other basic graphic units, all the paint operations inherit the class, and rewrite the drawing Method Drwa ()

6.drawbtnlistener.java

The file contains a public Drawbtnlistener class that implements the ActionListener interface, and the main function is to listen to the actions of the drawing-related action buttons.

7.toolbtnlistener.java

The file contains a public Toolbtnlistener class that implements the ActionListener interface, and the main function is to listen for the actions of the drawing buttons in the Drawing toolbar section.

8.newfilelistener.java

The file contains a public Newfilelistener class, with the main function of creating a new blank drawing file, initializing the paint area, and the brushes, colors, and so on.

9.loadfilelistener.java

The file contains a public Loadfilelistener class, the main function is to handle open file listening events, mainly to provide open Local file dialog box, you can select the local picture file.

10.savefilelistener.java

The file contains a pubic Savefilelistener class, the main function is to handle the listening events to save the file, mainly to provide a dialog box to save the file, you can select a local path, set the user name, click OK to save the file to local.

11.checkboxlist.java

The file contains a public CheckBoxList class, and the main function is to provide font style options.

12.mousea.java

The file contains a public Mousea class, which is used primarily to monitor and manipulate the corresponding time of the mouse when drawing.

13.mouseb.java

The file contains a public mouseb class that is used to complete the corresponding event when the mouse is dragged and the mouse is moved.

Three. Project Progress

This week's project follows the plan to complete the preliminary framework structure, and this week also gives a specific project structure. We will debug and test our Java code later, based on the design concept and design framework.

Four. Reference books

"Java Project Development Practice" Zhongnan University Press, 2015 edition

2015-2016-2 "Java Programming" team blog 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.