rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvTimeScaleRow Class Reference

Time scale row class. More...

#include <ilviews/graphics/timescalerow.h>

Inheritance diagram for IlvTimeScaleRow:
IlvDayTimeScaleRow IlvHalfDayTimeScaleRow IlvHourTimeScaleRow IlvMinuteTimeScaleRow IlvMonthTimeScaleRow IlvQuarterTimeScaleRow IlvWeekTimeScaleRow IlvYearTimeScaleRow

List of all members.

Public Types

enum  TextPos { LEFT, RIGHT, CENTER }
 

Position of labels in a time scale row. This type indicates the predefined positions of the labels in a time scale row.

More...

Public Member Functions

 IlvTimeScaleRow (IlvTimeScale *parent)
 Constructor.
virtual IlvTimeScaleRowcopy () const
 Returns a copy of the current time scale row.
IlString getAdditionalString () const
 Returns the additional text string displayed in the first interval.
IlCalendargetCalendar (IlDate time) const
 Gets the internal calendar of the parent scale set to the specified time.
IlCalendargetCalendar () const
 Gets the internal calendar of the parent scale.
IlvDisplaygetDisplay () const
 Returns the IlvDisplay of the parent scale.
IlInt getIntervalMinWidth () const
 Returns the minimal interval required to draw a text between two ticks.
IlvPalettegetPalette () const
 Returns the IlvPalette of the parent scale.
virtual IlInt getPreferredHeight () const
 Returns the preferred height of the time scale row.
IlvColorgetTextColor () const
 Gets the color of the row labels.
IlvFontgetTextFont () const
 Gets the font of the row labels.
IlvPalettegetTextPalette () const
 Gets the palette of the row labels.
TextPos getTextPosition () const
 Returns the position of labels.
IlvColorgetTickColor () const
 Gets the color of the row ticks.
IlvPalettegetTickPalette () const
 Gets the palette of the row ticks.
IlvTimeScalegetTimeScale () const
 Gets the referring time scale.
const IlTimeUnitgetTimeUnit () const
 Gets the internal time unit.
virtual
IlvTimeScaleRowFactory::rowtype 
getType () const =0
 Returns the type of the IlvTimeScaleRow.
virtual IlDate incrementTime (IlDate dateval)=0
 Increments the specified date by the value of the scale time unit.
IlBoolean isOverlappingLabelAllowed () const
 Indicates whether overlapping labels are allowed.
IlBoolean isVisible ()
 Indicates whether the row is visible.
virtual IlDate nextUnitTime (IlDate dateval)
 Computes the next unit value after the specified date.
virtual IlDate previousUnitTime (IlDate dateval)=0
 Computes the previous unit value before the specified date.
virtual void read (IlvInputFile &infile)
 Reads the time scale row description from an input file.
void setAdditionalString (IlString str)
 Sets the additional text string displayed in the first interval.
void setIntervalMinWidth (IlInt value)
 Sets the minimal interval required to draw a text between two ticks.
void setOverlappingLabelAllowed (IlBoolean overlap)
 Specifies whether overlapping labels are allowed.
void setTextColor (IlvColor *c)
 Sets the color of the row labels.
void setTextFont (IlvFont *f)
 Sets the font of the row labels.
void setTextPosition (TextPos pos)
 Sets the position of labels.
void setTickColor (IlvColor *c)
 Sets the colors of the row ticks.
void setTimeScale (IlvTimeScale *timescale)
 Sets the referring IlvTimeScale.
void setVisible (IlBoolean visible)
 Sets the visibility of the time scale row.
virtual void write (IlvOutputFile &outfile) const
 Saves the time scale row in an output file.

Protected Member Functions

virtual IlvTimeScaleRowcloneType (IlvTimeScale *scale) const =0
 Returns an object of the same type.
virtual void draw (IlvPort *dst, const IlvTransformer *t, const IlvTimeScalePaintContext &context, const IlvRect &rect) const
 Draws the time scale row on a specified port.
virtual void drawLabel (IlvPort *dst, const IlvTransformer *t, const IlvPoint &prevPos, const IlvPoint &nextPos, IlString text) const
 Draws a label in a scale interval.
virtual void drawTick (IlvPort *dst, const IlvTransformer *t, const IlvPoint &pos, IlInt height) const
 Draws a scale row tick.

Friends

class IlvTimeScale

Detailed Description

Time scale row class.

Library: views

This class represents a row which can be put in a IlvTimeScale.

All drawing operations are defined at this level. You should extend this class to determine the time unit management by overriding the previousUnitTime method. The drawing operations are done in the draw method, which displays ticks to separate each unit interval. These ticks are drawn using the drawTick method. In the intervals, text representing the time is drawn by the drawLabel method. By default, the text is displayed to the left of the interval.

See also:
previousUnitTime

Member Enumeration Documentation

Position of labels in a time scale row. This type indicates the predefined positions of the labels in a time scale row.

See also:
setTextPosition
Enumerator:
LEFT 

The text is left-aligned in the interval (default behavior).

RIGHT 

