insensa.view.image
Class ImageChartTestPlugin

java.lang.Object
  extended by insensa.view.image.ImageChartTestPlugin
All Implemented Interfaces:
IImageView, IInfoReaderImageView

public class ImageChartTestPlugin
extends java.lang.Object
implements IInfoReaderImageView


Nested Class Summary
 class ImageChartTestPlugin.DropInfoListener
           
(package private)  class ImageChartTestPlugin.myMouseListener
           
 
Field Summary
private  org.jfree.chart.ChartPanel chartPanel
           
private  CCountValues counts
           
(package private)  double[][] data
           
private  java.util.List<InfoReader> infoReaderList
           
(package private)  double maxCount
           
private  org.jfree.chart.plot.XYPlot plot
           
private  java.lang.String title
           
 
Constructor Summary
ImageChartTestPlugin()
           
 
Method Summary
 void addInfoReader(InfoReader iReader)
          Implement this method to check and store one incoming InfoReader
 void addInfoReader(java.util.List<InfoReader> iReader)
          Implement this method to check and store a List of incoming InfoReader
private  org.jfree.chart.JFreeChart createXYChart(org.jfree.data.xy.XYDataset dataset, java.lang.String title)
          Creates a chart.
private  org.jfree.data.xy.XYDataset createXYDataset()
           
 ImageComponent[] getChildComponents()
          This method will be used by the ImageFrame to put Components in separate Layers.
 javax.swing.JComponent getComponent()
          returns the main JComponent (parent JComponent).
 javax.swing.JComponent getDropTargetComponent()
          Return a JComponent that can be used as a target for Drop actions
 javax.swing.ImageIcon getFrameIcon()
           
 ImageFrame getImageFrame()
           
 javax.swing.JComponent getPanel()
           
 void initImage(java.awt.Dimension componentDim)
          This method will be executed by the Controller.
 void onDropObjects(java.util.List<java.lang.Object> objectList)
          This method allows to deal with Objects droped on the JComponent previsiuly defined in IImageView.getDropTargetComponent().
 void refresh(java.awt.Dimension dim)
          Gets called if the refresh button is pressed or if a refresh is necessary
 void resizeImage(java.awt.Dimension d)
          Gets called whenever the ImageFrame is resizing.
 void setCView(CView view)
          Reference to the CView
 void setImageFrame(ImageFrame parent)
          Reference to the ImageFrame
 void setTitle(java.lang.String title)
          Sets the title for this ImageFrame.
 void startView(java.awt.Dimension dim, java.awt.Dimension componentDimension)
          This is a secondary starting progress.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counts

private CCountValues counts

chartPanel

private org.jfree.chart.ChartPanel chartPanel

plot

private org.jfree.chart.plot.XYPlot plot

data

double[][] data

maxCount

double maxCount

title

private java.lang.String title

infoReaderList

private java.util.List<InfoReader> infoReaderList
Constructor Detail

ImageChartTestPlugin

public ImageChartTestPlugin()
Method Detail

addInfoReader

public void addInfoReader(InfoReader iReader)
Description copied from interface: IInfoReaderImageView
Implement this method to check and store one incoming InfoReader

Specified by:
addInfoReader in interface IInfoReaderImageView
See Also:
IInfoReaderImageView.addInfoReader(insensa.inforeader.InfoReader)

addInfoReader

public void addInfoReader(java.util.List<InfoReader> iReader)
Description copied from interface: IInfoReaderImageView
Implement this method to check and store a List of incoming InfoReader

Specified by:
addInfoReader in interface IInfoReaderImageView
See Also:
IInfoReaderImageView.addInfoReader(java.util.List)

createXYChart

private org.jfree.chart.JFreeChart createXYChart(org.jfree.data.xy.XYDataset dataset,
                                                 java.lang.String title)
Creates a chart.

Parameters:
dataset -
title -
Returns:

createXYDataset

private org.jfree.data.xy.XYDataset createXYDataset()
                                             throws java.io.IOException
Returns:
Throws:
java.io.IOException

getChildComponents

public ImageComponent[] getChildComponents()
Description copied from interface: IImageView
This method will be used by the ImageFrame to put Components in separate Layers. The Image Frame will do this automatically. The order in the array will be the same as the corresponding layer

