fi.helsinki.dacopan.ui
Class MSCPanel.MSCColumnModel

java.lang.Object
  extended by fi.helsinki.dacopan.ui.MSCPanel.MSCColumnModel
Enclosing class:
MSCPanel

public class MSCPanel.MSCColumnModel
extends java.lang.Object

MSCColumnModel encapsulates the information about different columns drawn in the MSCDrawingPanel. MSCColumnModel has four main parts, from left to right: note column, left variable columns, drawing area, right variable columns. Note column and drawing area are always represented by exactly one MSCColumn. Left and right variable columns are represented by 0..2 MSCColumn objects each.

Currently MSCColumnModel is implemented so that the same columns always exist in left and in right, and the order of columns is 'centric' in relation to the drawing are: the same column is always closest to the drawing area both in left and in right.

The actual MSCColumn objects always represent the usable area between the column border lines: the getLeftEdge returns the first pixel that can be used for plotting and getRightEdge returns the last. MSCColumnModel takes care of reserving one pixel between each column (and on the left and right sides of the left- and rightmost columns).

MSCColumnModel has actually two different kind of columns as variable columns. They are timestamp column and variable column. Not other columns are currently not supported as variable columns. Timestamp column is drawed if printTimestamp == true. Variable column is drawed if user has select any variables to shown (e.g. !columnVariables.isEmpty()).

To calculate the width of character MSCColumnModel uses the width of '8' at plain Verdana with selected font size as reference. The width of timestamp column, on the other hand, is calculated as a width of string "888.888888" using same font as above. The width of timestamp column is never reduced. For the variable column the width is calculated so that all values and their captions can be written to this field. Should this width cause drawing area to be smaller than WIDTH_DRAWING_AREA_MINIMUM, the available width is given to variable host. That is, the variable columns are shrunk as small as needed to get drawing area its minimum size. The widht of notes column is WIDTH_COLUMN_NOTES and it's allways included to the overall widht (as notes column is allways drawed).


Nested Class Summary
 class MSCPanel.MSCColumnModel.MSCColumn
           
 
Constructor Summary
MSCPanel.MSCColumnModel(int width, VariableDefinition[] columnVariables)
           
 
Method Summary
 MSCPanel.MSCColumnModel.MSCColumn getDrawingArea()
          Getter for property columnDrawingArea.
 MSCPanel.MSCColumnModel.MSCColumn[] getLeftCols()
          Getter for property columnsLeft.
 MSCPanel.MSCColumnModel.MSCColumn getNotesCol()
          Getter for property columnNotes.
 MSCPanel.MSCColumnModel.MSCColumn[] getRightCols()
          Getter for property columnsRight.
 int getTotalWidth()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MSCPanel.MSCColumnModel

public MSCPanel.MSCColumnModel(int width,
                               VariableDefinition[] columnVariables)
Method Detail

getNotesCol

public MSCPanel.MSCColumnModel.MSCColumn getNotesCol()
Getter for property columnNotes.

Returns:
Value of property columnNotes.

getLeftCols

public MSCPanel.MSCColumnModel.MSCColumn[] getLeftCols()
Getter for property columnsLeft.

Returns:
Value of property columnsLeft.

getDrawingArea

public MSCPanel.MSCColumnModel.MSCColumn getDrawingArea()
Getter for property columnDrawingArea.

Returns:
Value of property columnDrawingArea.

getRightCols

public MSCPanel.MSCColumnModel.MSCColumn[] getRightCols()
Getter for property columnsRight.

Returns:
Value of property columnsRight.

getTotalWidth

public int getTotalWidth()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


© Dacopan2 team, 2005-