Kieker 1.9

kieker.tools.traceAnalysis.repository
Class TraceColorRepository

java.lang.Object
  extended by kieker.analysis.analysisComponent.AbstractAnalysisComponent
      extended by kieker.analysis.repository.AbstractRepository
          extended by kieker.tools.traceAnalysis.repository.TraceColorRepository
All Implemented Interfaces:
IAnalysisComponent, IRepository

public class TraceColorRepository
extends AbstractRepository

Implementation of a trace color repository, which associates colors to traces. These colors can, for instance, be used to highlight traces in graph renderings.

Since:
1.6
Author:
Holger Knoche

Nested Class Summary
static class TraceColorRepository.TraceColorRepositoryData
          This class groups the data required for a TraceColorRepository.
 
Field Summary
static String CONFIG_PROPERTY_NAME_TRACE_COLOR_FILE_NAME
          Name of the configuration property that contains the file name of the trace color file.
 
Fields inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
CONFIG_NAME
 
Constructor Summary
TraceColorRepository(Configuration configuration, IProjectContext projectContext)
          Creates a new description repository using the given configuration.
TraceColorRepository(Configuration configuration, TraceColorRepository.TraceColorRepositoryData colorData, IProjectContext projectContext)
          Creates a new color repository with the given data.
 
Method Summary
static TraceColorRepository createFromFile(String fileName, IProjectContext projectContext)
          Initializes a trace color repository from a given file.
 Color getCollisionColor()
          Returns the color to use for elements for which no unique color can be determined.
 Map<Long,Color> getColorMap()
          Returns the color map stored in this repository.
 Configuration getCurrentConfiguration()
          This method should deliver a Configuration object containing the current configuration of this instance. In other words: The constructor should be able to use the given object to initialize a new instance of this class with the same intern properties.
 Color getDefaultColor()
          Returns the color to use for elements which are not defined in the color map.
 
Methods inherited from class kieker.analysis.repository.AbstractRepository
getRepositoryDescription, getRepositoryName
 
Methods inherited from class kieker.analysis.analysisComponent.AbstractAnalysisComponent
getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface kieker.analysis.analysisComponent.IAnalysisComponent
getName
 

Field Detail

CONFIG_PROPERTY_NAME_TRACE_COLOR_FILE_NAME

public static final String CONFIG_PROPERTY_NAME_TRACE_COLOR_FILE_NAME
Name of the configuration property that contains the file name of the trace color file.

See Also:
Constant Field Values
Constructor Detail

TraceColorRepository

public TraceColorRepository(Configuration configuration,
                            IProjectContext projectContext)
                     throws IOException
Creates a new description repository using the given configuration.

Parameters:
configuration - The configuration to use
projectContext - The project context for this plugin.
Throws:
IOException - If an I/O error occurs during initialization

TraceColorRepository

public TraceColorRepository(Configuration configuration,
                            TraceColorRepository.TraceColorRepositoryData colorData,
                            IProjectContext projectContext)
Creates a new color repository with the given data.

Parameters:
configuration - The configuration to use
colorData - The color data to use for this repository
projectContext - The project context to use for this repository.
Method Detail

getCurrentConfiguration

public Configuration getCurrentConfiguration()
This method should deliver a Configuration object containing the current configuration of this instance. In other words: The constructor should be able to use the given object to initialize a new instance of this class with the same intern properties.

Specified by:
getCurrentConfiguration in interface IAnalysisComponent
Specified by:
getCurrentConfiguration in class AbstractAnalysisComponent
Returns:
A completely filled configuration object.

getColorMap

public Map<Long,Color> getColorMap()
Returns the color map stored in this repository.

Returns:
See above

getDefaultColor

public Color getDefaultColor()
Returns the color to use for elements which are not defined in the color map.

Returns:
See above

getCollisionColor

public Color getCollisionColor()
Returns the color to use for elements for which no unique color can be determined.

Returns:
See above

createFromFile

public static TraceColorRepository createFromFile(String fileName,
                                                  IProjectContext projectContext)
                                           throws IOException
Initializes a trace color repository from a given file.

Parameters:
fileName - The name of the file to read from
projectContext - The project context to use.
Returns:
The initialized trace color repository
Throws:
IOException - If an I/O error occurs

Kieker 1.9

Copyright 2014 Kieker Project, http://kieker-monitoring.net