ElegantJCharts Java API Specification v2.0

com.elegantj.graphx
Class GraphEx

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.elegantj.data.comp.panel.DataPanel
                                |
                                +--com.elegantj.graphx.GraphEx
All Implemented Interfaces:
javax.accessibility.Accessible, java.lang.Cloneable, com.elegantj.data.comp.DatabaseColumn, java.io.Externalizable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class GraphEx
extends com.elegantj.data.comp.panel.DataPanel

This class acts as a container for Graph

See Also:
Serialized Form

Field Summary
static int AREA_GRAPH
          Area Graph Type
static int BAR_GRAPH
          Bar Graph Type
static int BUBBLE_GRAPH
          Bubble Graph Type
static int COMBINED_GRAPH
          Combined Graph Type
static int DOUGHNUT_GRAPH
          Doughnut Graph Type
static java.lang.String[] GRAPH_SUBTYPE_NAMES
           
static int[] GRAPH_SUBTYPES
           
static java.lang.String[] GRAPH_TYPE_NAMES
          Specifies the Graph Type Display values
static int[] GRAPH_TYPES
           
static int HISTOGRAM_GRAPH
          Histogram Graph Type
static int LINE_GRAPH
          Line Graph Type
static int PIE_GRAPH
          Pie Graph Type
static int RADAR_GRAPH
          Radar Graph Type
static java.util.ResourceBundle RESOURCE_BUNDLE
          Specifies the resource bundle
static int STOCK_GRAPH
          Stock Graph Type
static int XYSCATTER_GRAPH
          XYScatter Graph Type
 
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
GraphEx()
           
 
Method Summary
 void addContainerListener(java.awt.event.ContainerListener l)
          Adds the specified container listener to receive container events from this container.
 void addMouseListener(java.awt.event.MouseListener l)
          Adds the specified mouse listener to receive mouse events from this component.
 java.lang.Object clone()
          Clone of the object
protected  void doGraphChanged(int graph)
          This method sets the graph as the selected graphtype from menuitem or combobox
static int getBasicGraphType(int type)
          Converts the basic graph type related to sub type
 GraphPanel getGraph()
          Gets the Graph Object
 java.util.Vector getGraphData()
          Gets the graph data
 java.awt.image.BufferedImage getGraphImage()
          Get graph image
static int getGraphIndex(java.lang.String graphName)
           
 GraphPanel getGraphObject(int type)
          This method retrieves the graph object.
 int getGraphSubType()
          Gets the Graph sub type
static java.util.Vector getGraphSubTypes(int graphBasicType)
           
static java.util.Vector getGraphSubTypesName(int graphBasicType)
           
 int getGraphType()
          Gets the Graph Type
static int getGraphType(java.lang.String graphName)
           
static java.lang.String getImageName(java.lang.String graphName)
           
protected  java.awt.Rectangle getScaledSize(java.awt.Graphics g, java.awt.Rectangle rect, boolean visible)
           
static java.lang.String getTempletName(java.lang.String graphName)
           
protected  java.awt.Rectangle getVisibleGraphRect()
          Returns the Visible rectangle of the component
 void init()
           
 boolean isDrillDownGraph()
          Get given graph is drill down graph or not
static GraphPanel loadFromXML(java.io.File xmlFile)
          Read Xml sheet to graph properties
static GraphPanel loadFromXML(java.lang.String xmlFile)
          Read Xml sheet to graph properties
 void paint(java.awt.Graphics g)
          paints graph according to properties and data of graph.
 void paintEx(java.awt.Graphics g)
          Paints graph according to properties and data of graph.
 void populateGraph()
          populate graph
 void readExternal(java.io.ObjectInput in)
          This method retrieves the state of the bean
 void reDrawGraph()
           
 void setBackground(java.awt.Color c)
          Sets the Background color.
 void setBounds(int x, int y, int width, int height)
           
 void setBounds(java.awt.Rectangle r)
           
 void setDefaultProperties()
          Set default properties to Graph
 void setDrillDownGraph(boolean isDrillDownGraph)
          Set given graph as drill down graph
 void setFont(java.awt.Font f)
          Sets the Font.
 void setForeground(java.awt.Color c)
          Sets the Foreground color.
 boolean setGraph(boolean isSetProperty)
          draw Graph with default properties
 void setGraph(GraphPanel graph)
           
 void setGraphData(java.util.Vector graphData)
          Sets the graph data
 void setGraphImage(java.awt.Image image)
          Set graph image If graph image is specified then paint image if graph image is null then normal painting of graph is called
 void setGraphSubType(int type)
          Sets the Graph sub type
 void setGraphType(int type)
          Sets the Graph Type
 void setLegendAreaWidth(java.util.Vector data)
          Set Legend Area width to maximum Data String Width
 void setPrinting(boolean bPrinting)
           
 void writeExternal(java.io.ObjectOutput out)
          This method saves the state of the bean
 
