63 |
*/ |
*/ |
64 |
void place(VobScene vs, int coordsys, float scale); |
void place(VobScene vs, int coordsys, float scale); |
65 |
|
|
66 |
|
/** Get this box's length in characters or other units. |
67 |
|
* <code>getX(i)</code> is valid for |
68 |
|
* <code>i < getLength()</code>. |
69 |
|
*/ |
70 |
|
int getLength(); |
71 |
|
|
72 |
|
/** Get the position after a unit (e.g. character) |
73 |
|
* inside this HBox. |
74 |
|
*/ |
75 |
|
float getX(int i, float scale) throws IndexOutOfBoundsException; |
76 |
|
|
77 |
/** The key for this HBox. XXX */ |
/** The key for this HBox. XXX */ |
78 |
Object getKey(); |
Object getKey(); |
79 |
|
|
84 |
void setPrev(HBox b); |
void setPrev(HBox b); |
85 |
|
|
86 |
class Null implements HBox { |
class Null implements HBox { |
87 |
|
protected int length; |
88 |
|
public Null() { this(0); } |
89 |
|
public Null(int length) { this.length = length; } |
90 |
|
|
91 |
public float getWidth(float scale) { return 0; } |
public float getWidth(float scale) { return 0; } |
92 |
public float getHeight(float scale) { return 0; } |
public float getHeight(float scale) { return 0; } |
93 |
public float getDepth(float scale) { return 0; } |
public float getDepth(float scale) { return 0; } |
94 |
public void place(VobScene vs, int coordsys, float scale) {} |
public void place(VobScene vs, int coordsys, float scale) {} |
95 |
|
public int getLength() { return length; } |
96 |
|
public float getX(int i, float scale) { |
97 |
|
if(i<0 || i>length) throw new IndexOutOfBoundsException(""+i); |
98 |
|
return 0; |
99 |
|
} |
100 |
public Object getKey() { return null; } |
public Object getKey() { return null; } |
101 |
public void setPrev(HBox b) { } |
public void setPrev(HBox b) { } |
102 |
} |
} |
103 |
|
|
104 |
public Object WH_KEY = new Object(); |
public Object WH_KEY = new Object(); |
105 |
|
|
106 |
/** A useful base class for hboxes that are vobs. |
/** A useful base class for hboxes that are vobs. |
107 |
* The second coordsys will contain the width and height for this vob. |
* The second coordsys will contain the width and height for this vob. |
108 |
*/ |
*/ |
122 |
int cs_scale = vs.scaleCS(box, "textbox", h, h); |
int cs_scale = vs.scaleCS(box, "textbox", h, h); |
123 |
vs.map.put(this, cs_scale); |
vs.map.put(this, cs_scale); |
124 |
} |
} |
125 |
|
|
126 |
|
public int getLength() { return 1; } |
127 |
|
public float getX(int i, float scale) { |
128 |
|
if(i < 0 || i > 1) throw new IndexOutOfBoundsException(""+i); |
129 |
|
if(i == 0) return 0; |
130 |
|
else return getWidth(scale); |
131 |
|
} |
132 |
|
|
133 |
public Object getKey() { return null; /* XXX */ } |
public Object getKey() { return null; /* XXX */ } |
134 |
|
|
135 |
public void setPrev(HBox b) { } |
public void setPrev(HBox b) { } |