hotline.iconlib
Class HLExtractor

java.lang.Object
  |
  +--hotline.iconlib.HLExtractor

public class HLExtractor
extends java.lang.Object

use this class to open the hotline.dat file, access ICONs, GIFfs, etc.

See Also:
developer site

Field Summary
 boolean hasGIF
          true if there are GIFf-entries, false otherwise
 boolean hasICON
          true if there are ICON-entries, false otherwise
 int idGIFTable
          you should check hasGIF before you use this to get access to the GIF-table in the indexTable structure.
 int idICONTable
          you should check hasICON before you use this to get access to the ICON-table in the indexTable structure.
 hotline.iconlib.HLIndexTable indexTable
          gives access to the various tables, such as GIFf, ICON, ...
 
Constructor Summary
HLExtractor()
           
 
Method Summary
 void close()
          closes the internally opened hotline.dat file
 byte[] createWinBitmap(hotline.iconlib.HLIconData hlicd)
          create a bitmap from a HLIconData object
 javax.swing.Icon doTransitions(hotline.iconlib.HLIconData hlIconData)
          create an icon from a HLIconData object
 java.awt.Color getAlpha()
          get the current padding
 byte[] getGIF(int identity)
          extracts a gif (-banner) from the hotline.dat-file
 hotline.iconlib.HLIconData getIcon(int identity)
          gets an icon by its identity
 int getPadSize()
          get the current padding
 int getTableOffset()
          extract the tables offset from the hotline file
 int getTableSize()
          extract the tables size from the hotline file
 boolean isHotline(long tableOffset)
          validate whether the given file is a correct hotline.dat file
 boolean open(java.lang.String name)
          open a hotline.dat file, reference is stored internally
 boolean quickStart(java.lang.String hotlineFile)
          quick start function
note: use of this function is highly recommended - it does the whole job for you
example:
hv = new HLExtractor(); if (!
 void setAlpha(java.awt.Color newAlpha)
          change the alpha value
 void setPadSize(int newSize)
          change the padding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexTable

public hotline.iconlib.HLIndexTable indexTable
gives access to the various tables, such as GIFf, ICON, ...


hasGIF

public boolean hasGIF
true if there are GIFf-entries, false otherwise


hasICON

public boolean hasICON
true if there are ICON-entries, false otherwise


idGIFTable

public int idGIFTable
you should check hasGIF before you use this to get access to the GIF-table in the indexTable structure.
example:
               HLExtractor hv;
               HLTable          ht;
               ...
               ht = hv.indexTable.get(hv.idGIFTable);
               ...
          
value: -1 if there is no table in the indexTable structure, >=0 otherwise


idICONTable

public int idICONTable
you should check hasICON before you use this to get access to the ICON-table in the indexTable structure.
example:
               HLExtractor hv;
               HLTable          ht;
               ...
               ht = hv.indexTable.get(hv.idICONTable);
               ...
          
value: -1 if there is no table in the indexTable structure, >=0 otherwise

Constructor Detail

HLExtractor

public HLExtractor()
Method Detail

setPadSize

public void setPadSize(int newSize)
change the padding


setAlpha

public void setAlpha(java.awt.Color newAlpha)
change the alpha value


getPadSize

public int getPadSize()
get the current padding

Returns:
current padding

getAlpha

public java.awt.Color getAlpha()
get the current padding

Returns:
current padding

getIcon

public hotline.iconlib.HLIconData getIcon(int identity)
                                   throws java.io.IOException
gets an icon by its identity

Parameters:
identity - icon identity number
Returns:
HLIconData object with all necessary data stored in it
java.io.IOException

doTransitions

public javax.swing.Icon doTransitions(hotline.iconlib.HLIconData hlIconData)
create an icon from a HLIconData object

Parameters:
hlIconData - icon data stored in a HLIconData object
Returns:
icon

createWinBitmap

public byte[] createWinBitmap(hotline.iconlib.HLIconData hlicd)
create a bitmap from a HLIconData object

Parameters:
hlicd - icon data stored in a HLIconData object
Returns:
windows bitmap as a byte field

isHotline

public boolean isHotline(long tableOffset)
                  throws java.io.IOException
validate whether the given file is a correct hotline.dat file

Parameters:
tableOffset - vector tables offset
Returns:
true if it is a valid hotline.dat file, false otherwise
java.io.IOException

getTableSize

public int getTableSize()
                 throws java.io.IOException
extract the tables size from the hotline file

Returns:
vector tables size
java.io.IOException

getTableOffset

public int getTableOffset()
                   throws java.io.IOException
extract the tables offset from the hotline file

Returns:
vector tables offset
java.io.IOException

quickStart

public boolean quickStart(java.lang.String hotlineFile)
                   throws java.io.IOException
quick start function
note: use of this function is highly recommended - it does the whole job for you
example:
           hv = new HLExtractor();
           if (!hv.quickStart("hotline.dat")) {
                return;
           }
           // now an icon extraction
           hlid = hv.getIcon (128);
           if (hlid != null) {
                fpos      = hv.indexTable.get(hv.idICONTable).find(ic);
                hld      = hv.indexTable.get(hv.idICONTable).get(fpos);
                if (hld == null)
                {
                     System.out.println("No object is at that pos!");
                }
                else {
                     wbmp      = hv.createWinBitmap(hlid, hld);
                     tname = new String("Icon"+(int) hld.getIdentity());
                     tname=tname.concat(".bmp");
                     tempFile = new FileOutputStream(tname);
                     tempFile.write(wbmp);
                     tempFile.close();
                }
           }
           hv.close();
     

Returns:
true if successful, false when something went wrong
java.io.IOException

open

public boolean open(java.lang.String name)
             throws java.io.IOException
open a hotline.dat file, reference is stored internally

Parameters:
name - full path and name to the hotline.dat file
Returns:
true if the file was successfully opened, false otherwise
java.io.IOException

close

public void close()
           throws java.io.IOException
closes the internally opened hotline.dat file

java.io.IOException

getGIF

public byte[] getGIF(int identity)
              throws java.io.IOException
extracts a gif (-banner) from the hotline.dat-file

Parameters:
identity - identity of the GIF-images
Returns:
GIF-image stored in a byte field
java.io.IOException