• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between semantic events and low-level events

 
leena rane
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not exactly understood the difference between semantic events and low-level events.Could someone explain in simple words ?
(I know which 4 are semantic)
Thanx in advance
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

1)Semantic events
ActionEvent
AdjustmentEvent
ItemEvent
TextEvent
These classes are used for high level semantic events, to represent user interaction with a GUI component. For example , clicking a button, slecting a menu item , selecting a checkbox, scrolling and changing text in the text field or text area all result in indidual semantic events
2) Low level
ComponentEvent
ContainerEvent
FocusEvent
KeyEvent
MouseEvent
PaintEvent
WindowEvent
These classes are used to represent low level input or window operations.Several low level events can constitute a single semantic event. For example , clicking on a button is actually a sequence of mouse movements to position the cursor followed by pressing and releasing a mouse button.
http://www.amazon.com/exec/obidos/ASIN/0201596148/electricporkchop

hope this helps
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Low level events are those produced by the keyboard, mouse and those related to windows: KeyEvent, FocusEvent, MouseEvent, WindowEvent, ComponentEvent and ContainerEvent. Keyboard and mouse are regarded as low level input.
Sometimes a low level event spawned a semantic one. Such as a click of the mouse in a button produces ActionEvent; or an item has been selected in a Choice, or a window has been iconified.
While FocusEvent, KeyEvent, MouseEvent and ComponentEvent can ocurr in any Component; the semantics one, ItemEvent, TextEvent, AdjustmentEvent and ActionEvent are related with a particular type of component. Semantics events somehow have a meaning: TextEvent represents a change in the text of an TextComponent object. ItemEvent represents that an Item has been selected, this could be a Checkbox, a CheckboxMenuItem, or any item in a List or Choice. AdjustmentEvent means that the value hold by an object implementing Adjustable has changed. ActionEvent means that a Button was pressed, a List was double clicked, a TextField received Enter or a MenuItem was selected.
By listenning semantics events you are interested in what has happened (the meaning),not in the low events that ocurred.
Please correct or add anything
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey did you notice that the "meaning" of ActionEvent was not very clear?
Richard G. Baldwin wrote here
http://home.att.net/~baldwin.rg/Intermediate/Java080.htm
that the meaning is "do a command"
 
leena rane
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Ersin,
Thanx Jose
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Today I have discovered the following:
java.awt.event
java.awt.event.ComponentEvent low level events
but
java.awt.event
semantics events
All the low level events can obtain the Component on which they ocurred, and thus using all of its methods, via event.getComponent()
But with semantics you can't do that. I guess you are interested in the meaning of the event, not in the Component.
This is form the URL that I gave yesterday. Browse it, it's impresive.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic