Package quadbase.util

Interface IGanttPropertySet


public interface IGanttPropertySet
This interface is used to modify the properties associated with a 2D Gantt chart. A handle to an object that implements this interface can be obtained by calling the gethGanttProperties method defined in QbChart. eg. QbChart chart = new QbChart(...); IGanttPropertySet ganttProp = chart.gethGanttProperties();

The axis scales can be set using the time based class "java.util.Date" and/or its extended classes: "java.sql.Date", "java.sql.Time", and "java.sql.Timestamp". Setting the axis scales when the labels are displayed in the numeric format can be done through the IAxis class. The handle to it can be obtained by calling the gethXAxis method. eg. IAxis xAxis = chart.gethXAxis().

Graphics needs to be initialized before the "get" methods for the axis scaling can be called. Otherwise, the methods would return the perspective default values.

 eg.Frame frame = new Frame();
 frame.addNotify();
 
 // draw a frame chart of the same size as the chart
 chart.draw(frame.getGraphics(), frame, 500, 400);
 
 frame.removeNotify();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the IFormat object that is used for formatting the value axis labels.
    long
    Returns the maximum scale milliseconds value that was defined for this axis.
    long
    Returns the minimum scale milliseconds value that was defined for this axis.
    long
    Returns the scaleStep milliseconds value that was defined for this axis.
    boolean
    Returns the state of the arrows that link Gantt chart data.
    boolean
    Returns the state of value axis label display in DateTimeFormat, as opposed to NumericFormat.
    boolean
    Returns the state of the x-axis label display in day of the week fashion.
    boolean
    This function is used to check if the origin is calculated automatically or not
    boolean
    This function is used to check if the scale min, max, and step sizes are calculated automatically or not.
    boolean
    Returns if translucent GIF is used.
    void
    setArrowsDrawn(boolean state)
    Sets the state of the arrows that link Gantt chart data.
    void
    Specifies the IFormat object to be used for formatting the value axis labels.
    void
    setDateTimeDisplay(boolean state)
    Specifies the if the value axis labels are displayed in the DateTimeFormat
    void
    setDisplayByWeek(boolean state)
    Sets the state of the x-axis label display in day of the week fashion.
    void
    setMaxScale(Date maxScale)
    Sets the maximum scale value for this axis.
    void
    setMinScale(Date minScale)
    Sets the minimum scale value for this axis.
    void
    setOriginAutomatic(boolean b)
    This function is used to enable/disable auto calculation of origin.
    void
    setScaleAutomatic(boolean b)
    This function is used to enable/disable auto calculation of scales.
    void
    setScaleStep(int yr, int mo, int dd, int hr, int min)
    Sets the scalestep value for this axis.
    void
    setScaleStep(Date scaleStep)
    Sets the scalestep value for this axis.
    void
    setTranslucent(boolean state)
    Specifies if translucent GIF is used.
  • Method Details

    • isTranslucent

      boolean isTranslucent()
      Returns if translucent GIF is used.
    • setTranslucent

      void setTranslucent(boolean state)
      Specifies if translucent GIF is used. JDK1.2 or above is required.
      Parameters:
      state - the new state, default is false.
    • isDateTimeDisplay

      boolean isDateTimeDisplay()
      Returns the state of value axis label display in DateTimeFormat, as opposed to NumericFormat.
    • setDateTimeDisplay

      void setDateTimeDisplay(boolean state)
      Specifies the if the value axis labels are displayed in the DateTimeFormat
      Parameters:
      state - the new state, default is true.
    • getAxisLabelFormat

      IFormat getAxisLabelFormat()
      Returns the IFormat object that is used for formatting the value axis labels.
    • setAxisLabelFormat

      void setAxisLabelFormat(IFormat format)
      Specifies the IFormat object to be used for formatting the value axis labels.
    • isOriginAutomatic

      boolean isOriginAutomatic()
      This function is used to check if the origin is calculated automatically or not
      Returns:
      True if the origin value is automatic.
    • setOriginAutomatic

      void setOriginAutomatic(boolean b)
      This function is used to enable/disable auto calculation of origin.
      Parameters:
      b - True if auto origin is desired, false otherwise.
    • isScaleAutomatic

      boolean isScaleAutomatic()
      This function is used to check if the scale min, max, and step sizes are calculated automatically or not.
      Returns:
      True if the scale min, max, and step values are automatic.
    • setScaleAutomatic

      void setScaleAutomatic(boolean b)
      This function is used to enable/disable auto calculation of scales.
      Parameters:
      b - True if auto scale is desired, false otherwise.
    • getMinScale

      long getMinScale()
      Returns the minimum scale milliseconds value that was defined for this axis.
      Returns:
      The long int representation of the minimum scale.
    • setMinScale

      void setMinScale(Date minScale)
      Sets the minimum scale value for this axis. The java.sql Date, Time, Timestamp all extend the java.util.Date class, therefore, can be used as well.
      Parameters:
      minScale - The minimum scale to use.
    • getMaxScale

      long getMaxScale()
      Returns the maximum scale milliseconds value that was defined for this axis.
      Returns:
      The long int representation of the maximum scale.
    • setMaxScale

      void setMaxScale(Date maxScale)
      Sets the maximum scale value for this axis. The java.sql Date, Time, Timestamp classes all extend the java.util.Date class, therefore, can be used as well.
      Parameters:
      maxScale - The maximum scale to use.
    • getScaleStep

      long getScaleStep()
      Returns the scaleStep milliseconds value that was defined for this axis.
      Returns:
      The long int representation of the scale step.
    • setScaleStep

      void setScaleStep(Date scaleStep)
      Sets the scalestep value for this axis. The java.sql Date, Time, Timestamp classes all extend the java.util.Date class, therefore, can be used as well.

      Note on setting scalestep in units of "days":
      Use "setScaleStep(new java.util.Date(70, 0, D, 24 + Offset, 0, 0));" to set the scalestep to "D" number of days, where "Offset" is the offset from the GMT. For example, to have a scale step of 1 day when you are in the locale of Pacific Standard Timezone--GMT offset is "-8", the constructor to use is "new java.util.Date(70, 0, 1, 16, 0, 0)".

      Note on setting scalestep in units of "hours":
      Use "setScaleStep(new java.sql.TimeStamp(H + Offset, 0, 0);" to set the scalestep to "H" number of hours, where "Offset" is the offset from the GMT. For example, to have a scalestep of 12 hours when you are in the Pacific Standard Timezone--where GMT offset is "-8", the TimeStamp constructor to use is "new java.sql.TimeStamp(4,0,0)".

      Alternatively, you may turn the time zone offset off with the following code snippet. You do not need to correct JDK1.2 GMT offset as explained in the previous two paragraphs if you insert the following code in the beginning of your program.

       // Turn TimeZone Off
       SimpleTimeZone timeZone = new SimpleTimeZone(0, //set the RawOffset to 0,
                      TimeZone.getDefault().getID());
       TimeZone.setDefault(timeZone);
       
      Parameters:
      scaleStep - The scalestep to use.
    • setScaleStep

      void setScaleStep(int yr, int mo, int dd, int hr, int min)
      Sets the scalestep value for this axis.
      Parameters:
      yr - The scalestep in year
      mo - The scalestep in month
      dd - The scalestep in day
      hr - The scalestep in hour
      min - The scalestep in minute
    • isDisplayByWeek

      boolean isDisplayByWeek()
      Returns the state of the x-axis label display in day of the week fashion.
    • setDisplayByWeek

      void setDisplayByWeek(boolean state)
      Sets the state of the x-axis label display in day of the week fashion. Known issues: works for dates as early as from the year 1971. Day of week accuracy is compromised by inaccuracy in the java.util.Date class.
      Parameters:
      state - the new state.
    • isArrowsDrawn

      boolean isArrowsDrawn()
      Returns the state of the arrows that link Gantt chart data.
    • setArrowsDrawn

      void setArrowsDrawn(boolean state)
      Sets the state of the arrows that link Gantt chart data.
      Parameters:
      state - the new state.