de.lessvoid.nifty.loaderv2.types
Class ElementType

java.lang.Object
  extended by de.lessvoid.nifty.loaderv2.types.XmlBaseType
      extended by de.lessvoid.nifty.loaderv2.types.ElementType
All Implemented Interfaces:
XmlType
Direct Known Subclasses:
ControlDefinitionType, ControlType, ImageType, LayerType, PanelType, PopupType, TextType

public class ElementType
extends XmlBaseType


Field Summary
protected  Controller controller
           
protected  LinkedList<Object> controllers
           
protected  EffectsType effects
           
protected  ElementRendererCreator elementRendererCreator
           
protected  List<ElementType> elements
           
protected  InteractType interact
           
protected  String tagName
           
 
Constructor Summary
ElementType()
           
ElementType(Attributes attributes)
           
ElementType(ElementType src)
           
 
Method Summary
 void addControl(ElementType text)
           
 void addElementType(ElementType type)
           
 void addImage(ElementType image)
           
 void addLabel(ElementType label)
           
 void addPanel(ElementType panel)
           
 void addText(ElementType text)
           
 void applyAttributes(Element element, Attributes work, NiftyRenderEngine renderEngine)
           
protected  void applyChildren(Element parent, Screen screen, Nifty nifty)
           
 void applyEffects(Nifty nifty, Screen screen, Element element)
           
 void applyInteract(Nifty nifty, Screen screen, Element element)
           
 void applyPostAttributes(Element element, Attributes work, NiftyRenderEngine renderEngine)
           
 void applyStyles(StyleResolver styleResolver)
           
 void connectParentControls(Element parent)
          usually when elements (incl. controls) are loaded they are all present when the xml is being transformed into the runtime element tree. during this process each interact method is being resolved, tracing all controllers from top to bottom leading a list of controller instances for each method.
 ElementType copy()
           
 Element create(Element parent, Nifty nifty, Screen screen, LayoutPart layoutPart)
           
 EffectsType getEffects()
           
 Collection<ElementType> getElements()
           
 ElementType getFirstElement()
           
 InteractType getInteract()
           
 boolean hasElements()
           
protected  void makeFlat()
           
 String output(int offset)
           
 void prepare(Nifty nifty, Screen screen, ElementType rootElementType)
           
 void refreshAttributes(Nifty nifty, Screen screen, Element element, ControlAttributes attributes)
           
 void removeWithTag(String styleId)
           
 void setEffect(EffectsType effectsParam)
           
 void setInteract(InteractType interactParam)
           
 void translateSpecialValues(Nifty nifty, Screen screen)
           
 
Methods inherited from class de.lessvoid.nifty.loaderv2.types.XmlBaseType
getAttributes, initFromAttributes, mergeFromAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagName

protected String tagName

elementRendererCreator

protected ElementRendererCreator elementRendererCreator

interact

protected InteractType interact

effects

protected EffectsType effects

elements

protected List<ElementType> elements

controllers

protected LinkedList<Object> controllers

controller

protected Controller controller
Constructor Detail

ElementType

public ElementType()

ElementType

public ElementType(ElementType src)

ElementType

public ElementType(Attributes attributes)
Method Detail

copy

public ElementType copy()

makeFlat

protected void makeFlat()

hasElements

public boolean hasElements()

getFirstElement

public ElementType getFirstElement()

addElementType

public void addElementType(ElementType type)

addPanel

public void addPanel(ElementType panel)

addImage

public void addImage(ElementType image)

addLabel

public void addLabel(ElementType label)

addText

public void addText(ElementType text)

addControl

public void addControl(ElementType text)

setInteract

public void setInteract(InteractType interactParam)

setEffect

public void setEffect(EffectsType effectsParam)

output

public String output(int offset)
Overrides:
output in class XmlBaseType

create

public Element create(Element parent,
                      Nifty nifty,
                      Screen screen,
                      LayoutPart layoutPart)

applyAttributes

public void applyAttributes(Element element,
                            Attributes work,
                            NiftyRenderEngine renderEngine)

applyPostAttributes

public void applyPostAttributes(Element element,
                                Attributes work,
                                NiftyRenderEngine renderEngine)

applyEffects

public void applyEffects(Nifty nifty,
                         Screen screen,
                         Element element)

applyInteract

public void applyInteract(Nifty nifty,
                          Screen screen,
                          Element element)

applyChildren

protected void applyChildren(Element parent,
                             Screen screen,
                             Nifty nifty)

refreshAttributes

public void refreshAttributes(Nifty nifty,
                              Screen screen,
                              Element element,
                              ControlAttributes attributes)

getInteract

public InteractType getInteract()

getEffects

public EffectsType getEffects()

getElements

public Collection<ElementType> getElements()

prepare

public void prepare(Nifty nifty,
                    Screen screen,
                    ElementType rootElementType)

translateSpecialValues

public void translateSpecialValues(Nifty nifty,
                                   Screen screen)
Overrides:
translateSpecialValues in class XmlBaseType

applyStyles

public void applyStyles(StyleResolver styleResolver)

removeWithTag

public void removeWithTag(String styleId)

connectParentControls

public void connectParentControls(Element parent)
usually when elements (incl. controls) are loaded they are all present when the xml is being transformed into the runtime element tree. during this process each interact method is being resolved, tracing all controllers from top to bottom leading a list of controller instances for each method. when we're creating elements dynamically then every element below in the hierachry is resolved the same way but everything above us (the parent and parent.parent and so on) is not being linked, which leads to controllers missing. this call will now travel up the hierachry and collect all controllers and add them to the element we're currently processing.



Copyright © 2011. All Rights Reserved.