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.
-
editorPanel
-
-
id
-
-
item
-
-
list
-
-
nextCloneId
-
-
shadowItem
-
-
Slot(EditorPanel, int)
- This is the generic constructor for all slots.
-
clone()
-
This class doesn't implement cloneable but allow subclasses to support
clone.
-
getItem()
-
-
getMyRoot()
-
-
insertItem(Item, EditorObject)
-
-
insertItemBefore(Item, EditorObject)
- This method is invoked when a new item is inserted into this tree.
-
isLinkSlot()
-
-
paint(Graphics)
-
This is the generic paint method for all slots.
-
paint(Graphics, int, int)
- this method is rewritten to method setLocation in the future.
-
putItem(Item)
-
This method is invoked when an item is going to move into this slot.
-
putList(Item)
-
This method is invoked when new item is put to list of this slot.
-
setLinkSlot()
-
-
setLocation(int, int)
-
-
toString()
-
item
protected Item item
shadowItem
protected Item shadowItem
editorPanel
protected EditorPanel editorPanel
id
protected int id
nextCloneId
protected static int nextCloneId
list
public ListObject list
Slot
public Slot(EditorPanel panel,
int id)
- This is the generic constructor for all slots.
getMyRoot
public Slot getMyRoot()
- Returns:
- myRoot
isLinkSlot
public boolean isLinkSlot()
setLinkSlot
public void setLinkSlot()
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
paint
protected int paint(Graphics g,
int x,
int y)
- this method is rewritten to method setLocation in the future.
setLocation
protected int setLocation(int x,
int y)
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.
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.
insertItem
protected Slot insertItem(Item item,
EditorObject after)
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
getItem
public Item getItem()
- Returns:
- the item attached to this slot.
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
toString
public String toString()
- Returns:
- String getClass().toString().
- Overrides:
- toString in class EditorObject
All Packages Class Hierarchy This Package Previous Next Index