Specified by:
getChildComponents in interface IImageView
Returns:
any child components that should be put in different layers of an ImageFrame
See Also:
IImageView.getChildComponents()

getComponent

public javax.swing.JComponent getComponent()
Description copied from interface: IImageView
returns the main JComponent (parent JComponent). (eg JPanel, JScrollPane...)

Specified by:
getComponent in interface IImageView
Returns:
the main (parent) JComponent
See Also:
IImageView.getComponent()

getDropTargetComponent

public javax.swing.JComponent getDropTargetComponent()
Description copied from interface: IImageView
Return a JComponent that can be used as a target for Drop actions

Specified by:
getDropTargetComponent in interface IImageView
Returns:
a JComponent uses as DropTarget
See Also:
IImageView.getDropTargetComponent()

getFrameIcon

public javax.swing.ImageIcon getFrameIcon()
Specified by:
getFrameIcon in interface IImageView
Returns:
Frame icon, displayed in the internal frame
See Also:
IImageView.getFrameIcon()

getImageFrame

public ImageFrame getImageFrame()
Specified by:
getImageFrame in interface IImageView
Returns:
the stored ImageFrame
See Also:
IImageView.getImageFrame()

getPanel

public javax.swing.JComponent getPanel()
Returns:

initImage

public void initImage(java.awt.Dimension componentDim)
               throws java.io.IOException
Description copied from interface: IImageView
This method will be executed by the Controller. All initial functions, e.g. Creating Component and View Components should take place here. This method should never be empty. initImage is the first method in the creation process and gets called before startView or any resizing method

Specified by:
initImage in interface IImageView
Parameters:
componentDim - the dimension of the parent ImageFrame
Throws:
java.io.IOException
See Also:
IImageView.initImage(java.awt.Dimension)

onDropObjects

public void onDropObjects(java.util.List<java.lang.Object> objectList)
                   throws java.io.IOException
Description copied from interface: IImageView
This method allows to deal with Objects droped on the JComponent previsiuly defined in IImageView.getDropTargetComponent().
For example, it could be a List of IInfoReader or CRasterFileInformation

Specified by:
onDropObjects in interface IImageView
Throws:
java.io.IOException
See Also:
IImageView.onDropObjects(java.util.List)

refresh

public void refresh(java.awt.Dimension dim)
             throws java.io.IOException
Description copied from interface: IImageView
Gets called if the refresh button is pressed or if a refresh is necessary

Specified by:
refresh in interface IImageView
Parameters:
dim - The inner dimension of the ImageFrame
Throws:
java.io.IOException
See Also:
IImageView.refresh(java.awt.Dimension)

resizeImage

public void resizeImage(java.awt.Dimension d)
                 throws java.io.IOException
Description copied from interface: IImageView
Gets called whenever the ImageFrame is resizing.

It gets also called ones after this View is placed into the ImageFrame.
(after the initImage and startView processes)

Specified by:
resizeImage in interface IImageView
Parameters:
d - The inner dimension of the ImageFrame
Throws:
java.io.IOException
See Also:
IImageView.resizeImage(java.awt.Dimension)

setCView

public void setCView(CView view)
Description copied from interface: IImageView
Reference to the CView

Specified by:
setCView in interface IImageView
See Also:
IImageView.setCView(insensa.view.CView)

setImageFrame

public void setImageFrame(ImageFrame parent)
Description copied from interface: IImageView
Reference to the ImageFrame

Specified by:
setImageFrame in interface IImageView
See Also:
IImageView.setImageFrame(insensa.view.image.ImageFrame)

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: IImageView
Sets the title for this ImageFrame.

Specified by:
setTitle in interface IImageView
See Also:
IImageView.setTitle(java.lang.String)

startView

public void startView(java.awt.Dimension dim,
                      java.awt.Dimension componentDimension)
               throws java.io.IOException
Description copied from interface: IImageView
This is a secondary starting progress. Could be useful for starting new Threads. Functions that do not need a secondary starting progress, this method can left empty. In that case you only have to use the method IImageView.initImage(Dimension)

Specified by:
startView in interface IImageView
Parameters:
dim - The Dimension of the Internal Frame
componentDimension - The Component Dimension
Throws:
java.io.IOException - IImageView.initImage(Dimension)
See Also:
IImageView.startView(java.awt.Dimension, java.awt.Dimension)