Class MetersTabbedPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

public class MetersTabbedPane extends DynamicTabbedPane<MeterAVGPanel>
Since:
1.0 7 févr. 2009
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • MetersTabbedPane

      public MetersTabbedPane(House house)
      Parameters:
      house -
  • Method Details

    • setMetersFactory

      public void setMetersFactory(House metersFactory)
    • getNewTabTitle

      public String getNewTabTitle()
      Specified by:
      getNewTabTitle in class DynamicTabbedPane<MeterAVGPanel>
      Returns:
      the text shown on the new tab
    • getNewTabView

      public MeterAVGPanel getNewTabView()
      Description copied from class: DynamicTabbedPane
      The implementation of getNewTabView must provides an instance of a <T> component to show when the new tab will be selected.
      Specified by:
      getNewTabView in class DynamicTabbedPane<MeterAVGPanel>
      Returns:
      <T> component to associate to the new tab
    • openTab

      public MeterAVGPanel openTab(Meter meter)
    • getLastMeter

      protected Meter getLastMeter() throws Exception
      Throws:
      Exception
    • onOpenNewTab

      public MeterAVGPanel onOpenNewTab()
      Description copied from class: DynamicTabbedPane
      Override this method if you want other things to happen when opening a new tab.
      The override method may be like that :
        public StudentQuotationsPanel onOpenNewTab() {
        StudentQuotationsPanel studentQuotationsPanel = null;
        if (availableCourses == null || availableCourses.size() < 1) {
              JOptionPane.showMessageDialog(this, getLocalized("student.noCourse2Add")
                              + student.toString() + ".", getLocalized("course.add"),
                              JOptionPane.INFORMATION_MESSAGE);
        
        } else {
              Course course = (Course) JOptionPane.showInputDialog(this,
                              getLocalized("student.selectCourse2Add"), getLocalized("course.add"),
                              JOptionPane.PLAIN_MESSAGE,
                              BrolImagesEduCotation.COURSE_LOGO.getIcon(),
                              availableCourses.toArray(new Course[0]), null);
              if (course != null) {
                      startTab(course);
              }
        }
        return studentQuotationsPanel;
        }
        
      Overrides:
      onOpenNewTab in class DynamicTabbedPane<MeterAVGPanel>
      Returns:
      null if selection failed or canceled, T object otherwise
    • onCloseTab

      protected void onCloseTab(int index)
      Description copied from class: DynamicTabbedPane
      Removes the tab at the specified index
      Overrides:
      onCloseTab in class DynamicTabbedPane<MeterAVGPanel>
      Parameters:
      index - position of the tab to close