org.opt4j.viewer
Class Viewport

java.lang.Object
  extended by org.opt4j.viewer.Viewport

public class Viewport
extends java.lang.Object

The Viewport is a desktop for Widgets.

See Also:
Widget

Field Summary
protected  javax.swing.JDesktopPane desktop
           
protected static int OFFSET
           
protected  javax.swing.JPanel panel
           
protected  java.util.Map<Widget,javax.swing.JInternalFrame> widgets
           
 
Constructor Summary
Viewport()
          Constructs a Viewport for Widgets.
 
Method Summary
 void addToDesktop(javax.swing.JInternalFrame inFrame)
          Adds a JInternalFrame.
 void addWidget(Widget widget)
          Adds a widget.
protected  javax.swing.JInternalFrame createInternalFrame(Widget widget)
          Creates a widget as a JInternalFrame.
 javax.swing.JComponent get()
          Returns the component.
 javax.swing.JInternalFrame getInternalFrame(Widget widget)
          Returns the JInternalFrame of a Widget if it exists and null otherwise.
 void init()
          Initialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

desktop

protected final javax.swing.JDesktopPane desktop

panel

protected final javax.swing.JPanel panel

OFFSET

protected static final int OFFSET
See Also:
Constant Field Values

widgets

protected final java.util.Map<Widget,javax.swing.JInternalFrame> widgets
Constructor Detail

Viewport

public Viewport()
Constructs a Viewport for Widgets.

Method Detail

init

public void init()
Initialization. This method has to be called once after construction.


addWidget

public void addWidget(Widget widget)
Adds a widget.

Parameters:
widget - the widget to be added

createInternalFrame

protected javax.swing.JInternalFrame createInternalFrame(Widget widget)
Creates a widget as a JInternalFrame.

Parameters:
widget - the widget
Returns:
the constructed JInternalFrame

addToDesktop

public void addToDesktop(javax.swing.JInternalFrame inFrame)
Adds a JInternalFrame.

Parameters:
inFrame - the JInternalFrame to be added

getInternalFrame

public javax.swing.JInternalFrame getInternalFrame(Widget widget)
Returns the JInternalFrame of a Widget if it exists and null otherwise.

Parameters:
widget - the widget
Returns:
the internal frame

get

public javax.swing.JComponent get()
Returns the component.

Returns:
the component