com.yobotics.simulationconstructionset
Class ViewportConfiguration

java.lang.Object
  extended by com.yobotics.simulationconstructionset.ViewportConfiguration

public class ViewportConfiguration
extends java.lang.Object

Title: SimulationConstructionSet

Description: Class for storing camera view configurations for display in a ViewportPanel.

This class can store the position and size information of several cameras as shown in the following example:

view2.addCameraView("camera 1", 0, 0, 1, 2);
view2.addCameraView("camera 2", 1, 0, 3, 2);
view2.addCameraView("robot cam", 0, 2, 2, 1);

The above code adds three cameras named camera 1, camera 2 and robot cam. The next component of each camera is its column and row. In this example camera's 1 and 2 are both in the same row, row 0, but are separated into columns 0 and 1 respectively. The final two components, width and height, indicate the number of columns and rows that the camera fills. Camera 1 has a width of 1 and a height of 2. When placing cameras ensure that no overlap occurs as it will cause unpredictable behavior.

Copyright: Copyright (c) 2000

Company: Yobotics, Inc.

Version:
1.0
Author:
Jerry Pratt

Constructor Summary
ViewportConfiguration(java.lang.String name)
          Creates an empty configuration with the specified name.
 
Method Summary
 void addCameraView(java.lang.String cameraName, int col, int row, int width, int height)
          Adds a new camera view to this configuration.
 void cache3DViews(java.util.ArrayList cached3DViews)
          Store a set of 3DViews for reuse later.
 void cacheCanvas3DPanels(java.util.ArrayList cachedPanels)
          Stores a list of Canvas3DPanels.
 void cacheViewportPanel(javax.swing.JPanel viewportPanel)
          Stores a copy of the specified panel.
 java.util.ArrayList getCached3DViews()
          Retrives the list of cached 3DViews.
 java.util.ArrayList getCachedCanvas3DPanels()
          Retrieves the stored Canvas3DPanels.
 javax.swing.JPanel getCachedViewportPanel()
          Retrieve the cached panel.
 java.lang.String getName()
          Accessor method for the ViewportConfiguration's name
 java.util.ArrayList getPanelConfigurations()
          Retrieves a list of the stored ViewportPanelConfigurations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportConfiguration

public ViewportConfiguration(java.lang.String name)
Creates an empty configuration with the specified name.

Parameters:
name - Name of the configuration.
Method Detail

getName

public java.lang.String getName()
Accessor method for the ViewportConfiguration's name

Returns:
Name of the configuration

addCameraView

public void addCameraView(java.lang.String cameraName,
                          int col,
                          int row,
                          int width,
                          int height)
Adds a new camera view to this configuration. The new camera is placed in the specified row and column and is the specified number of rows and columns in size.

Parameters:
cameraName - Name of the camera to use.
col - Column in which to place the camera.
row - Row in which to place the camera.
width - Width of the camera in number of columns.
height - Height of the camera in number of rows.

getPanelConfigurations

public java.util.ArrayList getPanelConfigurations()
Retrieves a list of the stored ViewportPanelConfigurations. Each of these contain the relevant information to display a camera view.

Returns:
List containing the ViewportPanelConfigurations stored in this ViewportConfiguration.

cache3DViews

public void cache3DViews(java.util.ArrayList cached3DViews)
Store a set of 3DViews for reuse later. This method may be unused.

Parameters:
cached3DViews - List to store.

getCached3DViews

public java.util.ArrayList getCached3DViews()
Retrives the list of cached 3DViews. This method may be unused.

Returns:
ArrayList containing the cached 3DViews

cacheCanvas3DPanels

public void cacheCanvas3DPanels(java.util.ArrayList cachedPanels)
Stores a list of Canvas3DPanels. This method may be unused.

Parameters:
cachedPanels - List of cached panels to be stored.

getCachedCanvas3DPanels

public java.util.ArrayList getCachedCanvas3DPanels()
Retrieves the stored Canvas3DPanels. This method may be unused.

Returns:
ArrayList containing the stored panels.

cacheViewportPanel

public void cacheViewportPanel(javax.swing.JPanel viewportPanel)
Stores a copy of the specified panel. This method may be unused.

Parameters:
viewportPanel - Panel to store.

getCachedViewportPanel

public javax.swing.JPanel getCachedViewportPanel()
Retrieve the cached panel. This method may be unused.

Returns:
Panel to retrieve.