Gephi Toolkit Javadoc

org.gephi.utils.sparklines
Class SparklineParameters

java.lang.Object
  extended by org.gephi.utils.sparklines.SparklineParameters

public class SparklineParameters
extends java.lang.Object

Sparkline rendering settings:

Several constructors are provided for various use cases.

Author:
Eduardo Ramos
See Also:
SparklineGraph

Nested Class Summary
static class SparklineParameters.HighlightTextMode
          Defines what text is shown when highlightTextColor is not null.
 
Field Summary
static java.awt.Color DEFAULT_AREA_COLOR
           
static java.awt.Color DEFAULT_BACKGROUND_COLOR
           
static SparklineParameters.HighlightTextMode DEFAULT_HIGHLIGHT_TEXT_MODE
           
static java.awt.Color DEFAULT_HIGHLIGHT_VALUE_COLOR
           
static java.awt.Color DEFAULT_LINE_COLOR
           
static java.awt.Color DEFAULT_TEXT_BOX_COLOR
           
static java.awt.Color DEFAULT_TEXT_COLOR
           
 
Constructor Summary
SparklineParameters(int width, int height)
          Create a simple sparkline parameters with only lines
SparklineParameters(int width, int height, java.awt.Color lineColor)
          Create a simple sparkline parameters with only lines and a specific line color
SparklineParameters(int width, int height, java.awt.Color lineColor, java.awt.Color backgroundColor)
          Create a simple sparkline parameters with only lines and a specific line color and background color
SparklineParameters(int width, int height, java.awt.Color lineColor, java.awt.Color backgroundColor, java.awt.Color highlightMinColor, java.awt.Color highlightMaxColor)
          Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null)
SparklineParameters(int width, int height, java.awt.Color lineColor, java.awt.Color backgroundColor, java.awt.Color highlightMinColor, java.awt.Color highlightMaxColor, java.lang.Integer highlightedValueXPosition)
          Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null) and a x pixel position to highlight closest value with default highlight text and text box colors and default HighlightTextMode.
SparklineParameters(int width, int height, java.awt.Color lineColor, java.awt.Color backgroundColor, java.awt.Color highlightMinColor, java.awt.Color highlightMaxColor, java.lang.Integer highlightedValueXPosition, java.awt.Color highligtValueColor, java.awt.Color highlightTextColor, java.awt.Color highlightTextBoxColor, SparklineParameters.HighlightTextMode highlightTextMode)
          Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null) and a x pixel position to highlight closest value with specific highlight text and text box colors and HighlightTextMode.
 
Method Summary
 java.awt.Color getAreaColor()
          Returns current areaColor.
 java.awt.Color getBackgroundColor()
          Returns current background color.
 int getHeight()
          Returns current height for the sparkline in pixels.
 java.lang.Integer getHighlightedValueXPosition()
          Returns current X position for highlighting the closest value.
 java.awt.Color getHighlightMaxColor()
          Returns current highlightMaxColor.
 java.awt.Color getHighlightMinColor()
          Returns current highlightMinColor.
 java.awt.Color getHighlightTextBoxColor()
          Returns current color for the highlighted value text bounding box.
 java.awt.Color getHighlightTextColor()
          Returns current color for the highlighted value text.
 SparklineParameters.HighlightTextMode getHighlightTextMode()
          Return current HighlightTextMode
 java.awt.Color getHighligtValueColor()
          Returns current color for the highlighted value.
 java.awt.Color getLineColor()
          Returns current color for the sparkline line.
 int getWidth()
          Returns current width for the sparkline in pixels.
 boolean isDrawArea()
          Checks if the area under the line is enabled.
 boolean isTransparentBackground()
          Checks if transparent background is enabled.
 void setAreaColor(java.awt.Color areaColor)
          Set color to fill the area under the line.
 void setBackgroundColor(java.awt.Color backgroundColor)
          Set background color.
 void setDrawArea(boolean drawArea)
          Set draw area.
 void setHeight(int height)
          Set height for the sparkline in pixels.
 void setHighlightedValueXPosition(java.lang.Integer highlightedValueXPosition)
          Set a X position in pixels to find closest value in the sparkline and highlight it.
 void setHighlightMaxColor(java.awt.Color highlightMaxColor)
          Set color for the maximum value highlight, or null to draw no highlight.
 void setHighlightMinColor(java.awt.Color highlightMinColor)
          Set color for the minimum value highlight, or null to draw no highlight.
 void setHighlightTextBoxColor(java.awt.Color highlightTextBoxColor)
          Set color for the highlighted value text bounding box, or null to draw no box.
 void setHighlightTextColor(java.awt.Color highlightTextColor)
          Set color for the highlighted value text, or null to draw no text.
 void setHighlightTextMode(SparklineParameters.HighlightTextMode highlightTextMode)
          Set HighlightTextMode
 void setHighligtValueColor(java.awt.Color highligtValueColor)
          Set color for the value highlight, magenta is used if it is null.
 void setLineColor(java.awt.Color lineColor)
          Set color for the sparkline line.
 void setTransparentBackground(boolean transparentBackground)
          Set transparent background.
 void setWidth(int width)
          Set width for the sparkline in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LINE_COLOR

