org.objectweb.fractal.gui.graph.model
Class BasicDisplay

java.lang.Object
  extended byorg.objectweb.fractal.gui.graph.model.BasicDisplay
All Implemented Interfaces:
BindingController, Display

public class BasicDisplay
extends Object
implements Display, BindingController

Basic implementation of the Display interface.


Field Summary
static String DISPLAY_LISTENERS_BINDING
          A collection client interface bound to the listeners of this model.
static String USER_DATA_BINDING
          An optional client interface TODO.
 
Constructor Summary
BasicDisplay()
          Constructs a new BasicDisplay component.
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
          Binds the client interface whose name is given to a server interface.
 Rect getDisplayedArea()
          Returns the area of the component graph shown by this display.
 int getItfNameDisplayMode()
          Returns the displaying mode for the interfaces name of this display.
 int getMaxDepth()
          Returns the max depth at which the component graph is shown by this display.
 Rectangle getScreenSize()
          Returns the size of this display.
 boolean isAntialiasing()
          Returns true if this display is anti aliased.
 String[] listFc()
          Returns the names of the client interfaces of the component to which this interface belongs.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 void setDisplayedArea(Rect displayedArea)
          Sets the area of the component graph shown by this display.
 void setIsAntialiasing(boolean isAntialiasing)
          Sets the anti aliasing option of this display.
 void setItfNameDisplayMode()
          Sets the displaying mode for the interfaces name of this display.
 void setMaxDepth(int maxDepth)
          Sets the max depth at which the component graph is shown by this display.
 void setScreenSize(Rectangle screenSize)
          Sets the size of this display.
 void unbindFc(String clientItfName)
          Unbinds the given client interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_LISTENERS_BINDING

public static final String DISPLAY_LISTENERS_BINDING
A collection client interface bound to the listeners of this model.

See Also:
Constant Field Values

USER_DATA_BINDING

public static final String USER_DATA_BINDING
An optional client interface TODO.

See Also:
Constant Field Values
Constructor Detail

BasicDisplay

public BasicDisplay()
Constructs a new BasicDisplay component.

Method Detail

listFc

public String[] listFc()
Description copied from interface: BindingController
Returns the names of the client interfaces of the component to which this interface belongs.

Specified by:
listFc in interface BindingController
Returns:
the names of the client interfaces of the component to which this interface belongs.

lookupFc

public Object lookupFc(String clientItfName)
Description copied from interface: BindingController
Returns the interface to which the given client interface is bound. More precisely, returns the server interface to which the client interface whose name is given is bound. This server interface is necessarily in the same address space as the client interface (see bindFc).

Specified by:
lookupFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
Returns:
the server interface to which the given interface is bound, or null if it is not bound.

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
Description copied from interface: BindingController
Binds the client interface whose name is given to a server interface. More precisely, binds the client interface of the component to which this interface belongs, and whose name is equal to the given name, to the given server interface. The given server interface must be in the same address space as the client interface.

Specified by:
bindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.

unbindFc

public void unbindFc(String clientItfName)
Description copied from interface: BindingController
Unbinds the given client interface. More precisely, unbinds the client interface of the component to which this interface belongs, and whose name is equal to the given name.

Specified by:
unbindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.

getScreenSize

public Rectangle getScreenSize()
Description copied from interface: Display
Returns the size of this display.

Specified by:
getScreenSize in interface Display
Returns:
the size of this display, in pixels.
See Also:
Display.setScreenSize(java.awt.Rectangle)

setScreenSize

public void setScreenSize(Rectangle screenSize)
Description copied from interface: Display
Sets the size of this display.

Specified by:
setScreenSize in interface Display
Parameters:
screenSize - the new size of this display, in pixels.
See Also:
Display.getScreenSize()

getDisplayedArea

public Rect getDisplayedArea()
Description copied from interface: Display
Returns the area of the component graph shown by this display. Indeed a display may show only a portion of a component graph, which may be changed by zooming or scrolling.

Specified by:
getDisplayedArea in interface Display
Returns:
the area of the component graph shown by this display. This area is specified in the following way: if sr is the screen size, and dr is the displayed area, then the configuration in drawn in the rectangle (sr.x+sr.w*dr.x0, sr.y+sr.h*dr.y0, sr.x+sr.w*dr.x1, sr.y+sr.h*dr.y1). So, if sr is equal to (0,0,1,1), the configuration is drawn in the full screen rectangle, if it is equal to (0.5,0,1,1) the configuration is drawn in the half right part of the screen rectangle, and so on.
See Also:
Display.setDisplayedArea(org.objectweb.fractal.gui.graph.model.Rect)

setDisplayedArea

public void setDisplayedArea(Rect displayedArea)
Description copied from interface: Display
Sets the area of the component graph shown by this display.

Specified by:
setDisplayedArea in interface Display
Parameters:
displayedArea - the new area of the component graph shown by this display.
See Also:
Display.getDisplayedArea()

isAntialiasing

public boolean isAntialiasing()
Description copied from interface: Display
Returns true if this display is anti aliased.

Specified by:
isAntialiasing in interface Display
Returns:
true if this display is anti aliased.
See Also:
Display.setIsAntialiasing(boolean)

setIsAntialiasing

public void setIsAntialiasing(boolean isAntialiasing)
Description copied from interface: Display
Sets the anti aliasing option of this display.

Specified by:
setIsAntialiasing in interface Display
Parameters:
isAntialiasing - the new anti aliasing option of this display.

getMaxDepth

public int getMaxDepth()
Description copied from interface: Display
Returns the max depth at which the component graph is shown by this display.

Specified by:
getMaxDepth in interface Display
Returns:
the max depth at which the component graph is shown by this display.
See Also:
Display.setMaxDepth(int)

setMaxDepth

public void setMaxDepth(int maxDepth)
Description copied from interface: Display
Sets the max depth at which the component graph is shown by this display.

Specified by:
setMaxDepth in interface Display
Parameters:
maxDepth - the new max depth at which the component graph is shown by this display.
See Also:
Display.getMaxDepth()

getItfNameDisplayMode

public int getItfNameDisplayMode()
Description copied from interface: Display
Returns the displaying mode for the interfaces name of this display.

Specified by:
getItfNameDisplayMode in interface Display

setItfNameDisplayMode

public void setItfNameDisplayMode()
Description copied from interface: Display
Sets the displaying mode for the interfaces name of this display.

Specified by:
setItfNameDisplayMode in interface Display