Methods inherited from class com.elegantj.data.comp.panel.DataPanel
clone, getBandName, getColumnName, getColumnNo, getDataValue, getDisplayValue, getPattern, getPatternColor, isColumnField, isLayered, setBandName, setBorder, setColumnName, setColumnNo, setDataValue, setDisplayValue, setLayered, setOpaque, setPattern, setPatternColor
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, 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, 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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_BUNDLE

public static final transient java.util.ResourceBundle RESOURCE_BUNDLE
Specifies the resource bundle


BAR_GRAPH

public static final int BAR_GRAPH
Bar Graph Type

See Also:
Constant Field Values

LINE_GRAPH

public static final int LINE_GRAPH
Line Graph Type

See Also:
Constant Field Values

AREA_GRAPH

public static final int AREA_GRAPH
Area Graph Type

See Also:
Constant Field Values

PIE_GRAPH

public static final int PIE_GRAPH
Pie Graph Type

See Also:
Constant Field Values

RADAR_GRAPH

public static final int RADAR_GRAPH
Radar Graph Type

See Also:
Constant Field Values

COMBINED_GRAPH

public static final int COMBINED_GRAPH
Combined Graph Type

See Also:
Constant Field Values

HISTOGRAM_GRAPH

public static final int HISTOGRAM_GRAPH
Histogram Graph Type

See Also:
Constant Field Values

XYSCATTER_GRAPH

public static final int XYSCATTER_GRAPH
XYScatter Graph Type

See Also:
Constant Field Values

BUBBLE_GRAPH

public static final int BUBBLE_GRAPH
Bubble Graph Type

See Also:
Constant Field Values

STOCK_GRAPH

public static final int STOCK_GRAPH
Stock Graph Type

See Also:
Constant Field Values

DOUGHNUT_GRAPH

public static final int DOUGHNUT_GRAPH
Doughnut Graph Type

See Also:
Constant Field Values

GRAPH_TYPES

public static final int[] GRAPH_TYPES

GRAPH_TYPE_NAMES

public static final java.lang.String[] GRAPH_TYPE_NAMES
Specifies the Graph Type Display values


GRAPH_SUBTYPES

public static final int[] GRAPH_SUBTYPES

GRAPH_SUBTYPE_NAMES

public static final java.lang.String[] GRAPH_SUBTYPE_NAMES
Constructor Detail

GraphEx

public GraphEx()
Method Detail

init

public void init()

setGraph

public void setGraph(GraphPanel graph)

getGraph

public GraphPanel getGraph()
Gets the Graph Object


setGraphType

public void setGraphType(int type)
Sets the Graph Type


getGraphType

public int getGraphType()
Gets the Graph Type


setGraphSubType

public void setGraphSubType(int type)
Sets the Graph sub type


getGraphSubType

public int getGraphSubType()
Gets the Graph sub type


getBasicGraphType

public static int getBasicGraphType(int type)
Converts the basic graph type related to sub type


setGraphData

public void setGraphData(java.util.Vector graphData)
Sets the graph data

Parameters:
graphData - the double dimensional vector containing the graph data, first element of the vector should be column names

getGraphData

public java.util.Vector getGraphData()
Gets the graph data

Returns:
the double dimensional vector containing the graph data

getGraphObject

public GraphPanel getGraphObject(int type)
This method retrieves the graph object. GraphPanel is another class.

Parameters:
type -
Returns:
GraphPanel

reDrawGraph

public void reDrawGraph()

setGraph

