buddysoftpainter

Download Report

Transcript buddysoftpainter

BuddySoft Painter
Capstone Project
Buddy Landry
December 15, 2006
Project Description
• I was inspired to create my own version of
MS Paint after learning about Mouse
Listeners and GUI Components in this
class.
• I decided to see how close to the original
program I could get by using Java to code
it but decided to create a couple of my
own unique tools to add to it.
GUI Components
• I used JButtons to select from
multiple tools and Combo Boxes to
select foreground and background
colors as well as to select the tool
size.
• JMenus were used for the top menu
bar with dialog boxes.
GUI Layout
• I used a BorderLayout with a GridLayout
to organize my toolbar, menubar and
JPanel to draw on.
• Tooltips and Mnemonics were used to see
the tool description and to view the
alternate tool selection (alt+key).
• Dialog Boxes were used to provide the
user information in the program.
MouseListener and
MouseMotionListener
• The dragged method was used to
provide the paint on the JPanel. They
enabled the graphic context to
function on the panel to display the
user drawing input.
ButtonListener
(ActionListener)
• In order for the user to select different
tools, I set an integer value for each tool
and switched it when the user clicked a
different button to change the event
source.
• For the comboboxes I changed the
SelectedIndex to change color and sizes.
Tool Bar
•
•
•
•
•
•
•
List of Tools
1. Pencil
2. Feather
3. Blotch
4. Brush
5. Spray Can
6. Cobwebs
7. Open Oval
8. Open Rectangle
9. Closed Oval
10. Closed Rectangle
Outcomes
• I was able to create a good equivalent to
MS Paint with tools, buttons, drawing,
color selection, help dialog boxes, a open
dialog box, and an exit menu button.
• I lacked selection, cut, copy, and paste
features, and a save as dialog box. I wasn’t
sure about I/O streams to create it.
Lessons Learned
• The Sun Microsystems website was a terrific
resource providing vast information about GUI
Components. It had components I have never
heard of before.
• The API is a programmers best friend. It is
equivalent to the Actionscript library and
Dreamweaver O’Reilly code libraries.
• I learned the vast possibilities Java provides. The
object oriented aspect of Java makes it flexible
to create applications, animations, games.
Lessons Learned
• Class files allow a programmer to create unique
applications by inheriting what they need rather
than always creating something from scratch.
• The object oriented concepts exist in multiple
languages but are typed differently. Java is
strongly typed but other languages still declare
data types but just in different ways.
• Programming becomes formulaic after awhile.
Practice goes a long way because instantiation
becomes routine creating many components with
the same technique.
Other Goals
• A Java Word Processor.
• A Java Audio Player/Equalizer.
• Go into Java Advanced Topics such as
JDBC and Networking.
• Applets are neat. The applet life
cycle is a little bit different than
applications.