com.miginfocom.calendar.grid
Class GridLineRepetition

java.lang.Object
  extended by com.miginfocom.util.repetition.DefaultRepetition
      extended by com.miginfocom.calendar.grid.GridLineRepetition
All Implemented Interfaces:
Repetition, java.io.Serializable

public class GridLineRepetition
extends DefaultRepetition

A Repetition that annotates every repetition with how that grid line should look like and how wide it should be.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.util.repetition.DefaultRepetition
INTERVAL_ONCE, OFFSET_LAST
 
Constructor Summary
GridLineRepetition(int offset, int interval, AtRefRangeNumber startIndex, AtRefRangeNumber endIndex, int gridLineSize, java.awt.Paint paint)
          Constructor.
GridLineRepetition(int offset, int interval, AtRefRangeNumber startIndex, AtRefRangeNumber endIndex, int gridLineSize, java.awt.Paint paint, AtRefRangeNumber lineStart, AtRefRangeNumber lineEnd)
          Constructor.
GridLineRepetition(int offset, int interval, int gridLineSize, java.awt.Paint paint)
          Constructor without a valid range.
GridLineRepetition(int gridLineSize, java.awt.Paint paint)
          Constructor with only a size and paint.
 
Method Summary
 GridLine createGridLine()
          Creates a grid line from the fields.
 boolean equals(java.lang.Object o)
           
 int getGridLineSize()
          Returns the size of the line
 AtRefRangeNumber getLineEnd()
          Returns the end of the line relative to the bounds or null for ending at the end of the bounds.
 AtRefRangeNumber getLineStart()
          Returns the start of the line relative to the bounds or null for starting at the start of the bounds.
 java.awt.Paint getPaint()
          Returns the suggested paint.
 
Methods inherited from class com.miginfocom.util.repetition.DefaultRepetition
appliesTo, getEndIndex, getInterval, getOffset, getStartIndex, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridLineRepetition

public GridLineRepetition(int gridLineSize,
                          java.awt.Paint paint)
Constructor with only a size and paint.

Parameters:
gridLineSize - The size (thickness) of the line. Will be min, preferred and max size in sizes effectively.
paint - The suggested paint. Can be null.

GridLineRepetition

public GridLineRepetition(int offset,
                          int interval,
                          int gridLineSize,
                          java.awt.Paint paint)
Constructor without a valid range.

Parameters:
offset - The offset to add before the modulo remainder are checked. Offset 3 means (if modulo 2) that rows 3, 5, 7, 9... are targeted.
Note! One offset and modulo has special meanings. One specific line can be specified with modulo MODULO_ONE_SHOT. If offset is OFFSET_LAST it specifies the last grid line. Both should be before any other restraints though, since they are eveluated in order.
interval - The modulo for which the remainder has to be 0 for the other row properties to apply to that row. An interval of 2 means every second row. Must be > 0.
gridLineSize - The size (thickness) of the line. Will be min, preferred and max size in sizes effectively.
paint - The suggested paint. Can be null.

GridLineRepetition

public GridLineRepetition(int offset,
                          int interval,
                          AtRefRangeNumber startIndex,
                          AtRefRangeNumber endIndex,
                          int gridLineSize,
                          java.awt.Paint paint)
Constructor.

Parameters:
offset - The offset to add before the modulo remainder are checked. Offset 3 means (if modulo 2) that rows 3, 5, 7, 9... are targeted.
Note! One offset and modulo has special meanings. One specific line can be specified with modulo MODULO_ONE_SHOT. If offset is OFFSET_LAST it specifies the last grid line. Both should be before any other restraints though, since they are eveluated in order.
interval - The modulo for which the remainder has to be 0 for the other row properties to apply to that row. An interval of 2 means every second row. Must be > 0.
startIndex - The minimum index to accept. Value can be absolute or relative and relative to 0 or count (I.e. upper/lower bound). Can be null.
endIndex - The maximum index to accept. Value can be absolute or relative and relative to 0 or count (I.e. upper/lower bound). Can be null.
gridLineSize - The size (thickness) of the line. Will be min, preferred and max size sizes effectively.
paint - The suggested paint. Can be null.

GridLineRepetition

public GridLineRepetition(int offset,
                          int interval,
                          AtRefRangeNumber startIndex,
                          AtRefRangeNumber endIndex,
                          int gridLineSize,
                          java.awt.Paint paint,
                          AtRefRangeNumber lineStart,
                          AtRefRangeNumber lineEnd)
Constructor.

Parameters:
offset - The offset to add before the modulo remainder are checked. Offset 3 means (if modulo 2) that rows 3, 5, 7, 9... are targeted.
Note! One offset and modulo has special meanings. One specific line can be specified with modulo MODULO_ONE_SHOT. If offset is OFFSET_LAST it specifies the last grid line. Both should be before any other restraints though, since they are eveluated in order.
interval - The modulo for which the remainder has to be 0 for the other row properties to apply to that row. An interval of 2 means every second row. Must be > 0.
startIndex - The minimum index to accept. Value can be absolute or relative and relative to 0 or count (I.e. upper/lower bound). Can be null.
endIndex - The maximum index to accept. Value can be absolute or relative and relative to 0 or count (I.e. upper/lower bound). Can be null.
gridLineSize - The size (thickness) of the line. Will be min, preferred and max size sizes effectively.
paint - The suggested paint. Can be null.
lineStart - The start of the line relative to the bounds.
lineEnd - The end of the line relative to the bounds.
Method Detail

getGridLineSize

public int getGridLineSize()
Returns the size of the line

Returns:
The size of the line

getPaint

public java.awt.Paint getPaint()
Returns the suggested paint. Can be null.

Returns:
The suggested paint. Can be null.

getLineStart

public AtRefRangeNumber getLineStart()
Returns the start of the line relative to the bounds or null for starting at the start of the bounds.

Returns:
The start of the line relative to the bounds.

getLineEnd

public AtRefRangeNumber getLineEnd()
Returns the end of the line relative to the bounds or null for ending at the end of the bounds.

Returns:
The end of the line relative to the bounds.

createGridLine

public GridLine createGridLine()
Creates a grid line from the fields. The position wil be set to 0.

Returns:
A new grid line from the fields.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class DefaultRepetition


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.