com.jaxfront.swing.ui.wrapper
Class RecursionWrapper

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 com.jaxfront.swing.ui.visualizers.AbstractView
                      extended by com.jaxfront.swing.ui.visualizers.AbstractSimpleTypeView
                          extended by com.jaxfront.swing.ui.wrapper.RecursionWrapper
All Implemented Interfaces:
ComplexVisualizer, ListVisualizer, RecursionVisualizer, SimpleTypeVisualizer, TabbableView, Visualizer, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class RecursionWrapper
extends AbstractSimpleTypeView
implements TabbableView, Visualizer, ListVisualizer, RecursionVisualizer

This class represents a RecursiveView which is derived from the class AbstractView. This class is responsible for the drawing of GUI elements for recursive types.

Version:
1.4.1
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class com.jaxfront.swing.ui.visualizers.AbstractView
FILL, FILL_NO_GROW, HEADER_HEIGHT_OFFSET, PROPERTY_USER_CHANGED_SERIALIZE
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
RecursionWrapper(Type type)
          RecursiveView constructor.
RecursionWrapper(Type type, Type context)
          RecursiveView constructor.
 
Method Summary
 void addTab(Type type)
           
 void addToRecursionPanel(Visualizer comp)
           
 void createRecursion()
          Creates recursion
 void deleteRecursion()
          Delete recursion.
 void expand(boolean expand)
           
 Type getContext()
           
 JAXDataTable getDataTable()
          Returns internal tabel representation.
 Document getDOM()
          Returns the current JAXFront document (DOM).
 javax.swing.JDialog getEditDialog(Type selectedType)
          Returns the edit dialog for a given type.
 javax.swing.JPanel getEditorComponentPanel()
          Returns the component panel.
 javax.swing.JComponent getEditorField()
          Returns the editorfield of the editor component of a AbstractSimpleTypeView.
 java.awt.Component getFirstFocusableComponent()
          Returns the first focusable component of the current view which is needed to set the focus on the first component of a visualizer.
 Visualizer getImplementation()
           
 ListType getListModel()
           
 Type getModel()
          Returns the model (type) of this visualizer.
 javax.swing.JPanel getRecursionPanel()
           
 Type getSelectedTabType()
           
 java.awt.Dimension getSize(java.awt.Dimension dim)
           
 java.lang.String getText()
          Returns the value of the component.
 void jumpTo()
          Bring this visualizer to front and set the focus.
 void markError()
          Marks the component with the defined ErrorColor if the value is not valid.
 void populateModel()
          Updates the model (type) that belongs to this visualizer.
 void populateView()
          Updates the view of this visualizer.
 void postInitialization()
          Gets called after the UI factory has created this visualizer.
 void release()
          Releases allocated resources for this visualizer.
 void removeHint()
          Removes a user defined hint message below the current component.
 void removeMessage()
          Removes the validation error message from this type.
 void removeTab(Type type)
           
 void requestFocus()
           
 void resetError()
          Removes the error from this visualizer.
 void resetView()
           
 void selectType(Type type)
          Selects the requested type in the list.
 void selectType(Type type, boolean isUserAction)
          Selects the requested type in the list.
 void setApplicationRequired(boolean required)
          Sets the view component to be required or not defined by the application not by xml schema.
 void setBackground(java.awt.Color color)
           
 void setCodeSetValues(java.lang.String url, java.lang.String codeSetName, java.lang.String[] values, java.lang.String defaultSelection)
          Sets the codeSet values for the current type.
 void setDeleteable(boolean deleteable)
           
 void setEditable(boolean enabled)
          Sets the view component editable .
 void setEnabled(boolean enabled)
          Sets the view component enabled or disabled.
 void setFont(java.awt.Font font)
           
 void setForeground(java.awt.Color color)
           
 void setLabelColor(java.awt.Color color)
          Sets the foreground color for the label.
 void setRequired(boolean required)
          Sets the view component to be required or not.
 void setToolTipText(java.lang.String text)
           
 void setVisible(boolean visible)
          Sets the view component visible or not visible.
 void showHint(java.lang.String text, boolean isFormula, java.awt.Color color, boolean isBold)
          Shows an user defined hint message below the current component.
 void showLabel(boolean show)
          Sets the label of this visualizer visible or not visible.
 void showModel(Type type)
          Shows the visualizer for the passed type within my list.
 void showTab(Type type, java.lang.Object component)
          Shows/Selects the tab in which the given component is placed in.
 void showUpDownButtons(boolean showUpDownButtons)
          Sets the visibility of the up/down buttons for a list view.
 
