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.
 java.lang.String getName()
          Accessor method for the ViewportConfiguration's name
 java.util.ArrayList<ViewportPanelConfiguration> 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<ViewportPanelConfiguration> 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.