public static final java.awt.Color DEFAULT_LINE_COLOR

DEFAULT_AREA_COLOR

public static final java.awt.Color DEFAULT_AREA_COLOR

DEFAULT_BACKGROUND_COLOR

public static final java.awt.Color DEFAULT_BACKGROUND_COLOR

DEFAULT_HIGHLIGHT_VALUE_COLOR

public static final java.awt.Color DEFAULT_HIGHLIGHT_VALUE_COLOR

DEFAULT_TEXT_COLOR

public static final java.awt.Color DEFAULT_TEXT_COLOR

DEFAULT_TEXT_BOX_COLOR

public static final java.awt.Color DEFAULT_TEXT_BOX_COLOR

DEFAULT_HIGHLIGHT_TEXT_MODE

public static final SparklineParameters.HighlightTextMode DEFAULT_HIGHLIGHT_TEXT_MODE
Constructor Detail

SparklineParameters

public SparklineParameters(int width,
                           int height)
Create a simple sparkline parameters with only lines

Parameters:
width - Width in pixels
height - Height in pixels

SparklineParameters

public SparklineParameters(int width,
                           int height,
                           java.awt.Color lineColor)
Create a simple sparkline parameters with only lines and a specific line color

Parameters:
width - Width in pixels
height - Height in pixels
lineColor - Lines color

SparklineParameters

public SparklineParameters(int width,
                           int height,
                           java.awt.Color lineColor,
                           java.awt.Color backgroundColor)
Create a simple sparkline parameters with only lines and a specific line color and background color

Parameters:
width - Width in pixels
height - Height in pixels
lineColor - Lines color
backgroundColor - Background color

SparklineParameters

public SparklineParameters(int width,
                           int height,
                           java.awt.Color lineColor,
                           java.awt.Color backgroundColor,
                           java.awt.Color highlightMinColor,
                           java.awt.Color highlightMaxColor)
Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null)

Parameters:
width - Width in pixels
height - Height in pixels
lineColor - Lines color
backgroundColor - Background color
highlightMinColor - Min value highlight color or null
highlightMaxColor - Max value highlight color or null

SparklineParameters

public SparklineParameters(int width,
                           int height,
                           java.awt.Color lineColor,
                           java.awt.Color backgroundColor,
                           java.awt.Color highlightMinColor,
                           java.awt.Color highlightMaxColor,
                           java.lang.Integer highlightedValueXPosition)
Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null) and a x pixel position to highlight closest value with default highlight text and text box colors and default HighlightTextMode.

Parameters:
width - Width in pixels
height - Height in pixels
lineColor - Lines color
backgroundColor - Background color
highlightMinColor - Min value highlight color or null
highlightMaxColor - Max value highlight color or null
highlightedValueXPosition - X position in pixels to find closest value in the sparkline

SparklineParameters

public SparklineParameters(int width,
                           int height,
                           java.awt.Color lineColor,
                           java.awt.Color backgroundColor,
                           java.awt.Color highlightMinColor,
                           java.awt.Color highlightMaxColor,
                           java.lang.Integer highlightedValueXPosition,
                           java.awt.Color highligtValueColor,
                           java.awt.Color highlightTextColor,
                           java.awt.Color highlightTextBoxColor,
                           SparklineParameters.HighlightTextMode highlightTextMode)
Create a sparkline parameters specifying colors for line, background, and max/min highlight colors (no highlight if null) and a x pixel position to highlight closest value with specific highlight text and text box colors and HighlightTextMode.

Parameters:
width - Width in pixels
height - Height in pixels
lineColor - Lines color
backgroundColor - Background color
highlightMinColor - Min value highlight color or null
highlightMaxColor - Max value highlight color or null
highlightedValueXPosition - X position in pixels to find closest value in the sparkline
highligtValueColor - Highlighted value color (Magenta if null)
highlightTextColor - Highlighted value text color or null
highlightTextBoxColor - Highlighted value text box color or null
highlightTextMode - What to show on the highlight text (x and/or y values)
Method Detail

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns current background color.

Returns:
Current background color

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)
Set background color. If null and transparent background is not enabled, white will be used by default.

Parameters:
backgroundColor - New background color

getHeight

public int getHeight()
Returns current height for the sparkline in pixels.