Methods inherited from class com.jaxfront.swing.ui.visualizers.AbstractSimpleTypeView
focusGained, focusLost, getSimpleModel, itemStateChanged, keyPressed, keyReleased, keyTyped, removeLabel, setChoosenKeyContextValue, setEditorField
 
Methods inherited from class com.jaxfront.swing.ui.visualizers.AbstractView
addNewChild, addTreeNode, createTabActionIcon, doUserSerialization, focusComponent, focusFirstComponent, getBorderPanel, getChoiceComboBox, getColumnSpecLabelAndComponent, getDefaultBackgroundColor, getEditorComponent, getHintTextLabel, getLabel, getLabelPanel, getLabelPanel, getLabelText, getPercentageColumnSpecComponent, getRowSpec, getRowSpecArray, getRowSpecDefaultComponentHeight, getSelectedType, getStyle, getTableLabelComponent, getVisualizerPanel, isRunningInDialog, isViewReleased, propertyChange, removeTreeNode, scrollToView, setEditorComponent, setEnabled, setFirstFocusableComponent, setLabelText, setModel, setSerializable, setTableLableComponent, setTreeIcon, setUserSerializable, setValues, setVisibleAndSerializable, showMessage, uiAction, useUserModifiedSerialization
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jaxfront.core.ui.Visualizer
getLabelText, isViewReleased, removeLabel, setLabelText, setModel
 
Methods inherited from interface com.jaxfront.core.ui.ListVisualizer
getSelectedType
 
Methods inherited from interface com.jaxfront.core.ui.Visualizer
getLabelText, isViewReleased, removeLabel, setLabelText, setModel
 
Methods inherited from interface com.jaxfront.core.ui.Visualizer
getLabelText, isViewReleased, removeLabel, setLabelText, setModel
 

Constructor Detail

RecursionWrapper

public RecursionWrapper(Type type)
RecursiveView constructor.

Parameters:
type - the underlying model (type)

RecursionWrapper

public RecursionWrapper(Type type,
                        Type context)
RecursiveView constructor.

Parameters:
type - the underlying model (type)
Method Detail

setDeleteable

public void setDeleteable(boolean deleteable)

getSize

public java.awt.Dimension getSize(java.awt.Dimension dim)
Overrides:
getSize in class javax.swing.JComponent
See Also:
Component.getSize(java.awt.Dimension)

markError

public void markError()
Description copied from class: AbstractSimpleTypeView
Marks the component with the defined ErrorColor if the value is not valid.

Specified by:
markError in interface Visualizer
Overrides:
markError in class AbstractSimpleTypeView
See Also:
Visualizer.markError()

populateModel

public void populateModel()
Description copied from interface: Visualizer
Updates the model (type) that belongs to this visualizer.

Specified by:
populateModel in interface Visualizer
Overrides:
populateModel in class AbstractSimpleTypeView
See Also:
Visualizer.populateModel()

populateView

public void populateView()
Description copied from interface: Visualizer
Updates the view of this visualizer.

Specified by:
populateView in interface Visualizer
Specified by:
populateView in class AbstractView
See Also:
Visualizer.populateView()

resetError

public void resetError()
Description copied from interface: Visualizer
Removes the error from this visualizer.

Specified by:
resetError in interface Visualizer
Overrides:
resetError in class AbstractSimpleTypeView
See Also:
Visualizer.resetError()

setLabelColor

public void setLabelColor(java.awt.Color color)
Description copied from interface: Visualizer
Sets the foreground color for the label.

Specified by:
setLabelColor in interface Visualizer
Overrides:
setLabelColor in class AbstractSimpleTypeView
Parameters:
color - label foreground color
See Also:
Visualizer.setLabelColor(java.awt.Color)

setRequired

public void setRequired(boolean required)
Description copied from interface: Visualizer
Sets the view component to be required or not. For example: the background of the view component may change its color.

Specified by:
setRequired in interface Visualizer
Overrides:
setRequired in class AbstractSimpleTypeView
Parameters:
required - indicates if a visualizer requires user input
See Also:
Visualizer.setRequired(boolean)

setApplicationRequired

