User Tools

Site Tools


dot_class

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dot_class [2022/09/15 09:24] frchrisdot_class [2022/09/15 09:48] (current) – [Dot class] frchris
Line 1: Line 1:
 **Dot Class** **Dot Class**
 +
 +BlueJ is a great "starter IDE" but eventually you will want more of the features of a more professional IDE.  Also, if you only know one IDE, do you really know what an IDE is?  It is good to see what is the same and what is different between two or more IDEs to see the strengths and weaknesses in a given context.
 +
 +
  
 Extreme programming refers to the wise tradition to write the code that tests your new object before you actually write the new object.  It really does help you define what you need from your new class. Extreme programming refers to the wise tradition to write the code that tests your new object before you actually write the new object.  It really does help you define what you need from your new class.
 +
 +Here is a [[http://ia800502.us.archive.org/10/items/MakingAJavaClassForDots/Dotclassdemo-Broadband.m4v|link]] to making a Dot class starting with making a tester.  At the time, Applets were a simple way to write graphics based code, but Applets have since been "deprecated" due to security concerns.  You may wish to fast forward to minute 10:45 to see the beginnings of the Dot class.
 +
 +Below is a full fledged Graphics application that was based on a generic [[https://mathorama.com/apcs/pmwiki.php?n=Main.MouseListenerApplication| MouseListenerApplication]].  Writing code that is reusable saves a lot of labor and debugging time.  
  
 <code java DotTester.java> <code java DotTester.java>
Line 99: Line 107:
  
  
 +====Dot class====
  
 +Here is a bit of starter code to save you time, but feel free to write this from scratch!
  
 <code java Dot.java> <code java Dot.java>
Line 136: Line 146:
 } }
 </code> </code>
 +
 +Things to do:
 +  - Write a two parameter constructor
 +  - Write a method that returns a random number that is in the range of ''min'' to ''max''
 +  - Write a method that returns a random Color
 +  - Write a method that will draw itself on a ''Graphic'' object
 +  - Write a ''toString'' method to override the inherited  ''Object'' ''toString()'' method.
 +  - Write overload your constructor a few times
 +
dot_class.1663248270.txt.gz · Last modified: 2022/09/15 09:24 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki