Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.pjsofts.eurobudget.beans
Class TransactionCustomizer  view TransactionCustomizer download TransactionCustomizer.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.pjsofts.eurobudget.beans.TransactionCustomizer
All Implemented Interfaces:
javax.accessibility.Accessible, java.beans.Customizer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
PaymentCustomizer, VersementCustomizer, VirementCustomizer

public class TransactionCustomizer
extends javax.swing.JPanel
implements java.beans.Customizer

Customizer for a Transaction Will update immediatly all changes on the given bean


Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  Account account
          The account on which we are creating this transaction, this is used only on complex transaction which need to know about it.
private  com.pjsofts.beans.AmountEditor amountEditor
          amount editor
private  java.util.SortedMap categories
          its own map of categories, given by the data model (see DataModel for format ) Used to update sub categories list
private  javax.swing.JPanel ctgPanel
           
private  com.pjsofts.beans.DateEditor dateEditor
          date editor
private  javax.swing.JScrollPane detailsScrollPane
           
private static boolean doAutoCompletion
          flag for auto-completion of transaction : when writting in some special field (to/from), some solutions by completion are proposed (not yey implemented)
protected static boolean doAutoEntry
          flag for auto-entry (when entering amount, other fields are completed with same value as latest similar transaction ) of transaction
private  boolean doBeanChanges
          flag to enable/disable bean changes, this allows to init gui without resetting the bean warning: this could breaks the rules that what is on screen is really bean's values.
private  javax.swing.JLabel flagsLabel
           
 java.awt.Component focusRoot
          focus cycle root for this container , date editor
private static java.util.ResourceBundle i18n
           
private  javax.swing.JComboBox jComboCtg
           
private  javax.swing.JComboBox jComboCtg2
           
private  javax.swing.JLabel jLabelAmount
           
private  javax.swing.JLabel jLabelCtg
           
private  javax.swing.JLabel jLabelCtgSpecial
           
private  javax.swing.JLabel jLabelDate
           
private  javax.swing.JLabel jLabelDetails
           
private  javax.swing.JTextArea jTextAreaDetails
           
protected  java.beans.PropertyChangeSupport support
          manager property listeners for this customizer
protected  Transaction txnBean
          warning will stay null as long as setObject is not called
 
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.Container
 
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
TransactionCustomizer()
          Creates a new instance of TransactionCustomizer, without category
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          add a listener to any changes on this customizer.
private  void amountEditorChange(java.beans.PropertyChangeEvent evt)
           
private  void dateEditorChange(java.beans.PropertyChangeEvent evt)
           
protected  void doAutoEntryFromAmount()
          implement auto entry from amount may be overriden (should be) by all subclasses
protected  void doAutoEntryFromDirection()
          implement auto entry from amount may be overriden (should be) by all subclasses
 Account getAccount()
          Getter for property account.
 java.util.SortedMap getCategories()
          Getter for property categories.
 Transaction getObject()
          use carefully
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void initTexts()
           
protected  boolean isAutoEntryFromAmountPossible()
          may be overriden (should be) by all subclasses
protected  boolean isAutoEntryFromDirectionPossible()
          may be overriden (should be) by all subclasses
private  void jComboCtg2ActionPerformed(java.awt.event.ActionEvent evt)
           
private  void jComboCtg2FocusLost(java.awt.event.FocusEvent evt)
          t means todays, +/-/up/down slides date,PageUp/Down slides month
private  void jComboCtgActionPerformed(java.awt.event.ActionEvent evt)
           
private  void jComboCtgFocusLost(java.awt.event.FocusEvent evt)
           
private  void jTextAreaDetailsFocusLost(java.awt.event.FocusEvent evt)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          Remove a PropertyChangeListener.
protected  void resetComponents()
          if no bean, then reset all gui component to sort of null or empty value
 void setAccount(Account account)
          Setter for property account.
 void setCategories(java.util.SortedMap categories)
          Setter for property categories.
protected  void setCategoryEnable(boolean b)
          disabled all category Combo
protected  void setCategoryPair(CategoryPair pair)
          update customizer with this value of category pair if SPECIAL CATEGORY, hide combo and put a label [category]
 void setEnabledAll(boolean b)
          enable or disable all components
 void setObject(java.lang.Object obj)
          Associate a bean with this customizer.
 void updateDataModel(com.pjsofts.eurobudget.DataModel dm, java.lang.Object arg)
          synch with a data model change , try to keep selection ...
 void updateSubCategoriesList(Category main)
          fill the list of sub categories; select none (and put txn sub cat to null!!)
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

categories

private java.util.SortedMap categories
its own map of categories, given by the data model (see DataModel for format ) Used to update sub categories list


account

private Account account
The account on which we are creating this transaction, this is used only on complex transaction which need to know about it. (Virement, Actions ...) Also used by auto-entry ..


doBeanChanges

private boolean doBeanChanges
flag to enable/disable bean changes, this allows to init gui without resetting the bean warning: this could breaks the rules that what is on screen is really bean's values. but in the same time protects bean data from side-effects and bugs from gui initialization...


support

protected java.beans.PropertyChangeSupport support
manager property listeners for this customizer


txnBean

protected Transaction txnBean
warning will stay null as long as setObject is not called


dateEditor

private com.pjsofts.beans.DateEditor dateEditor
date editor


amountEditor

private com.pjsofts.beans.AmountEditor amountEditor
amount editor


focusRoot

public java.awt.Component focusRoot
focus cycle root for this container , date editor


doAutoEntry

protected static boolean doAutoEntry
flag for auto-entry (when entering amount, other fields are completed with same value as latest similar transaction ) of transaction


doAutoCompletion

private static boolean doAutoCompletion
flag for auto-completion of transaction : when writting in some special field (to/from), some solutions by completion are proposed (not yey implemented)


jLabelCtgSpecial

private javax.swing.JLabel jLabelCtgSpecial

jLabelDate

private javax.swing.JLabel jLabelDate

detailsScrollPane

private javax.swing.JScrollPane detailsScrollPane

jLabelDetails

private javax.swing.JLabel jLabelDetails

jLabelCtg

private javax.swing.JLabel jLabelCtg

jLabelAmount

private javax.swing.JLabel jLabelAmount

flagsLabel

private javax.swing.JLabel flagsLabel

jComboCtg2

private javax.swing.JComboBox jComboCtg2

ctgPanel

private javax.swing.JPanel ctgPanel

jComboCtg

private javax.swing.JComboBox jComboCtg

jTextAreaDetails

private javax.swing.JTextArea jTextAreaDetails

i18n

private static final java.util.ResourceBundle i18n
Constructor Detail

TransactionCustomizer

public TransactionCustomizer()
Creates a new instance of TransactionCustomizer, without category

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
add a listener to any changes on this customizer. act as a proxy on the bean .. Changes are fired when customizer changes a bean value. the source object will be the customizer

Specified by:
addPropertyChangeListener in interface java.beans.Customizer

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
Description copied from interface: java.beans.Customizer
Remove a PropertyChangeListener.

Specified by:
removePropertyChangeListener in interface java.beans.Customizer

setObject

public void setObject(java.lang.Object obj)
Associate a bean with this customizer. must reinitialize all gui components even if bean variables are null Enable/disable the customizer depending of transaction(virement,verified..). Warning: side-effect, setting object to this customizer cause customizer to change this object value !! (this allows to see quickly bugs on screen (value disappearing) and a lazy implementation, but is quite tricky) Another implementation could call an initGuiField method that doesn't do & fire property change on bean (but this reclaims twice as more methods, or to remove action listeners before and readding them after)

Specified by:
setObject in interface java.beans.Customizer

resetComponents

protected void resetComponents()
if no bean, then reset all gui component to sort of null or empty value


setCategoryPair

protected void setCategoryPair(CategoryPair pair)
update customizer with this value of category pair if SPECIAL CATEGORY, hide combo and put a label [category]


getObject

public Transaction getObject()
use carefully


updateDataModel

public void updateDataModel(com.pjsofts.eurobudget.DataModel dm,
                            java.lang.Object arg)
synch with a data model change , try to keep selection ...


initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.


initTexts

private void initTexts()

jComboCtg2FocusLost

private void jComboCtg2FocusLost(java.awt.event.FocusEvent evt)
t means todays, +/-/up/down slides date,PageUp/Down slides month


jTextAreaDetailsFocusLost

private void jTextAreaDetailsFocusLost(java.awt.event.FocusEvent evt)

dateEditorChange

private void dateEditorChange(java.beans.PropertyChangeEvent evt)

amountEditorChange

private void amountEditorChange(java.beans.PropertyChangeEvent evt)

isAutoEntryFromAmountPossible

protected boolean isAutoEntryFromAmountPossible()
may be overriden (should be) by all subclasses


doAutoEntryFromAmount

protected void doAutoEntryFromAmount()
implement auto entry from amount may be overriden (should be) by all subclasses


isAutoEntryFromDirectionPossible

protected boolean isAutoEntryFromDirectionPossible()
may be overriden (should be) by all subclasses


doAutoEntryFromDirection

protected void doAutoEntryFromDirection()
implement auto entry from amount may be overriden (should be) by all subclasses


jComboCtgFocusLost

private void jComboCtgFocusLost(java.awt.event.FocusEvent evt)

jComboCtg2ActionPerformed

private void jComboCtg2ActionPerformed(java.awt.event.ActionEvent evt)

jComboCtgActionPerformed

private void jComboCtgActionPerformed(java.awt.event.ActionEvent evt)

updateSubCategoriesList

public void updateSubCategoriesList(Category main)
fill the list of sub categories; select none (and put txn sub cat to null!!)


getCategories

public java.util.SortedMap getCategories()
Getter for property categories.


setCategories

public void setCategories(java.util.SortedMap categories)
Setter for property categories.


getAccount

public Account getAccount()
Getter for property account.


setAccount

public void setAccount(Account account)
Setter for property account.


setEnabledAll

public void setEnabledAll(boolean b)
enable or disable all components


setCategoryEnable

protected void setCategoryEnable(boolean b)
disabled all category Combo