|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.plugins.analysis.graph.GraphConfiguration
public class GraphConfiguration
Configuration properties of a trend graph.
| Field Summary | |
|---|---|
protected static String |
SEPARATOR
Separator of cookie values. |
| Constructor Summary | |
|---|---|
GraphConfiguration(BuildResultGraph... availableGraphs)
Creates a new instance of GraphConfiguration. |
|
GraphConfiguration(BuildResultGraph graph)
Creates a new instance of GraphConfiguration. |
|
GraphConfiguration(Collection<? extends BuildResultGraph> availableGraphs)
Creates a new instance of GraphConfiguration. |
|
| Method Summary | |
|---|---|
static hudson.util.FormValidation |
checkHeight(String height)
Performs on-the-fly validation on the trend graph height. |
static GraphConfiguration |
createDeactivated()
Creates a configuration for a deactivated graph. |
static GraphConfiguration |
createDefault()
Creates a default configuration. |
protected File |
createDefaultsFile(hudson.model.AbstractProject<?,?> project,
String pluginName)
Creates a file with for the default values. |
boolean |
equals(Object obj)
|
int |
getBuildCount()
Returns the number of builds to consider. |
String |
getBuildCountString()
Returns the build count as a string. |
int |
getDayCount()
Returns the number of days to consider. |
String |
getDayCountString()
Returns the day count as a string. |
BuildResultGraph |
getGraph(String graphId)
Returns the graph with the specified ID. |
BuildResultGraph |
getGraphType()
Returns the type of the graph. |
int |
getHeight()
Returns the height. |
Collection<BuildResultGraph> |
getRegisteredGraphs()
Returns the registered graphs. |
int |
getWidth()
Returns the width. |
int |
hashCode()
|
boolean |
initializeFrom(int width,
int height)
Initializes this configuration with the specified values. |
boolean |
initializeFrom(int width,
int height,
int dayCount)
Initializes this configuration with the specified values. |
boolean |
initializeFrom(net.sf.json.JSONObject value)
Parses the provided JSON object and initializes the members. |
boolean |
initializeFrom(String value)
Parses the provided string and initializes the members. |
boolean |
initializeFrom(String width,
String height,
String dayCountString)
Initializes this configuration with the specified values. |
boolean |
initializeFromFile(File file)
Reads the specified file, parses the content and initializes the members. |
protected boolean |
initializeLocal(net.sf.json.JSONObject localConfiguration)
Parses the provided JSON object and initializes the members of the local configuration. |
protected boolean |
initializeLocal(String[] localConfiguration)
Parses the provided array of string values and initializes the members of the local configuration. |
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,
BuildResultGraph 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 String |
serializeBoolean(boolean value)
Serializes a boolean. |
String |
serializeToString()
Serializes the values of this configuration. |
String |
toString()
|
boolean |
useBuildDateAsDomain()
Returns whether the build date or the build number should be used as domain. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String SEPARATOR
| Constructor Detail |
|---|
public GraphConfiguration(Collection<? extends BuildResultGraph> availableGraphs)
GraphConfiguration.
availableGraphs - the available build graphspublic GraphConfiguration(BuildResultGraph... availableGraphs)
GraphConfiguration.
availableGraphs - the available build graphspublic GraphConfiguration(BuildResultGraph graph)
GraphConfiguration.
graph - the graph to use| Method Detail |
|---|
public static GraphConfiguration createDeactivated()
public static GraphConfiguration createDefault()
public boolean initializeFrom(String value)
false is returned and the
members are reset to their default values.
value - the initialization value stored in the format
width!height!buildCount!dayCount!graphType
true is the initialization was successful,
false otherwiseserializeToString()
public boolean initializeFrom(int width,
int height)
width - the width of the graphheight - the height of the graph
true is the initialization was successful,
false otherwise
public boolean initializeFrom(int width,
int height,
int dayCount)
width - the width of the graphheight - the height of the graphdayCount - the number of days to build the graph for
true is the initialization was successful,
false otherwise
public boolean initializeFrom(String width,
String height,
String dayCountString)
width - the width of the graphheight - the height of the graphdayCountString - the number of days to build the graph for
true is the initialization was successful,
false otherwiseprotected boolean initializeLocal(String[] localConfiguration)
false is returned and the members are reset to their
default values.
The provided default implementation simply returns true.
localConfiguration - the initialization values
true is the initialization was successful,
false otherwiseserializeToString()public boolean initializeFrom(net.sf.json.JSONObject value)
false is returned
and the members are reset to their default values.
value - the initialization value
true is the initialization was successful,
false otherwiseserializeToString()protected boolean initializeLocal(net.sf.json.JSONObject localConfiguration)
false is returned and the members are reset to their
default values.
The provided default implementation simply returns true.
localConfiguration - the initialization values
true is the initialization was successful,
false otherwiseserializeToString()public boolean initializeFromFile(File file)
false is returned and the members are reset to
their default values.
file - the file with the initialization values
true is the initialization was successful,
false otherwiseserializeToString()
protected File createDefaultsFile(hudson.model.AbstractProject<?,?> project,
String pluginName)
project - the project used as directory for the filepluginName - the name of the plug-in
public String getBuildCountString()
public String getDayCountString()
public String serializeToString()
initializeFrom(String)protected String serializeBoolean(boolean value)
value - the value
protected static boolean isValid(int newWidth,
int newHeight,
int newBuildCount,
int newDayCount,
BuildResultGraph newGraphType)
newWidth - the new widthnewHeight - the new heightnewBuildCount - the new build countnewDayCount - the new day countnewGraphType - the new graph type
true if the configuration parameters are valid,
false otherwise.protected static boolean isValidBuildCount(int newBuildCount)
newBuildCount - the new build count
true if the build count is valid.protected static boolean isValidWidth(int newWidth)
newWidth - the new width
true if the width is valid, false
otherwiseprotected static boolean isValidHeight(int newHeight)
newHeight - the new height
true if the width is valid, false
otherwisepublic int getHeight()
public int getWidth()
public boolean useBuildDateAsDomain()
public int getBuildCount()
public boolean isBuildCountDefined()
true if there is a valid build count is defined,
false otherwisepublic int getDayCount()
public boolean isDayCountDefined()
true if there is a valid day count is defined,
false otherwisepublic BuildResultGraph getGraphType()
public boolean isDefault()
true if this instance is initialized with its default values.public boolean isVisible()
true, if the trend graph is visible, false otherwisepublic String toString()
toString in class Objectpublic Collection<BuildResultGraph> getRegisteredGraphs()
public BuildResultGraph getGraph(String graphId)
graphId - the graph ID
DEFAULT_GRAPH is returned.public static hudson.util.FormValidation checkHeight(String height)
height - the height
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||