The text is right-aligned in the interval.

CENTER 

The text is centered in the interval.


Constructor & Destructor Documentation

IlvTimeScaleRow::IlvTimeScaleRow ( IlvTimeScale parent  ) 

Constructor.

This constructor creates a new instance of a time scale row. This instance can be added to an IlvTimeScale object using the addRow method. Then, it can be removed using the removeRow method.

Parameters:
parent The IlvTimeScale which this row is part of.
See also:
IlvTimeScale::addRow
IlvTimeScale::setRow
IlvTimeScale::removeRow

Member Function Documentation

virtual IlvTimeScaleRow* IlvTimeScaleRow::cloneType ( IlvTimeScale scale  )  const [protected, pure virtual]

Returns an object of the same type.

This method should be implemented by subclasses. It must return an object of the same type as the object on which the method is called, attached to the given IlvTimeScale.

Parameters:
scale The IlvTimeScale on which the row is attached.
Returns:
A newly allocated object of the same type as the object on which the method is called.

Implemented in IlvYearTimeScaleRow, IlvQuarterTimeScaleRow, IlvMonthTimeScaleRow, IlvWeekTimeScaleRow, IlvDayTimeScaleRow, IlvHalfDayTimeScaleRow, IlvHourTimeScaleRow, and IlvMinuteTimeScaleRow.

virtual void IlvTimeScaleRow::draw ( IlvPort dst,
const IlvTransformer t,
const IlvTimeScalePaintContext context,
const IlvRect rect 
) const [protected, virtual]

Draws the time scale row on a specified port.

This method is overridden to draw the scale row on the specified IlvPort and with the specified IlvTimeScalePaintContext.

It calls drawTick to perform tick drawings and drawText to label the intervals. It also uses nextUnitTime to increment the intervals.

Parameters:
dst The destination port.
t The transformer value. If 0, no transformation is performed.
rect The rectangle in which the scale row should be drawn. The rectangle should be in the destination (IlvPort) coordinates.
context The paint context in which the scale row paints.
See also:
drawTick
drawText
getTimeScale
nextUnitTime
IlvTimeScale::getTime
IlvTimeScale::getLocation
virtual void IlvTimeScaleRow::drawLabel ( IlvPort dst,
const IlvTransformer t,
const IlvPoint prevPos,
const IlvPoint nextPos,
IlString  text 
) const [protected, virtual]

Draws a label in a scale interval.

This method is called to draw the label corresponding to a scale interval. This interval is defined by the rectangle (prevPos, nextPos). The text can be centered using the setTextPosition method. The color can be changed using the setTextColor method. The text IlString representing the time is returned by the computeDateText method and can be preceded by an additional string set using the setAdditionalString method if the interval begins before the visible part of the scale.

Parameters:
dst The destination port.
t The transformer value. If 0, no transformation is performed.
prevPos The top-left corner of the rectangle.
nextPos The bottom-right corner of the rectangle.
text The text to draw.
virtual void IlvTimeScaleRow::drawTick ( IlvPort dst,
const IlvTransformer t,
const IlvPoint pos,
IlInt  height 
) const [protected, virtual]

Draws a scale row tick.

This method is called to draw a tick in the scale. A tick is the line drawn between two time unit intervals.

Parameters:
dst The destination port.
t The transformer value. If 0, no transformation is performed.
pos The bottom point of the tick.
height The maximum height of the tick.
See also:
setTickColor
IlString IlvTimeScaleRow::getAdditionalString (  )  const

Returns the additional text string displayed in the first interval.

The string is displayed before the text of the first interval that opens to the left of the row if this interval extends beyond the visible part of the scale.

Returns:
The text string to display.
IlCalendar* IlvTimeScaleRow::getCalendar ( IlDate  time  )  const

Gets the internal calendar of the parent scale set to the specified time.

Parameters:
time The time to set the calendar to.
IlInt IlvTimeScaleRow::getIntervalMinWidth (  )  const

Returns the minimal interval required to draw a text between two ticks.

If the interval width is less than this value, the text is not drawn. If the value has never been set, the method returns -1 and the width of the first text displayed is used as the minimum width.

Returns:
The minimal interval value, in pixels.
TextPos IlvTimeScaleRow::getTextPosition (  )  const

Returns the position of labels.

Returns:
The position of labels in the time scale row. The default value is LEFT.
See also:
setTextPosition
IlvTimeScale* IlvTimeScaleRow::getTimeScale (  )  const

Gets the referring time scale.

Returns:
The IlvTimeScale which the row is part of.
virtual IlvTimeScaleRowFactory::rowtype IlvTimeScaleRow::getType (  )  const [pure virtual]
virtual IlDate IlvTimeScaleRow::incrementTime ( IlDate  dateval  )  [pure virtual]

Increments the specified date by the value of the scale time unit.

For example, in a timescale row whose time unit has been set to the minute, the increment time of January 14th 2001 8:12:34 is January 14th 2001 8:13:34. To implement this method, you can use a IlCalendar object provided by IlvTimeScale::getCalendar.

