jimm.datavision.field
Class TextField

java.lang.Object
  extended by java.util.Observable
      extended by jimm.datavision.Element
          extended by jimm.datavision.field.Field
              extended by jimm.datavision.field.TextField
All Implemented Interfaces:
java.lang.Cloneable, java.util.Observer, Draggable, Identity, Writeable

public class TextField
extends Field

A text field represents static text. The value of a text field holds the text.

Author:
Jim Menard, jimm@io.com

Field Summary
 
Fields inherited from class jimm.datavision.field.Field
border, bounds, cache, DEFAULT_HEIGHT, DEFAULT_WIDTH, format, id, maxIdSeen, value
 
Fields inherited from class jimm.datavision.Element
report, section, visible
 
Constructor Summary
TextField(java.lang.Long id, Report report, Section section, java.lang.Object value, boolean visible)
          Constructs a text field with the specified id in the specified report section whose text value is value.
 
Method Summary
 java.lang.String designLabel()
          Returns a string representing the field in the GUI during report design.
 java.lang.String dragString()
          Returns the string used to identify a field type when dragging.
 java.lang.String formulaString()
          Returns a string representing the field as it appears in a formula.
 FieldWidget makeWidget(SectionWidget sw)
          Returns a new widget of the appropriate FieldWidget subclass for this field.
 void setValue(java.lang.Object newValue)
          Sets the value.
 java.lang.String typeString()
          Returns the string that specifies this field's type in the report XML.
 void writeXML(XMLWriter out)
          Writes this field as an XML tag.
 
Methods inherited from class jimm.datavision.field.Field
canBeAggregated, clone, create, createFromDragString, finalize, getBorder, getBorderOrDefault, getBounds, getFormat, getId, getOutputHeight, getValue, refersTo, refersTo, refersTo, refersTo, setBorder, setBounds, setFormat, toString, update, writeFieldGuts
 
Methods inherited from class jimm.datavision.Element
getReport, getSection, isVisible, setSection, setVisible
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextField

public TextField(java.lang.Long id,
                 Report report,
                 Section section,
                 java.lang.Object value,
                 boolean visible)
Constructs a text field with the specified id in the specified report section whose text value is value.

Parameters:
id - the new field's id
report - the report containing this element
section - the report section in which the field resides
value - the text string
visible - show/hide flag
Method Detail

setValue

public void setValue(java.lang.Object newValue)
Description copied from class: Field
Sets the value.

Overrides:
setValue in class Field
Parameters:
newValue - the new value

makeWidget

public FieldWidget makeWidget(SectionWidget sw)
Description copied from class: Field
Returns a new widget of the appropriate FieldWidget subclass for this field. Subclasses override this method to return different types of widgets.

Overrides:
makeWidget in class Field
Parameters:
sw - a field widget

dragString

public java.lang.String dragString()
Description copied from class: Field
Returns the string used to identify a field type when dragging. Usually returns Field.typeString() plus a value or an id.

Specified by:
dragString in interface Draggable
Specified by:
dragString in class Field
Returns:
the string used to identify the field when dragging

typeString

public java.lang.String typeString()
Description copied from class: Field
Returns the string that specifies this field's type in the report XML.

Specified by:
typeString in class Field
Returns:
a string representing this field's type; used in XML files

designLabel

public java.lang.String designLabel()
Description copied from class: Field
Returns a string representing the field in the GUI during report design.

Overrides:
designLabel in class Field
Returns:
a string useful for display in the design GUI

formulaString

public java.lang.String formulaString()
Returns a string representing the field as it appears in a formula. We need to escape quotes in the string.

Specified by:
formulaString in class Field
Returns:
a string useful in a formula

writeXML

public void writeXML(XMLWriter out)
Description copied from class: Field
Writes this field as an XML tag. Writes bounds, border, and format.

Specified by:
writeXML in interface Writeable
Overrides:
writeXML in class Field
Parameters:
out - a writer that knows how to write XML