11 |
static int ForcedBreakWeight; |
static int ForcedBreakWeight; |
12 |
static int GoodBreakWeight; |
static int GoodBreakWeight; |
13 |
|
|
14 |
final static int X_AXIS = 0; |
public final static int X_AXIS = 0; |
15 |
final static int Y_AXIS = 1; |
public final static int Y_AXIS = 1; |
16 |
|
|
17 |
float width, height; |
float width, height; |
18 |
Element elt; |
Element elt; |
19 |
View parent; |
View parent; |
20 |
|
|
21 |
|
/** |
22 |
|
* this vector contains the views ordered at offsets... |
23 |
|
*/ |
24 |
Vector v = new Vector(); |
Vector v = new Vector(); |
25 |
|
|
26 |
int getViewCount() |
|
27 |
|
public View(Element elem) |
28 |
|
{ |
29 |
|
elt = elem; |
30 |
|
} |
31 |
|
|
32 |
|
public int getViewCount() |
33 |
{ |
{ |
34 |
return v.size(); |
return v.size(); |
35 |
} |
} |
36 |
|
|
37 |
View getView(int a) |
public View getView(int a) |
38 |
{ |
{ |
39 |
return (View) v.get(a); |
return (View) v.get(a); |
40 |
} |
} |
41 |
|
|
42 |
void remove(int i) |
public void remove(int i) |
43 |
{ |
{ |
44 |
v.removeElementAt(i); |
v.removeElementAt(i); |
45 |
} |
} |
46 |
|
|
47 |
void insert(int off, View view) |
public void insert(int off, View view) |
48 |
{ |
{ |
49 |
v.insertElementAt(view, off); |
v.insertElementAt(view, off); |
50 |
} |
} |
51 |
void append(View view) |
|
52 |
|
public void append(View view) |
53 |
{ |
{ |
54 |
v.addElement(view); |
v.addElement(view); |
55 |
} |
} |
56 |
|
|
57 |
void paint(Graphics g, Shape allocation) |
public void paint(Graphics g, Shape allocation) |
58 |
{ |
{ |
59 |
System.out.println("view.paint() !!!!"); |
System.out.println("view.paint() !!!!"); |
60 |
} |
} |
61 |
|
|
62 |
void setParent(View a) |
public void setParent(View a) |
63 |
{ |
{ |
64 |
parent = a; |
parent = a; |
65 |
} |
} |
66 |
View getParent() |
|
67 |
|
public View getParent() |
68 |
{ |
{ |
69 |
return parent; |
return parent; |
70 |
} |
} |
71 |
|
|
72 |
void setSize(int w, int h) |
public void setSize(int w, int h) |
73 |
{ |
{ |
74 |
width = w; |
width = w; |
75 |
height = h; |
height = h; |
76 |
} |
} |
77 |
|
|
78 |
View(Element elem) |
public Document getDocument() |
|
{ |
|
|
elt = elem; |
|
|
} |
|
|
|
|
|
Document getDocument() |
|
79 |
{ |
{ |
80 |
return getElement().getDocument(); |
return getElement().getDocument(); |
81 |
} |
} |
82 |
|
|
83 |
Element getElement() |
public Element getElement() |
84 |
{ |
{ |
85 |
return elt; |
return elt; |
86 |
} |
} |
87 |
|
|
88 |
float getPreferredSpan(int a) |
public float getPreferredSpan(int a) |
89 |
{ |
{ |
90 |
switch (a) |
switch (a) |
91 |
{ |
{ |