com.sibvisions.rad.ui.swing.ext
Class JVxChart

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.sibvisions.rad.ui.swing.ext.JVxChart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, javax.accessibility.Accessible, IControl, ITableControl, ITranslatable, ITranslator

public class JVxChart
extends javax.swing.JPanel
implements ITableControl, java.lang.Runnable

The JVxChart is a simple chart panel which also implements the ITableControl interface.

See Also:
Serialized Form

Nested Class Summary
static class JVxChart.DataBookCategoryDataset
          The JVxChart.DataBookCategoryDataset extends the DefaultCategoryDataset and provides data from an IDataBook.
static class JVxChart.DataBookXYDataset
          This class provides an AbstractIntervalXYDataset implementation for a DataBook.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int STYLE_AREA
          Style constant for showing an area chart.
static int STYLE_BARS
          Style constant for showing a bar chart.
static int STYLE_LINES
          Style constant for showing a line chart.
static int STYLE_PIE
          Style constant for showing a pie chart.
 
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.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
JVxChart()
          Constructs a JVxChart.
 
Method Summary
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
 ChartPanel getChartPanel()
          Gets the ChartPanel displayed, or null if non is displayed.
 int getChartStyle()
          Gets the style of the chart.
 IDataBook getDataBook()
          Gets the DataBook shown by this control.
 java.lang.String getTitle()
          Gets the title.
 TranslationMap getTranslation()
          Gets the possible translation mapping.
 java.lang.String getXAxisTitle()
          Gets the x axis title.
 java.lang.String getXColumnName()
          Gets the x column name.
 java.lang.String getYAxisTitle()
          Gets the y axis title.
 java.lang.String[] getYColumnNames()
          Gets the y column names.
 boolean isTranslationEnabled()
          Gets whether the translation is en- or disabled.
 void notifyRepaint()
          The control need to check if the part is visible and then repaint the part.
 void run()
          
 void saveEditing()
          Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.
 void setChartStyle(int pChartStyle)
          Sets the style of the chart.
 void setDataBook(IDataBook pDataBook)
          Sets the DataBook shown by this control.
 void setTitle(java.lang.String pTitle)
          Sets the title.
 void setTranslation(TranslationMap pTranslation)
          Sets the possible translations.
 void setTranslationEnabled(boolean pEnabled)
          Sets the translation en- or disabled.
 void setXAxisTitle(java.lang.String pXAxisTitle)
          Sets the x axis title.
 void setXColumnName(java.lang.String pXColumnName)
          Sets the x column name.
 void setYAxisTitle(java.lang.String pYAxisTitle)
          Sets the y axis title.
 void setYColumnNames(java.lang.String[] pYColumnNames)
          Sets the y column names.
 void startEditing()
          Informs the GUI control, that the editor should be opened.
 java.lang.String translate(java.lang.String pText)
          Gets the translation.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, 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

STYLE_LINES

public static final int STYLE_LINES
Style constant for showing a line chart.

See Also:
Constant Field Values

STYLE_AREA

public static final int STYLE_AREA
Style constant for showing an area chart.

See Also:
Constant Field Values

STYLE_BARS

public static final int STYLE_BARS
Style constant for showing a bar chart.

See Also:
Constant Field Values

STYLE_PIE

public static final int STYLE_PIE
Style constant for showing a pie chart.

See Also:
Constant Field Values
Constructor Detail

JVxChart

public JVxChart()
Constructs a JVxChart.

Method Detail

notifyRepaint

public void notifyRepaint()
The control need to check if the part is visible and then repaint the part. Notify repaint is called on every change. The IControl has to catch the change, and return immediate. The change analysis and display has to be done with invoke later by the control.

Specified by:
notifyRepaint in interface IControl

startEditing

public void startEditing()
Informs the GUI control, that the editor should be opened.

Specified by:
startEditing in interface ITableControl

cancelEditing

public void cancelEditing()
Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.

Specified by:
cancelEditing in interface IControl

saveEditing

public void saveEditing()
                 throws ModelException
Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.

Specified by:
saveEditing in interface IControl
Throws:
ModelException - if the value can not be stored.

setTranslation

public void setTranslation(TranslationMap pTranslation)
Sets the possible translations.

Specified by:
setTranslation in interface ITranslatable
Parameters:
pTranslation - the translation mapping

getTranslation

public TranslationMap getTranslation()
Gets the possible translation mapping.

Specified by:
getTranslation in interface ITranslatable
Returns:
the translation mapping

setTranslationEnabled

public void setTranslationEnabled(boolean pEnabled)
Sets the translation en- or disabled.

Specified by:
setTranslationEnabled in interface ITranslatable
Parameters:
pEnabled - true to enable the translation, false to disable

isTranslationEnabled

public boolean isTranslationEnabled()
Gets whether the translation is en- or disabled.

Specified by:
isTranslationEnabled in interface ITranslatable
Returns:
true if translation is performed, false otherwise

run

public void run()

Specified by:
run in interface java.lang.Runnable

getDataBook

public IDataBook getDataBook()
Gets the DataBook shown by this control.

Specified by:
getDataBook in interface ITableControl
Returns:
the DataBook.
See Also:
setDataBook(javax.rad.model.IDataBook)

setDataBook

public void setDataBook(IDataBook pDataBook)
Sets the DataBook shown by this control.

Specified by:
setDataBook in interface ITableControl
Parameters:
pDataBook - the DataBook.
See Also:
getDataBook()

getChartStyle

public int getChartStyle()
Gets the style of the chart.

Returns:
the chart style (STYLE_LINES, STYLE_AREA, STYLE_BARS).

setChartStyle

public void setChartStyle(int pChartStyle)
Sets the style of the chart.

Parameters:
pChartStyle - the chart style (STYLE_LINES, STYLE_AREA, STYLE_BARS).

getTitle

public java.lang.String getTitle()
Gets the title.

Returns:
the title.

setTitle

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

Parameters:
pTitle - the title.

getXAxisTitle

public java.lang.String getXAxisTitle()
Gets the x axis title.

Returns:
the x axis title.

setXAxisTitle

public void setXAxisTitle(java.lang.String pXAxisTitle)
Sets the x axis title.

Parameters:
pXAxisTitle - the x axis title.

getYAxisTitle

public java.lang.String getYAxisTitle()
Gets the y axis title.

Returns:
the y axis title.

setYAxisTitle

public void setYAxisTitle(java.lang.String pYAxisTitle)
Sets the y axis title.

Parameters:
pYAxisTitle - the y axis title.

getXColumnName

public java.lang.String getXColumnName()
Gets the x column name.

Returns:
the x column name.

setXColumnName

public void setXColumnName(java.lang.String pXColumnName)
Sets the x column name.

Parameters:
pXColumnName - the x column name.

getYColumnNames

public java.lang.String[] getYColumnNames()
Gets the y column names.

Returns:
the y column names.

setYColumnNames

public void setYColumnNames(java.lang.String[] pYColumnNames)
Sets the y column names.

Parameters:
pYColumnNames - y column names.

translate

public java.lang.String translate(java.lang.String pText)
Gets the translation.

Specified by:
translate in interface ITranslator
Parameters:
pText - the text.
Returns:
the translation.

getChartPanel

public ChartPanel getChartPanel()
Gets the ChartPanel displayed, or null if non is displayed.

Returns:
the ChartPanel.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.