com.miginfocom.calendar.grid
Class GridLine

java.lang.Object
  extended by com.miginfocom.calendar.grid.GridLine

public class GridLine
extends java.lang.Object

A grid line.


Constructor Summary
GridLine()
          Constructor.
GridLine(int position, int size, java.awt.Paint paint)
          Constructor.
GridLine(int position, int size, java.awt.Paint paint, AtRefRangeNumber secondaryStart, AtRefRangeNumber secondaryEnd)
          Constructor.
 
Method Summary
 GridLine cloneGridLine()
          Make a copy of this grid line
 int getEnd()
          Returns position + size.
 int getMiddleHi()
          Returns position + (size >> 1).
 int getMiddleLo()
          Returns position + (size >> 1).
 java.awt.Paint getPaint()
          The paint to use for drawing this grid line.
 int getPosition()
          Start position in the primary (thin) dimension.
 AtRefRangeNumber getSecondaryEnd()
          End in the long dimension.
 AtRefRangeNumber getSecondaryStart()
          Start in the long dimension.
 int getSize()
          Size in the primary (thin) dimension.
 void setPaint(java.awt.Paint paint)
          Sets the paint to use for drawing this grid line.
 void setPosition(int position)
          Sets the start position in the primary (thin) dimension.
 void setSecondaryEnd(AtRefRangeNumber secondaryEnd)
          Sets the end in the long dimension.
 void setSecondaryStart(AtRefRangeNumber secondaryStart)
          Sets start in the long dimension.
 void setSize(int size)
          Sets the size in the primary (thin) dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridLine

public GridLine()
Constructor.


GridLine

public GridLine(int position,
                int size,
                java.awt.Paint paint)
Constructor.

Parameters:
position - Position in the primary (thin) dimension.
size - Size the primary (thin) dimension.
paint - The paint to use for drawing this grid line.

GridLine

public GridLine(int position,
                int size,
                java.awt.Paint paint,
                AtRefRangeNumber secondaryStart,
                AtRefRangeNumber secondaryEnd)
Constructor.

Parameters:
position - Position in the primary (thin) dimension.
size - Size the primary (thin) dimension.
paint - The paint to use for drawing this grid line.
secondaryStart - Start in the long dimension. May be null.
secondaryEnd - End in the long dimension. May be null.
Method Detail

getPaint

public java.awt.Paint getPaint()
The paint to use for drawing this grid line. May be null.

Returns:
The paint to use for drawing this grid line.

setPaint

public void setPaint(java.awt.Paint paint)
Sets the paint to use for drawing this grid line.

Parameters:
paint - The paint to use for drawing this grid line. May be null.

getPosition

public int getPosition()
Start position in the primary (thin) dimension.

Returns:
Position in the primary (thin) dimension.

setPosition

public void setPosition(int position)
Sets the start position in the primary (thin) dimension. This is the only thing that is changable for the grid line and is donw in the layout process.

Parameters:
position - The start position in the primary (thin) dimension.

getSize

public int getSize()
Size in the primary (thin) dimension. May be 0 but never negative.

Returns:
Size the primary (thin) dimension.

setSize

public void setSize(int size)
Sets the size in the primary (thin) dimension. May be 0 but never negative.

Parameters:
size - The size the primary (thin) dimension.

getSecondaryStart

public AtRefRangeNumber getSecondaryStart()
Start in the long dimension. May be null.

Returns:
Start in the long dimension. May be null.

setSecondaryStart

public void setSecondaryStart(AtRefRangeNumber secondaryStart)
Sets start in the long dimension. May be null.

Parameters:
secondaryStart - Start in the long dimension. May be null.

getSecondaryEnd

public AtRefRangeNumber getSecondaryEnd()
End in the long dimension. May be null.

Returns:
End in the long dimension. May be null.

setSecondaryEnd

public void setSecondaryEnd(AtRefRangeNumber secondaryEnd)
Sets the end in the long dimension. May be null.

Parameters:
secondaryEnd - End in the long dimension. May be null.

getEnd

public int getEnd()
Returns position + size.

Returns:
position + size

getMiddleLo

public int getMiddleLo()
Returns position + (size >> 1).

Returns:
position + (size >> 1)

getMiddleHi

public int getMiddleHi()
Returns position + (size >> 1).

Returns:
position + (size >> 1)

cloneGridLine

public GridLine cloneGridLine()
Make a copy of this grid line

Returns:
A copy of this grid line


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.