Deliver Information, not Just Data - PowerPoint PPT Presentation

1 / 4
About This Presentation
Title:

Deliver Information, not Just Data

Description:

Attention to detail (don't assume anyone can do the job team approach) ... area of the component is decreased (inset) by the pixels assigned to its border) ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 5
Provided by: williamm9
Category:

less

Transcript and Presenter's Notes

Title: Deliver Information, not Just Data


1
Deliver Information, not Just Data
  • Design displays carefully
  • Visual order and user focus (control contrast)
  • Match the medium (mixed metaphors)
  • Attention to detail (dont assume anyone can do
    the jobteam approach)
  • Screen belongs to User (avoid trying to help the
    user manage the screen)
  • Preserve display inertia (localize the response
    to user actionwait for Return to reposition
    list)
  • Dont respond too quickly
  • Warn the user of proposed changemake change
    predictable and appropriate (measured) response

2
Custom Painting
  • As we should by now realize the Swing library is
    divided between containers and components. We
    have used JPanel components for grouping. Now
    will will use them for drawing.
  • The coordinate systems for ANY component makes
    the upper lefthand corner (0,0), so the lower
    right hand corner is (width-1, height-1) where
    units are pixels.
  • Any border width comes out of the dimensions of
    the component (more accurately, the visible area
    of the component is decreased (inset) by the
    pixels assigned to its border).
  • getInsets() obtains a components border width,
    getWidth() and getHeight() obtains the
    components outer dimensions.

3
Repaint()
  • When invoked, the componet schedules itself to be
    refreshed in graphics memory. With no arguments,
    the whole component is repainted, but with four
    arguments, only that rectangular portion is
    refreshed. (g.getClipBounds() tells you what
    region of your component is visible on the
    screen)
  • Example Code
  • CoordinateDemo (p. 861)
  • SelectionDemo (p.879)

4
The Graphics Object
  • When component.repaint() is invoked the
    paintComponent(Graphics g) method for that
    component is called and it employs a default
    color, font, etc. to do the custom painting.
    After painting the background of the component
    (because of a call to super.paintComponent) the
    method does the drawing requested, then invokes
    paintBorder and finally paintChildren so that any
    components internal to the component will also
    repaint themselves.
  • Graphics
Write a Comment
User Comments (0)
About PowerShow.com