- Hlavní stránka
- Balíky
- Třídy
- Soubory

# src/cz/neubauer/tomas/hazardanalysis/model/tablemodels/ComponentDangerVariantTableModel.java

Zobrazit dokumentaci tohoto souboru.

    00001
    00004 package cz.neubauer.tomas.hazardanalysis.model.tablemodels;
    00005
    00006 import java.util.ArrayList;
    00007
    00008 import cz.neubauer.tomas.hazardanalysis.model.components.Component;
    00009 import cz.neubauer.tomas.hazardanalysis.model.dangers.DangerVariant;
    00010
    00014 public class ComponentDangerVariantTableModel extends DangerVariantTableModel {
    00015
    00019         private static final long serialVersionUID = 7740684095250049692L;
    00020
    00021         private Component component;
    00022
    00027         public ComponentDangerVariantTableModel(Component component,
    00028                         ArrayList<DangerVariant> variants) {
    00029                 super(variants);
    00030                 this.component = component;
    00031         }
    00032
    00033         /*
    00034          * (non-Javadoc)
    00035          *
    00036          * @see rizika.gui.DangerVariantTableModel#getValueAt(int, int)
    00037          */
    00038         @Override
    00039         public Object getValueAt(int rowIndex, int columnIndex) {
    00040                 DangerVariant currentVariant = getDangerVariants().get(rowIndex);
    00041                 switch (columnIndex) {
    00042                 case 0:
    00043                         return currentVariant.getDescription();
    00044                 case 1:
    00045                         return currentVariant.isSelected();// component.hasDangerVariant(currentVariant);
    00046                 default:
    00047                         return null;
    00048                 }
    00049         }
    00050
    00051         public Component getComponent() {
    00052                 return component;
    00053         }
    00054
    00055         public void setComponent(Component component) {
    00056                 this.component = component;
    00057         }
    00058
    00059         /*
    00060          * (non-Javadoc)
    00061          *
    00062          * @see rizika.gui.DangerVariantTableModel#getColumnName(int)
    00063          */
    00064         @Override
    00065         public String getColumnName(int column) {
    00066                 switch (column) {
    00067                 case 0:
    00068                         return "Popis nebezpečí";
    00069                 case 1:
    00070                         return "";
    00071                 default:
    00072                         return null;
    00073                 }
    00074         }
    00075 }