vlcskineditor.items
Class Playtree

java.lang.Object
  extended by vlcskineditor.Item
      extended by vlcskineditor.items.Playtree
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Playtree
extends Item
implements java.awt.event.ActionListener

Playtree item


Field Summary
 java.lang.String bgcolor1
           
 java.lang.String BGCOLOR1_DEFAULT
           
 java.lang.String bgcolor2
           
 java.lang.String BGCOLOR2_DEFAULT
           
 java.lang.String bgimage
           
 java.lang.String BGIMAGE_DEFAULT
           
 java.lang.String closedimage
           
 java.lang.String CLOSEDIMAGE_DEFAULT
           
 java.lang.String fgcolor
           
 java.lang.String FGCOLOR_DEFAULT
           
 boolean flat
           
 boolean FLAT_DEFAULT
           
 java.lang.String font
           
 int height
           
 int HEIGHT_DEFAULT
           
 java.lang.String itemimage
           
 java.lang.String ITEMIMAGE_DEFAULT
           
 java.lang.String openimage
           
 java.lang.String OPENIMAGE_DEFAULT
           
 java.lang.String playcolor
           
 java.lang.String PLAYCOLOR_DEFAULT
           
 java.lang.String selcolor
           
 java.lang.String SELCOLOR_DEFAULT
           
 java.lang.String var
           
 java.lang.String VAR_DEFAULT
           
 int width
           
 int WIDTH_DEFAULT
           
 
Fields inherited from class vlcskineditor.Item
clicked, created, help, HELP_DEFAULT, hovered, id, ID_DEFAULT, lefttop, LEFTTOP_DEFAULT, offsetx, offsety, rightbottom, RIGHTBOTTOM_DEFAULT, s, selected, type, vis, visible, VISIBLE_DEFAULT, x, X_DEFAULT, xkeepratio, XKEEPRATIO_DEFAULT, y, Y_DEFAULT, ykeepratio, YKEEPRATIO_DEFAULT
 
Constructor Summary
Playtree(org.w3c.dom.Node n, Skin s_)
          Parses a playtree from a XML node
Playtree(Skin s_)
           
Playtree(java.lang.String xmlcode, Skin s_)
          Creates a new instance of Playtree
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 boolean contains(int x_, int y_)
          Checks whether the given point is inside the Item
 void draw(java.awt.Graphics2D g, int z)
          Draws the item to a graphics context
 void draw(java.awt.Graphics2D g_, int x_, int y_, int z)
          Draws the item to a graphics context with the offset x,y
 Item getItem(java.lang.String id_)
          Gets an Item of the given ID
 Item getParentOf(java.lang.String id_)
          Gets the parent Item of the Item with the given ID
 javax.swing.tree.DefaultMutableTreeNode getTreeNode()
          Creates a DefaultMutableTreeNode to be displayed in the items tree
 void renameForCopy(java.lang.String p)
          Renames the Item after the copy process
 void resourceRenamed(java.lang.String oldid, java.lang.String newid)
          Changes all references to the resource formerly identfied by oldid to the resources newid
 java.lang.String returnCode(java.lang.String indent)
          Creates the XML code representing the item
 void showOptions()
          Show a dialog to modify the items's parameters
 void update()
          Update the Item's attributes according to the user input
 void updateToGlobalVariables()
          Invokes the item to update its variables that depend on the global variables, that is e.g. visibility
 boolean uses(java.lang.String id_)
          Checks whether the resource with the given ID is used by this Item or one of its subitems
 
Methods inherited from class vlcskineditor.Item
actionWasEdited, getParentListOf, setClicked, setHover, setOffset, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH_DEFAULT

public final int WIDTH_DEFAULT
See Also:
Constant Field Values

HEIGHT_DEFAULT

public final int HEIGHT_DEFAULT
See Also:
Constant Field Values

VAR_DEFAULT

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

BGIMAGE_DEFAULT

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

FGCOLOR_DEFAULT

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

PLAYCOLOR_DEFAULT

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

SELCOLOR_DEFAULT

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

