Top Description Inners Fields Constructors Methods
javax.swing.plaf.metal

public Class MetalRootPaneUI

extends BasicRootPaneUI
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.awt.Component, .Container, .Cursor, .Dialog, .Dimension, .Frame, .Insets, .LayoutManager, .LayoutManager2, .Point, .Rectangle, .Toolkit, .Window, java.awt.event.InputEvent, .MouseEvent, java.beans.PropertyChangeEvent, javax.swing.JComponent, .JLayeredPane, .JRootPane, .LookAndFeel, .SwingUtilities, javax.swing.event.MouseInputListener, javax.swing.plaf.ComponentUI, javax.swing.plaf.basic.BasicRootPaneUI

Provides the metal look and feel implementation of RootPaneUI.

MetalRootPaneUI provides support for the windowDecorationStyle property of JRootPane. MetalRootPaneUI does this by way of installing a custom LayoutManager, a private Component to render the appropriate widgets, and a private Border. The LayoutManager is always installed, regardless of the value of the windowDecorationStyle property, but the Border and Component are only installed/added if the windowDecorationStyle is other than JRootPane.NONE.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Terry Kellerman
Since
1.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
MetalRootPaneUI.MetalRootLayout

A custom layout manager that is responsible for the layout of layeredPane, glassPane, menuBar and titlePane, if one has been installed.

private class
MetalRootPaneUI.MouseInputHandler

MouseInputHandler is responsible for handling resize/moving of the Window.

Field Summary

Modifier and TypeField and Description
private static final int
BORDER_DRAG_THICKNESS

Region from edges that dragging is active from.

private static final String[]
borderKeys

Keys to lookup borders in defaults table.

private static final int
CORNER_DRAG_WIDTH

The amount of space (in pixels) that the cursor is changed on.

private static final int[]
cursorMapping

Maps from positions to cursor type.

private Cursor
lastCursor

Cursor used to track the cursor set by the user.

private LayoutManager
layoutManager

The LayoutManager that is set on the JRootPane.

private MouseInputListener
mouseInputListener

MouseInputListener that is added to the parent Window the JRootPane is contained in.

private JRootPane
root

JRootPane providing the look and feel for.

private LayoutManager
savedOldLayout

LayoutManager of the JRootPane before we replaced it.

private JComponent
titlePane

JComponent providing window decorations.

private Window
window

Window the JRootPane is in.

Constructor Summary

AccessConstructor and Description
public
MetalRootPaneUI()

Constructs a MetalRootPaneUI.

Method Summary

Modifier and TypeMethod and Description
private LayoutManager
createLayoutManager()

Returns a LayoutManager that will be set on the JRootPane.

private JComponent
createTitlePane(JRootPane root)

Returns the JComponent to render the window decoration style.

public static ComponentUI

Returns:

the RootPaneUI implementation for the passed in JRootPane
createUI
(JComponent
the JRootPane the RootPaneUI will be created for
c
)

Hides javax.swing.plaf.basic.BasicRootPaneUI.createUI.

Creates a UI for a JRootPane.
private MouseInputListener
createWindowMouseInputListener(JRootPane root)

Returns a MouseListener that will be added to the Window containing the JRootPane.

private JRootPane
getRootPane()

Returns the JRootPane we're providing the look and feel for.

private JComponent

Returns:

the current window title pane, or null
getTitlePane
()

Returns the JComponent rendering the title pane.

pack-priv void
installBorder(JRootPane root)

Installs the appropriate Border onto the JRootPane.

private void
installClientDecorations(JRootPane root)

Installs the necessary state onto the JRootPane to render client decorations.

private void
installLayout(JRootPane root)

Installs the appropriate LayoutManager on the JRootPane to render the window decorations.

public void
installUI(JComponent
the JRootPane to install state onto
c
)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.installUI.

Invokes supers implementation of installUI to install the necessary state onto the passed in JRootPane to render the metal look and feel implementation of RootPaneUI.
private void
installWindowListeners(JRootPane root, Component
The parent of the JRootPane
parent
)

Installs the necessary Listeners on the parent Window, if there is one.

public void
propertyChange(PropertyChangeEvent
A PropertyChangeEvent object describing the event source and the property that has changed.
e
)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.propertyChange.

Implements java.beans.PropertyChangeListener.propertyChange.

