com.eltima.chart
Class AbstractAxis

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.eltima.chart.AbstractAxis
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
HorizontalAxis, VerticalAxis

public abstract class AbstractAxis
extends javax.swing.JComponent

The base class for all axes.

Copyright: Copyright (c) 2000-2005

Company: Eltima Software

Version:
4.0
Author:
[SoftInfinity Dpt.]
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int CROSSES_AT_MAX
           
static int CROSSES_AT_MIN
           
static int CROSSES_AT_ZERO
           
static int LABEL_PLACEMENT_AT_CATEGORIES
           
static int LABEL_PLACEMENT_BETWEEN_CATEGORIES
           
protected  javax.swing.CellRendererPane rendererPane
           
static int TYPE_CATEGORY
           
static int TYPE_DATA
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractAxis(ELChart chart)
          Creates an axis with the specified chart.
 
Method Summary
(package private) abstract  void fillComponentsPosition()
          Fill axis components position.
 GradientModel getAxisGradient()
          Returns the axis GradientModel.
 int getAxisType()
          Returns the axis type.
 int getAxisWeight()
          Returns the axis weight.
 ELChart getChart()
          Returns the chart.
 int getCrossesType()
          Returns the axis crossing type.
 int getLabelAxisMargin()
          Returns the Label/Axis margin.
 LabelModel getLabelModel()
          Returns the label LabelModel.
 int getLabelPlacement()
          Returns the label placement.
 javax.swing.JLabel getLabelRenderer()
          Returns the axis label renderer.
 Tick getMajorTick()
          Returns the major Tick.
 Tick getMinorTick()
          Returns the minor Tick.
 java.lang.String getTitle()
          Returns axis title.
 int getTitleLabelMargin()
          Returns the Title/Label margin.
 LabelModel getTitleModel()
          Returns the title LabelModel.
 javax.swing.JLabel getTitleRenderer()
          Returns the Title renderer.
 double getUnitValue(double sum, int unitCnt)
          Returns unit value and depends on the sum of positive and negative max values and requires the number of units.
 boolean isAxisVisible()
          Returns true if axis is visible
 boolean isLabelVisible()
          Returns true if axis labels is visible.
 boolean isTitleVisible()
          Returns true if axis title is visible.
 void setAxisGradient(GradientModel model)
          Sets the axis GradientModel.
 void setAxisType(int type)
          Sets the axis type.
 void setAxisVisible(boolean visible)
          Sets axis is visible.
 void setAxisWeight(int weight)
          Sets the axis weight.
 void setBounds(int x, int y, int width, int height)
          Moves and resizes this component.
 void setCrossesType(int type)
          Sets the axis crossing type.
 void setLabelAxisMargin(int margin)
          Sets the Label/Axis margin.
 void setLabelModel(LabelModel model)
          Sets the axis label LabelModel.
 void setLabelPlacement(int placement)
          Sets the label placement.
 void setLabelRenderer(javax.swing.JLabel renderer)
          Sets the axis label renderer.
 void setLabelVisible(boolean visible)
          Sets the axis labels visible.
 void setMajorTick(Tick tick)
          Sets the major Tick.
 void setMinorTick(Tick tick)
          Sets the minor Tick.
 void setTitle(java.lang.String title)
          Sets the axis title.
 void setTitleLabelMargin(int margin)
          Sets the Title/Label margin.
 void setTitleModel(LabelModel model)
          Sets the axis title LabelModel.
 void setTitleRenderer(javax.swing.JLabel renderer)
          Sets the Title renderer.
 void setTitleVisible(boolean visible)
          Sets the axis title visible.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rendererPane

protected javax.swing.CellRendererPane rendererPane

TYPE_DATA

public static final int TYPE_DATA
See Also:
Constant Field Values

TYPE_CATEGORY

public static final int TYPE_CATEGORY
See Also:
Constant Field Values

LABEL_PLACEMENT_BETWEEN_CATEGORIES

public static final int LABEL_PLACEMENT_BETWEEN_CATEGORIES
See Also:
Constant Field Values

LABEL_PLACEMENT_AT_CATEGORIES

public static final int LABEL_PLACEMENT_AT_CATEGORIES
See Also:
Constant Field Values

CROSSES_AT_MAX

public static final int CROSSES_AT_MAX
See Also:
Constant Field Values

CROSSES_AT_MIN

public static final int CROSSES_AT_MIN
See Also:
Constant Field Values

CROSSES_AT_ZERO

public static final int CROSSES_AT_ZERO
See Also:
Constant Field Values
Constructor Detail

AbstractAxis

