vlcskineditor
Class Item

java.lang.Object
  extended by vlcskineditor.Item
Direct Known Subclasses:
Anchor, Button, Checkbox, Group, Image, Panel, Playtree, RadialSlider, Slider, SliderBackground, Text, Video

public abstract class Item
extends java.lang.Object

Abstract superclass representing layout elements


Field Summary
protected  boolean clicked
          Indicates whether this Item is clicked on in the preview window
 boolean created
          Determines whether the process of creating the object has finished
 java.lang.String help
          The Item's help attrtibute
 java.lang.String HELP_DEFAULT
          Default help value
protected  boolean hovered
          Indicates whether this Item is hovered by the mouse in the preview window
 java.lang.String id
          The Item's ID attribute
 java.lang.String ID_DEFAULT
          Default ID value
 java.lang.String lefttop
          The lefttop attribute
 java.lang.String LEFTTOP_DEFAULT
          Default lefttop value
 int offsetx
          The absolute x coordinates of the parent which contains this Item
 int offsety
          The absolute y coordinates of the parent which contains this Item
 java.lang.String rightbottom
          The Item's rightbottom attribute
 java.lang.String RIGHTBOTTOM_DEFAULT
          Default rightbottom value
 Skin s
          Represents the skin to which an item belongs
protected  boolean selected
          Indicates whether this Item is selected in the item list
 java.lang.String type
          The Item's type
protected  boolean vis
          Store for the parsed visible attribute, indicating whether the Item is drawn or not
 java.lang.String visible
          The Item's visible attribute
 java.lang.String VISIBLE_DEFAULT
          Default visible value
 int x
          The Item's x attribute
 int X_DEFAULT
          Default X value
 boolean xkeepratio
          The Item's xkeepratio attribute
 boolean XKEEPRATIO_DEFAULT
          Default xkeepratio value
 int y
          The Item's y attribute
 int Y_DEFAULT
          Default Y value
 boolean ykeepratio
          The Item's ykeepratio attribute
 boolean YKEEPRATIO_DEFAULT
          Default ykeepratio value
 
Constructor Summary
Item()
           
 
Method Summary
 void actionWasEdited(ActionEditor ae)
          Tells the Item that an action attribute has been changed by the ActionEditor ae
 boolean contains(int x_, int y_)
          Checks whether the given point is inside the Item
abstract  void draw(java.awt.Graphics2D g, int z)
          Draws the item to a graphics context
abstract  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
abstract  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
abstract  java.lang.String returnCode(java.lang.String indent)
          Creates the XML code representing the item
 void setClicked(boolean c)
          Sets whether the Item is clicked in the preview or not
 void setHover(boolean h)
          Sets whether the Item is hovered by the mouse in the preview or not
 void setOffset(int x_, int y_)
          Sets the absolut offset of the Item's parent
 void setSelected(boolean s)
          Sets whether the Item is selected in the tree or not
abstract  void showOptions()
          Show a dialog to modify the items's parameters
abstract  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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s

public Skin s
Represents the skin to which an item belongs


ID_DEFAULT

public final java.lang.String ID_DEFAULT
Default ID value

See Also:
Constant Field Values

VISIBLE_DEFAULT

public final java.lang.String VISIBLE_DEFAULT
Default visible value

See Also:
Constant Field Values

X_DEFAULT

public final int X_DEFAULT
Default X value

See Also:
Constant Field Values

Y_DEFAULT

public final int Y_DEFAULT
Default Y value

See Also:
Constant Field Values

LEFTTOP_DEFAULT

public final java.lang.String LEFTTOP_DEFAULT
Default lefttop value

See Also:
Constant Field Values

RIGHTBOTTOM_DEFAULT

public final java.lang.String RIGHTBOTTOM_DEFAULT
Default rightbottom value

See Also:
Constant Field Values

XKEEPRATIO_DEFAULT

public final boolean XKEEPRATIO_DEFAULT
Default xkeepratio value

See Also:
Constant Field Values

YKEEPRATIO_DEFAULT

