infomat.view.picture
Class SparsePartPicture

java.lang.Object
  extended by infomat.view.picture.SparsePartPicture

public class SparsePartPicture
extends java.lang.Object


Field Summary
private  javax.swing.border.MatteBorder border
           
private  java.awt.Color borderColor
           
private  int colFrom
           
private  int colTo
           
private  java.util.HashMap<java.lang.Integer,SparsePixel> columnColorMap
           
private  IObjectGroup columnGroup
           
private  int gridX
           
private  int gridY
           
private  java.awt.image.BufferedImage image
           
private  java.awt.Dimension imageDimension
           
private  boolean largeImageCol
           
private  boolean largeImageRow
           
private  int offsetX
           
private  int offsetY
           
private  int origoX
           
private  int origoY
           
private  DoubleHashMap pixelMap
           
private  int rowFrom
           
private  IObjectGroup rowGroup
           
private  int rowTo
           
private  SparsePicture sparsePicture
           
private  java.util.Vector<SparsePixel> sparsePixels
           
private  ToolbarView toolbarView
           
private  boolean toSmall
           
 
Constructor Summary
SparsePartPicture(java.awt.Dimension imageDimension, int colFrom, int colTo, int rowFrom, int rowTo, IObjectGroup columnGroup, IObjectGroup rowGroup)
           
 
Method Summary
protected  void add(SparsePixel sp)
           
protected  void adjustColumnColorOpacity(float newMinWeight, float newMaxWeight, float currentMinWeight, float currentMaxWeight)
           
protected  void adjustColumnColorPixelsToHeight()
           
protected  void adjustOpacity(float newMinWeight, float newMaxWeight, float currentMinWeight, float currentMaxWeight)
           
private  void adjustOpacity(java.util.Vector<SparsePixel> vec, float newMinWeight, float newMaxWeight, float currentMinWeight, float currentMaxWeight)
           
protected  java.awt.Color getBackgroundColor()
           
protected  java.awt.Color getBorderColor()
           
protected  IObject getClosestColumnIObject(int x)
           
protected  IObject getClosestRowIObject(int y)
           
protected  int getClosestXPixelForColumn(int col)
          Returns the closest x coordinate in the picture for a column in the IMatrix.
protected  int getClosestYPixelForRow(int row)
           
protected  int getColFrom()
           
protected  int getColTo()
           
protected  java.util.HashMap<java.lang.Integer,SparsePixel> getColumnColorMap()
           
protected  SparsePixel getColumnColorPixel(int x)
           
protected  java.util.Vector<SparsePixel> getColumnColorPixels()
           
protected  IObjectGroup getColumnGroup()
           
protected  IObjectGroup getColumnIObjects(int x)
           
protected  int getGridX()
           
protected  int getGridY()
           
protected  java.awt.image.BufferedImage getImage()
           
protected  int getImageHeight()
           
protected  java.awt.Dimension getImageSize()
           
protected  int getImageWidth()
           
protected  int getIMatrixPartHeight()
           
protected  java.awt.Dimension getIMatrixPartSize()
           
protected  int getIMatrixPartWidth()
           
private  boolean getLargeImageCol()
           
private  boolean getLargeImageRow()
           
protected  IObject getLastColumnIObject(int x)
           
protected  IObject getLastRowIObject(int y)
           
protected  int getOffsetX()
           
protected  int getOffsetY()
           
protected  int getOrigoX()
           
protected  int getOrigoY()
           
protected  SparsePixel getPixel(int x, int y)
          Adds a new SparsePixel to the picture.
protected  java.util.Vector<SparsePixel> getPixels()
           
protected  int getRowFrom()
           
protected  IObjectGroup getRowGroup()
           
protected  IObjectGroup getRowIObjects(int y)
           
protected  int getRowTo()
           
protected  InfomatView getView()
           
protected  void makeAverageColumnColor()
           
protected  void makeImage()
          Should not be run several times.
protected  void putColumnColorPixel(SparsePixel sp)
           
protected  void putPixel(SparsePixel sp)
           
protected  void setColumnColorMap(java.util.HashMap<java.lang.Integer,SparsePixel> map)
           
protected  void setGridXY(int x, int y)
          Use with care!
protected  void setLargeImageCol(boolean largeImageCol)
           
protected  void setLargeImageRow(boolean largeImageRow)
           
protected  void setOffsetXY(int x, int y)
          Use with care!
protected  void setOrigo(int x, int y)
          Use with care!
protected  void setSparsePicture(SparsePicture sparsePicture)
           
protected  void setToolbarView(ToolbarView toolbarView)
           
protected  boolean toSmall()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sparsePicture

private SparsePicture sparsePicture

toSmall

private boolean toSmall

image

private java.awt.image.BufferedImage image

imageDimension

private java.awt.Dimension imageDimension

borderColor

private java.awt.Color borderColor

border

private javax.swing.border.MatteBorder border

largeImageRow

private boolean largeImageRow

largeImageCol

private boolean largeImageCol

origoX

private int origoX

origoY

private int origoY

gridX

private int gridX

gridY

private int gridY

offsetX

private int offsetX

