org.homeunix.thecave.buddi.view.panels
Class TransactionEditorPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.homeunix.thecave.moss.swing.MossPanel
                      extended by org.homeunix.thecave.buddi.view.panels.TransactionEditorPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, StandardContainer

public class TransactionEditorPanel
extends MossPanel

The transaction editing pane, which includes text fields to enter date, descriptions, number, amount, etc. Currently used in TransactionFrame and ScheduledTransaction.

Author:
wyatt
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static long serialVersionUID
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TransactionEditorPanel(Document model, Source associatedAccount, boolean scheduledTransactionPane)
           
 
Method Summary
 Source getFrom()
           
 Source getTo()
           
 Transaction getTransaction()
           
 Transaction getTransactionNew()
          Creates and returns a new transaction, given the currently entered values in TransactinEditor.
 Transaction getTransactionUpdated()
          Returns the updated transaction.
 void init()
          The method to initialize the container.
 boolean isChanged()
           
 boolean isDangerouslyChanged()
           
 boolean isTransactionValid()
           
 boolean isTransactionValid(Source thisSource)
           
 void resetSelection()
           
 void setChanged(boolean changed)
           
 void setEnabled(boolean arg0)
           
 void setTransaction(Transaction transaction, boolean force)
           
 void updateClearedAndReconciled()
          Forces the Cleared and reconciled boxes to update to the current values as stored in the model.
 void updateContent()
          The method to update components on screen when content changes.
 
Methods inherited from class org.homeunix.thecave.moss.swing.MossPanel
clear, open, updateButtons
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

TransactionEditorPanel

public TransactionEditorPanel(Document model,
                              Source associatedAccount,
                              boolean scheduledTransactionPane)
Method Detail

init

public void init()
Description copied from interface: StandardContainer
The method to initialize the container. This should do at minimum the following: a) Create and add apropriate UI controls (buttons, panels, etc). This is generally done in the View level. b) Create and add actions to the UI controls. This is generally done at the Controller level. In short, init() should do everything required to make a fully function window, other than pack(), setVisible(true), and any positioning methods as required for a given window. init() MUST only be called once. You should not call it directly, unless you do not call openWindow().

Specified by:
init in interface StandardContainer
Overrides:
init in class MossPanel

setTransaction

public void setTransaction(Transaction transaction,
                           boolean force)

isChanged

public boolean isChanged()

isDangerouslyChanged

public boolean isDangerouslyChanged()
Returns:
a boolean value indicating whether it's likely that this transaction was inadvertently edited by the user when they were trying to create a new transaction instead.

setChanged

public void setChanged(boolean changed)

getTransactionUpdated

public Transaction getTransactionUpdated()
                                  throws InvalidValueException
Returns the updated transaction. If called from a new transaction, it throws an exception.

Returns:
Throws:
InvalidValueException

getTransaction

public Transaction getTransaction()

getTransactionNew

public Transaction getTransactionNew()
                              throws InvalidValueException
Creates and returns a new transaction, given the currently entered values in TransactinEditor. If all the required fields are not filled in, returns null.

Returns:
Throws:
InvalidValueException

getFrom

public Source getFrom()

getTo

public Source getTo()

isTransactionValid

public boolean isTransactionValid()

isTransactionValid

public boolean isTransactionValid(Source thisSource)

updateContent

public void updateContent()
Description copied from interface: StandardContainer
The method to update components on screen when content changes. Essentially forces a complete redraw of the screen. This can potentially be a time consuming operation, so you should generally use this method sparingly. Do not put anything in updateContent which cannot be called repeatedly, such as code for loading data from disk, initializing listeners, etc. While this code is probably not to be called often, there is no guarantee that it will only be called once. Put code which can only be called once into init().

Specified by:
updateContent in interface StandardContainer
Overrides:
updateContent in class MossPanel

setEnabled

public void setEnabled(boolean arg0)
Overrides:
setEnabled in class javax.swing.JComponent

resetSelection

public void resetSelection()

updateClearedAndReconciled

public void updateClearedAndReconciled()
Forces the Cleared and reconciled boxes to update to the current values as stored in the model. Should only be used for the Clear / Reconcile shortcuts.