public void setApplicationRequired(boolean required)
Description copied from interface: Visualizer
Sets the view component to be required or not defined by the application not by xml schema.

Specified by:
setApplicationRequired in interface Visualizer
Overrides:
setApplicationRequired in class AbstractSimpleTypeView
Parameters:
required - indicates if a visualizer required user input
See Also:
Visualizer.setApplicationRequired(boolean)

showLabel

public void showLabel(boolean show)
Description copied from interface: Visualizer
Sets the label of this visualizer visible or not visible.

Specified by:
showLabel in interface Visualizer
Overrides:
showLabel in class AbstractView
Parameters:
show - visibility of the label
See Also:
Visualizer.showLabel(boolean)

createRecursion

public void createRecursion()
Creates recursion

Specified by:
createRecursion in interface RecursionVisualizer

getDOM

public Document getDOM()
Description copied from class: AbstractView
Returns the current JAXFront document (DOM).

Overrides:
getDOM in class AbstractView
Returns:
the current JAXFront DOM

getModel

public Type getModel()
Description copied from interface: Visualizer
Returns the model (type) of this visualizer.

Specified by:
getModel in interface Visualizer
Overrides:
getModel in class AbstractView
See Also:
Visualizer.getModel()

deleteRecursion

public void deleteRecursion()
Delete recursion.

Specified by:
deleteRecursion in interface RecursionVisualizer

getRecursionPanel

public javax.swing.JPanel getRecursionPanel()

jumpTo

public void jumpTo()
Description copied from interface: Visualizer
Bring this visualizer to front and set the focus.

Specified by:
jumpTo in interface Visualizer
Overrides:
jumpTo in class AbstractView

postInitialization

public void postInitialization()
Description copied from interface: Visualizer
Gets called after the UI factory has created this visualizer. Do whatever you want here.

Specified by:
postInitialization in interface Visualizer
Overrides:
postInitialization in class AbstractView

setEditable

public void setEditable(boolean enabled)
Description copied from interface: Visualizer
Sets the view component editable .

Specified by:
setEditable in interface Visualizer
Overrides:
setEditable in class AbstractSimpleTypeView
Parameters:
enabled - enable/disable this visualizer
See Also:
Visualizer.setEditable(boolean)

setVisible

public void setVisible(boolean visible)
Description copied from interface: Visualizer
Sets the view component visible or not visible.

Specified by:
setVisible in interface Visualizer
Overrides:
setVisible in class AbstractView
Parameters:
visible - visibility of the visualizer
See Also:
Component.setVisible(boolean)

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Visualizer
Sets the view component enabled or disabled.

Specified by:
setEnabled in interface Visualizer
Overrides:
setEnabled in class AbstractSimpleTypeView
Parameters:
enabled - enable/disable this visualizer
See Also:
Component.setEnabled(boolean)

getText

public java.lang.String getText()
Description copied from interface: SimpleTypeVisualizer
Returns the value of the component.

Specified by:
getText in interface SimpleTypeVisualizer
Specified by:
getText in class AbstractSimpleTypeView
Returns:
String

getContext

public Type getContext()
Specified by:
getContext in interface Visualizer
Overrides:
getContext in class AbstractView

showTab

public void showTab(Type type,
                    java.lang.Object component)
Description copied from interface: TabbableView
Shows/Selects the tab in which the given component is placed in.

Specified by:
showTab in interface TabbableView
component - of the tab to be shown

getSelectedTabType

public Type getSelectedTabType()
Specified by:
getSelectedTabType in interface TabbableView

getEditorField

public javax.swing.JComponent getEditorField()
Description copied from interface: SimpleTypeVisualizer
Returns the editorfield of the editor component of a AbstractSimpleTypeView. Please note that the method getEditorComponent() returns the complete editor that may include more than just a textfield or a combobox whereas this method only returns the blank editor field (textfield, combobox, ...) that may also be used for cell editors.

Specified by:
getEditorField in interface SimpleTypeVisualizer
Overrides:
getEditorField in class AbstractSimpleTypeView
Returns:
the editorfield of the editor component of a AbstractSimpleTypeView

showHint

public void showHint(java.lang.String text,
                     boolean isFormula,
                     java.awt.Color color,
                     boolean isBold)
Description copied from class: AbstractView
Shows an user defined hint message below the current component.

