com.jaxfront.swing.ui.visualizers
Class AbstractCompositeView

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.AbstractCompositeView
All Implemented Interfaces:
DOMChangeListener, ComplexVisualizer, TabbableView, Visualizer, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener
Direct Known Subclasses:
AbstractCompositeTabView, AbstractPagingView, ComplexGroupView, SimpleGroupView

public abstract class AbstractCompositeView
extends AbstractView
implements TabbableView, java.awt.event.ActionListener, DOMChangeListener, javax.swing.event.ChangeListener, java.awt.event.ItemListener

This class represents an AbstractCompositeView which is derived by the abstract class AbstractView. This class gets derived by the Visualizers ComplexGroupView and SimpleGroupView. It is responsible for drawing and managing the gui components of its underlying JAXFront types.

Version:
1.60
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
AbstractCompositeView()
          Default constructor.
AbstractCompositeView(Type context)
          Default constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Manages action events on this visualizer.
 void addTab(Type type)
           
 void applyCustomLayout(javax.swing.JPanel compHolder, java.util.List childs, boolean isTabHolder)
           
 void applyStandardLayout(javax.swing.JPanel compHolder, java.util.List childs, boolean isTabHolder)
           
 void domChanged(DOMChangeEvent event)
          Manages DOMChangeEvents for this visualizer.
 javax.swing.border.Border getBorder()
          Gets the border of the typesPanel of this visualizer.
 javax.swing.JPanel getChoicePanel()
           
 Type getModel()
          Returns the model (type) of this visualizer.
 javax.swing.Action getNotSerializeTabAction()
           
 Type getSelectedTabType()
           
 javax.swing.Action getSerializeTabAction()
           
 TabActionIcon getTabActionIcon(int index)
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void markError()
          Visualizes the validation errors that occured on this visualizer.
 void populateModel()
          Updates the underlying model.
 void populateView()
          Refreshes the view according to the underlying model.
 void release()
          Releases allocated resources for this visualizer.
 void removeTab(Type type)
           
 void resetError()
          Removes the visualization of validating errors for this visualizer.
abstract  void setApplicationRequired(boolean aBoolean)
          Sets the view component to be required or not defined by the application not by xml schema.
 void setBorder(javax.swing.border.Border border)
          Sets a border to the panel of this visualizer.
 void setChoosenKeyContextValue(java.lang.String xpathRelativeToChoosenKeyContext, java.lang.String newValue)
           
 void setChoosenKeyValue(java.lang.String xpathRelativeToChoosenKey, java.lang.String newValue)
           
 void setEditable(boolean editable)
          Sets the view component editable .
 void setEnabled(boolean enabled)
          Sets whether or not this component is enabled.
 void setEnabled(boolean enabled, boolean setOptionalToo)
          Sets the component enabled/disabled.
 void setLabelColor(java.awt.Color color)
          Sets a color for the label of this visualizer.
abstract  void setRequired(boolean aBoolean)
          Sets if the visualizer requires a user input or not.
 void setSelectedTab(Type type)
           
 void setTabName(java.lang.String oldName, java.lang.String newName)
           
 void showChoice(Type type)
          Selects the given type as selected in the choice-combobox.
 void showLabel(boolean show)
          Shows or hides the label of this visualizer.
 void showTab(Type selectedType, java.lang.Object component)
          Shows the required tab.
 void stateChanged(javax.swing.event.ChangeEvent event)
           
 
Methods inherited from class com.jaxfront.swing.ui.visualizers.AbstractView
addNewChild, addTreeNode, createTabActionIcon, doUserSerialization, focusComponent, focusFirstComponent, focusGained, focusLost, getBorderPanel, getChoiceComboBox, getColumnSpecLabelAndComponent, getContext, getDefaultBackgroundColor, getDOM, getEditorComponent, getEditorComponentPanel, getFirstFocusableComponent, getHintTextLabel, getImplementation, getLabel, getLabelPanel, getLabelPanel, getLabelText, getPercentageColumnSpecComponent, getRowSpec, getRowSpecArray, getRowSpecDefaultComponentHeight, getSelectedType, getStyle, getTableLabelComponent, getVisualizerPanel, isRunningInDialog, isViewReleased, jumpTo, postInitialization, propertyChange, removeHint, removeLabel, removeMessage, removeTreeNode, scrollToView, setCodeSetValues, setEditorComponent, setFirstFocusableComponent, setLabelText, setModel, setSerializable, setTableLableComponent, setTreeIcon, setUserSerializable, setValues, setVisible, setVisibleAndSerializable, showHint, 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, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, 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
 

Constructor Detail

AbstractCompositeView

public AbstractCompositeView()
Default constructor.


AbstractCompositeView

public AbstractCompositeView(Type context)
Default constructor.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Manages action events on this visualizer.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an ActionEvent

