Class tred.Slot
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tred.Slot

java.lang.Object
   |
   +----tred.EditorObject
           |
           +----tred.Slot

public class Slot
extends EditorObject
This is the abstract class Slot for all kind of slots and is intended to be subclassed.

Variable Index

 o editorPanel
 o id
 o item
 o list
 o nextCloneId
 o shadowItem

Constructor Index

 o Slot(EditorPanel, int)
This is the generic constructor for all slots.

Method Index

 o clone()
This class doesn't implement cloneable but allow subclasses to support clone.
 o getItem()
 o getMyRoot()
 o insertItem(Item, EditorObject)
 o insertItemBefore(Item, EditorObject)
This method is invoked when a new item is inserted into this tree.
 o isLinkSlot()
 o paint(Graphics)
This is the generic paint method for all slots.
 o paint(Graphics, int, int)
this method is rewritten to method setLocation in the future.
 o putItem(Item)
This method is invoked when an item is going to move into this slot.
 o putList(Item)
This method is invoked when new item is put to list of this slot.
 o setLinkSlot()
 o setLocation(int, int)
 o toString()

Variables

 o item
  protected Item item
 o shadowItem
  protected Item shadowItem
 o editorPanel
  protected EditorPanel editorPanel
 o id
  protected int id
 o nextCloneId
  protected static int nextCloneId
 o list
  public ListObject list

Constructors

 o Slot
  public Slot(EditorPanel panel,
              int id)
This is the generic constructor for all slots.

Methods

 o getMyRoot
  public Slot getMyRoot()
Returns:
myRoot
 o isLinkSlot
  public boolean isLinkSlot()
 o setLinkSlot
  public void setLinkSlot()
 o paint
  protected boolean paint(Graphics g)
This is the generic paint method for all slots. This method is intended to be overridden. Every subclass should have it's own paint method which invokes this super paint method as it's first statement. Note. If the slot has a ListObject, those slots in the list are not drawed! Anyway, because of implementation of stack, shadowed items of the list must be drawn on the screen.
Overrides:
paint in class EditorObject
 o paint
  protected int paint(Graphics g,
                      int x,
                      int y)
this method is rewritten to method setLocation in the future.
 o setLocation
  protected int setLocation(int x,
                            int y)
 o putList
  protected Slot putList(Item item)
This method is invoked when new item is put to list of this slot.
Parameters:
item - which is put to list of this slot.
Returns:
null if the argument item is null; new clone of this slot otherwise. this slot is returned.
 o putItem
  protected Slot putItem(Item item)
This method is invoked when an item is going to move into this slot. If generic movements are not allowed a subclass should override this method and return null in case a movement is invalid. Method returns rslot which is the slot where the item really is attached to. Usually rslot is this slot. Anyway, if the panel that this slot belongs to is a listArray, the rslot is the (cloned) slot where the item is moved to.
Parameters:
item - which moves into this slot.
Returns:
rslot if item == null or this slot is empty; null if this slot is occupied.
 o insertItem
  protected Slot insertItem(Item item,
                            EditorObject after)
 o insertItemBefore
  protected Slot insertItemBefore(Item item,
                                  EditorObject before)
This method is invoked when a new item is inserted into this tree. The item is inserted into this slot between some existing items.
Parameters:
item - - item which is inserted
 o getItem
  public Item getItem()
Returns:
the item attached to this slot.
 o clone
  public Object clone()
This class doesn't implement cloneable but allow subclasses to support clone. This method is implemented to provide a clone implementation that clones all fields correctly if the default implementation isn't correct.
Overrides:
clone in class Object
 o toString
  public String toString()
Returns:
String getClass().toString().
Overrides:
toString in class EditorObject

All Packages  Class Hierarchy  This Package  Previous  Next  Index