L2 - Generic Graphics Overview
L2 - Generic Graphics Overview
PROGRAMMING
ITPE 104
TABLE OF CONTENT
01 Generic Graphics Overview
The Graphical User Interface
Graphical Events
TABLE OF CONTENT
02 Primitive Events and their Handlers
Mouse Events
Keyboard Events
Timer Events
GENERIC GRAPHICAL
OVERVIEW
A style of coding where a program’s overall
flow of execution is dictated by events.
• The program loads, then waits for user input events.
• As each events occurs, the program runs particular code to respond.
• The overall flow of what code is executed is determined by the series of
events that occur.
• Contrast with application – or algorithm-driven control where program
expects input data in a pre-determined order and timing
– Typical of large non-GUI applications like web crawling, payroll batch
simulation
GRAPHICAL USER INTERFACE
It refers to the visual elements and interactive features
of software or a digital system that allow users to
interact with and control the program using graphical
elements like icons, buttons, windows, and menus.
GUIs make software more user-friendly and accessible
by providing an intuitive way for users to perform tasks
and access information, typically through mouse clicks
or touchscreen interactions.
GUI IN EDP
GUI is a type of UI that allows users to interact with a computer using graphics.
GUIs typically use windows, icons, menus and pointers to allow user to input and
output information.
GUIs are typically implemented using event-driven programming. This means that
the GUI program listens for events, such as mouse clicks and key presses, and then
responds to those events.
GUI IN EDP
Here are some examples of how EDP is used to implement GUIs:
• When a user clicks on a button, the GUI program may open a window or
perform
• When a user types in a text field, the GUI program may update the display
to show the new text
• When a user moves the mouse over a window, the GUI program may
change the cursor or highlight the window
• When a user presses a key on keyboard, the GUI program may perform
some action such as opening a new menu or closing a window
GRAPHICAL USER INTERFACE
GUI Design Principles
– are set of guidelines that can be used to design effective GUIs
• Consistency: in terms of its design, layout and functionality
• Simplicity: simple and easy to use
• Clarity: clear and easy to understand
• Feedback: provides feedback to users about their actions
• Efficiency: efficient and allows users to complete their tasks quickly and easily
GRAPHICAL USER INTERFACE
GUI Design Principles
In addition to these general principles, there are also a number of specific
principles that can be applied to different aspects of GUI design, such as:
• Window Design
• Menu Design
• Form Design
• Icon Design
• Color Design
GRAPHICAL EVENTS
• ActionEvent: triggered when a user interacts with a GUI component that can
perform an action
• MouseEvent: generated when the mouse is used to interact with GUI
components *primitive
• KeyEvent: associated with keyboard interactions *primitive
• WindowEvent: related to the opening, closing, resizing, and other window-
related actions in GUI applications
• ComponentEvent: generated when there are changes to a GUI component,
such as when it's resized, moved, or shown or hidden
• FocusEvent: related to the focus of GUI components
• ItemEvent: associated with components like checkboxes and radio buttons
GRAPHICAL EVENTS
In Java, handling these graphical events involves creating event listeners and
implementing callback methods to respond to specific events.
PRIMITIVE EVENTS
Here are some examples of how EDP is used to implement GUIs:
• When a user clicks on a button, the GUI program may open a window or
perform
• When a user types in a text field, the GUI program may update the display
to show the new text
• When a user moves the mouse over a window, the GUI program may
change the cursor or highlight the window
• When a user presses a key on keyboard, the GUI program may perform
some action such as opening a new menu or closing a window
Thots? Kweschens?
Konsurnz? Komplaynts?
ssardeng@dmmmsu.edu.ph
Monday/9:30 AM – 10:30 AM
Thursday/3:00 PM – 4:00 PM