com.java4less.rchart
Class JiChartBean

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.java4less.rchart.JiChartBean
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JiChartBean
extends javax.swing.JPanel
implements java.awt.event.AdjustmentListener, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.io.Serializable


You must use this class if you want to use RChart with zoom and scroll in a Swing application since JiChartBean is a subclass of JPanel.
The difference between JiChartBean and JChartBean is that the first implements scroll and zoom.
Example:

// create chart object ...

JChartBean jc=new JChartBean();
jc.setChart(chart);
chart.virtualHeight=800;
chart.virtualWidth=1200;

JiChartBean jic=new JiChartBean(jc,true);
YourJPanel.add("Center",jic);

Or if you want to use the chart loader:

JChartBean jc=new JChartBean();
jc.getChartLoader().loadFromFile(dataFile,true);
jc.buildChart();
jc.getChart().virtualHeight=800;
jc.getChart().virtualWidth=1200;

JiChartBean jic=new JiChartBean(jc,true);
YourJPanel.add("Center",jic);

See Also:
Serialized Form

Inner Class Summary
 class JiChartBean.southPanel
           
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 boolean allowZoom
          if TRUE the +/- zoom buttons will be made visible.
 JChartBean chartBean
           
 int currentZoom
           
 int maxZoom
          maximum zoom in %.
 javax.swing.JButton minusZoom
           
 int minZoom
          minimum zoom in %.
 javax.swing.JButton plusZoom
           
 javax.swing.JLabel zoom
           
 int zoomIncrement
          zoom increment in % for the +/- buttons.
 JiChartBean.southPanel zoomPanel
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
JiChartBean()
           
JiChartBean(JChartBean jcb, boolean aZoom)
          create an interactive chart with the chart c.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 java.lang.String getDataFile()
          chart definition file
 int getIncrementZoom(int m)
          get zoom increment
 int getMaxZoom(int m)
          get maximum zoom
 int getMinZoom(int m)
          get minimum zoom
 java.lang.String getName()
           
 java.awt.Dimension getPreferredSize()
          preferred size
 int getVirtualHeight()
          chart size
 int getVirtualWidth()
          chart size
 void init()
          you must call this method after the doLayout() method of the container where you put iChart.
 void setDataFile(java.lang.String d)
          set chart definition file and load it automatically
 void setIncrementZoom(int m)
          set zoom increment
 void setMaxZoom(int m)
          set maximum zoom
 void setMinZoom(int m)
          set minimum zoom
 void setParameter(java.lang.String param, java.lang.String val)
          set parameter
 void setVirtualHeight(int h)
          chart size
 void setVirtualWidth(int w)
          chart size
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, updateUI
 
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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

chartBean

public JChartBean chartBean

allowZoom

public boolean allowZoom
if TRUE the +/- zoom buttons will be made visible.

maxZoom

public int maxZoom
maximum zoom in %. The default is 300.

minZoom

public int minZoom
minimum zoom in %. The default is 50.

currentZoom

public int currentZoom

zoomIncrement

public int zoomIncrement
zoom increment in % for the +/- buttons. The default is 25.

plusZoom

public javax.swing.JButton plusZoom

minusZoom

public javax.swing.JButton minusZoom

zoom

public javax.swing.JLabel zoom

zoomPanel

public JiChartBean.southPanel zoomPanel
Constructor Detail

JiChartBean

public JiChartBean()

JiChartBean

public JiChartBean(JChartBean jcb,
                   boolean aZoom)
create an interactive chart with the chart c. If aZoom is true, the zoom will be activated.
Method Detail

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

init

public void init()
you must call this method after the doLayout() method of the container where you put iChart.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener

setParameter

public void setParameter(java.lang.String param,
                         java.lang.String val)
set parameter

getName

public java.lang.String getName()
Overrides:
getName in class java.awt.Component

getDataFile

public java.lang.String getDataFile()
chart definition file

setMaxZoom

public void setMaxZoom(int m)
set maximum zoom

setMinZoom

public void setMinZoom(int m)
set minimum zoom

setIncrementZoom

public void setIncrementZoom(int m)
set zoom increment

getMaxZoom

public int getMaxZoom(int m)
get maximum zoom

getMinZoom

public int getMinZoom(int m)
get minimum zoom

getIncrementZoom

public int getIncrementZoom(int m)
get zoom increment

setDataFile

public void setDataFile(java.lang.String d)
set chart definition file and load it automatically

getPreferredSize

public java.awt.Dimension getPreferredSize()
preferred size
Overrides:
getPreferredSize in class javax.swing.JComponent

setVirtualWidth

public void setVirtualWidth(int w)
chart size

setVirtualHeight

public void setVirtualHeight(int h)
chart size

getVirtualWidth

public int getVirtualWidth()
chart size

getVirtualHeight

public int getVirtualHeight()
chart size