viceroy.GUI
Interface ViewController

All Known Implementing Classes:
LocalViceroyPeer

public interface ViewController

This is the interface nodes that wish to be displayed must implement. The reason we use enum of various colors and shapes, rather than let the node draw itself is so that we can avoid forcing nodes to import gui

Author:
Anat Talmy
, Oren Dobzinski

Field Summary
static int BLACK
           
static int BLUE
           
static int GREEN
           
static int MAGENTA
           
static int ORANGE
           
static int RED
           
static int SHAPE_CIRCLE
           
static int SHAPE_DEFAULT
           
static int SHAPE_DIAMOND
           
static int SHAPE_HOLLOW_DIAMOND
           
static int SHAPE_OCTAGON
           
static int SHAPE_SQUARE
           
static int SHAPE_TRIANGLE
           
static int WHITE
           
static int YELLOW
           
 
Method Summary
 java.util.Vector getChildren(int mode)
          Returns all the children of the node
 int getColor(int mode)
          Returns one of the above color enum telling the panel how to display the node in the gui
 int getLevel()
          Returns the level of a node
 ViceroyPeer getLookupAnswer(Resource lookedUp)
          Gets the viceroy peer who is supposed to be responsible for the lookedup value
 MessagePath getLookupPath(Resource lookedUp)
          Gets the path that the lookup search has gone through
 int getShape(int mode)
          Returns one of the above SHAPE_ enum telling the panel how to display the node in the gui
 HashValue hashValue()
          Calculates the hash value.
 

Field Detail

SHAPE_DIAMOND

public static final int SHAPE_DIAMOND
See Also:
Constant Field Values

SHAPE_SQUARE

public static final int SHAPE_SQUARE
See Also:
Constant Field Values

SHAPE_CIRCLE

public static final int SHAPE_CIRCLE
See Also:
Constant Field Values

SHAPE_TRIANGLE

public static final int SHAPE_TRIANGLE
See Also:
Constant Field Values

SHAPE_OCTAGON

public static final int SHAPE_OCTAGON
See Also:
Constant Field Values

SHAPE_HOLLOW_DIAMOND

public static final int SHAPE_HOLLOW_DIAMOND
See Also:
Constant Field Values

SHAPE_DEFAULT

public static final int SHAPE_DEFAULT
See Also:
Constant Field Values

RED

public static final int RED
See Also:
Constant Field Values

GREEN

public static final int GREEN
See Also:
Constant Field Values

BLUE

public static final int BLUE
See Also:
Constant Field Values

WHITE

public static final int WHITE
See Also:
Constant Field Values

BLACK

public static final int BLACK
See Also:
Constant Field Values

YELLOW

public static final int YELLOW
See Also:
Constant Field Values

MAGENTA

public static final int MAGENTA
See Also:
Constant Field Values

ORANGE

public static final int ORANGE
See Also:
Constant Field Values
Method Detail

getChildren

public java.util.Vector getChildren(int mode)
Returns all the children of the node

Parameters:
mode - enum indicating what mode of display we are in (node needs to decide itself which classes to send as children for each possible value)
Returns:

getShape

public int getShape(int mode)
Returns one of the above SHAPE_ enum telling the panel how to display the node in the gui

Parameters:
mode - node can use this to change its shape according to the current mode
Returns:

getColor

public int getColor(int mode)
Returns one of the above color enum telling the panel how to display the node in the gui

Parameters:
mode - node can use this to change its color according to the current mode
Returns:

getLevel

public int getLevel()
Returns the level of a node

Returns:
the level of a node

getLookupAnswer

public ViceroyPeer getLookupAnswer(Resource lookedUp)
Gets the viceroy peer who is supposed to be responsible for the lookedup value

Parameters:
lookedUp - The value which was lookedup
Returns:
the viceroy peer who is supposed to be responsible for the lookedup value

getLookupPath

public MessagePath getLookupPath(Resource lookedUp)
Gets the path that the lookup search has gone through

Parameters:
lookedUp - the resource lookedup
Returns:
the path that the lookup search has gone through

hashValue

public HashValue hashValue()
Calculates the hash value.

Returns:
a HashValue object with the hash-value.