Returns:
Current height for the sparkline in pixels

setHeight

public void setHeight(int height)
Set height for the sparkline in pixels.

Parameters:
height - Height in pixels

getHighlightTextBoxColor

public java.awt.Color getHighlightTextBoxColor()
Returns current color for the highlighted value text bounding box.

Returns:
Current highlightTextBoxColor

setHighlightTextBoxColor

public void setHighlightTextBoxColor(java.awt.Color highlightTextBoxColor)
Set color for the highlighted value text bounding box, or null to draw no box. Used only if highlightedValueXPosition is not null.

Parameters:
highlightTextBoxColor - New highlightTextBoxColor or null

getHighlightTextColor

public java.awt.Color getHighlightTextColor()
Returns current color for the highlighted value text.

Returns:
Current highlightTextColor

setHighlightTextColor

public void setHighlightTextColor(java.awt.Color highlightTextColor)
Set color for the highlighted value text, or null to draw no text. Used only if highlightedValueXPosition is not null.

Parameters:
highlightTextColor - New highlightTextColor or null

getHighligtValueColor

public java.awt.Color getHighligtValueColor()
Returns current color for the highlighted value.

Returns:
Current highligtValueColor

setHighligtValueColor

public void setHighligtValueColor(java.awt.Color highligtValueColor)
Set color for the value highlight, magenta is used if it is null. Used only if highlightedValueXPosition is not null.

Parameters:
highligtValueColor - New highligtValueColor

getHighlightMaxColor

public java.awt.Color getHighlightMaxColor()
Returns current highlightMaxColor.

Returns:
Current highlightMaxColor

setHighlightMaxColor

public void setHighlightMaxColor(java.awt.Color highlightMaxColor)
Set color for the maximum value highlight, or null to draw no highlight.

Parameters:
highlightMaxColor - New highlightMaxColor

getHighlightMinColor

public java.awt.Color getHighlightMinColor()
Returns current highlightMinColor.

Returns:
Current highlightMinColor

setHighlightMinColor

public void setHighlightMinColor(java.awt.Color highlightMinColor)
Set color for the minimum value highlight, or null to draw no highlight.

Parameters:
highlightMinColor - New highlightMinColor

getHighlightedValueXPosition

public java.lang.Integer getHighlightedValueXPosition()
Returns current X position for highlighting the closest value.

Returns:
Current highlightedValueXPosition in pixels

setHighlightedValueXPosition

public void setHighlightedValueXPosition(java.lang.Integer highlightedValueXPosition)

Set a X position in pixels to find closest value in the sparkline and highlight it.

If null or out of the sparkline width range, no value is highlighted.

Parameters:
highlightedValueXPosition - New highlightedValueXPosition in pixels

getHighlightTextMode

public SparklineParameters.HighlightTextMode getHighlightTextMode()
Return current HighlightTextMode

Returns:
Current HighlightTextMode
See Also:
SparklineParameters.HighlightTextMode

setHighlightTextMode

public void setHighlightTextMode(SparklineParameters.HighlightTextMode highlightTextMode)
Set HighlightTextMode

Parameters:
highlightTextMode - New HighlightTextMode
See Also:
SparklineParameters.HighlightTextMode

getLineColor

public java.awt.Color getLineColor()
Returns current color for the sparkline line.

Returns:
Current line color

setLineColor

public void setLineColor(java.awt.Color lineColor)
Set color for the sparkline line. If null, blue will be used by default.

Parameters:
lineColor - New lineColor

getWidth

public int getWidth()
Returns current width for the sparkline in pixels.

Returns:
Current width for the sparkline in pixels

setWidth

public void setWidth(int width)
Set width for the sparkline in pixels.

Parameters:
width - width in pixels

isTransparentBackground

public boolean isTransparentBackground()
Checks if transparent background is enabled.

Returns:
transparent background enabled

setTransparentBackground

public void setTransparentBackground(boolean transparentBackground)
Set transparent background. If true, background color is ignored and no background is drawn.

Parameters:
transparentBackground - transparent background enabled

setAreaColor

public void setAreaColor(java.awt.Color areaColor)
Set color to fill the area under the line. If null, semi-transparent default line color will be used. Used only if draw area is enabled.

Parameters:
areaColor - New areaColor

getAreaColor

public java.awt.Color getAreaColor()
Returns current areaColor.

Returns:
Current areaColor

setDrawArea

public void setDrawArea(boolean drawArea)
Set draw area. If true, the area under the line is filled with areaColor.

Parameters:
drawArea - draw area enabled

isDrawArea

public boolean isDrawArea()
Checks if the area under the line is enabled.

Returns:
draw area enabled

Gephi Toolkit Javadoc