Source code: com/hartmath/prettyprint/PrettyPrintBox.java
1 /*
2 * PrettyPrintBox.java
3 * Copyright (C) 2000 Slava Pestov
4 * 2001 Klaus Hartlage
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20 //package mtac.gui.prettyprint;
21 package com.hartmath.prettyprint;
22
23 import java.util.ArrayList;
24 import java.awt.*;
25
26 /**
27 * Description of the Class
28 *
29 *@author khartlage
30 *@created 25. September 2001
31 */
32 public abstract class PrettyPrintBox {
33 /**
34 * Description of the Field
35 */
36 public static int COUNT;
37 /**
38 * main pretty printer DEBUG flag
39 */
40 public final static boolean DEBUG = false;
41
42 public final static String FONTFAMILY = "Serif";
43 public final static int FONTSIZE = 18;
44 public final static int MIN_SIZE = 50;
45
46
47 /**
48 * Constructor for the PrettyPrintBox object
49 */
50 public PrettyPrintBox() {
51 COUNT++;
52 }
53
54
55 /**
56 * Gets the insets attribute of the PrettyPrintBox object
57 *
58 *@return The insets value
59 */
60 public Insets getInsets() {
61 return new Insets(2, 2, 2, 2);
62 }
63
64
65 public abstract BoxMetrics getBoxMetrics();
66
67
68 /**
69 * paint this box
70 *
71 *@param g Description of Parameter
72 *@param size Description of Parameter
73 *@param x Description of Parameter
74 *@param y Description of Parameter
75 */
76 public abstract void paint(Graphics g, BoxMetrics size, int x, int y);
77
78
79 /**
80 * split a box (box.width < max_wirdth)
81 *
82 *@param max_width max_width of the box
83 *@return null if split isn't available
84 */
85 public ArrayList split(int max_width) {
86 return null;
87 }
88
89 public void done(String font, int fontSize) {
90 }
91
92 }