vlcskineditor.resources
Class Bitmap

java.lang.Object
  extended by vlcskineditor.Resource
      extended by vlcskineditor.resources.ImageResource
          extended by vlcskineditor.resources.Bitmap
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Bitmap
extends ImageResource
implements java.awt.event.ActionListener

Handles Bitmap resources


Field Summary
 java.lang.String alphacolor
           
 java.lang.String ALPHACOLOR_DEFAULT
           
 java.lang.String file
           
 int fps
           
 int FPS_DEFAULT
           
 int nbframes
           
 java.util.List<SubBitmap> SubBitmaps
           
 
Fields inherited from class vlcskineditor.resources.ImageResource
image
 
Fields inherited from class vlcskineditor.Resource
id, s, type
 
Constructor Summary
Bitmap(org.w3c.dom.Node n, Skin s_)
          Creates a new Bitmap from a XML node
Bitmap(Skin s_, java.io.File f_)
          Creates a new Bitmap from a given file.
Bitmap(java.lang.String xmlcode, Skin s_)
          Creates a new Bitmap from xml code
Bitmap(java.lang.String id_, java.lang.String file_, java.lang.String alphacolor_, int nbframes_, int fps_, Skin s_)
          Creates a new Bitmap from given attributes
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 Resource getParentOf(java.lang.String id_)
          If a Resource does contain another Resource of the given id (e.g. a SubBitmap) the containing Resource is returned
 javax.swing.tree.DefaultMutableTreeNode getTreeNode()
          Creates a DefaultMutableTreeNode to be displayed in the resources tree
 void renameForCopy(java.lang.String p)
          Renames the Resource after the copy process
 java.lang.String returnCode(java.lang.String indent)
          Creates the XML code representing the resource
 void showOptions()
          Show a dialog to modify the resource's parameters
 void update()
          Update the Resource's attributes according to user input
 boolean updateImage()
          Regenerates the image represented by the Bitmap object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

public java.lang.String file

ALPHACOLOR_DEFAULT

public final java.lang.String ALPHACOLOR_DEFAULT
See Also:
Constant Field Values

alphacolor

public java.lang.String alphacolor

nbframes

public int nbframes

FPS_DEFAULT

public final int FPS_DEFAULT
See Also:
Constant Field Values

fps

public int fps

SubBitmaps

public java.util.List<SubBitmap> SubBitmaps
Constructor Detail

Bitmap

public Bitmap(org.w3c.dom.Node n,
              Skin s_)
Creates a new Bitmap from a XML node

Parameters:
n - The XML node
s_ - The skin in which the Bitmap is used

Bitmap

public Bitmap(java.lang.String xmlcode,
              Skin s_)
Creates a new Bitmap from xml code

Parameters:
xmlcode - The XML code from which the Bitmap should be created. One line per tag.
s_ - The skin in which the Bitmap is used. This is necessary in order that the image file can be located relatively to the skin file.

Bitmap

public Bitmap(java.lang.String id_,
              java.lang.String file_,
              java.lang.String alphacolor_,
              int nbframes_,
              int fps_,
              Skin s_)
Creates a new Bitmap from given attributes

Parameters:
id_ - The ID of the new Bitmap
file_ - The relative path to the image file.
alphacolor_ - The alphacolor of the Bitmap. Format is #RRGGBB.
nbframes_ - If the Bitmap is animated this defines the number of frames.
fps_ - If the Bitmap is animated this defines the frames displayed per second.
s_ - The skin in which the Bitmap is used. This is necessary in order that the image file can be located relatively to the skin file.

Bitmap

public Bitmap(Skin s_,
              java.io.File f_)
Creates a new Bitmap from a given file.

Parameters:
s_ - The skin in which the Bitmap is used. This is necessary in order that the image file can be located relatively to the skin file.
f_ - The image file represented by this Bitmap.
Method Detail

updateImage

public boolean updateImage()
Regenerates the image represented by the Bitmap object.


update

public void update()
Description copied from class: Resource
Update the Resource's attributes according to user input

Specified by:
update in class Resource

showOptions

public void showOptions()
Description copied from class: Resource
Show a dialog to modify the resource's parameters

Specified by:
showOptions in class Resource

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

returnCode

public java.lang.String returnCode(java.lang.String indent)
Description copied from class: Resource
Creates the XML code representing the resource

Specified by:
returnCode in class Resource

getTreeNode

public javax.swing.tree.DefaultMutableTreeNode getTreeNode()
Description copied from class: Resource
Creates a DefaultMutableTreeNode to be displayed in the resources tree

Specified by:
getTreeNode in class Resource

getParentOf

public Resource getParentOf(java.lang.String id_)
Description copied from class: Resource
If a Resource does contain another Resource of the given id (e.g. a SubBitmap) the containing Resource is returned

Overrides:
getParentOf in class Resource

renameForCopy

public void renameForCopy(java.lang.String p)
Description copied from class: Resource
Renames the Resource after the copy process

Overrides:
renameForCopy in class Resource