Nov 11 1 Example Program Example Program DemoMouseInk.java
Nov 11 1
Example ProgramExample Program
DemoMouseInk.java
Nov 11 2
Example ProgramExample Program
DemoMouseUnistrokes.java
Nov 11 3
ImagesImages
DemoImage.java
DemoImage2.java
Nov 11 4
TextText
Characterized byFont familyStyleSize and Spacing
Nov 11 5
Font FamiliesFont Families
Three typesSerif
A serif is a short line extending from and at an angle to the upper and lower strokes of a letterSerif fonts facilitate human perception in distinguishing among letters
Sans serifWithout serifs
Monospaced or fixed-pitchEach character occupies the same amount of horizontal space
Nov 11 6
Serifs IllustratedSerifs Illustrated
AB abAB ab
Times roman
Bookman oldstyle
serifs
Nov 11 7
Sans Serifs IllustratedSans Serifs Illustrated
CD cdCD cd
Arial
Lucida sans
Nov 11 8
Monospaced IllustratedMonospaced Illustrated
IM imIM im
Courier new
OCR A Extended
Nov 11 9
Font StyleFont Style
Plain
Italic
Bold
Italic + bold
Hello Java World
Hello Java World
Hello Java World
Hello Java World
Nov 11 10
Font SizeFont Size
Font size is measured in pointsA point is the smallest typographical unit of measurement1 point = 1 / 72 inch (i.e., 72 points per inch)
Hello Java World48 point font size
Nov 11 11
Font SpacingFont Spacing
Nov 11 12
Readability of TextReadability of Text
Guidelines:Uppercase vs lowercase
WORDS WRITTEN IN BLOCK CAPITALS take longer to read than those written in lowercaseHowever, an important word written in CAPITALS is quickly perceived provided it is surrounded by words in lowercase
Serif vs. sans serifFor printed text, serif fonts are easier to run one’s eyes along and take in the written contentFor on-screen text, serif fonts generally produce less well than sans serif fonts due to poorer resolution of the display
Nov 11 13
Example Program Example Program (shown earlier)(shown earlier)
Nov 11 14
Example ProgramExample Program
DemoList3.java
Nov 11 15
Image File FormatsImage File Formats
There are many, many file formats for storing imagesThese include…
gif, jpg, tiff, bmp
Nov 11 16
gifgif
gif = graphics interchange formatPronounced giff (with a hard ‘g’)Introduced in 1987 by CompuServe Inc.Very popular format for web pagesFeatures
Limited to 256 colors (8-bit)Lossless data compression (compresses best for images with lots of repetition; e.g., flat colors)Support for transparency
one colour in the image’s pallete (usually the ‘background’) is treated as transparent
Support for animation
Nov 11 17
jpgjpg
jpg = jpeg = joint photographic experts groupPronounced jay-pegFeatures
Always uses 24-bit colorLossy data compression (up to 95% reduction, but with loss of image quality proportional to amount of compression)
Nov 11 18
tifftiff
tif = tiff = tagged image file formatFeatures
Supports different compression schemes (lossy and lossless)Supports any resolutionBlack and white, color, or grey shades
Nov 11 19
bmpbmp
bmp = bit-mapStandard for Windows environmentUses a pixel map to hold line-by-line raster informationFeatures
No compressionFiles are large
Nov 11 20
Example (1)Example (1)
Transparent gif
Format File Sizegif 1639jpg 5522tif 3328bmp 7942
jpg, tif, bmp
Nov 11 21
Example (2)Example (2)
Animated gifwith transparentbackground
Nov 11 22
Programming Challenge Programming Challenge SolutionSolution
Create a GUI layout, as follows
Clear Exit
Enter some text:
Clear Exit
Enter some text:
Upon launching After resizing