offsetY

private int offsetY

sparsePixels

private java.util.Vector<SparsePixel> sparsePixels

pixelMap

private DoubleHashMap pixelMap

columnColorMap

private java.util.HashMap<java.lang.Integer,SparsePixel> columnColorMap

rowFrom

private int rowFrom

rowTo

private int rowTo

colFrom

private int colFrom

colTo

private int colTo

columnGroup

private IObjectGroup columnGroup

rowGroup

private IObjectGroup rowGroup

toolbarView

private ToolbarView toolbarView
Constructor Detail

SparsePartPicture

public SparsePartPicture(java.awt.Dimension imageDimension,
                         int colFrom,
                         int colTo,
                         int rowFrom,
                         int rowTo,
                         IObjectGroup columnGroup,
                         IObjectGroup rowGroup)
Method Detail

putColumnColorPixel

protected void putColumnColorPixel(SparsePixel sp)

getColumnColorPixel

protected SparsePixel getColumnColorPixel(int x)

getColumnColorMap

protected java.util.HashMap<java.lang.Integer,SparsePixel> getColumnColorMap()

setColumnColorMap

protected void setColumnColorMap(java.util.HashMap<java.lang.Integer,SparsePixel> map)

getColumnColorPixels

protected java.util.Vector<SparsePixel> getColumnColorPixels()

setSparsePicture

protected void setSparsePicture(SparsePicture sparsePicture)

setToolbarView

protected void setToolbarView(ToolbarView toolbarView)

setOrigo

protected void setOrigo(int x,
                        int y)
Use with care!


setGridXY

protected void setGridXY(int x,
                         int y)
Use with care!


setOffsetXY

protected void setOffsetXY(int x,
                           int y)
Use with care!


setLargeImageRow

protected void setLargeImageRow(boolean largeImageRow)

setLargeImageCol

protected void setLargeImageCol(boolean largeImageCol)

getLargeImageRow

private boolean getLargeImageRow()

getLargeImageCol

private boolean getLargeImageCol()

getBorderColor

protected java.awt.Color getBorderColor()

putPixel

protected void putPixel(SparsePixel sp)

add

protected void add(SparsePixel sp)

makeAverageColumnColor

protected void makeAverageColumnColor()

getPixel

protected SparsePixel getPixel(int x,
                               int y)
Adds a new SparsePixel to the picture. If there is a SparsePixel at its cooridinates the new SparsePixel is accumulated to it.

Parameters:
sp - A SparsePixel.

getRowFrom

protected int getRowFrom()

getRowTo

protected int getRowTo()

getColFrom

protected int getColFrom()

getColTo

protected int getColTo()

getRowGroup

protected IObjectGroup getRowGroup()

getColumnGroup

protected IObjectGroup getColumnGroup()

getLastRowIObject

protected IObject getLastRowIObject(int y)

getLastColumnIObject

protected IObject getLastColumnIObject(int x)

getClosestRowIObject

protected IObject getClosestRowIObject(int y)

getClosestColumnIObject

protected IObject getClosestColumnIObject(int x)

getColumnIObjects

protected IObjectGroup getColumnIObjects(int x)

getRowIObjects

protected IObjectGroup getRowIObjects(int y)

getClosestXPixelForColumn

protected int getClosestXPixelForColumn(int col)
Returns the closest x coordinate in the picture for a column in the IMatrix. For columns that are larger than one pixel the leftmost coordinate is returned.


getClosestYPixelForRow

protected int getClosestYPixelForRow(int row)

getPixels

protected java.util.Vector<SparsePixel> getPixels()

getView

protected InfomatView getView()

getIMatrixPartWidth

protected int getIMatrixPartWidth()

getIMatrixPartHeight

protected int getIMatrixPartHeight()

getIMatrixPartSize

protected java.awt.Dimension getIMatrixPartSize()

getImageWidth

protected int getImageWidth()

getImageHeight

protected int getImageHeight()

getOrigoX

protected int getOrigoX()

getOrigoY

protected int getOrigoY()

getGridX

protected int getGridX()

getGridY

protected int getGridY()

getOffsetX

protected int getOffsetX()

getOffsetY

protected int getOffsetY()

getImageSize

protected java.awt.Dimension getImageSize()

getImage

protected java.awt.image.BufferedImage getImage()

getBackgroundColor

protected java.awt.Color getBackgroundColor()

toSmall

protected boolean toSmall()

makeImage

protected void makeImage()
Should not be run several times.


adjustColumnColorPixelsToHeight

protected void adjustColumnColorPixelsToHeight()

adjustOpacity

private void adjustOpacity(java.util.Vector<SparsePixel> vec,
                           float newMinWeight,
                           float newMaxWeight,
                           float currentMinWeight,
                           float currentMaxWeight)

adjustOpacity

protected void adjustOpacity(float newMinWeight,
                             float newMaxWeight,
                             float currentMinWeight,
                             float currentMaxWeight)

adjustColumnColorOpacity

protected void adjustColumnColorOpacity(float newMinWeight,
                                        float newMaxWeight,
                                        float currentMinWeight,
                                        float currentMaxWeight)