Class PeriodEditPanel

All Implemented Interfaces:
IItem<Period>, IItemEditor<Period>, IItemPanel<Period>, ImageObserver, MenuContainer, Serializable, Accessible

public class PeriodEditPanel extends JPanel implements IItemEditor<Period>
Since:
1.0 Nov 1, 2008
Author:
Steph GAUDRY TODO : implement validation in the period edit panel (start period may not starts before start year... idem for the end)
See Also:
Serialized Form
  • Constructor Details

    • PeriodEditPanel

      public PeriodEditPanel()
    • PeriodEditPanel

      public PeriodEditPanel(PeriodsPanel periodsPanel)
  • Method Details

    • main

      public static void main(String[] args)
      Auto-generated main method to display this JPanel inside a new JFrame.
    • data2view

      public void data2view()
      Description copied from interface: IItemEditor
      Gets data from the item object and set the view components with it
      Specified by:
      data2view in interface IItemEditor<Period>
    • saveOrUpdateItem

      public Period saveOrUpdateItem()
      Description copied from interface: IItemEditor
      Calls the persistent layer to save or update the current item.
      This method may be invoked by the ManagementPanel
      Specified by:
      saveOrUpdateItem in interface IItemEditor<Period>
      Returns:
      saved item (the persistent layer will probably set the id if a new item is saved)
    • view2data

      public void view2data()
      Description copied from interface: IItemEditor
      Gets data from the view, and sets the item data with it
      Specified by:
      view2data in interface IItemEditor<Period>
    • getItemName

      public String getItemName()
      Specified by:
      getItemName in interface IItemPanel<Period>
      Returns:
      a user readable name (ie person, actor,...)
    • getPanel

      public JPanel getPanel()
      Description copied from interface: IItemPanel
      Mostly implemented like this :
      public JPanel getPanel(){
              return this;
       }
      because we cannot inherit from JPanel for an interface, but we must insert the implemented class in a container.
      Specified by:
      getPanel in interface IItemPanel<Period>
      Returns:
      the panel
    • setItem

      public void setItem(Period item)
      Description copied from interface: IItem
      Give an item to the view
      Specified by:
      setItem in interface IItem<Period>