public final boolean YKEEPRATIO_DEFAULT
Default ykeepratio value

See Also:
Constant Field Values

HELP_DEFAULT

public final java.lang.String HELP_DEFAULT
Default help value

See Also:
Constant Field Values

id

public java.lang.String id
The Item's ID attribute


visible

public java.lang.String visible
The Item's visible attribute


x

public int x
The Item's x attribute


y

public int y
The Item's y attribute


lefttop

public java.lang.String lefttop
The lefttop attribute


rightbottom

public java.lang.String rightbottom
The Item's rightbottom attribute


xkeepratio

public boolean xkeepratio
The Item's xkeepratio attribute


ykeepratio

public boolean ykeepratio
The Item's ykeepratio attribute


help

public java.lang.String help
The Item's help attrtibute


type

public java.lang.String type
The Item's type


selected

protected boolean selected
Indicates whether this Item is selected in the item list


hovered

protected boolean hovered
Indicates whether this Item is hovered by the mouse in the preview window


clicked

protected boolean clicked
Indicates whether this Item is clicked on in the preview window


offsetx

public int offsetx
The absolute x coordinates of the parent which contains this Item


offsety

public int offsety
The absolute y coordinates of the parent which contains this Item


vis

protected boolean vis
Store for the parsed visible attribute, indicating whether the Item is drawn or not


created

public boolean created
Determines whether the process of creating the object has finished

Constructor Detail

Item

public Item()
Method Detail

showOptions

public abstract void showOptions()
Show a dialog to modify the items's parameters


update

public abstract void update()
Update the Item's attributes according to the user input


returnCode

public abstract java.lang.String returnCode(java.lang.String indent)
Creates the XML code representing the item

Parameters:
indent - The indentation string
Returns:
The indented XML code

draw

public abstract void draw(java.awt.Graphics2D g,
                          int z)
Draws the item to a graphics context

Parameters:
g - graphics context
z - zoom factor

draw

public abstract void draw(java.awt.Graphics2D g,
                          int x,
                          int y,
                          int z)
Draws the item to a graphics context with the offset x,y

Parameters:
g - Graphics context
x - X offset
y - Y offset
z - Zoom factor

getTreeNode

public abstract javax.swing.tree.DefaultMutableTreeNode getTreeNode()
Creates a DefaultMutableTreeNode to be displayed in the items tree

Returns:
The DefaultMutableTreeNode representation of this Item

getItem

public Item getItem(java.lang.String id_)
Gets an Item of the given ID

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_)
Gets the list containing the Item with the given ID

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_)
Gets the parent Item of the Item with the given ID

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

setSelected

public void setSelected(boolean s)
Sets whether the Item is selected in the tree or not

Parameters:
s - Selected or not

setHover

public void setHover(boolean h)
Sets whether the Item is hovered by the mouse in the preview or not

Parameters:
h - Hovered or not

setClicked

public void setClicked(boolean c)
Sets whether the Item is clicked in the preview or not

Parameters:
c - Clicked or not

contains

public boolean contains(int x_,
                        int y_)
Checks whether the given point is inside the 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

setOffset

public void setOffset(int x_,
                      int y_)
Sets the absolut offset of the Item's parent

Parameters:
x_ - The parents absolute x location
y_ - The parents absolute y location

actionWasEdited

public void actionWasEdited(ActionEditor ae)
Tells the Item that an action attribute has been changed by the ActionEditor ae

Parameters:
ae - The ActionEditor who changed the action attribute

uses

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

Parameters:
id_ - The resource's id
Returns:
True if used, false otherwise

renameForCopy

public void renameForCopy(java.lang.String p)
Renames the Item after the copy process

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

updateToGlobalVariables

public void updateToGlobalVariables()
Invokes the item to update its variables that depend on the global variables, that is e.g. visibility


resourceRenamed

public void resourceRenamed(java.lang.String oldid,
                            java.lang.String newid)
Changes all references to the resource formerly identfied by oldid to the resources newid

Parameters:
oldid - The former ID of the renamed resource
newid - The new ID of the renamed resource