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:
ImageObserver, MenuContainer, Serializable, Runnable, Accessible, IControl, ITableControl, ITranslatable

public class JVxChart
extends JPanel
implements ITableControl, Runnable

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

See Also:
Serialized Form

Nested Class Summary
static class JVxChart.DataBookXYDataset
          This class provides an AbstractIntervalXYDataset implementation for a DataBook.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int STYLE_AREA
          Style constant for showing bars.
static int STYLE_BARS
          Style constant for showing bars.
static int STYLE_LINES
          Style constant for showing bars.
 
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 an editor.
 
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.
 String getTitle()
          Gets the title.
 TranslationMap getTranslation()
          Gets the translation mapping for this table.
 String getTranslation(String pText)
          Gets the translation.
 String getXAxisTitle()
          Gets the x axis title.
 String getXColumnName()
          Gets the x column name.
 String getYAxisTitle()
          Gets the y axis title.
 String[] getYColumnNames()
          Gets the y column names.
 void notifyRepaint()
          The control need to check if the part is visible and then repaint the part.
 void run()
          The run method is invoked from AWT EventQueue.
 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(String pTitle)
          Sets the title.
 void setTranslation(TranslationMap pTranslation)
          Sets the translation mapping for this table.
 void setXAxisTitle(String pXAxisTitle)
          Sets the x axis title.
 void setXColumnName(String pXColumnName)
          Sets the x column name.
 void setYAxisTitle(String pYAxisTitle)
          Sets the y axis title.
 void setYColumnNames(String[] pYColumnNames)
          Sets the y column names.
 void startEditing()
          Informs the GUI control, that the editor should be opened.
 
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 bars.

See Also:
Constant Field Values

STYLE_AREA

public static final int STYLE_AREA
Style constant for showing bars.

See Also:
Constant Field Values

STYLE_BARS

public static final int STYLE_BARS
Style constant for showing bars.

See Also:
Constant Field Values
Constructor Detail

JVxChart

public JVxChart()
Constructs an editor.

Method Detail

notifyRepaint

public void notifyRepaint()
The control need to check if the part is visible and then repaint the part.

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 translation mapping for this table.

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

getTranslation

public TranslationMap getTranslation()
Gets the translation mapping for this table.

Specified by:
getTranslation in interface ITranslatable
Returns:
the current translation mapping or null if there is no translation mapping

run

public void run()
The run method is invoked from AWT EventQueue. It enables events from the model again. Due to performance reasons the events are disabled from the first call of notifyRepaint until the EventQueue calls the run method. This minimizes the repaints of the control.

Specified by:
run in interface 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 String getTitle()
Gets the title.

Returns:
the title.

setTitle

public void setTitle(String pTitle)
Sets the title.

Parameters:
pTitle - the title.

getXAxisTitle

public String getXAxisTitle()
Gets the x axis title.

Returns:
the x axis title.

setXAxisTitle

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

Parameters:
pXAxisTitle - the x axis title.

getYAxisTitle

public String getYAxisTitle()
Gets the y axis title.

Returns:
the y axis title.

setYAxisTitle

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

Parameters:
pYAxisTitle - the y axis title.

getXColumnName

public String getXColumnName()
Gets the x column name.

Returns:
the x column name.

setXColumnName

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

Parameters:
pXColumnName - the x column name.

getYColumnNames

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

Returns:
the y column names.

setYColumnNames

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

Parameters:
pYColumnNames - y column names.

getTranslation

public String getTranslation(String pText)
Gets the translation.

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.