public AbstractAxis(ELChart chart)
Creates an axis with the specified chart.

Parameters:
chart - ELChart
Method Detail

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Moves and resizes this component.

Parameters:
x - int
y - int
width - int
height - int

fillComponentsPosition

abstract void fillComponentsPosition()
Fill axis components position.


getUnitValue

public double getUnitValue(double sum,
                           int unitCnt)
Returns unit value and depends on the sum of positive and negative max values and requires the number of units.

Parameters:
sum - double
unitCnt - int
Returns:
double

isLabelVisible

public boolean isLabelVisible()
Returns true if axis labels is visible.

Returns:
boolean

setLabelVisible

public void setLabelVisible(boolean visible)
Sets the axis labels visible.

Parameters:
visible - boolean

isAxisVisible

public boolean isAxisVisible()
Returns true if axis is visible

Returns:
boolean

setAxisVisible

public void setAxisVisible(boolean visible)
Sets axis is visible.

Parameters:
visible - boolean

getAxisWeight

public int getAxisWeight()
Returns the axis weight.

Returns:
int

setAxisWeight

public void setAxisWeight(int weight)
Sets the axis weight.

Parameters:
weight - int

getAxisType

public int getAxisType()
Returns the axis type.

Returns:
int

setAxisType

public void setAxisType(int type)
Sets the axis type.


getLabelPlacement

public int getLabelPlacement()
Returns the label placement.

Returns:
int

setLabelPlacement

public void setLabelPlacement(int placement)
Sets the label placement.

Parameters:
placement - LABEL_PLACEMENT_BETWEEN_CATEGORIES or LABEL_PLACEMENT_AT_CATEGORIES.

getMajorTick

public Tick getMajorTick()
Returns the major Tick.

Returns:
Tick

getMinorTick

public Tick getMinorTick()
Returns the minor Tick.

Returns:
Tick

getLabelAxisMargin

public int getLabelAxisMargin()
Returns the Label/Axis margin.

Returns:
int

setLabelAxisMargin

public void setLabelAxisMargin(int margin)
Sets the Label/Axis margin.


getLabelRenderer

public javax.swing.JLabel getLabelRenderer()
Returns the axis label renderer.

Returns:
JLabel

setLabelRenderer

public void setLabelRenderer(javax.swing.JLabel renderer)
Sets the axis label renderer.


getTitleLabelMargin

public int getTitleLabelMargin()
Returns the Title/Label margin.

Returns:
int

setTitleLabelMargin

public void setTitleLabelMargin(int margin)
Sets the Title/Label margin.

Parameters:
margin - int

getTitleRenderer

public javax.swing.JLabel getTitleRenderer()
Returns the Title renderer.

Returns:
JLabel

setTitleRenderer

public void setTitleRenderer(javax.swing.JLabel renderer)
Sets the Title renderer.

Parameters:
renderer - JLabel

getTitle

public java.lang.String getTitle()
Returns axis title.

Returns:
String

setTitle

public void setTitle(java.lang.String title)
Sets the axis title.

Parameters:
title - String

getLabelModel

public LabelModel getLabelModel()
Returns the label LabelModel.

Returns:
LabelModel

getTitleModel

public LabelModel getTitleModel()
Returns the title LabelModel.

Returns:
LabelModel

isTitleVisible

public boolean isTitleVisible()
Returns true if axis title is visible.

Returns:
boolean

setTitleVisible

public void setTitleVisible(boolean visible)
Sets the axis title visible.


getChart

public ELChart getChart()
Returns the chart.

Returns:
ELChart

getCrossesType

public int getCrossesType()
Returns the axis crossing type.

Returns:
int

setCrossesType

public void setCrossesType(int type)
Sets the axis crossing type.

Parameters:
type - CROSSES_AT_MAX, CROSSES_AT_MIN or CROSSES_AT_ZERO.

getAxisGradient

public GradientModel getAxisGradient()
Returns the axis GradientModel.

Returns:
GradientModel

setAxisGradient

public void setAxisGradient(GradientModel model)
Sets the axis GradientModel.

Parameters:
model - GradientModel

setLabelModel

public void setLabelModel(LabelModel model)
Sets the axis label LabelModel.

Parameters:
model - LabelModel

setTitleModel

public void setTitleModel(LabelModel model)
Sets the axis title LabelModel.

Parameters:
model - LabelModel

setMajorTick

public void setMajorTick(Tick tick)
Sets the major Tick.

Parameters:
tick - Tick

setMinorTick

public void setMinorTick(Tick tick)
Sets the minor Tick.

Parameters:
tick - Tick