|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.chart.BaseChart org.ujac.chart.Base2DScaleChart
public abstract class Base2DScaleChart
Name: Base2DScaleChart
Description: Base class for 2D scale charts like bar and line charts.
Field Summary | |
---|---|
static int |
ARROWHEAD_STYLE_FILLED
The arrowhead style for filled arrows. |
static int |
ARROWHEAD_STYLE_OPEN
The arrowhead style for open arrows. |
static int |
DEFAULT_ARROWHEAD_STYLE
The default arrowhead style. |
static float |
DEFAULT_DESCRIPTION_ITEM_SPACING
The default description item spacing. |
static float |
DEFAULT_DESCRIPTION_LINE_SPACING
The default description line spacing. |
static Color |
DEFAULT_GRID_BACKGROUND_COLOR
The default grid background color. |
static Color |
DEFAULT_GRID_COLOR
The default grid color. |
static float |
DEFAULT_LINE_WIDTH
The default line width. |
static float |
DEFAULT_SCALE_ARROWHEAD_LENGTH
The default scale arrowhead length. |
static String |
DEFAULT_SCALE_ARROWHEAD_STYLE
The default scale arrowhead style. |
static float |
DEFAULT_SCALE_MARK_LENGTH
The default line width. |
static int |
DEFAULT_SEGMENT_MARK_STYLE
The default segment mark style. |
protected Rectangle |
effectiveViewport
The effective viewport (is determined whenever draw scale is called). |
protected float |
horizontalOffset
The horizontal offset for the chart. |
protected float[] |
horizontalPositions
The horizontal positions for the values. |
protected float |
horizontalScale
The horizontal scale for the chart. |
protected double |
max
The maximum value. |
protected double |
min
The minimum value. |
protected double |
range
The value range. |
protected Font |
scaleFont
The Font to use for the grid. |
static int |
SEGMENT_MARK_STYLE_BORDER
The segment mark style for border lines. |
static int |
SEGMENT_MARK_STYLE_CENTER
The segment mark style for centered lines. |
protected float |
verticalAnchor
The vertical anchor from which to draw the chart. |
protected float |
verticalMaximum
The maximum vertical position. |
protected float |
verticalMinimum
The minimum vertical position. |
protected float |
verticalScale
The vertical scale for the chart values. |
protected float |
verticalZero
The vertical position of the zero coordinate. |
Fields inherited from class org.ujac.chart.BaseChart |
---|
attributes, DEFAULT_BORDER_WIDTH, DEFAULT_DESCRIPTION_COLOR, DEFAULT_DESCRIPTION_FONT, DEFAULT_DESCRIPTION_LINE_WIDTH, DEFAULT_DESCRIPTION_PATTERN, DEFAULT_PADDING, DEFAULT_SHADOW_COLOR, DEFAULT_SHADOW_OFFSET, DEFAULT_TITLE_FONT, defaultPercentFormat, defaultValueFormat, model |
Constructor Summary | |
---|---|
Base2DScaleChart()
|
Method Summary | |
---|---|
protected float |
calculateBaseLinePosition()
Calculates the base scale line position for the chart. |
protected float |
calculateVerticalExtent(double value)
Calculates the vertical extent for the given value. |
protected float |
calculateVerticalPosition(double value)
Calculates the vertical position for the given value. |
protected Rectangle |
calcViewport(Rectangle2D viewport,
Graphics2D graphics)
Calculates the viewport. |
protected void |
drawLegend(Rectangle2D viewport,
Graphics2D graphics)
Draws the legend. |
protected void |
drawScale(Rectangle2D viewport,
Rectangle2D effectiveViewport,
Graphics2D graphics)
Draws the scale. |
String |
formatScaleValue(double number,
double stepSize)
Format a number for scale value output. |
Color |
getGridBackgroundColor()
Gets the grid background color. |
Color |
getGridColor()
Gets the grid color. |
protected int |
getInnerPadding()
Gets the inner padding. |
float |
getLineWidth()
Gets the line width. |
float |
getScaleArrowheadLength()
Gets the scale arrowhead length. |
int |
getScaleArrowheadStyle()
Gets the scale arrowhead style. |
float |
getScaleArrowheadWidth()
Gets the scale arrowhead width. |
float |
getScaleMarkLength()
Gets the scale mark length. |
NumberFormat |
getScaleValueFormat()
Gets the number format for scale value output. |
int |
getSegmentMarkStyle()
Gets the segment mark style. |
protected TextChartItem |
getSegmentScaleDescription()
Gets the segment scale description. |
protected TextChartItem |
getValueScaleDescription()
Gets the value scale description. |
float |
getValueStepSize(double descriptionHeight)
Gets the value step size according to the attribute ATTR_VALUE_STEP_SIZE or calculates if it's not specified. |
boolean |
isViewGrid()
Gets the 'view-grid' flag. |
boolean |
isViewLegend()
Gets the 'view-legend' flag. |
boolean |
isViewScaleArrows()
Gets the 'view-scale-arrows' flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SEGMENT_MARK_STYLE_CENTER
public static final int SEGMENT_MARK_STYLE_BORDER
public static final int DEFAULT_SEGMENT_MARK_STYLE
public static final int ARROWHEAD_STYLE_OPEN
public static final int ARROWHEAD_STYLE_FILLED
public static final int DEFAULT_ARROWHEAD_STYLE
public static final float DEFAULT_LINE_WIDTH
public static final float DEFAULT_SCALE_MARK_LENGTH
public static final float DEFAULT_SCALE_ARROWHEAD_LENGTH
public static final String DEFAULT_SCALE_ARROWHEAD_STYLE
public static final Color DEFAULT_GRID_COLOR
public static final Color DEFAULT_GRID_BACKGROUND_COLOR
public static final float DEFAULT_DESCRIPTION_ITEM_SPACING
public static final float DEFAULT_DESCRIPTION_LINE_SPACING
protected Font scaleFont
protected Rectangle effectiveViewport
protected float verticalAnchor
protected float verticalMinimum
protected float verticalMaximum
protected float verticalZero
protected double max
protected double min
protected double range
protected float horizontalOffset
protected float horizontalScale
protected float verticalScale
protected float[] horizontalPositions
Constructor Detail |
---|
public Base2DScaleChart()
Method Detail |
---|
public float getLineWidth()
public float getScaleMarkLength()
public float getValueStepSize(double descriptionHeight)
descriptionHeight
- The description height.
public boolean isViewLegend()
public boolean isViewScaleArrows()
public float getScaleArrowheadLength()
public float getScaleArrowheadWidth()
public int getScaleArrowheadStyle()
public NumberFormat getScaleValueFormat()
public String formatScaleValue(double number, double stepSize)
number
- The number to format.stepSize
- The step size to use.
public int getSegmentMarkStyle()
public boolean isViewGrid()
public Color getGridColor()
public Color getGridBackgroundColor()
protected int getInnerPadding()
protected TextChartItem getValueScaleDescription()
protected TextChartItem getSegmentScaleDescription()
protected void drawScale(Rectangle2D viewport, Rectangle2D effectiveViewport, Graphics2D graphics)
viewport
- The viewport.effectiveViewport
- The effective viewport for the scale.graphics
- The graphics object to use.protected void drawLegend(Rectangle2D viewport, Graphics2D graphics)
viewport
- The viewport.graphics
- The graphics object to use.protected Rectangle calcViewport(Rectangle2D viewport, Graphics2D graphics)
viewport
- The original viewport.graphics
- The graphics interface needed for font metrics calculation.
protected float calculateVerticalPosition(double value)
value
- The value we are interrested in the vertical position for
protected float calculateVerticalExtent(double value)
value
- The value we are interrested in the vertical position for
protected float calculateBaseLinePosition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |