LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing
Class LySwingFreeChart

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.win.swing.LySwingObject
          extended by leon.view.win.swing.LySwingFieldItem
              extended by leon.view.win.swing.LySwingPanel
                  extended by leon.view.win.swing.LySwingFreeChart
All Implemented Interfaces:
java.awt.image.ImageObserver, LyEventTransmitter, LyGetChartConverterInterface, LyPrintInterface, LyGraphicalChart, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetPopupMenuInterface, LySwingComponent

public class LySwingFreeChart
extends LySwingPanel
implements LySwingComponent, LyGraphicalChart, LyPrintInterface, LyGetChartConverterInterface, java.awt.image.ImageObserver

This class implements the Chart object (as described in the dtd) for swing viewer using JFreeChart components.

See Also:
LyChartConverter, JFreeChart

Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LySwingFreeChart(LyChart chart)
          Class constructor of a chart object for the Swing target.
 
Method Summary
 void addColumn(LyColumn column, int pos)
          Inserts a sub-component column at given position.
 void free()
          (non-Javadoc).
 LyChartConverter getChartConverter()
          Retreives the chart Converter.
 java.awt.Component getComponent()
          (non-Javadoc).
 int[] getComponentDimension()
          Get the dimension of the component used to represent the chart.
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
          Always updates the current chart image if requested.
 void print(LyPrintListenerInterface listener)
          Prints the content of the chart on a printer output.
 void printEnd(java.awt.PrintJob job, LyChart canvas, LyPrintListenerInterface listener)
          Prints the content of the given chart on the specified print job.
 void removeColumn(LyColumn column)
          Removes a sub-component column.
 
Methods inherited from class leon.view.win.swing.LySwingPanel
setPopupMenu
 
Methods inherited from class leon.view.win.swing.LySwingFieldItem
getActionTransmitter, getSelectionTransmitter
 
Methods inherited from class leon.view.win.swing.LySwingObject
getBounds, getChildrenBounds, getDefaultFrame
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getController, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LySwingFreeChart

public LySwingFreeChart(LyChart chart)
Class constructor of a chart object for the Swing target.

Parameters:
chart - a CHART component defined for every type of view targets created by LyChartController. The chart component is initialized and created from a chart converter for JFreeChart.
See Also:
LyChartController
Method Detail

print

public void print(LyPrintListenerInterface listener)
Prints the content of the chart on a printer output.

Specified by:
print in interface LyPrintInterface
Parameters:
listener - the listener of this chart
See Also:
LyPrintInterface.print(LyPrintListenerInterface)

printEnd

public void printEnd(java.awt.PrintJob job,
                     LyChart canvas,
                     LyPrintListenerInterface listener)
Prints the content of the given chart on the specified print job. The resulting image is printed on one page if a printer listener is given, then the JFreeChart is modified with the corresponding image.

Parameters:
job - printer handler
canvas - the component to print
listener - the listener of this chart

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
Always updates the current chart image if requested. None of the given parameters are used.

Specified by:
imageUpdate in interface java.awt.image.ImageObserver
Parameters:
img - the image being observed
infoflags - the bitwise inclusive OR of the following flags:
  • ImageObserver.WIDTH
  • ImageObserver.HEIGHT
  • ImageObserver.PROPERTIES
  • ImageObserver.SOMEBITS
  • ImageObserver.FRAMEBITS
  • ImageObserver.ALLBITS
  • ImageObserver.ERROR
  • ImageObserver.ABORT
x - the x coordinate
y - the y coordinate
width - the width
height - the height
Returns:
true
See Also:
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)

free

public void free()
(non-Javadoc).

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyGraphicalObject
See Also:
LyFreeInterface.free()

addColumn

public void addColumn(LyColumn column,
                      int pos)
Inserts a sub-component column at given position.

This method is not implemented and don't do anything.

Specified by:
addColumn in interface LyGraphicalChart
Parameters:
column - the column to add to columns list
pos - the position where the sub-component is inserted

removeColumn

public void removeColumn(LyColumn column)
Removes a sub-component column.

This method is not implemented and don't do anything.

Specified by:
removeColumn in interface LyGraphicalChart
Parameters:
column - the column to remove to columns list

getComponent

public java.awt.Component getComponent()
(non-Javadoc).

Specified by:
getComponent in interface LySwingComponent
Overrides:
getComponent in class LySwingObject
Returns:
this Swing view component
See Also:
LySwingComponent.getComponent()

getChartConverter

public LyChartConverter getChartConverter()
Retreives the chart Converter.

Specified by:
getChartConverter in interface LyGetChartConverterInterface
Returns:
the chart Converter
See Also:
LyGetChartConverterInterface.getChartConverter()

getComponentDimension

public int[] getComponentDimension()
Get the dimension of the component used to represent the chart.

Specified by:
getComponentDimension in interface LyGetChartConverterInterface
Returns:
an array of two integers (width and height of the component).

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com