hudson.plugins.checkstyle.util
Class GraphConfiguration

java.lang.Object
  extended by hudson.plugins.checkstyle.util.GraphConfiguration
Direct Known Subclasses:
GraphConfigurationDetail

public class GraphConfiguration
extends java.lang.Object

Configuration properties of a trend graph.


Field Summary
protected static int DEFAULT_HEIGHT
          The default height.
protected static int DEFAULT_WIDTH
          The default width.
 
Constructor Summary
GraphConfiguration(java.lang.String value)
          Creates a new instance of GraphConfiguration.
GraphConfiguration(java.lang.String value, java.io.File defaultsFile)
          Creates a new instance of GraphConfiguration.
 
Method Summary
 org.jfree.chart.JFreeChart createGraph(AbstractHealthDescriptor healthDescriptor, ResultAction<? extends BuildResult> resultAction, java.lang.String url)
          Creates the graph.
 int getBuildCount()
          Returns the number of builds to consider.
 int getDayCount()
          Returns the number of days to consider.
 GraphType getGraphType()
          Returns the type of the graph.
 int getHeight()
          Returns the height.
 int getWidth()
          Returns the width.
 boolean isBuildCountDefined()
          Returns whether a valid build count is defined.
 boolean isDayCountDefined()
          Returns whether a valid day count is defined.
 boolean isDefault()
          Returns whether this instance is initialized with its default values.
protected static boolean isValid(int newWidth, int newHeight, int newBuildCount, int newDayCount, GraphType newGraphType)
          Returns whether the configuration parameters are valid.
protected static boolean isValidBuildCount(int newBuildCount)
          Returns if the build count is valid.
protected static boolean isValidHeight(int newHeight)
          Returns whether the width is valid.
protected static boolean isValidWidth(int newWidth)
          Returns whether the width is valid.
 boolean isVisible()
          Returns whether the trend graph is visible or not.
protected  java.lang.String serializeToString(int width, int height, int buildCount, int dayCount, GraphType graphType)
          Serializes the values of this configuration.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

protected static final int DEFAULT_WIDTH
The default width.

See Also:
Constant Field Values

DEFAULT_HEIGHT

protected static final int DEFAULT_HEIGHT
The default height.

See Also:
Constant Field Values
Constructor Detail

GraphConfiguration

public GraphConfiguration(java.lang.String value)
Creates a new instance of GraphConfiguration.

Parameters:
value - the initial value of this configuration (the syntax of the string is defined in initializeFrom(String))

GraphConfiguration

public GraphConfiguration(java.lang.String value,
                          java.io.File defaultsFile)
Creates a new instance of GraphConfiguration.

Parameters:
value - the initial value of this configuration (the syntax of the string is defined in initializeFrom(String))
defaultsFile - a file with default values in case the specified value is not valid
Method Detail

serializeToString

protected java.lang.String serializeToString(int width,
                                             int height,
                                             int buildCount,
                                             int dayCount,
                                             GraphType graphType)
Serializes the values of this configuration.

Parameters:
width - width of graph
height - height of graph
buildCount - the build count
dayCount - the day count
graphType - type of graph
Returns:
serialized configuration
See Also:
initializeFrom(String)

isValid

protected static boolean isValid(int newWidth,
                                 int newHeight,
                                 int newBuildCount,
                                 int newDayCount,
                                 GraphType newGraphType)
Returns whether the configuration parameters are valid.

Parameters:
newWidth - the new width
newHeight - the new height
newBuildCount - the new build count
newDayCount - the new day count
newGraphType - the new graph type
Returns:
true if the configuration parameters are valid, false otherwise.

isValidBuildCount

protected static boolean isValidBuildCount(int newBuildCount)
Returns if the build count is valid.

Parameters:
newBuildCount - the new build count
Returns:
true if the build count is valid.

isValidWidth

protected static boolean isValidWidth(int newWidth)
Returns whether the width is valid.

Parameters:
newWidth - the new width
Returns:
true if the width is valid, false otherwise

isValidHeight

protected static boolean isValidHeight(int newHeight)
Returns whether the width is valid.

Parameters:
newHeight - the new height
Returns:
true if the width is valid, false otherwise

getHeight

public int getHeight()
Returns the height.

Returns:
the height

getWidth

public int getWidth()
Returns the width.

Returns:
the width

getBuildCount

public int getBuildCount()
Returns the number of builds to consider.

Returns:
the number of builds to consider

isBuildCountDefined

public boolean isBuildCountDefined()
Returns whether a valid build count is defined.

Returns:
true if there is a valid build count is defined, false otherwise

getDayCount

public int getDayCount()
Returns the number of days to consider.

Returns:
the number of days to consider

isDayCountDefined

public boolean isDayCountDefined()
Returns whether a valid day count is defined.

Returns:
true if there is a valid day count is defined, false otherwise

getGraphType

public GraphType getGraphType()
Returns the type of the graph.

Returns:
the type

createGraph

public org.jfree.chart.JFreeChart createGraph(AbstractHealthDescriptor healthDescriptor,
                                              ResultAction<? extends BuildResult> resultAction,
                                              java.lang.String url)
Creates the graph.

Parameters:
healthDescriptor - the health descriptor
resultAction - the action to start the graph with
url - base URL of the graph links
Returns:
the graph

isDefault

public boolean isDefault()
Returns whether this instance is initialized with its default values.

Returns:
true if this instance is initialized with its default values.

isVisible

public boolean isVisible()
Returns whether the trend graph is visible or not.

Returns:
true, if the trend graph is visible, false otherwise

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.