~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to java/awt/Checkbox.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Checkbox.java -- An AWT checkbox widget
2
 
   Copyright (C) 1999, 2000, 2001, 2002, 2005  Free Software Foundation, Inc.
 
2
   Copyright (C) 1999, 2000, 2001, 2002, 2005, 2006
 
3
   Free Software Foundation, Inc.
3
4
 
4
5
This file is part of GNU Classpath.
5
6
 
459
460
public synchronized void
460
461
setState(boolean state)
461
462
{
462
 
  this.state = state;
463
 
  if (peer != null)
 
463
  if (this.state != state)
464
464
    {
465
 
      CheckboxPeer cp = (CheckboxPeer) peer;
466
 
      cp.setState (state);
 
465
      this.state = state;
 
466
      if (peer != null)
 
467
        {
 
468
          CheckboxPeer cp = (CheckboxPeer) peer;
 
469
          cp.setState (state);
 
470
        }
467
471
    }
468
472
}
469
473
 
599
603
dispatchEventImpl(AWTEvent e)
600
604
{
601
605
  if (e.id <= ItemEvent.ITEM_LAST
602
 
      && e.id >= ItemEvent.ITEM_FIRST
603
 
      && (item_listeners != null 
604
 
          || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0))
605
 
    processEvent(e);
 
606
      && e.id >= ItemEvent.ITEM_FIRST)
 
607
    {
 
608
      ItemEvent ie = (ItemEvent) e;
 
609
      int itemState = ie.getStateChange();
 
610
      setState(itemState == ItemEvent.SELECTED ? true : false);
 
611
      if (item_listeners != null 
 
612
          || (eventMask & AWTEvent.ITEM_EVENT_MASK) != 0)
 
613
        processEvent(e);
 
614
    }
606
615
  else
607
616
    super.dispatchEventImpl(e);
608
617
}