jimm.datavision.field
Class ColumnField

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

public class ColumnField
extends Field

A column field represents a data source column. The value of a column field holds the Column object.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  Column column
           
 
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
ColumnField(java.lang.Long id, Report report, Section section, java.lang.Object value, boolean visible)
          Constructs a column field with the specified id in the specified report section whose database Column's id is value.
 
Method Summary
 boolean canBeAggregated()
          This override returns true if this column is in a detail section and holds a numeric type.
 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.
 Column getColumn()
          Returns the database column.
 java.lang.Object getValue()
          Returns the value of this field.
 void setColumn(Column newColumn)
          Sets the database column.
 java.lang.String typeString()
          Returns the string that specifies this field's type in the report XML.
 
Methods inherited from class jimm.datavision.field.Field
clone, create, createFromDragString, designLabel, finalize, getBorder, getBorderOrDefault, getBounds, getFormat, getId, getOutputHeight, makeWidget, refersTo, refersTo, refersTo, refersTo, setBorder, setBounds, setFormat, setValue, toString, update, writeFieldGuts, writeXML
 
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
 

Field Detail

column

protected Column column
Constructor Detail

ColumnField

public ColumnField(java.lang.Long id,
                   Report report,
                   Section section,
                   java.lang.Object value,
                   boolean visible)
Constructs a column field with the specified id in the specified report section whose database Column's id 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 string id of a database column
visible - show/hide flag
Method Detail

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

getColumn

public Column getColumn()
Returns the database column.

Returns:
the database column

setColumn

public void setColumn(Column newColumn)
Sets the database column.

Parameters:
newColumn - the new database column

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

formulaString

public java.lang.String formulaString()
Description copied from class: Field
Returns a string representing the field as it appears in a formula.

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

getValue

public java.lang.Object getValue()
Returns the value of this field. For column fields, this is the current value of the database column.

Overrides:
getValue in class Field
Returns:
the value string

canBeAggregated

public boolean canBeAggregated()
This override returns true if this column is in a detail section and holds a numeric type.

Overrides:
canBeAggregated in class Field
Returns:
true if this field can be aggregated