Class PNotesPage

All Implemented Interfaces:
PAppComponent, PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PContextChangedListener, PViewDataChangeListener, ActionListener, ContainerListener, ImageObserver, MenuContainer, VetoableChangeListener, Serializable, EventListener, Accessible

See Also:
  • Constructor Details

    • PNotesPage

      public PNotesPage(JFrame frame)
  • Method Details

    • getModelHandle

      public PModelHandle getModelHandle()
      Get the current model handle
      Specified by:
      getModelHandle in interface PComponent
      Overrides:
      getModelHandle in class PIACustomizablePanel
      Returns:
      The PModelHandle associated with this component.
    • getOldNotes

      protected String getOldNotes()
    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Get the class name for this classes controller
      Specified by:
      getControllerClassName in interface PComponent
      Overrides:
      getControllerClassName in class PIACustomizablePanel
      Returns:
      A null String.
      Throws:
      RemoteException - thrown for errors
    • actionPerformed

      public void actionPerformed(ActionEvent ae)
      Handle button events
      Specified by:
      actionPerformed in interface ActionListener
    • setOldText

      protected void setOldText()
      Set the text in the view are with old notes
    • closeNotes

      protected void closeNotes()
      Clear the text in the Add-Notes area before exiting
    • isDirty

      public boolean isDirty()
      Check if the user-entered field is dirty
      Specified by:
      isDirty in interface PComponentAttribute
      Overrides:
      isDirty in class PIACustomizablePanel
      Returns:
      True if any descendant is marked DIRTY; false otherwise.
    • saveNotes

      protected void saveNotes()
      save the notes. when save done, refresh the view panel with new text.
    • saveNotes

      public void saveNotes(int notesCategory, String textToSave)
      Overloaded saveNotes. this is invoked by other "dialogs" that wish to save notes.
      Parameters:
      notesCategory -
      textToSave -
    • queryUser

      protected boolean queryUser()
      Ask user if the dirtied text-field need to be saved
      Returns:
      true - user want to save
    • exit

      public boolean exit()
      On window event check if the fields are dirtied and the user wants to save the notes
      Returns:
      true on user wants to exit and false otherwise
    • getIsNotesVisible

      protected boolean getIsNotesVisible()
      this is a helper method for the parent frame to check if the panel has any updated info on the last-saved state (whether visible or not)
      Returns:
      true if visible, false otherwise
    • setIsNotesVisible

      protected void setIsNotesVisible(boolean flag)
      this is a helper method for the parent frame to check if the panel has any updated info on the last-saved state (whether visible or not)
      Parameters:
      flag - -
    • vetoableChange

      public void vetoableChange(PropertyChangeEvent event) throws PropertyVetoException
      Implement veteoableChange. Listens to account Vetoable change
      Specified by:
      vetoableChange in interface VetoableChangeListener
      Parameters:
      Veteoable - change event
      Throws:
      PropertyVetoException
    • okToExit

      public boolean okToExit(PContextChangedEvent event)
      Listens to window close event. Note: there are some no-op event-handlers
      Specified by:
      okToExit in interface PContextChangedListener
      Parameters:
      event - the event to handle
      window - close event
    • toTop

      public void toTop(PContextChangedEvent event)
      Handle a ContextChanged event
      Specified by:
      toTop in interface PContextChangedListener
      Parameters:
      event - The event to handle
    • wasOnTop

      public void wasOnTop(PContextChangedEvent event)
      Handle a ContextChanged event
      Specified by:
      wasOnTop in interface PContextChangedListener
      Parameters:
      event - The event to handle
    • appletStart

      public void appletStart(PContextChangedEvent event)
      Handle a ContextChanged event
      Specified by:
      appletStart in interface PContextChangedListener
      Parameters:
      event - The event to handle
    • appletStop

      public void appletStop(PContextChangedEvent event)
      Handle a ContextChanged event
      Specified by:
      appletStop in interface PContextChangedListener
      Parameters:
      event - The event to handle
    • sizeChanged

      public void sizeChanged(PContextChangedEvent event)
      Handle a ContextChanged event
      Specified by:
      sizeChanged in interface PContextChangedListener
      Parameters:
      event - The event to handle