vlcskineditor.items
Class Slider

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

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

Slider item


Field Summary
 java.lang.String down
           
 java.lang.String DOWN_DEFAULT
           
 java.lang.String over
           
 java.lang.String OVER_DEFAULT
           
 java.lang.String points
           
 SliderBackground sbg
           
 int thickness
           
 int THICKNESS_DEFAULT
           
 java.lang.String tooltiptext
           
 java.lang.String TOOLTIPTEXT_DEFAULT
           
 java.lang.String up
           
 java.lang.String value
           
 java.lang.String VALUE_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
Slider(org.w3c.dom.Node n, Skin s_)
          Parses a slider from a XML node
Slider(org.w3c.dom.Node n, Skin s_, boolean isInPlaytree)
          Parses a slider contained in a Playtree from a XML node
Slider(Skin s_)
           
Slider(Skin s_, boolean ipt)
           
Slider(java.lang.String xmlcode, Skin s_)
          Creates a new instance of Slider
Slider(java.lang.String xmlcode, Skin s_, boolean ipt)
           
 
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
 boolean isInPlaytree()
           
 void removeBG()
           
 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 updateBezier()
           
 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

DOWN_DEFAULT

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

OVER_DEFAULT

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

THICKNESS_DEFAULT

public final int THICKNESS_DEFAULT
See Also:
Constant Field Values

VALUE_DEFAULT

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

TOOLTIPTEXT_DEFAULT

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

up

public java.lang.String up

down

public java.lang.String down

over

public java.lang.String over

points

public java.lang.String points

thickness

public int thickness

value

public java.lang.String value

tooltiptext

public java.lang.String tooltiptext

sbg

public SliderBackground sbg
Constructor Detail

Slider

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

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

Slider

public Slider(org.w3c.dom.Node n,
              Skin s_,
              boolean isInPlaytree)
Parses a slider contained in a Playtree from a XML node

Parameters:
n - The XML node
s_ - The parent skin
isInPlaytree - The boolean value indicating whether the slider is inside a playtree or not

Slider

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

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

Slider

public Slider(java.lang.String xmlcode,
              Skin s_,
              boolean ipt)

Slider

public Slider(Skin s_)

Slider

public Slider(Skin s_,
              boolean ipt)
Method Detail

updateBezier

public void updateBezier()

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

removeBG

public void removeBG()

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

isInPlaytree

public boolean isInPlaytree()

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