/[gzz]/gzz/gzz/view/CellView.java
ViewVC logotype

Diff of /gzz/gzz/view/CellView.java

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

revision 1.8 by benja, Sat Nov 2 01:23:45 2002 UTC revision 1.9 by benja, Fri Dec 6 01:03:51 2002 UTC
# Line 1  Line 1 
1  /*  /*
2  CellView.java  CellInBox.java
3   *       *    
4   *    Copyright (c) 2002, Benja Fallenstein   *    Copyright (c) 2002, Tuomas J. Lukka
5   *       *    
6   *    You may use and distribute under the terms of either the GNU Lesser   *    You may use and distribute under the terms of either the GNU Lesser
7   *    General Public License, either version 2 of the license or,   *    General Public License, either version 2 of the license or,
# Line 18  CellView.java Line 18  CellView.java
18   *       *    
19   */   */
20  /*  /*
21   * Written by Benja Fallenstein   * Written by Tuomas J. Lukka
22   */   */
23    
24  package gzz.view;  package gzz.view;
25  import gzz.*;  import gzz.*;
26  import gzz.vob.*;  import gzz.vob.*;
27  import gzz.vob.vobs.*;  import gzz.vob.vobs.*;
28    
29  /** A view showing a single cell.  /** A view that shows a cell in a box.
30     * Whether it draws a box or not is not defined by this interface.
31     * A common pattern is that a CellView drawing a box calls
32     * a sub-cellview to draw the actual content.
33     * <p>
34     * When subclassing, you must override one of the getSize() methods;
35     * the others will work. If you don't, you'll get an infinite loop:
36     * the default implementations call each other.
37   */   */
38  public abstract class CellView extends CellInBox {  public abstract class CellView {
39  public static final String rcsid = "$Id$";  public static final String rcsid = "$Id$";
40        /** Place the contents of one cell into the given coord system.
41         * The coordsys given shall be a mapping from the rectangle
42         * (0,w)x(0,h) onto the screen.
43         * @param box A coordinate system, into whose "unit square" the cell will be placed.
44         *                  Note that some coordinate systems (box, orthoBox) set their "unit
45         *                  square" not to be 0..1 x 0..1.
46         */
47        public abstract void place(Cell c, VobScene vs, int box,
48                               ViewContext context);
49    
50        /** Get the default size of the cell.
51         * @param c The cell to get size for, or null for a default size.
52         */
53        public void getSize(Cell c, ViewContext context, float[] out) {
54            getSize(c, 1, context, out);
55        }
56    
57        /** Get the default size of the cell at a given scale.
58         * This method exists for the benefit of AWT, where fonts cannot
59         * be scaled accurately.
60         * <p>
61         * Note that the returned width and height are in Box scale:
62         * they are not multiplied by the scale parameter.
63         * @param c The cell to get size for, or null for a default size.
64         */
65        public void getSize(Cell c, float scale, ViewContext context,
66                            float[] out) {
67            getSize(c, context, out);
68        }
69  }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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