public boolean setGraph(boolean isSetProperty)
draw Graph with default properties

Parameters:
isSetProperty - true for set Default properties otherwize false
Returns:
boolean true - if Graph drawn without any problem, false - otherwise

setLegendAreaWidth

public void setLegendAreaWidth(java.util.Vector data)
Set Legend Area width to maximum Data String Width


populateGraph

public void populateGraph()
populate graph


doGraphChanged

protected void doGraphChanged(int graph)
This method sets the graph as the selected graphtype from menuitem or combobox


setDefaultProperties

public void setDefaultProperties()
Set default properties to Graph


setBackground

public void setBackground(java.awt.Color c)
Sets the Background color.

Overrides:
setBackground in class com.elegantj.data.comp.panel.DataPanel

setForeground

public void setForeground(java.awt.Color c)
Sets the Foreground color.

Overrides:
setForeground in class javax.swing.JComponent

setFont

public void setFont(java.awt.Font f)
Sets the Font.

Overrides:
setFont in class javax.swing.JComponent

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.

Overrides:
addMouseListener in class java.awt.Component
Parameters:
l - the mouse listener

addContainerListener

public void addContainerListener(java.awt.event.ContainerListener l)
Adds the specified container listener to receive container events from this container.

Overrides:
addContainerListener in class java.awt.Container
Parameters:
l - the container listener

setGraphImage

public void setGraphImage(java.awt.Image image)
Set graph image If graph image is specified then paint image if graph image is null then normal painting of graph is called

Parameters:
image - the graph image

getGraphImage

public java.awt.image.BufferedImage getGraphImage()
Get graph image

Returns:
Image the graph image

setDrillDownGraph

public void setDrillDownGraph(boolean isDrillDownGraph)
Set given graph as drill down graph

Parameters:
isDrillDownGraph - true - if drill down graph; false - otherwise

isDrillDownGraph

public boolean isDrillDownGraph()
Get given graph is drill down graph or not

Returns:
boolean true - if drill down graph; false - otherwise

paint

public void paint(java.awt.Graphics g)
paints graph according to properties and data of graph.

Overrides:
paint in class com.elegantj.data.comp.panel.DataPanel

paintEx

public void paintEx(java.awt.Graphics g)
Paints graph according to properties and data of graph.


getScaledSize

protected java.awt.Rectangle getScaledSize(java.awt.Graphics g,
                                           java.awt.Rectangle rect,
                                           boolean visible)
Parameters:
g - Instance of Graphics
rect - Visible rect
visible - Wheather Graph is Fit into Visible Size
Returns:
rectangle Scaled Rectangle

getVisibleGraphRect

protected java.awt.Rectangle getVisibleGraphRect()
Returns the Visible rectangle of the component

Returns:
the rectangle contains the paint boundary of the component

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Overrides:
setBounds in class java.awt.Component

setBounds

public void setBounds(java.awt.Rectangle r)
Overrides:
setBounds in class java.awt.Component

setPrinting

public void setPrinting(boolean bPrinting)

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
This method retrieves the state of the bean

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class com.elegantj.data.comp.panel.DataPanel
java.lang.ClassNotFoundException
java.io.IOException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
This method saves the state of the bean

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class com.elegantj.data.comp.panel.DataPanel
java.io.IOException

clone

public java.lang.Object clone()
Clone of the object

Specified by:
clone in interface com.elegantj.data.comp.DatabaseColumn
Overrides:
clone in class com.elegantj.data.comp.panel.DataPanel
Returns:
Object

getGraphSubTypesName

public static java.util.Vector getGraphSubTypesName(int graphBasicType)

getGraphSubTypes

public static java.util.Vector getGraphSubTypes(int graphBasicType)

getImageName

public static java.lang.String getImageName(java.lang.String graphName)

getTempletName

public static java.lang.String getTempletName(java.lang.String graphName)

getGraphType

public static int getGraphType(java.lang.String graphName)

getGraphIndex

public static int getGraphIndex(java.lang.String graphName)

loadFromXML

public static GraphPanel loadFromXML(java.io.File xmlFile)
Read Xml sheet to graph properties


loadFromXML

public static GraphPanel loadFromXML(java.lang.String xmlFile)
Read Xml sheet to graph properties


ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.