|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object types.Widget
public abstract class Widget
The general type of all widgets.
Field Summary | |
---|---|
Map<String,Integer> |
attrLineNums
A mapping from attribute names to the line numbers at which they were specified. |
Map<String,List<String>> |
attrs
A mapping from attribute names to values. |
List<Widget> |
children
A list of the widget's children. |
GUIFile |
file
The .gui file declaring this widget. |
String |
id
The identifier of the widget. |
protected static int |
lastAnonIdNumber
The number appended to the last anonymous identifier generated. |
int |
lineNum
The line number at which this widget was declared. |
Widget |
parent
The widget's parent, or null for a top-level widget. |
String |
type
The identifier of the type of the widget. |
Constructor Summary | |
---|---|
protected |
Widget(String type,
String id,
GUIFile file,
int lineNum)
|
protected |
Widget(String type,
String id,
Widget parent,
GUIFile file,
int lineNum)
|
Method Summary | |
---|---|
protected static String |
formatValueList(List<String> values)
Format a list of values for printing. |
protected static String |
mkAnonId()
|
protected static String |
mkAnonId(String type)
Make an anonymous identifier for a widget of the given type. |
protected static String |
mkIdIfNeeded(String id)
Make an anonymous identifier if needed. |
protected static String |
mkIdIfNeeded(String id,
String type)
Make an anonymous identifier, if needed, for a widget of the given type. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final String id
public final String type
public final Widget parent
null
for a top-level widget.
public final List<Widget> children
public final Map<String,List<String>> attrs
public final GUIFile file
public final int lineNum
public final Map<String,Integer> attrLineNums
protected static int lastAnonIdNumber
Constructor Detail |
---|
protected Widget(String type, String id, GUIFile file, int lineNum)
type
- The identifier of the type of the widget.id
- The identifier of the widget, or null
for
anonymous.file
- The GUIFile in which the widget was declared.lineNum
- The line number at which this widget was declared.protected Widget(String type, String id, Widget parent, GUIFile file, int lineNum)
type
- The identifier of the type of the widget.id
- The identifier of the widget, or null
for
anonymous.parent
- The widget's parent widget, or null
for a
top-level widget.file
- The GUIFile in which the widget was declared.lineNum
- The line number at which this widget was declared.Method Detail |
---|
protected static String mkAnonId()
protected static String mkIdIfNeeded(String id)
id
- An identifier.
id
if id != null && id.length() > 0
; a new
anonymous identifier otherwise.mkAnonId()
protected static String mkAnonId(String type)
type
- The type of the widget.
protected static String mkIdIfNeeded(String id, String type)
id
- An identifier.type
- The type of the widget.
id
if id != null && id.length() > 0
; a new
anonymous identifier otherwise.mkAnonId()
protected static String formatValueList(List<String> values)
values
- A list of values.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |