Using Java's drawing methods for lines, shapes, colors,
text, and fonts.
Many logos are made of a few simple shapes and text. You
are going to write 2 java programs that each draw a logo
using Java's drawing methods.
Please screen capture just the drawing panel, not the entire screen.
To create a screen capture on a Mac:
- command-shift-4 key initiates the capture
- click on one corner of the image and drag to the other
diagonal corner.
- You will likely find the file with the image on the
desktop.
To create a screen capture in Windows:
- Select the window you want to capture.
- Hit Alt-PrintScreen to capture an image of your window to the clipboard.
- Switch into your editor and paste it with Ctrl-V
A color picker is a tool for sampling a color from the
screen and then showing you the Red, Green, and Blue values
need to specify that exact color in a new Java Color object.
Color pickers are built into many grahpical tools, available
as browser plug-ins, and as free downloads on the web. Here
are simple examples that you already have:
- On Windows: do a screen capture containing the color you want, run Start > All Programs > Accessories > paint, paste your screen capture into paint, select the eye dropper tool, click on the color you want, click on Edit colors, use the Red, Green, Blue values shown to create your color in Java.
- On a Mac: Run Applications > Utilities > Digital
Color Meter, select Display in sRGB, move the mouse over
anything to see its Red Green Blue color values.
Pick any logo shown above and write a java program to draw it. For most it won't be possible to match them exactly, but try to get close.
- Basic documentation about the DrawingPanel and Graphics2D class can be found at: www.cs.usm.maine.edu/~boothe/cos160/UsingJavaGraphics.pdf
- Copy the file DrawingPanel.java found at www.cs.usm.maine.edu/~boothe/cos160/DrawingPanel.java into your program3 project folder. To copy files, right click on the link and save the file to the desktop. After saving to the desktop you can drag it into your project. Alternatively, just clicking on the link, highlighting the entire text and copying the program (Ctrl-c or command-c on Macs). Then just paste it into your project by right clicking on the project and pasting (Ctrl-v or command-v on Macs) (If the word "snippet" arises at any time, you did it wrong ... delete that and try again)
Copy your program and a screen capture of your drawing to
your solutions document.
Write a program to draw a second logo from above or find
another logo on the web to draw (except HR Block, Target,
and Facebook which will be used in class).
Copy your program and a screen capture of your drawing to your solutions document. If you found a logo on the web explain what it is and include a picture of the original in your document.
Create your own personal logo, and briefly explain why it
represents you.
Copy your program and a screen capture of your logo to your
solutions document.
Turn in your programs and screenshots of the drawing
panels. If you have a color printer please use it. If you
not, that's okay.