applyCustomLayout

public void applyCustomLayout(javax.swing.JPanel compHolder,
                              java.util.List childs,
                              boolean isTabHolder)

applyStandardLayout

public void applyStandardLayout(javax.swing.JPanel compHolder,
                                java.util.List childs,
                                boolean isTabHolder)

addTab

public void addTab(Type type)

getTabActionIcon

public TabActionIcon getTabActionIcon(int index)

getSerializeTabAction

public javax.swing.Action getSerializeTabAction()

getNotSerializeTabAction

public javax.swing.Action getNotSerializeTabAction()

removeTab

public void removeTab(Type type)

getChoicePanel

public javax.swing.JPanel getChoicePanel()

domChanged

public void domChanged(DOMChangeEvent event)
Manages DOMChangeEvents for this visualizer.

Specified by:
domChanged in interface DOMChangeListener
Parameters:
event - a DOMChangeEvent that occured

getBorder

public javax.swing.border.Border getBorder()
Gets the border of the typesPanel of this visualizer.

Overrides:
getBorder in class javax.swing.JComponent
Returns:
the border of the typesPanel

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Overrides:
itemStateChanged in class AbstractView
See Also:
ItemListener.itemStateChanged(ItemEvent)

markError

public void markError()
Visualizes the validation errors that occured on this visualizer.

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

populateModel

public void populateModel()
Updates the underlying model.

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

populateView

public void populateView()
Refreshes the view according to the underlying model.

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

resetError

public void resetError()
Removes the visualization of validating errors for this visualizer.

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

setBorder

public void setBorder(javax.swing.border.Border border)
Sets a border to the panel of this visualizer.

Overrides:
setBorder in class javax.swing.JComponent
Parameters:
border - a border

setEnabled

public void setEnabled(boolean enabled)
Sets whether or not this component is enabled. A component which is enabled may respond to user input, while a component which is not enabled cannot respond to user input. Some components may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input.

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

setEnabled

public void setEnabled(boolean enabled,
                       boolean setOptionalToo)
Sets the component enabled/disabled.

Overrides:
setEnabled in class AbstractView
Parameters:
enabled - true, if the component should be enabled
setOptionalToo - true, if the optionalCheckBox should be enabled true

setEditable

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

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

setLabelColor

public void setLabelColor(java.awt.Color color)
Sets a color for the label of this visualizer.

Specified by:
setLabelColor in interface Visualizer
Specified by:
setLabelColor in class AbstractView
Parameters:
color - a new color for the label
See Also:
Visualizer.setLabelColor(java.awt.Color)

setRequired

public abstract void setRequired(boolean aBoolean)
Sets if the visualizer requires a user input or not. Required fields are displayed in another color.

Specified by:
setRequired in interface Visualizer
Specified by:
setRequired in class AbstractView
Parameters:
aBoolean - true, if this visualizer requires user input, false otherwise
See Also:
Visualizer.setRequired(boolean)

setApplicationRequired

public abstract void setApplicationRequired(boolean aBoolean)
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 AbstractView
Parameters:
aBoolean - indicates if a visualizer required user input
See Also:
Visualizer.setApplicationRequired(boolean)

showChoice

public void showChoice(Type type)
Selects the given type as selected in the choice-combobox.

Parameters:
type - a given type to be selected

showLabel

public void showLabel(boolean show)
Shows or hides the label of this visualizer.

Specified by:
showLabel in interface Visualizer
Overrides:
showLabel in class AbstractView
Parameters:
show - if true, show the label, if false, hide the label
See Also:
Visualizer.showLabel(boolean)

showTab

public void showTab(Type selectedType,
                    java.lang.Object component)
Shows the required tab.

Specified by:
showTab in interface TabbableView
Parameters:
tabName - the name of the tab to be displayed

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 AbstractView
See Also:
Visualizer.release()

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent event)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener
See Also:
ChangeListener.stateChanged(javax.swing.event.ChangeEvent)

setChoosenKeyValue

public void setChoosenKeyValue(java.lang.String xpathRelativeToChoosenKey,
                               java.lang.String newValue)
See Also:
com.jaxfront.core.type.AbstractType#setChoosenKeyValue(java.lang.String, java.lang.String)

setChoosenKeyContextValue

public void setChoosenKeyContextValue(java.lang.String xpathRelativeToChoosenKeyContext,
                                      java.lang.String newValue)
Specified by:
setChoosenKeyContextValue in class AbstractView
See Also:
com.jaxfront.core.type.AbstractType#setChoosenKeyContextValue(java.lang.String, java.lang.String)

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()

getSelectedTabType

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

setSelectedTab

public void setSelectedTab(Type type)

setTabName

public void setTabName(java.lang.String oldName,
                       java.lang.String newName)