Overrides:
showHint in class AbstractView
Parameters:
text - a hint text or a formula expression
isFormula - true, if the hint text should be treated as formula expression
color - the color of the hint text
isBold - true, if the hint text should be displayed bold

setCodeSetValues

public void setCodeSetValues(java.lang.String url,
                             java.lang.String codeSetName,
                             java.lang.String[] values,
                             java.lang.String defaultSelection)
Description copied from class: AbstractView
Sets the codeSet values for the current type.

Overrides:
setCodeSetValues in class AbstractView
Parameters:
url - the url of the codeSet to be set
codeSetName - the name of the codeSet to be set
values - the values of the codeSet
defaultSelection - the default selected code of the codeset

removeHint

public void removeHint()
Description copied from class: AbstractView
Removes a user defined hint message below the current component.

Overrides:
removeHint in class AbstractView

removeMessage

public void removeMessage()
Description copied from class: AbstractView
Removes the validation error message from this type.

Overrides:
removeMessage in class AbstractView

setBackground

public void setBackground(java.awt.Color color)
Overrides:
setBackground in class AbstractSimpleTypeView
See Also:
Component.setBackground(java.awt.Color)

setForeground

public void setForeground(java.awt.Color color)
Overrides:
setForeground in class AbstractSimpleTypeView
See Also:
Component.setForeground(java.awt.Color)

setToolTipText

public void setToolTipText(java.lang.String text)
Overrides:
setToolTipText in class javax.swing.JComponent

setFont

public void setFont(java.awt.Font font)
Overrides:
setFont in class javax.swing.JComponent

getFirstFocusableComponent

public java.awt.Component getFirstFocusableComponent()
Description copied from class: AbstractView
Returns the first focusable component of the current view which is needed to set the focus on the first component of a visualizer.

Overrides:
getFirstFocusableComponent in class AbstractView
Returns:
the first focusable component

getEditorComponentPanel

public javax.swing.JPanel getEditorComponentPanel()
Description copied from class: AbstractView
Returns the component panel.

Overrides:
getEditorComponentPanel in class AbstractView
Returns:
the component panel

selectType

public void selectType(Type type)
Description copied from interface: ListVisualizer
Selects the requested type in the list.

Specified by:
selectType in interface ListVisualizer

getEditDialog

public javax.swing.JDialog getEditDialog(Type selectedType)
Returns the edit dialog for a given type.

Specified by:
getEditDialog in interface ListVisualizer
Parameters:
selectedType - a given type
Returns:
JDialog the dialog for a type

getDataTable

public JAXDataTable getDataTable()
Description copied from interface: ListVisualizer
Returns internal tabel representation.

Specified by:
getDataTable in interface ListVisualizer

addTab

public void addTab(Type type)
Specified by:
addTab in interface ListVisualizer

removeTab

public void removeTab(Type type)
Specified by:
removeTab in interface ListVisualizer

showUpDownButtons

public void showUpDownButtons(boolean showUpDownButtons)
Description copied from interface: ListVisualizer
Sets the visibility of the up/down buttons for a list view.

Specified by:
showUpDownButtons in interface ListVisualizer
Parameters:
showUpDownButtons - true if the buttons should be shown

getImplementation

public Visualizer getImplementation()
Specified by:
getImplementation in interface Visualizer
Overrides:
getImplementation in class AbstractView

resetView

public void resetView()
Specified by:
resetView in interface ListVisualizer

requestFocus

public void requestFocus()
Overrides:
requestFocus in class javax.swing.JComponent

showModel

public void showModel(Type type)
Description copied from interface: ListVisualizer
Shows the visualizer for the passed type within my list.

Specified by:
showModel in interface ListVisualizer
Parameters:
type - to visualize

addToRecursionPanel

public void addToRecursionPanel(Visualizer comp)
Specified by:
addToRecursionPanel in interface RecursionVisualizer

expand

public void expand(boolean expand)
Specified by:
expand in interface RecursionVisualizer

getListModel

public ListType getListModel()
Specified by:
getListModel in interface ListVisualizer

release

public void release()
Description copied from interface: Visualizer
Releases allocated resources for this visualizer.

Specified by:
release in interface Visualizer
Overrides:
release in class AbstractSimpleTypeView
See Also:
Visualizer.release()

selectType

public void selectType(Type type,
                       boolean isUserAction)
Description copied from interface: ListVisualizer
Selects the requested type in the list.

Specified by:
selectType in interface ListVisualizer