/[classpath]/classpath/javax/swing/text/View.java
ViewVC logotype

Diff of /classpath/javax/swing/text/View.java

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

revision 1.6.2.2 by gnu_andrew, Sat Jan 15 17:02:21 2005 UTC revision 1.6.2.3 by gnu_andrew, Tue Jan 25 12:41:41 2005 UTC
# Line 1  Line 1 
1  /* View.java --  /* View.java --
2     Copyright (C) 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
35  obligated to do so.  If you do not wish to do so, delete this  obligated to do so.  If you do not wish to do so, delete this
36  exception statement from your version. */  exception statement from your version. */
37    
38    
39  package javax.swing.text;  package javax.swing.text;
40    
41  import java.awt.Container;  import java.awt.Container;
# Line 69  public abstract class View implements Sw Line 70  public abstract class View implements Sw
70    
71    public abstract void paint(Graphics g, Shape s);    public abstract void paint(Graphics g, Shape s);
72    
73    public void setParent(View a)    public void setParent(View parent)
74    {    {
75      parent = a;      this.parent = parent;
76    }    }
77            
78    public View getParent()    public View getParent()
# Line 87  public abstract class View implements Sw Line 88  public abstract class View implements Sw
88    
89    public Container getContainer()    public Container getContainer()
90    {    {
91        View parent = getParent();
92      return parent != null ? parent.getContainer() : null;      return parent != null ? parent.getContainer() : null;
93    }    }
94        
# Line 101  public abstract class View implements Sw Line 103  public abstract class View implements Sw
103    }    }
104    
105    public abstract float getPreferredSpan(int axis);    public abstract float getPreferredSpan(int axis);
106    
107      public int getResizeWeight(int axis)
108      {
109        return 0;
110      }
111    
112      public float getMaximumSpan(int axis)
113      {
114        if (getResizeWeight(axis) <= 0)
115          return getPreferredSpan(axis);
116    
117        return Integer.MAX_VALUE;
118      }
119    
120      public float getMinimumSpan(int axis)
121      {
122        if (getResizeWeight(axis) <= 0)
123          return getPreferredSpan(axis);
124    
125        return Integer.MAX_VALUE;
126      }
127      
128      public void setSize(float width, float height)
129      {
130        // The default implementation does nothing.
131      }
132        
133    public float getAlignment(int axis)    public float getAlignment(int axis)
134    {    {
# Line 109  public abstract class View implements Sw Line 137  public abstract class View implements Sw
137    
138    public AttributeSet getAttributes()    public AttributeSet getAttributes()
139    {    {
140      return elt.getAttributes();      return getElement().getAttributes();
141    }    }
142        
143    public boolean isVisible()    public boolean isVisible()
# Line 129  public abstract class View implements Sw Line 157  public abstract class View implements Sw
157    
158    public ViewFactory getViewFactory()    public ViewFactory getViewFactory()
159    {    {
160        View parent = getParent();
161      return parent != null ? parent.getViewFactory() : null;      return parent != null ? parent.getViewFactory() : null;
162    }    }
163    
# Line 167  public abstract class View implements Sw Line 196  public abstract class View implements Sw
196    
197    public int getStartOffset()    public int getStartOffset()
198    {    {
199      return elt.getStartOffset();      return getElement().getStartOffset();
200    }    }
201    
202    public int getEndOffset()    public int getEndOffset()
203    {    {
204      return elt.getEndOffset();      return getElement().getEndOffset();
205    }    }
206    
207    public Shape getChildAllocation(int index, Shape a)    public Shape getChildAllocation(int index, Shape a)
# Line 205  public abstract class View implements Sw Line 234  public abstract class View implements Sw
234    
235      return null;      return null;
236    }    }
237    
238      /**
239       * @since 1.3
240       */
241      public Graphics getGraphics()
242      {
243        return getContainer().getGraphics();
244      }
245  }  }
246    

Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.6.2.3

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