bass.stats
Class StatsFactory

java.lang.Object
  extended by bass.stats.StatsFactory

public class StatsFactory
extends java.lang.Object

Basically responsible for creating the different graphs in statistics section.

Author:
Fabian Winkhardt

Field Summary
static java.awt.GradientPaint bgColor
           
static javax.swing.JList genreJList
           
static int MODE_GENREGROWTH
           
static int tempMode
           
static Gui thisGui
           
static int TOP_FANS
           
static int TOP_FPD
           
static int TOP_PLAYS
           
static int TOP_SINCE
           
static int TOP_VIEWS
           
 
Constructor Summary
StatsFactory()
           
 
Method Summary
static java.awt.Component generateActivityCurve(Gui theGui)
          Generates the time series chart showing the growth of registered bands at MySpace and the amount of bands that went inactive after registration.
static java.awt.Component generateGenreFrequency(Gui theGui, java.lang.String mode)
          Generates the bar chart based on the amount of bands in every genre
static java.awt.Component generateGenreGrowth(Gui theGui, java.lang.String[] genreArray)
          Generates the time series chart displaying the growth of single genres in comparison
static java.awt.Component generateGenreJList(java.lang.String[] genreArray, int listMode)
          generates a jlist with all genres, adds it into a scrollpane and returns the component
static java.lang.String generateHTML(int mode, DTO_BandWithFPD[] bands, java.lang.String genre)
          Creates a html formatted string of the given bands, putting them into a ranking table.
static java.awt.Component generateHypeCurve(Gui theGui)
          Generates the time series chart based amount of bands/musicians registered per day.
static java.awt.Component generateLabelType(Gui theGui, java.lang.String mode)
          Generates the bar chart showing the label ratio for all bands and single genres
static java.awt.Component generateLongTailChart(Gui theGui)
          Generates the pie chart based on the long tail data
static java.awt.Component generateTopBands(Gui theGui, java.lang.String genre, int mode)
          Generates a ranking based on "mode" for all genres or a specific one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisGui

public static Gui thisGui

MODE_GENREGROWTH

public static final int MODE_GENREGROWTH
See Also:
Constant Field Values

TOP_FANS

public static final int TOP_FANS
See Also:
Constant Field Values

TOP_VIEWS

public static final int TOP_VIEWS
See Also:
Constant Field Values

TOP_PLAYS

public static final int TOP_PLAYS
See Also:
Constant Field Values

TOP_SINCE

public static final int TOP_SINCE
See Also:
Constant Field Values

TOP_FPD

public static final int TOP_FPD
See Also:
Constant Field Values

tempMode

public static int tempMode

bgColor

public static java.awt.GradientPaint bgColor

genreJList

public static javax.swing.JList genreJList
Constructor Detail

StatsFactory

public StatsFactory()
Method Detail

generateLongTailChart

public static java.awt.Component generateLongTailChart(Gui theGui)
Generates the pie chart based on the long tail data

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateGenreFrequency

public static java.awt.Component generateGenreFrequency(Gui theGui,
                                                        java.lang.String mode)
Generates the bar chart based on the amount of bands in every genre

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateGenreGrowth

public static java.awt.Component generateGenreGrowth(Gui theGui,
                                                     java.lang.String[] genreArray)
Generates the time series chart displaying the growth of single genres in comparison

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateLabelType

public static java.awt.Component generateLabelType(Gui theGui,
                                                   java.lang.String mode)
Generates the bar chart showing the label ratio for all bands and single genres

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateHypeCurve

public static java.awt.Component generateHypeCurve(Gui theGui)
Generates the time series chart based amount of bands/musicians registered per day.

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateActivityCurve

public static java.awt.Component generateActivityCurve(Gui theGui)
Generates the time series chart showing the growth of registered bands at MySpace and the amount of bands that went inactive after registration.

Parameters:
theGui - - used for (re)setting the progress bar
Returns:
Component - the actual graph

generateTopBands

public static java.awt.Component generateTopBands(Gui theGui,
                                                  java.lang.String genre,
                                                  int mode)
Generates a ranking based on "mode" for all genres or a specific one.

Parameters:
theGui - - used for (re)setting the progress counter
genre - - the specified genre ("all" for all genres)
mode - - the ranking mode (fans, plays, views, membership, friends per day)
Returns:
Component - the generated ranking + List of genres to select from

generateGenreJList

public static java.awt.Component generateGenreJList(java.lang.String[] genreArray,
                                                    int listMode)
generates a jlist with all genres, adds it into a scrollpane and returns the component

Parameters:
resetAL - the action listener for the reset button
startAL - the action listener for the start button
Returns:
s.a.

generateHTML

public static java.lang.String generateHTML(int mode,
                                            DTO_BandWithFPD[] bands,
                                            java.lang.String genre)
Creates a html formatted string of the given bands, putting them into a ranking table.

Parameters:
mode - - The different kinds of ranking
bands - - The array of bands
genre - - The specified genre (or "all genres")
Returns:
String - html representation of the given list of bands