Invoked when a property changes.
private void
setTitlePane(JRootPane root, JComponent
the JComponent to use for the window title pane.
titlePane
)

Sets the window title pane -- the JComponent used to provide a plaf a way to override the native operating system's window title pane with one whose look and feel are controlled by the plaf.

private void
uninstallBorder(JRootPane root)

Removes any border that may have been installed.

private void
uninstallClientDecorations(JRootPane root)

Uninstalls any state that installClientDecorations has installed.

private void
uninstallLayout(JRootPane root)

Uninstalls the previously installed LayoutManager.

public void
uninstallUI(JComponent
the JRootPane to uninstall state from
c
)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.uninstallUI.

Invokes supers implementation to uninstall any of its state.
private void
uninstallWindowListeners(JRootPane root)

Uninstalls the necessary Listeners on the Window the Listeners were last installed on.

Inherited from javax.swing.plaf.basic.BasicRootPaneUI:
installComponentsinstallDefaultsinstallKeyboardActionsinstallListenersuninstallComponentsuninstallDefaultsuninstallKeyboardActionsuninstallListeners

Field Detail

BORDER_DRAG_THICKNESSback to summary
private static final int BORDER_DRAG_THICKNESS

Region from edges that dragging is active from.

borderKeysback to summary
private static final String[] borderKeys

Keys to lookup borders in defaults table.

CORNER_DRAG_WIDTHback to summary
private static final int CORNER_DRAG_WIDTH

The amount of space (in pixels) that the cursor is changed on.

cursorMappingback to summary
private static final int[] cursorMapping

Maps from positions to cursor type. Refer to calculateCorner and calculatePosition for details of this.

lastCursorback to summary
private Cursor lastCursor

Cursor used to track the cursor set by the user. This is initially Cursor.DEFAULT_CURSOR.

layoutManagerback to summary
private LayoutManager layoutManager

The LayoutManager that is set on the JRootPane.

mouseInputListenerback to summary
private MouseInputListener mouseInputListener

MouseInputListener that is added to the parent Window the JRootPane is contained in.

rootback to summary
private JRootPane root

JRootPane providing the look and feel for.

savedOldLayoutback to summary
private LayoutManager savedOldLayout

LayoutManager of the JRootPane before we replaced it.

titlePaneback to summary
private JComponent titlePane

JComponent providing window decorations. This will be null if not providing window decorations.

windowback to summary
private Window window

Window the JRootPane is in.

Constructor Detail

MetalRootPaneUIback to summary
public MetalRootPaneUI()

Constructs a MetalRootPaneUI.

Method Detail

createLayoutManagerback to summary
private LayoutManager createLayoutManager()

Returns a LayoutManager that will be set on the JRootPane.

createTitlePaneback to summary
private JComponent createTitlePane(JRootPane root)

Returns the JComponent to render the window decoration style.

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.basic.BasicRootPaneUI.createUI.

Creates a UI for a JRootPane.

Parameters
c:JComponent

the JRootPane the RootPaneUI will be created for

Returns:ComponentUI

the RootPaneUI implementation for the passed in JRootPane

createWindowMouseInputListenerback to summary
private MouseInputListener createWindowMouseInputListener(JRootPane root)

Returns a MouseListener that will be added to the Window containing the JRootPane.

getRootPaneback to summary
private JRootPane getRootPane()

Returns the JRootPane we're providing the look and feel for.

getTitlePaneback to summary
private JComponent getTitlePane()

Returns the JComponent rendering the title pane. If this returns null, it implies there is no need to render window decorations.

Returns:JComponent

the current window title pane, or null

See Also
setTitlePane
installBorderback to summary
pack-priv void installBorder(JRootPane root)

Installs the appropriate Border onto the JRootPane.

installClientDecorationsback to summary
private void installClientDecorations(JRootPane root)

Installs the necessary state onto the JRootPane to render client decorations. This is ONLY invoked if the JRootPane has a decoration style other than JRootPane.NONE.

installLayoutback to summary
private void installLayout(JRootPane root)

Installs the appropriate LayoutManager on the JRootPane to render the window decorations.

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.installUI.

Invokes supers implementation of installUI to install the necessary state onto the passed in JRootPane to render the metal look and feel implementation of RootPaneUI. If the windowDecorationStyle property of the JRootPane is other than JRootPane.NONE, this will add a custom Component to render the widgets to JRootPane, as well as installing a custom Border and LayoutManager on the JRootPane.

