vlcskineditor.items
Class Group

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

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

Represents a Group item


Field Summary
 java.util.List<Item> items
          The items contained in the group
 
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
Group(org.w3c.dom.Node n, Skin s_)
          Parses a Group from a givn XML node
Group(Skin s_)
           
Group(java.lang.String xmlcode, Skin s_)
          Creates a new instance of Group
 
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
 java.util.List<Item> getParentListOf(java.lang.String id_)
          Gets the list containing the Item with 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
 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, resourceRenamed, setClicked, setHover, setOffset, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

public java.util.List<Item> items
The items contained in the group

Constructor Detail

Group

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

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

Group

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


Group

public Group(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

getParentListOf

public java.util.List<Item> getParentListOf(java.lang.String id_)
Description copied from class: Item
Gets the list containing the Item with the given ID

Overrides:
getParentListOf in class Item
Parameters:
id_ - ID of the item whose parent list is looked for
Returns:
If this Item or one of its children contains an Item with the given ID its parent list 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