All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jdsltools.visualization.ElementPanels.ElementPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jdsltools.visualization.ElementPanels.ElementPanel

public abstract class ElementPanel
extends Panel
implements ElementSelector
Integration of the logical interface jdsltools.visualization.ElementSelector with a visual Panel. All interface implementation and all layout are left to subclasses.

Author:
Mark Handy

Constructor Index

 o ElementPanel()

Method Index

 o beginDeletionOperation()
Will be called when the user begins a deletion from the Container, so the ElementPanel can take any appropriate action.

 o beginInsertionOperation()
Will be called when the user begins an insertion into the Container, so the ElementPanel can take any appropriate action (clearing the previous return value, for example).

 o beginOtherOperation()
Will be called when the user begins an operation on the Container that is not subsumed above, so the ElementPanel can take any appropriate action.

 o beginReadOperation()
Will be called when the user begins a read-only operation on the Container, so the ElementPanel can take any appropriate action.

 o endOperation()
Will be called when a Container operation returns, so the ElementPanel can take any appropriate action (randomly generating a new element, for example).

 o endReadOperation()
 o loadState(ElementPanelState)
 o paramElement()
ElementPanels give the user a choice from a universe of data elements.
 o paramKey()
 o paramPosition1()
ElementPanels have to report Locators to be used in Container operations.
 o paramPosition2()
A few Container operations require two locators.
 o saveState()
 o setParamPosition(Position)
Stores a Locator in the ElementPanel, to be reported later, when paramLocator1() or paramLocator2() is called.
 o setParamPosition1(Position)
Stores a Locator in the ElementSelector, to be reported later, when paramLocator1() or paramLocator2() is called.
 o setParamPosition2(Position)
 o setReturnElement(Object)
Displays the result of a method call (one which returns user elements, not Locators, e.g., remove or replace) in the ElementPanel.

 o setReturnLocator(Locator)
Displays the result of a method call (one which returns Locators) in the ElementSelector.

 o setReturnPosition(Position)
Displays the result of a method call (one which returns Locators) in the ElementPanel.

 o timelineEffect()
The structure displayed has moved in history and the element panel must respond accordingly

Constructors

 o ElementPanel
 public ElementPanel()

Methods

 o paramElement
 public abstract Object paramElement()
ElementPanels give the user a choice from a universe of data elements. This method reports the user's choice.

Returns:
The user's element
 o paramKey
 public abstract Object paramKey()
 o paramPosition1
 public abstract Position paramPosition1()
ElementPanels have to report Locators to be used in Container operations. They might or might not be able to generate Locators themselves, but other objects can choose Locators and use the setParamLocator(.) method.

Returns:
The Locator parameter selected by the user
 o paramPosition2
 public abstract Position paramPosition2()
A few Container operations require two locators. This method is therefore necessary but rarely used.

Returns:
The additional Locator parameter selected by the user
 o setParamPosition
 public abstract void setParamPosition(Position position) throws InvalidElementException, InvalidPositionException
Stores a Locator in the ElementPanel, to be reported later, when paramLocator1() or paramLocator2() is called. (Whether to store the Locator as loc1 or loc2 is up to the ElementPanel.)

Parameters:
locator - A Locator to be stored
 o setReturnElement
 public abstract void setReturnElement(Object element) throws InvalidElementException
Displays the result of a method call (one which returns user elements, not Locators, e.g., remove or replace) in the ElementPanel.

Parameters:
element - Returned element, to be displayed
 o setReturnPosition
 public abstract void setReturnPosition(Position position) throws InvalidElementException, InvalidPositionException
Displays the result of a method call (one which returns Locators) in the ElementPanel.

Parameters:
locator - Returned locator, to be displayed
 o beginInsertionOperation
 public abstract void beginInsertionOperation()
Will be called when the user begins an insertion into the Container, so the ElementPanel can take any appropriate action (clearing the previous return value, for example).

 o beginDeletionOperation
 public abstract void beginDeletionOperation()
Will be called when the user begins a deletion from the Container, so the ElementPanel can take any appropriate action.

 o beginReadOperation
 public abstract void beginReadOperation()
Will be called when the user begins a read-only operation on the Container, so the ElementPanel can take any appropriate action.

 o beginOtherOperation
 public abstract void beginOtherOperation()
Will be called when the user begins an operation on the Container that is not subsumed above, so the ElementPanel can take any appropriate action.

 o endOperation
 public abstract void endOperation()
Will be called when a Container operation returns, so the ElementPanel can take any appropriate action (randomly generating a new element, for example).

 o saveState
 public abstract ElementPanelState saveState()
 o loadState
 public abstract void loadState(ElementPanelState e)

All Packages  Class Hierarchy  This Package  Previous  Next  Index