|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfilecontroller.ReadPGMImageFile
public class ReadPGMImageFile
The ReadPGMImageFile -class reads Portable GreyMap (PGM) images made by user, and converts them to form this program uses. PGM files contains also a header part in the beginning of file, which is read and pulled apart before the actual data.
Field Summary | |
---|---|
private java.awt.Color |
colorOfCornerArea
Background color of corner area in weather -image. |
private java.awt.Color |
colorOfRadarArea
Background color of radar area in weather -image. |
private int[] |
colorPalette
colorPalette array of colors in integer RGB. |
private java.lang.String |
dataDir
dataDir is directory for PGM-images. |
private java.lang.String |
errorMessage
errorMessage if errors. |
private java.awt.image.BufferedImage |
mapImage
mapImage weather image. |
private int[][] |
mapMatrix
mapMatrix weather image in numeric-mode. |
private java.awt.image.BufferedImage |
offScreenImage
offScreenImage is working area for Java 2D. |
private Parameters |
parameters
parameters Current instance of Parameter class. |
private int |
pictureHeight
pictureWidth map height. |
private int |
pictureWidth
pictureWidth map width. |
private int[] |
radarImageSize
radarImageSize size of PGM-image. |
private int |
radarPics
currentRadarPic latest composed image. |
private int |
renderMapHeight
render height. |
private int |
renderMapWidth
render width. |
private java.lang.Boolean |
status
status is false if construct fails. |
private java.util.ArrayList<java.lang.String> |
weatherFiles
weatherFiles is list of images. |
private int |
weatherFilesPointer
currentWeatherFile Pointer to current row. |
Constructor Summary | |
---|---|
ReadPGMImageFile(Parameters parameters)
Constructor of this class. |
Method Summary | |
---|---|
java.lang.String |
getErrorMessage()
Returns latest error message. |
java.awt.image.BufferedImage |
getMap()
Returns rendered weather data in bufferedImage -format. |
int[][] |
getMapMatrix()
Returns rendered weather data in integer matrix. |
private java.lang.String |
getPictureName()
This method returns path and name of the next PGM-image in order. |
private int[] |
getPrintColorPalette()
This method initialize a color palette, which is used when rendering storms from weather data into BufferedImage-object. |
boolean |
getStatus()
Returns a current status of this instance. |
private boolean |
loadList(java.lang.String filename)
Load user's weather data-list from file. |
private boolean |
loadPicture()
Method renders a PGM-image. |
private boolean |
recognizeHeaderLine(java.lang.String headerLine,
int headerNumber)
Method tries to recognize PGM picture's current header line, and set the value of the header into program's data structure. |
private boolean |
renderWeathermapToBufferedImage()
This method converts the weather data from integer matrix into bufferedImage. |
boolean |
update()
Method renders next PGM -images from user's list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.awt.Color colorOfCornerArea
private java.awt.Color colorOfRadarArea
private int[] colorPalette
private java.lang.String dataDir
private java.lang.String errorMessage
private java.awt.image.BufferedImage mapImage
private int[][] mapMatrix
private java.awt.image.BufferedImage offScreenImage
private Parameters parameters
private int pictureHeight
private int pictureWidth
private int[] radarImageSize
private int radarPics
private int renderMapHeight
private int renderMapWidth
private java.lang.Boolean status
private java.util.ArrayList<java.lang.String> weatherFiles
private int weatherFilesPointer
Constructor Detail |
---|
public ReadPGMImageFile(Parameters parameters)
parameters
- Current parameter -class.Method Detail |
---|
public java.lang.String getErrorMessage()
public java.awt.image.BufferedImage getMap()
public int[][] getMapMatrix()
private java.lang.String getPictureName()
private int[] getPrintColorPalette()
public boolean getStatus()
private boolean loadList(java.lang.String filename)
filename
- Name of user list, this comes from Parameter -class.
private boolean loadPicture()
private boolean recognizeHeaderLine(java.lang.String headerLine, int headerNumber)
headerLine
- Current line.headerNumber
- Number of line.
private boolean renderWeathermapToBufferedImage()
public boolean update()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |