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

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended byorg.objectweb.jac.aspects.gui.swing.SwingCustomized
All Implemented Interfaces:
Accessible, CompositeView, CustomizedView, ImageObserver, MenuContainer, RootPaneContainer, Serializable, View, ViewIdentity, WindowConstants

public class SwingCustomized
extends JFrame
implements CustomizedView

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
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.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SwingCustomized(ViewFactory factory, DisplayContext context, CustomizedGUI customized)
           
 
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()
           
 CustomizedGUI getCustomizedGUI()
          Returns the customized GUI, i.e. the object that contains all the parametrization of this view as built by the GUI aspect.
 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.
 PanelView getPanelView()
          Returns the content pane of the customized, i.e. a panel containing some sub-panels.
 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 requestFocus()
           
 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 setMenuBar(MenuView menuBar, String position)
          Set a menu bar to the customized.
 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 setPosition(int left, int up, int width, int height)
          Sets the dimensions and position of the window regarding to the main screen.
 void setSize(Length width, Length height)
          Sets the preferred size for this view.
 void setSplitters()
           
 void setStatusBar(StatusView view, String position)
          Set a status bar to the customized.
 void setStyle(String style)
          Sets the view style.
 void setToolBar(MenuView toolBar)
          Set a tool bar to the customized.
 void setType(String type)
          Set the view type.
 void setViewBorder(Border v)
          Set the value of viewBorder.
 void showStatus(String message)
          Show a message on the customized's status bar.
 String toString()
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

SwingCustomized

public SwingCustomized(ViewFactory factory,
                       DisplayContext context,
                       CustomizedGUI customized)
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

setSplitters

public void setSplitters()

setPosition

public void setPosition(int left,
                        int up,
                        int width,
                        int height)
Sets the dimensions and position of the window regarding to the main screen.

Parameters:
left - left-border pixel
up - upper-border pixel
width - in percentage regarding the screen
height - in percentage regarding the screen

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

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.

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

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)

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

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

getFactory

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

Specified by:
getFactory in interface View

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

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.

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

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

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

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

getViews

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

Specified by:
getViews in interface CompositeView

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

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

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

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

getCustomizedGUI

public CustomizedGUI getCustomizedGUI()
Description copied from interface: CustomizedView
Returns the customized GUI, i.e. the object that contains all the parametrization of this view as built by the GUI aspect.

Specified by:
getCustomizedGUI in interface CustomizedView
Returns:
an implementation-independant object

setMenuBar

public void setMenuBar(MenuView menuBar,
                       String position)
Description copied from interface: CustomizedView
Set a menu bar to the customized.

Specified by:
setMenuBar in interface CustomizedView
Parameters:
menuBar - the abstract menu bar
position - (TOP||BOTTOM)

setToolBar

public void setToolBar(MenuView toolBar)
Description copied from interface: CustomizedView
Set a tool bar to the customized.

Specified by:
setToolBar in interface CustomizedView
Parameters:
toolBar - the abstract tool bar

setStatusBar

public void setStatusBar(StatusView view,
                         String position)
Description copied from interface: CustomizedView
Set a status bar to the customized.

Specified by:
setStatusBar in interface CustomizedView
Parameters:
view - the abstract status bar
position - (TOP||BOTTOM)

showStatus

public void showStatus(String message)
Description copied from interface: CustomizedView
Show a message on the customized's status bar.

Specified by:
showStatus in interface CustomizedView
Parameters:
message - the message to show

getPanelView

public PanelView getPanelView()
Description copied from interface: CustomizedView
Returns the content pane of the customized, i.e. a panel containing some sub-panels.

Specified by:
getPanelView in interface CustomizedView
Returns:
the view of subpanes

getContext

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

requestFocus

public void requestFocus()
Specified by:
requestFocus in interface CustomizedView

toString

public String toString()