Parameters
c:JComponent

the JRootPane to install state onto

installWindowListenersback to summary
private void installWindowListeners(JRootPane root, Component parent)

Installs the necessary Listeners on the parent Window, if there is one.

This takes the parent so that cleanup can be done from removeNotify, at which point the parent hasn't been reset yet.

Parameters
parent:Component

The parent of the JRootPane

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.propertyChange.

Implements java.beans.PropertyChangeListener.propertyChange.

Invoked when a property changes. MetalRootPaneUI is primarily interested in events originating from the JRootPane it has been installed on identifying the property windowDecorationStyle. If the windowDecorationStyle has changed to a value other than JRootPane.NONE, this will add a Component to the JRootPane to render the window decorations, as well as installing a Border on the JRootPane. On the other hand, if the windowDecorationStyle has changed to JRootPane.NONE, this will remove the Component that has been added to the JRootPane as well resetting the Border to what it was before installUI was invoked.

Parameters
e:PropertyChangeEvent

A PropertyChangeEvent object describing the event source and the property that has changed.

setTitlePaneback to summary
private void setTitlePane(JRootPane root, JComponent titlePane)

Sets the window title pane -- the JComponent used to provide a plaf a way to override the native operating system's window title pane with one whose look and feel are controlled by the plaf. The plaf creates and sets this value; the default is null, implying a native operating system window title pane.

Parameters
titlePane:JComponent

the JComponent to use for the window title pane.

uninstallBorderback to summary
private void uninstallBorder(JRootPane root)

Removes any border that may have been installed.

uninstallClientDecorationsback to summary
private void uninstallClientDecorations(JRootPane root)

Uninstalls any state that installClientDecorations has installed.

Note

This may be called if you haven't installed client decorations yet (ie before installClientDecorations has been invoked).

uninstallLayoutback to summary
private void uninstallLayout(JRootPane root)

Uninstalls the previously installed LayoutManager.

uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.basic.BasicRootPaneUI.uninstallUI.

Invokes supers implementation to uninstall any of its state. This will also reset the LayoutManager of the JRootPane. If a Component has been added to the JRootPane to render the window decoration style, this method will remove it. Similarly, this will revert the Border and LayoutManager of the JRootPane to what it was before installUI was invoked.

Parameters
c:JComponent

the JRootPane to uninstall state from

uninstallWindowListenersback to summary
private void uninstallWindowListeners(JRootPane root)

Uninstalls the necessary Listeners on the Window the Listeners were last installed on.

javax.swing.plaf.metal back to summary

private Class MetalRootPaneUI.MetalRootLayout

extends Object
implements LayoutManager2
Class Inheritance
All Implemented Interfaces
java.awt.LayoutManager2, java.awt.LayoutManager

A custom layout manager that is responsible for the layout of layeredPane, glassPane, menuBar and titlePane, if one has been installed.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
addLayoutComponent(String
the string to be associated with the component
name
,
Component
the component to be added
comp
)

Implements java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.
public void
addLayoutComponent(Component
the component to be added
comp
,
Object
where/how the component is added to the layout.
constraints
)

Implements java.awt.LayoutManager2.addLayoutComponent.

Adds the specified component to the layout, using the specified constraint object.
public float
getLayoutAlignmentX(Container
the target container
target
)

Implements java.awt.LayoutManager2.getLayoutAlignmentX.

Returns the alignment along the x axis.
public float
getLayoutAlignmentY(Container
the target container
target
)

Implements java.awt.LayoutManager2.getLayoutAlignmentY.

Returns the alignment along the y axis.
public void
invalidateLayout(Container
the target container
target
)

Implements java.awt.LayoutManager2.invalidateLayout.

Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
public void
layoutContainer(Container
the Container for which this layout manager is being used
parent
)

Implements java.awt.LayoutManager.layoutContainer.

Instructs the layout manager to perform the layout for the specified container.
public Dimension

Returns:

a Dimension object containing the layout's maximum size
maximumLayoutSize
(Container
the Container for which this layout manager is being used
target
)

Implements java.awt.LayoutManager2.maximumLayoutSize.

Returns the maximum amount of space the layout can use.
public Dimension

