org.objectweb.jac.aspects.gui.swing
Class DesktopView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLayeredPane
                  extended byjavax.swing.JDesktopPane
                      extended byorg.objectweb.jac.aspects.gui.swing.DesktopView
All Implemented Interfaces:
Accessible, CompositeView, ImageObserver, MenuContainer, Serializable, View, ViewIdentity

public class DesktopView
extends JDesktopPane
implements CompositeView

This class defines a Swing component tree view for objects that are related to a root object through relations or collections.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JDesktopPane
JDesktopPane.AccessibleJDesktopPane
 
Nested classes inherited from class javax.swing.JLayeredPane
JLayeredPane.AccessibleJLayeredPane
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JDesktopPane
LIVE_DRAG_MODE, OUTLINE_DRAG_MODE
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
DesktopView()
           
 
Method Summary
 void addHorizontalStrut(int width)
          Adds an horizontal separator in the composite in order to insert blanks between components.
 void addVerticalStrut(int height)
          Adds a vertical separator in the composite in order to insert blanks between components.
 void addView(View view)
          Adds a component view in the composite.
 void addView(View view, Object extraInfos)
          Adds a component view in the composite.
 void close(boolean validate)
          Close this view.
 boolean containsView(String viewType, Object[] parameters)
          Tells wether the composite view contains a view with some given view type and paramters
 boolean equalsView(String type, Object[] parameters)
           
 boolean equalsView(ViewIdentity view)
          Tells if a view is the same as another one, ie it has the same type and parameters.
 DisplayContext getContext()
           
 String getDescription()
          Get the value of description.
 ViewFactory getFactory()
          Gets the factory.
 String getLabel()
          Gets the view's label (identifier).
 MethodItem getMessage()
          Get the value of message.
 Object[] getParameters()
          The parameters that were used to compile the view.
 View getParentView()
          Get the value of parentView.
 View getRootView()
          Gets the ancestor view whose parent is null
 String getStyle()
          Gets the user-defined style for this view.
 String getType()
          Gets the view type.
 View getView(Object id)
          Gets a component view from an id object.
 Border getViewBorder()
          Get the value of viewBorder.
 Collection getViews()
          Gets all the component views in this composite.
 boolean isClosed()
          Tells if this view has been closed by the GUI or the user.
 boolean isDescendantOf(View ancestor)
          Tells wether this view has a given view in its ancestors
 void removeAllViews(boolean validate)
          Removes all the views in this composite.
 void removeView(View component, boolean validate)
          Removes a component view in this composite.
 void setContext(DisplayContext context)
          Sets the display context for this view.
 void setDescription(String v)
          Set the value of description.
 void setFactory(ViewFactory factory)
          Sets the factory for this view (WEB, SWING or other supported factory).
 void setFocus(FieldItem field, Object option)
          Focus a field of an object's view.
 void setLabel(String label)
          Sets the label (the identifier) of the view.
 void setMessage(MethodItem v)
          Set the value of message.
 void setParameters(Object[] parameters)
          Sets the parameters that were used to construct the view.
 void setParentView(View v)
          Set the value of parentView.
 void setSize(Length width, Length height)
          Sets the preferred size for this view.
 void setStyle(String style)
          Sets the view style.
 void setType(String type)
          Set the view type.
 void setViewBorder(Border v)
          Set the value of viewBorder.
 String toString()
           
 
Methods inherited from class javax.swing.JDesktopPane
getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DesktopView

public DesktopView()
Method Detail

addHorizontalStrut

public void addHorizontalStrut(int width)
Description copied from interface: CompositeView
Adds an horizontal separator in the composite in order to insert blanks between components.

Specified by:
addHorizontalStrut in interface CompositeView

addVerticalStrut

public void addVerticalStrut(int height)
Description copied from interface: CompositeView
Adds a vertical separator in the composite in order to insert blanks between components.

Specified by:
addVerticalStrut in interface CompositeView

setStyle

public void setStyle(String style)
Description copied from interface: View
Sets the view style. The style can be exploited in different maners depending on the GUI supports (e.g. with CSS for the WEB). Styles are user-defined.

Specified by:
setStyle in interface View

getStyle

public String getStyle()
Description copied from interface: View
Gets the user-defined style for this view.

Specified by:
getStyle in interface View
Returns:
the style, null if undefined

getViewBorder

public Border getViewBorder()
Get the value of viewBorder.

Specified by:
getViewBorder in interface View
Returns:
value of viewBorder.

setViewBorder

public void setViewBorder(Border v)
Set the value of viewBorder.

Specified by:
setViewBorder in interface View
Parameters:
v - Value to assign to viewBorder.

getDescription

public String getDescription()
Get the value of description.

Specified by:
getDescription in interface View
Returns:
value of description.

setDescription

public void setDescription(String v)
Set the value of description.

Specified by:
setDescription in interface View
Parameters:
v - Value to assign to description.
See Also:
View.setMessage(MethodItem)

getParentView

public View getParentView()
Get the value of parentView.

Specified by:
getParentView in interface View
Returns:
value of parentView.
See Also:
CompositeView

setParentView

public void setParentView(View v)
Set the value of parentView.

