org.gamenet.application.mm8leveleditor.lod
Class FileBasedModifiedLodResource

java.lang.Object
  extended byorg.gamenet.application.mm8leveleditor.lod.FileBasedModifiedLodResource
All Implemented Interfaces:
LodResource, TGADataConsumer, TGADataProducer

public class FileBasedModifiedLodResource
extends Object
implements LodResource, TGADataProducer, TGADataConsumer


Field Summary
private  int byteHeight
           
private  int byteWidth
           
private  FormatConverter converter
           
private  File file
           
private  int[] palette
           
 
Constructor Summary
FileBasedModifiedLodResource(FormatConverter converter, File file)
           
 
Method Summary
 int getByteHeight()
           
 int getByteWidth()
           
 byte[] getData()
           
 byte[] getDataHeader()
           
 File getFile()
           
 String getName()
           
 int[] getPalette()
           
 String getResourceType()
           
 String getTextDescription()
           
private  byte[] readData(FormatConverter converter, File file)
           
private  byte[] readDataOld(FormatConverter converter, File file)
           
 void setImageHeight(int height)
           
 void setImagePalette(int[] palette)
           
 void setImageWidth(int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private File file

converter

private FormatConverter converter

byteWidth

private int byteWidth

byteHeight

private int byteHeight

palette

private int[] palette
Constructor Detail

FileBasedModifiedLodResource

public FileBasedModifiedLodResource(FormatConverter converter,
                                    File file)
Method Detail

getFile

public File getFile()

readData

private byte[] readData(FormatConverter converter,
                        File file)

readDataOld

private byte[] readDataOld(FormatConverter converter,
                           File file)

getData

public byte[] getData()
Specified by:
getData in interface LodResource

getByteWidth

public int getByteWidth()
Specified by:
getByteWidth in interface TGADataProducer
Returns:
image width in bytes

getByteHeight

public int getByteHeight()
Specified by:
getByteHeight in interface TGADataProducer
Returns:
image height in bytes

getPalette

public int[] getPalette()
                 throws IOException
Specified by:
getPalette in interface TGADataProducer
Returns:
int array of palette data
Throws:
IOException

setImageWidth

public void setImageWidth(int width)
Specified by:
setImageWidth in interface TGADataConsumer

setImageHeight

public void setImageHeight(int height)
Specified by:
setImageHeight in interface TGADataConsumer

setImagePalette

public void setImagePalette(int[] palette)
Specified by:
setImagePalette in interface TGADataConsumer

getTextDescription

public String getTextDescription()
Specified by:
getTextDescription in interface LodResource

getResourceType

public String getResourceType()
Specified by:
getResourceType in interface LodResource

getName

public String getName()
Specified by:
getName in interface LodResource

getDataHeader

public byte[] getDataHeader()
Specified by:
getDataHeader in interface LodResource