Returns:

a Dimension object containing the layout's minimum size
minimumLayoutSize
(Container
the Container for which this layout manager is being used
parent
)

Implements java.awt.LayoutManager.minimumLayoutSize.

Returns the minimum amount of space the layout needs.
public Dimension

Returns:

a Dimension object containing the layout's preferred size
preferredLayoutSize
(Container
the Container for which this layout manager is being used
parent
)

Implements java.awt.LayoutManager.preferredLayoutSize.

Returns the amount of space the layout would like to have.
public void
removeLayoutComponent(Component
the component to be removed
comp
)

Implements java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MetalRootLayoutback to summary
private MetalRootLayout()

Method Detail

addLayoutComponentback to summary
public void addLayoutComponent(String name, Component comp)

Implements java.awt.LayoutManager.addLayoutComponent.

Doc from java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

Parameters
name:String

the string to be associated with the component

comp:Component

the component to be added

addLayoutComponentback to summary
public void addLayoutComponent(Component comp, Object constraints)

Implements java.awt.LayoutManager2.addLayoutComponent.

Doc from java.awt.LayoutManager2.addLayoutComponent.

Adds the specified component to the layout, using the specified constraint object.

Parameters
comp:Component

the component to be added

constraints:Object

where/how the component is added to the layout.

getLayoutAlignmentXback to summary
public float getLayoutAlignmentX(Container target)

Implements java.awt.LayoutManager2.getLayoutAlignmentX.

Doc from java.awt.LayoutManager2.getLayoutAlignmentX.

Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Parameters
target:Container

the target container

Returns:float

the x-axis alignment preference

getLayoutAlignmentYback to summary
public float getLayoutAlignmentY(Container target)

Implements java.awt.LayoutManager2.getLayoutAlignmentY.

Doc from java.awt.LayoutManager2.getLayoutAlignmentY.

Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

Parameters
target:Container

the target container

Returns:float

the y-axis alignment preference

invalidateLayoutback to summary
public void invalidateLayout(Container target)

Implements java.awt.LayoutManager2.invalidateLayout.

Doc from java.awt.LayoutManager2.invalidateLayout.

Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

Parameters
target:Container

the target container

layoutContainerback to summary
public void layoutContainer(Container parent)

Implements java.awt.LayoutManager.layoutContainer.

Instructs the layout manager to perform the layout for the specified container.

Parameters
parent:Container

the Container for which this layout manager is being used

maximumLayoutSizeback to summary
public Dimension maximumLayoutSize(Container target)

Implements java.awt.LayoutManager2.maximumLayoutSize.

Returns the maximum amount of space the layout can use.

Parameters
target:Container

the Container for which this layout manager is being used

Returns:Dimension

a Dimension object containing the layout's maximum size

minimumLayoutSizeback to summary
public Dimension minimumLayoutSize(Container parent)

Implements java.awt.LayoutManager.minimumLayoutSize.

Returns the minimum amount of space the layout needs.

Parameters
parent:Container

the Container for which this layout manager is being used

Returns:Dimension

a Dimension object containing the layout's minimum size

preferredLayoutSizeback to summary
public Dimension preferredLayoutSize(Container parent)

Implements java.awt.LayoutManager.preferredLayoutSize.

Returns the amount of space the layout would like to have.

Parameters
parent:Container

the Container for which this layout manager is being used

Returns:Dimension

a Dimension object containing the layout's preferred size

removeLayoutComponentback to summary
public void removeLayoutComponent(Component comp)

Implements java.awt.LayoutManager.removeLayoutComponent.

Doc from java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.

Parameters
comp:Component

the component to be removed

javax.swing.plaf.metal back to summary

private Class MetalRootPaneUI.MouseInputHandler

extends Object
implements MouseInputListener
Class Inheritance
All Implemented Interfaces
javax.swing.event.MouseInputListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.awt.event.MouseListener

MouseInputHandler is responsible for handling resize/moving of the Window. It sets the cursor directly on the Window when then mouse moves over a hot spot.

Field Summary

Modifier and TypeField and Description
private int
dragCursor

Used to determine the corner the resize is occurring from.

private int
dragHeight

Height of the window when the drag started.

private int
dragOffsetX

X location the mouse went down on for a drag operation.

private int
dragOffsetY

Y location the mouse went down on for a drag operation.