Specified by:
setParentView in interface View
Parameters:
v - Value to assign to parentView.
See Also:
CompositeView

getRootView

public View getRootView()
Description copied from interface: View
Gets the ancestor view whose parent is null

Specified by:
getRootView in interface View

isDescendantOf

public boolean isDescendantOf(View ancestor)
Description copied from interface: View
Tells wether this view has a given view in its ancestors

Specified by:
isDescendantOf in interface View
Parameters:
ancestor - the ancestor

getMessage

public MethodItem getMessage()
Get the value of message.

Specified by:
getMessage in interface View
Returns:
value of message.

setMessage

public void setMessage(MethodItem v)
Set the value of message.

Specified by:
setMessage in interface View
Parameters:
v - Value to assign to message.
See Also:
View.setDescription(String)

addView

public void addView(View view,
                    Object extraInfos)
Description copied from interface: CompositeView
Adds a component view in the composite.

Specified by:
addView in interface CompositeView
Parameters:
view - the component view
extraInfos - some positionning infos on where the component should be added in the composite

addView

public void addView(View view)
Description copied from interface: CompositeView
Adds a component view in the composite.

Specified by:
addView in interface CompositeView
Parameters:
view - the component view

removeView

public void removeView(View component,
                       boolean validate)
Description copied from interface: CompositeView
Removes a component view in this composite.

Specified by:
removeView in interface CompositeView
Parameters:
component - the component view to remove
validate - wether to validate values in editors

getView

public View getView(Object id)
Description copied from interface: CompositeView
Gets a component view from an id object.

Specified by:
getView in interface CompositeView

getViews

public Collection getViews()
Description copied from interface: CompositeView
Gets all the component views in this composite.

Specified by:
getViews in interface CompositeView

removeAllViews

public void removeAllViews(boolean validate)
Description copied from interface: CompositeView
Removes all the views in this composite.

Specified by:
removeAllViews in interface CompositeView
Parameters:
validate - wether to validate values in editors

containsView

public boolean containsView(String viewType,
                            Object[] parameters)
Description copied from interface: CompositeView
Tells wether the composite view contains a view with some given view type and paramters

Specified by:
containsView in interface CompositeView
Parameters:
viewType - the type of the view to look for
parameters - the parameters of the view to look for
Returns:
true if the composite contains a view with the given type and parameters

setContext

public void setContext(DisplayContext context)
Description copied from interface: View
Sets the display context for this view.

The display context contains the factory that is used for this view.

Specified by:
setContext in interface View

getContext

public DisplayContext getContext()
Specified by:
getContext in interface View
Returns:
the DisplayContext of the view

setLabel

public void setLabel(String label)
Description copied from interface: View
Sets the label (the identifier) of the view.

Specified by:
setLabel in interface View
Parameters:
label - a string that identifies the view

getLabel

public String getLabel()
Description copied from interface: View
Gets the view's label (identifier).

Specified by:
getLabel in interface View
Returns:
the view's label

setSize

public void setSize(Length width,
                    Length height)
Description copied from interface: View
Sets the preferred size for this view.

Specified by:
setSize in interface View
Parameters:
width - the preferred width. If null, the preferred width is not changed.
height - the preferred height. If null, the preferred height is not changed.

close

public void close(boolean validate)
Description copied from interface: View
Close this view. This should be upcalled when the view is closed in order to free resources or close other dependant views.

Specified by:
close in interface View
Parameters:
validate - wether to validate any value contained in editors.

isClosed

public boolean isClosed()
Description copied from interface: View
Tells if this view has been closed by the GUI or the user.

Specified by:
isClosed in interface View

getFactory

public ViewFactory getFactory()
Description copied from interface: View
Gets the factory.

Specified by:
getFactory in interface View

setFactory

public void setFactory(ViewFactory factory)
Description copied from interface: View
Sets the factory for this view (WEB, SWING or other supported factory).

Specified by:
setFactory in interface View

setType

public void setType(String type)
Description copied from interface: ViewIdentity
Set the view type.

Specified by:
setType in interface ViewIdentity

getType

public String getType()
Description copied from interface: ViewIdentity
Gets the view type.

Specified by:
getType in interface ViewIdentity
Returns:
view type string as declared in web.acc or swing.acc depending on the GUI target

setParameters

public void setParameters(Object[] parameters)
Description copied from interface: ViewIdentity
Sets the parameters that were used to construct the view.

Specified by:
setParameters in interface ViewIdentity

getParameters

public Object[] getParameters()
Description copied from interface: ViewIdentity
The parameters that were used to compile the view.

Specified by:
getParameters in interface ViewIdentity

equalsView

public boolean equalsView(ViewIdentity view)
Description copied from interface: ViewIdentity
Tells if a view is the same as another one, ie it has the same type and parameters.

Specified by:
equalsView in interface ViewIdentity

equalsView

public boolean equalsView(String type,
                          Object[] parameters)
Specified by:
equalsView in interface ViewIdentity

setFocus

public void setFocus(FieldItem field,
                     Object option)
Description copied from interface: View
Focus a field of an object's view.

Specified by:
setFocus in interface View
Parameters:
field - the field to focus
option - an extra option

toString

public String toString()