net.codescore.ui.components.dnd
Class DnDVbox

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Box
                  extended by org.zkoss.zul.Vbox
                      extended by net.codescore.ui.components.dnd.DnDVbox
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DnDColumn>, DnDColumn, Component, ComponentCtrl

public class DnDVbox
extends Vbox
implements DnDColumn

A Vbox that acts as a column for DnDObjects

Author:
Adam Cornett
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrl
 
Field Summary
protected  int col
           
private  List<DnDObject> objects
          The list of objects that this column has
private static long serialVersionUID
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
DnDVbox(int col)
           
 
Method Summary
 void addWindow(DnDObject win)
          Adds a DnDObject to the end of this column
 int compareTo(DnDColumn o)
           
 void fixRowNums()
          Each DnDObject has a 'row number' which is an index of where the item is vertically in the column.
 int getColumnNumber()
          Returns the column index for this column.
 void onDrop(DropEvent event)
          This method handles the drop event for the column
 void reBuildList()
          Fixes the row numbers (DnDColumn.fixRowNums()) and then redraws the column.
 void removeWindow(DnDObject win)
          Removed a DnDObject from this column
 void sortList()
          Sorts the internal column list according to the DnDObject's comparator
 String toString()
           
 
Methods inherited from class org.zkoss.zul.Box
getAlign, getCaveAttrs, getChildInnerAttrs, getChildOuterAttrs, getHeights, getOrient, getOuterAttrs, getPack, getSpacing, getValign, getWidths, insertBefore, isHorizontal, isVertical, onChildRemoved, onDrawNewChild, setAlign, setHeights, setOrient, setPack, setSpacing, setValign, setWidths
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, newExtraCtrl, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isAsapRequired, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onPageDetached, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdateDeferred, smartUpdateValues, unsetVariable
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

objects

private final List<DnDObject> objects
The list of objects that this column has


col

protected final int col
Constructor Detail

DnDVbox

public DnDVbox(int col)
Parameters:
col - This column's number. Columns are 1-indexed: the column to the far left is 1 the next one to the right is 2, etc.
Method Detail

addWindow

public void addWindow(DnDObject win)
Description copied from interface: DnDColumn
Adds a DnDObject to the end of this column

Specified by:
addWindow in interface DnDColumn
Parameters:
win - The object to be added

compareTo

public int compareTo(DnDColumn o)
Specified by:
compareTo in interface Comparable<DnDColumn>

fixRowNums

public void fixRowNums()
Description copied from interface: DnDColumn
Each DnDObject has a 'row number' which is an index of where the item is vertically in the column. This method will iterate over each DnDObject in the column and ensure that its row number is one more than the previous element.

Specified by:
fixRowNums in interface DnDColumn

getColumnNumber

public int getColumnNumber()
Description copied from interface: DnDColumn
Returns the column index for this column.

Specified by:
getColumnNumber in interface DnDColumn
Returns:
A 1 indexed number indicating the position from left to right of this column

onDrop

public void onDrop(DropEvent event)
Description copied from interface: DnDColumn
This method handles the drop event for the column

Specified by:
onDrop in interface DnDColumn
Parameters:
event - The event object passed from ZK

reBuildList

public void reBuildList()
Description copied from interface: DnDColumn
Fixes the row numbers (DnDColumn.fixRowNums()) and then redraws the column.

Specified by:
reBuildList in interface DnDColumn

removeWindow

public void removeWindow(DnDObject win)
Description copied from interface: DnDColumn
Removed a DnDObject from this column

Specified by:
removeWindow in interface DnDColumn
Parameters:
win - The object to be removed

sortList

public void sortList()
Description copied from interface: DnDColumn
Sorts the internal column list according to the DnDObject's comparator

Specified by:
sortList in interface DnDColumn

toString

public String toString()
Overrides:
toString in class AbstractComponent


Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.