private int
dragWidth

Width of the window when the drag started.

private boolean
isMovingWindow

Set to true if the drag operation is moving the window.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
adjust(Rectangle bounds, Dimension min, int deltaX, int deltaY, int deltaWidth, int deltaHeight)

private int
calculateCorner(Window w, int x, int y)

Returns the corner that contains the point x, y, or -1 if the position doesn't match a corner.

private int
calculatePosition(int spot, int width)

Returns an integer indicating the position of spot in width.

private int
getCursor(int corner)

Returns the Cursor to render for the specified corner.

public void
mouseClicked(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.
public void
mouseDragged(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.
public void
mouseEntered(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.
public void
mouseExited(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.
public void
mouseMoved(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
public void
mousePressed(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.
public void
mouseReleased(MouseEvent
the event to be processed
ev
)

Implements java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dragCursorback to summary
private int dragCursor

Used to determine the corner the resize is occurring from.

dragHeightback to summary
private int dragHeight

Height of the window when the drag started.

dragOffsetXback to summary
private int dragOffsetX

X location the mouse went down on for a drag operation.

dragOffsetYback to summary
private int dragOffsetY

Y location the mouse went down on for a drag operation.

dragWidthback to summary
private int dragWidth

Width of the window when the drag started.

isMovingWindowback to summary
private boolean isMovingWindow

Set to true if the drag operation is moving the window.

Constructor Detail

MouseInputHandlerback to summary
private MouseInputHandler()

Method Detail

adjustback to summary
private void adjust(Rectangle bounds, Dimension min, int deltaX, int deltaY, int deltaWidth, int deltaHeight)
calculateCornerback to summary
private int calculateCorner(Window w, int x, int y)

Returns the corner that contains the point x, y, or -1 if the position doesn't match a corner.

calculatePositionback to summary
private int calculatePosition(int spot, int width)

Returns an integer indicating the position of spot in width. The return value will be: 0 if < BORDER_DRAG_THICKNESS 1 if < CORNER_DRAG_WIDTH 2 if >= CORNER_DRAG_WIDTH && < width - BORDER_DRAG_THICKNESS 3 if >= width - CORNER_DRAG_WIDTH 4 if >= width - BORDER_DRAG_THICKNESS 5 otherwise

getCursorback to summary
private int getCursor(int corner)

Returns the Cursor to render for the specified corner. This returns 0 if the corner doesn't map to a valid Cursor

mouseClickedback to summary
public void mouseClicked(MouseEvent ev)

Implements java.awt.event.MouseListener.mouseClicked.

Doc from java.awt.event.MouseListener.mouseClicked.

Invoked when the mouse button has been clicked (pressed and released) on a component.

Parameters
ev:MouseEvent

the event to be processed

Annotations
@SuppressWarnings:deprecation
mouseDraggedback to summary
public void mouseDragged(MouseEvent ev)

Implements java.awt.event.MouseMotionListener.mouseDragged.

Doc from java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.

Parameters
ev:MouseEvent

the event to be processed

mouseEnteredback to summary
public void mouseEntered(MouseEvent ev)

Implements java.awt.event.MouseListener.mouseEntered.

Doc from java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

Parameters
ev:MouseEvent

the event to be processed

mouseExitedback to summary
public void mouseExited(MouseEvent ev)

Implements java.awt.event.MouseListener.mouseExited.

Doc from java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

Parameters
ev:MouseEvent

the event to be processed

mouseMovedback to summary
public void mouseMoved(MouseEvent ev)

Implements java.awt.event.MouseMotionListener.mouseMoved.

Doc from java.awt.event.MouseMotionListener.mouseMoved.

Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Parameters
ev:MouseEvent

the event to be processed

mousePressedback to summary
public void mousePressed(MouseEvent ev)

Implements java.awt.event.MouseListener.mousePressed.

Doc from java.awt.event.MouseListener.mousePressed.

Invoked when a mouse button has been pressed on a component.

Parameters
ev:MouseEvent

the event to be processed

mouseReleasedback to summary
public void mouseReleased(MouseEvent ev)

Implements java.awt.event.MouseListener.mouseReleased.

Doc from java.awt.event.MouseListener.mouseReleased.

Invoked when a mouse button has been released on a component.

Parameters
ev:MouseEvent

the event to be processed