/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.52 by fitzsim, Thu Sep 25 18:44:19 2003 UTC revision 1.53 by fitzsim, Thu Oct 2 18:39:54 2003 UTC
# Line 72  public class GtkComponentPeer extends Gt Line 72  public class GtkComponentPeer extends Gt
72  {  {
73    Component awtComponent;    Component awtComponent;
74    
75      Insets insets;
76    
77    /* this isEnabled differs from Component.isEnabled, in that it    /* this isEnabled differs from Component.isEnabled, in that it
78       knows if a parent is disabled.  In that case Component.isEnabled       knows if a parent is disabled.  In that case Component.isEnabled
79       may return true, but our isEnabled will always return false */       may return true, but our isEnabled will always return false */
# Line 90  public class GtkComponentPeer extends Gt Line 92  public class GtkComponentPeer extends Gt
92      throw new RuntimeException ();      throw new RuntimeException ();
93    }    }
94    
95      void initializeInsets ()
96      {
97        insets = new Insets (0, 0, 0, 0);
98      }
99    
100    native void connectHooks ();    native void connectHooks ();
101    
102    protected GtkComponentPeer (Component awtComponent)    protected GtkComponentPeer (Component awtComponent)
# Line 115  public class GtkComponentPeer extends Gt Line 122  public class GtkComponentPeer extends Gt
122        //        c.setFont (cp.getFont ());        //        c.setFont (cp.getFont ());
123        if (awtComponent.getFont() != null)        if (awtComponent.getFont() != null)
124          setFont(awtComponent.getFont());          setFont(awtComponent.getFont());
125          
126        if (! (awtComponent instanceof Window))        initializeInsets ();
127          {  
128            setCursor (awtComponent.getCursor ());        setCursor (awtComponent.getCursor ());
129            Rectangle bounds = awtComponent.getBounds ();        Rectangle bounds = awtComponent.getBounds ();
130            setBounds (bounds.x, bounds.y, bounds.width, bounds.height);        setBounds (bounds.x, bounds.y, bounds.width, bounds.height);
131          }  
132      } catch (RuntimeException ex) { ; }      } catch (RuntimeException ex) { ; }
133    }    }
134    
# Line 278  public class GtkComponentPeer extends Gt Line 285  public class GtkComponentPeer extends Gt
285    {    {
286      Component parent = awtComponent.getParent ();      Component parent = awtComponent.getParent ();
287            
288      if (parent instanceof Frame)      if (parent instanceof Window)
289        {        {
290          Insets insets = ((Frame)parent).getInsets ();          Insets insets = ((Window) parent).getInsets ();
291          /* convert Java's coordinate space into GTK+'s coordinate space */          // Convert from Java coordinates to GTK coordinates.
292          setNativeBounds (x-insets.left, y-insets.top, width, height);          setNativeBounds (x - insets.left, y - insets.top, width, height);
293        }        }
294      else      else
295        setNativeBounds (x, y, width, height);        setNativeBounds (x, y, width, height);

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26