mavis.gui
Enum ComponentColumn

java.lang.Object
  extended by java.lang.Enum<ComponentColumn>
      extended by mavis.gui.ComponentColumn
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ComponentColumn>

public enum ComponentColumn
extends java.lang.Enum<ComponentColumn>

Represents a column in the magnetic component table. Calculates the values of that column. The overriding methods of each column type are used by the MagneticComponentTableModel to get proper return values for the AbstractTableModel methods like getValueAt, etc.


Enum Constant Summary
ANGLE
          Showing the maximum angular deviation of the magnetic component.
ANTIPOLE
          Showing the antipole checkbox setting of the magnetic component.
COUNT
          Showing ordinal number of the magnetic component, starting from number 1.
D
          Showing the declination of the magnetic component.
DJ
          Showing the Median intensity of the magnetic component.
EXCLUDED
          Showing the excluded points in the range of the magnetic component.
I
          Showing the inclination of the magnetic component.
PLAT
          Showing the Ancient pole position (Latitude) of the magnetic component.
PLON
          Showing the Ancient pole position (Longitude) of the magnetic component.
RANGE
          Showing the intensity/temperature range of the magnetic component.
STEPS
          Showing the steps included in the magnetic component.
 
Field Summary
protected  java.lang.String columnName
          Name of the column.
private static StyledWrapper defaultWrapper
          Style for the default cell renderer
private static StyledWrapper headerWrapper
          Style for the cell header renderer
protected  java.text.NumberFormat numberFormat
          The number format for the values in this column.
protected  java.lang.String toolTipText
          The tooltip for the column.
protected  java.lang.String value
          The value for the column.
 
Method Summary
static ComponentColumn[] getAllColumns()
          Returns all the columns supported by the program.
 java.lang.Class<?> getColumnClass()
          Returns the class of this column regardless of the row.
 java.lang.String getColumnName()
          Returns the name of this column.
 java.text.NumberFormat getNumberFormat()
          Returns the number format used for rendering the numbers in this column.
 java.lang.String getToolTipText(Project project)
          Returns the tooltip text for this column.
 java.lang.Object getValue(int rowIndex, Session session)
          Returns the value for this column's specified row.
 boolean isCellEditable(int rowIndex)
          Returns true if the cell can be edited.
 void setNumberFormat(java.text.NumberFormat numberFormat)
          Sets the number format used for rendering the numbers in this column.
 void setValue(java.lang.Object value, int rowIndex, Session session)
           
static ComponentColumn valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ComponentColumn[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 StyledWrapper wrap(java.lang.Object value, int rowIndex, Session session)
          Wraps the specified object to a styled renderer's wrapper according to the state of the measurement step.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

COUNT

public static final ComponentColumn COUNT
Showing ordinal number of the magnetic component, starting from number 1.


STEPS

public static final ComponentColumn STEPS
Showing the steps included in the magnetic component.


RANGE

public static final ComponentColumn RANGE
Showing the intensity/temperature range of the magnetic component.


D

public static final ComponentColumn D
Showing the declination of the magnetic component.


I

public static final ComponentColumn I
Showing the inclination of the magnetic component.


ANGLE

public static final ComponentColumn ANGLE
Showing the maximum angular deviation of the magnetic component.


DJ

public static final ComponentColumn DJ
Showing the Median intensity of the magnetic component.


PLON

public static final ComponentColumn PLON
Showing the Ancient pole position (Longitude) of the magnetic component.


PLAT

public static final ComponentColumn PLAT
Showing the Ancient pole position (Latitude) of the magnetic component.


EXCLUDED

public static final ComponentColumn EXCLUDED
Showing the excluded points in the range of the magnetic component.


ANTIPOLE

public static final ComponentColumn ANTIPOLE
Showing the antipole checkbox setting of the magnetic component.

Field Detail

defaultWrapper

private static final StyledWrapper defaultWrapper
Style for the default cell renderer


headerWrapper

private static final StyledWrapper headerWrapper
Style for the cell header renderer


columnName

protected java.lang.String columnName
Name of the column.


toolTipText

protected java.lang.String toolTipText
The tooltip for the column.


value

protected java.lang.String value
The value for the column.


numberFormat

protected java.text.NumberFormat numberFormat
The number format for the values in this column.

Method Detail

values

public static final ComponentColumn[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ComponentColumn c : ComponentColumn.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ComponentColumn valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getAllColumns

public static ComponentColumn[] getAllColumns()
Returns all the columns supported by the program. The returned values are in the order that they should be shown in the measurement sequence table.


wrap

public StyledWrapper wrap(java.lang.Object value,
                          int rowIndex,
                          Session session)
Wraps the specified object to a styled renderer's wrapper according to the state of the measurement step.

Parameters:
value - the object to be wrapped.
rowIndex - the index of the row. Can be greater than the number of measurement steps.
session - the project whose value to get. Can be null.
Returns:
the wrapped object.

getValue

public java.lang.Object getValue(int rowIndex,
                                 Session session)
Returns the value for this column's specified row. The default implementation is to use the algoritm of a MeasurementValue object. If no MeasurementValue has been provided, will return an empty string. Subclasses can override the default behaviour.

Parameters:
rowIndex - the index of the row. Can be greater than the number of measurement steps.
session - the project whose value to get. Can be null.
Returns:
the wrapped value (class e.g. Boolean, StyledWrapper) that should be shown in that cell.

setValue

public void setValue(java.lang.Object value,
                     int rowIndex,
                     Session session)

getColumnName

public java.lang.String getColumnName()
Returns the name of this column. The name will be shown in the header of the table. The default implementation returns always the columnName property. Subclasses can override the default behaviour. the open project or null if no project is active.


getToolTipText

public java.lang.String getToolTipText(Project project)
Returns the tooltip text for this column. The default implementation returns the description of the provided MeasurementValue or null if none is provided. Subclasses can override the default behaviour. the open project or null if no project is active.

Returns:
the tooltip text or null if none is set.

getColumnClass

public java.lang.Class<?> getColumnClass()
Returns the class of this column regardless of the row. The default implementation is to return StyledTableCellRenderer.Wrapper.class. Subclasses can override the default behaviour.


getNumberFormat

public java.text.NumberFormat getNumberFormat()
Returns the number format used for rendering the numbers in this column.


setNumberFormat

public void setNumberFormat(java.text.NumberFormat numberFormat)
Sets the number format used for rendering the numbers in this column.

Throws:
java.lang.NullPointerException - if numberFormat is null.

isCellEditable

public boolean isCellEditable(int rowIndex)
Returns true if the cell can be edited. Default return value is false. Override in the Enum constants if necessary. Currently, only the Antipole checkbox needs to be and is editable.

Parameters:
rowIndex - the row being queried
Returns:
false if the cell contents can not be edited by the user