Parameters:
dateval The date to increment.
Returns:
The value dateval + scale time unit.
See also:
IlvTimeScale::getCalendar

Implemented in IlvYearTimeScaleRow, IlvQuarterTimeScaleRow, IlvMonthTimeScaleRow, IlvWeekTimeScaleRow, IlvDayTimeScaleRow, IlvHalfDayTimeScaleRow, IlvHourTimeScaleRow, and IlvMinuteTimeScaleRow.

IlBoolean IlvTimeScaleRow::isOverlappingLabelAllowed (  )  const

Indicates whether overlapping labels are allowed.

Returns:
IlTrue if overlapping labels are allowed, otherwise IlFalse.
IlBoolean IlvTimeScaleRow::isVisible (  ) 

Indicates whether the row is visible.

Returns:
IlTrue if the row is visible and IlFalse if it is not.
virtual IlDate IlvTimeScaleRow::nextUnitTime ( IlDate  dateval  )  [virtual]

Computes the next unit value after the specified date.

If dateval is already an integer unit value, the method returns a copy of it. The method implementation depends on the unit of the scale row. For example, in a minute-unit time scale row, the next unit time of January 14th, 2001, 8:12:34 is January 14th, 2001, 8:13:00, and the next unit time of January 14th, 2001, 9:01:00 is January 14th, 2001, 9:01:00. This method is necessary for integer-zoom interaction on the scale and useful when drawing it. To implement this method, you can use a IlCalendar object provided by IlvTimeScale::getCalendar.

Parameters:
dateval The date to ceil.
See also:
IlvTimeScale::getCalendar
virtual IlDate IlvTimeScaleRow::previousUnitTime ( IlDate  dateval  )  [pure virtual]

Computes the previous unit value before the specified date.

If dateval is already an integer unit value, the method returns a copy of it. For example, in a minute-unit time scale row, the previous unit time of January 14th, 2001, 8:12:34 is January 14th, 2001, 8:12:00, and the previous unit time of January 14th, 2001, 9:01:00 is January 14th, 2001, 9:01:00. Its implementation depends on the unit of the scale row. This method is necessary for integer-zoom interaction on the scale. To implement this method, you can use a IlCalendar object provided by IlvTimeScale::getCalendar.

Parameters:
dateval The date to floor.
See also:
IlvTimeScale::getCalendar

Implemented in IlvYearTimeScaleRow, IlvQuarterTimeScaleRow, IlvMonthTimeScaleRow, IlvWeekTimeScaleRow, IlvDayTimeScaleRow, IlvHalfDayTimeScaleRow, IlvHourTimeScaleRow, and IlvMinuteTimeScaleRow.

virtual void IlvTimeScaleRow::read ( IlvInputFile infile  )  [virtual]

Reads the time scale row description from an input file.

Parameters:
infile The input file.

Reimplemented in IlvYearTimeScaleRow, IlvQuarterTimeScaleRow, IlvMonthTimeScaleRow, IlvWeekTimeScaleRow, IlvDayTimeScaleRow, IlvHalfDayTimeScaleRow, IlvHourTimeScaleRow, and IlvMinuteTimeScaleRow.

void IlvTimeScaleRow::setAdditionalString ( IlString  str  ) 

Sets the additional text string displayed in the first interval.

This string is displayed before the text of the time unit interval at the left side of the row if this interval extends beyond the visible part of the scale.

Parameters:
str The text string.
void IlvTimeScaleRow::setIntervalMinWidth ( IlInt  value  ) 

Sets the minimal interval required to draw a text between two ticks.

If the interval width is less than this value, the text is not drawn. By default, the minimal interval is defined by the width of the first text displayed in the row.

Parameters:
value The interval to set, in pixels.
void IlvTimeScaleRow::setOverlappingLabelAllowed ( IlBoolean  overlap  ) 

Specifies whether overlapping labels are allowed.

Parameters:
overlap IlTrue if overlapping labels are allowed, IlFalse if they are not.
void IlvTimeScaleRow::setTextPosition ( TextPos  pos  ) 

Sets the position of labels.

Parameters:
pos Can take the TextPos values LEFT, RIGHT or CENTER.
void IlvTimeScaleRow::setTimeScale ( IlvTimeScale timescale  ) 

Sets the referring IlvTimeScale.

Parameters:
timescale The time scale which the row is part of.
void IlvTimeScaleRow::setVisible ( IlBoolean  visible  ) 

Sets the visibility of the time scale row.

Parameters:
visible IlTrue to make the time scale row visible and IlFalse to make it invisible.
virtual void IlvTimeScaleRow::write ( IlvOutputFile outfile  )  const [virtual]

Saves the time scale row in an output file.

Parameters:
outfile The output file.

Reimplemented in IlvYearTimeScaleRow, IlvQuarterTimeScaleRow, IlvMonthTimeScaleRow, IlvWeekTimeScaleRow, IlvDayTimeScaleRow, IlvHalfDayTimeScaleRow, IlvHourTimeScaleRow, and IlvMinuteTimeScaleRow.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.