org.opensha.sra.gui.components
Class StructureDescriptorBean

java.lang.Object
  extended by org.opensha.sra.gui.components.StructureDescriptorBean
All Implemented Interfaces:
GuiBeanAPI

public class StructureDescriptorBean
extends Object
implements GuiBeanAPI

Title: StructureDescriptorBean
Description: A bean to gather and store information about a structure. While this can be expanding upon to include more specific information about a structure, its current implementation holds only the information for the purposes of the BenefitCostRatio application.

Author:
Eric Martinez
See Also:
BRC_Application

Field Summary
 
Fields inherited from interface org.opensha.sra.gui.components.GuiBeanAPI
APPLET, APPLICATION, BUTTON, EMBED, MENUOPT, SPLASH, WEB
 
Constructor Summary
StructureDescriptorBean(List<AbstractVulnerability> vulns)
          Creates an unnamed StructureDescriptorBean
StructureDescriptorBean(String name, List<AbstractVulnerability> vulns)
          Creates a new StructureDescriptorBean with the given name.
 
Method Summary
 double getReplaceCost()
           
 Object getVisualization(int type)
          See the general contract in GuiBeanAPI.
 String getVisualizationClassName(int type)
          See the general contract in GuiBeanAPI.
 VulnerabilityBean getVulnerabilityBean()
           
 AbstractVulnerability getVulnerabilityModel()
           
 boolean isVisualizationSupported(int type)
          See the general contract in GuiBeanAPI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureDescriptorBean

public StructureDescriptorBean(List<AbstractVulnerability> vulns)
Creates an unnamed StructureDescriptorBean


StructureDescriptorBean

public StructureDescriptorBean(String name,
                               List<AbstractVulnerability> vulns)
Creates a new StructureDescriptorBean with the given name. The name is used for display purposes within the application.

Parameters:
name - The title of this bean.
Method Detail

getVulnerabilityBean

public VulnerabilityBean getVulnerabilityBean()
Returns:
The vulnerability bean used by this bean

getVulnerabilityModel

public AbstractVulnerability getVulnerabilityModel()
Returns:
The current vulnerability model selected within the vulnerability bean

getReplaceCost

public double getReplaceCost()
Returns:
The current cost to replace the structre describe by this bean

getVisualization

public Object getVisualization(int type)
See the general contract in GuiBeanAPI.

Specified by:
getVisualization in interface GuiBeanAPI
Parameters:
type - An int defining the type of application visualization desired.
Returns:
The visualization of the GuiBean. This might be a JComponent in the case of an applet/application, but might just be an HTML String in the case of a web application. Implementation can vary greatly.

getVisualizationClassName

public String getVisualizationClassName(int type)
See the general contract in GuiBeanAPI.

Specified by:
getVisualizationClassName in interface GuiBeanAPI
Parameters:
type - The type of visualization desired.
Returns:
The fully qualified class name of the visualization object returned by getVisualization. If the given type is not supported, then null is returned.

isVisualizationSupported

public boolean isVisualizationSupported(int type)
See the general contract in GuiBeanAPI.

Specified by:
isVisualizationSupported in interface GuiBeanAPI
Parameters:
type - The type of application the visualization is desired for.
Returns:
True if the visualization type is available, false otherwise.