insensa.view.image.map
Class AbstractInfoReaderImageMap

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by insensa.view.image.map.AbstractInfoReaderImageMap
All Implemented Interfaces:
IImageView, IInfoReaderImageView, ImageComponent, IImageMap, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
ImageMapBreaks

public abstract class AbstractInfoReaderImageMap
extends javax.swing.JComponent
implements IInfoReaderImageView, IImageMap

See Also:
Serialized Form

Nested Class Summary
 class AbstractInfoReaderImageMap.GetPointInformationListener
           
 class AbstractInfoReaderImageMap.MouseHoverListener
           
 class AbstractInfoReaderImageMap.MouseOnImage
           
 class AbstractInfoReaderImageMap.OpenSettingsActionListener
           
 class AbstractInfoReaderImageMap.SaveImageActionListener
           
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.util.List<java.awt.Color> colorList
           
protected  float endColor
           
protected  java.awt.image.BufferedImage image
           
protected  ImageMapPopup imageMapPopup
           
protected  boolean invert
           
protected  InfoReader iReader
           
protected  ILegendComponent legend
           
protected  java.awt.image.BufferedImage origImage
           
protected  ImageFrame parent
           
protected  javax.swing.JProgressBar progressBar
           
protected  java.util.List<ClassificationRange> rangeList
           
protected  CRasterFileInformation rasterFile
           
private static long serialVersionUID
           
protected  float startColor
           
protected  java.lang.String title
           
protected  CView view
           
 
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
AbstractInfoReaderImageMap()
           
 
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
protected  java.awt.Dimension calcOptimalSize(java.awt.Dimension img, java.awt.Dimension comp)
           
 java.awt.image.BufferedImage createNewImage(java.awt.Dimension dim)
           
 ImageComponent[] getChildComponents()
          This method will be used by the ImageFrame to put Components in separate Layers.
 java.util.List<java.awt.Color> getColorList()
           
 IColorListGenerator getColorListGenerator()
           
 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()
           
 java.awt.image.BufferedImage getImage()
           
 ImageFrame getImageFrame()
           
 InfoReader getInfoReader()
           
 ILegendComponent getLegend()
           
 java.util.List<ClassificationRange> getRangeList()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent event)
           
 void imagePopupFunction(java.awt.event.MouseEvent e, ImageComponent iComp)
           
 void initImage(java.awt.Dimension componentDim)
          This method will be executed by the Controller.
 boolean isInvert()
           
 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().
protected  void paintComponent(java.awt.Graphics g)
           
 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 dim)
          Gets called whenever the ImageFrame is resizing.
 void saveImage(java.lang.String outputFileName, java.awt.Dimension dim)
           
 void saveLegend(java.lang.String outputFileName, java.awt.Dimension dim)
           
 void scaleImage(int width, int height)
           
 void setColorList(java.util.List<java.awt.Color> colorList)
           
 void setCView(CView view)
          Reference to the CView
protected  void setImage(java.awt.image.BufferedImage image)
           
 void setImageFrame(ImageFrame parent)
          Reference to the ImageFrame
 void setInvert(boolean invert)
           
 void setLegend(ILegendComponent legend)
           
 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 javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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
 
Methods inherited from interface insensa.view.image.map.IImageMap
createRangeList, getImageMapSettings
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

view

protected CView view

iReader

protected InfoReader iReader

image

protected java.awt.image.BufferedImage image

origImage

protected java.awt.image.BufferedImage origImage

title

protected java.lang.String title

legend

protected ILegendComponent legend

colorList

protected java.util.List<java.awt.Color> colorList

rangeList

protected java.util.List<ClassificationRange> rangeList

rasterFile

protected CRasterFileInformation rasterFile

invert

protected boolean invert

progressBar

protected javax.swing.JProgressBar progressBar

startColor

protected float startColor

endColor

protected float endColor

imageMapPopup

protected ImageMapPopup imageMapPopup

parent

protected ImageFrame parent
Constructor Detail

AbstractInfoReaderImageMap

public AbstractInfoReaderImageMap()
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)

calcOptimalSize

protected java.awt.Dimension calcOptimalSize(java.awt.Dimension img,
                                             java.awt.Dimension comp)
Parameters:
img -
comp -
Returns:

createNewImage

public java.awt.image.BufferedImage createNewImage(java.awt.Dimension dim)
                                            throws java.io.IOException
Specified by:
createNewImage in interface ImageComponent
Returns:
Throws:
java.io.IOException
See Also:
ImageComponent.createNewImage(java.awt.Dimension)

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()

getInfoReader

public InfoReader getInfoReader()
Specified by:
getInfoReader in interface IImageMap
Returns:
See Also:
IImageMap.getInfoReader()

getColorList

public java.util.List<java.awt.Color> getColorList()
Specified by:
getColorList in interface IImageMap
Returns:
See Also:
IImageMap.getColorList()

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
Specified by:
getComponent in interface ImageComponent
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()

getImage

public java.awt.image.BufferedImage getImage()
Specified by:
getImage in interface ImageComponent
Returns:
See Also:
ImageComponent.getImage()

getImageFrame

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

getLegend

public ILegendComponent getLegend()
Specified by:
getLegend in interface IImageMap
Returns:
See Also:
IImageMap.getLegend()

getRangeList

public java.util.List<ClassificationRange> getRangeList()
Specified by:
getRangeList in interface IImageMap
Returns:
See Also:
IImageMap.getRangeList()

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent event)
Overrides:
getToolTipText in class javax.swing.JComponent
See Also:
JComponent.getToolTipText(java.awt.event.MouseEvent)

imagePopupFunction

public void imagePopupFunction(java.awt.event.MouseEvent e,
                               ImageComponent iComp)
                        throws java.io.IOException
Parameters:
e -
iComp -
Throws:
java.io.IOException

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)

isInvert

public boolean isInvert()
Specified by:
isInvert in interface IImageMap
Returns:
See Also:
IImageMap.isInvert()

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)

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent
See Also:
JComponent.paintComponent(java.awt.Graphics)

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
Specified by:
refresh in interface ImageComponent
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 dim)
                 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
Specified by:
resizeImage in interface ImageComponent
Parameters:
dim - The inner dimension of the ImageFrame
Throws:
java.io.IOException
See Also:
IImageView.resizeImage(java.awt.Dimension)

saveImage

public void saveImage(java.lang.String outputFileName,
                      java.awt.Dimension dim)
               throws java.io.IOException
Parameters:
outputFileName -
dim -
Throws:
java.io.IOException

saveLegend

public void saveLegend(java.lang.String outputFileName,
                       java.awt.Dimension dim)
                throws java.io.IOException
Parameters:
outputFileName -
dim -
Throws:
java.io.IOException

scaleImage

public void scaleImage(int width,
                       int height)
Parameters:
width -
height -

setColorList

public void setColorList(java.util.List<java.awt.Color> colorList)
Specified by:
setColorList in interface IImageMap
See Also:
IImageMap.setColorList(java.util.List)

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)

setImage

protected void setImage(java.awt.image.BufferedImage image)
Parameters:
image -

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)

setInvert

public void setInvert(boolean invert)
Specified by:
setInvert in interface IImageMap
See Also:
IImageMap.setInvert(boolean)

setLegend

public void setLegend(ILegendComponent legend)
Parameters:
legend -

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)

getColorListGenerator

public IColorListGenerator getColorListGenerator()
Specified by:
getColorListGenerator in interface IImageMap
Returns:
See Also:
IImageMap.getColorListGenerator()