BGCOLOR1_DEFAULT

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

BGCOLOR2_DEFAULT

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

FLAT_DEFAULT

public final boolean FLAT_DEFAULT
See Also:
Constant Field Values

ITEMIMAGE_DEFAULT

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

OPENIMAGE_DEFAULT

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

CLOSEDIMAGE_DEFAULT

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

width

public int width

height

public int height

font

public java.lang.String font

var

public java.lang.String var

bgimage

public java.lang.String bgimage

fgcolor

public java.lang.String fgcolor

playcolor

public java.lang.String playcolor

selcolor

public java.lang.String selcolor

bgcolor1

public java.lang.String bgcolor1

bgcolor2

public java.lang.String bgcolor2

flat

public boolean flat

itemimage

public java.lang.String itemimage

openimage

public java.lang.String openimage

closedimage

public java.lang.String closedimage
Constructor Detail

Playtree

public Playtree(org.w3c.dom.Node n,
                Skin s_)
Parses a playtree from a XML node

Parameters:
n - The XML node
s_ - The parent skin

Playtree

public Playtree(java.lang.String xmlcode,
                Skin s_)
Creates a new instance of Playtree

Parameters:
xmlcode - The XML code
s_ - The parent skin

Playtree

public Playtree(Skin s_)
Method Detail

update

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

Specified by:
update in class Item

showOptions

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

Specified by:
showOptions in class Item

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: Item
Creates the XML code representing the item

Specified by:
returnCode in class Item
Parameters:
indent - The indentation string
Returns:
The indented XML code

draw

public void draw(java.awt.Graphics2D g,
                 int z)
Description copied from class: Item
Draws the item to a graphics context

Specified by:
draw in class Item
Parameters:
g - graphics context
z - zoom factor

draw

public void draw(java.awt.Graphics2D g_,
                 int x_,
                 int y_,
                 int z)
Description copied from class: Item
Draws the item to a graphics context with the offset x,y

Specified by:
draw in class Item
Parameters:
g_ - Graphics context
x_ - X offset
y_ - Y offset
z - Zoom factor

contains

public boolean contains(int x_,
                        int y_)
Description copied from class: Item
Checks whether the given point is inside the Item

Overrides:
contains in class Item
Parameters:
x_ - The point's x coordinate
y_ - The point's y coordinate
Returns:
True when the point is contained in the Item, false otherwise

getTreeNode

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

Specified by:
getTreeNode in class Item
Returns:
The DefaultMutableTreeNode representation of this Item

getItem

public Item getItem(java.lang.String id_)
Description copied from class: Item
Gets an Item of the given ID

Overrides:
getItem in class Item
Parameters:
id_ - The ID of the desired Item
Returns:
If this Item or one of its children contains an Item with the given ID it is returned, otherwise null is returned

getParentOf

public Item getParentOf(java.lang.String id_)
Description copied from class: Item
Gets the parent Item of the Item with the given ID

Overrides:
getParentOf in class Item
Parameters:
id_ - ID of the item whose parent is looked for
Returns:
If this Item or one of its children contains an Item with the given ID its parent item is returned, otherwise null is returned

uses

public boolean uses(java.lang.String id_)
Description copied from class: Item
Checks whether the resource with the given ID is used by this Item or one of its subitems

Overrides:
uses in class Item
Parameters:
id_ - The resource's id
Returns:
True if used, false otherwise

renameForCopy

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

Overrides:
renameForCopy in class Item
Parameters:
p - The rename pattern, where %oldid% will be replaced by the Item's old ID

updateToGlobalVariables

public void updateToGlobalVariables()
Description copied from class: Item
Invokes the item to update its variables that depend on the global variables, that is e.g. visibility

Overrides:
updateToGlobalVariables in class Item

resourceRenamed

public void resourceRenamed(java.lang.String oldid,
                            java.lang.String newid)
Description copied from class: Item
Changes all references to the resource formerly identfied by oldid to the resources newid

Overrides:
resourceRenamed in class Item
Parameters:
oldid - The former ID of the renamed resource
newid - The new ID of the renamed resource