APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicDesktopIconUI

extends DesktopIconUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.metal.MetalDesktopIconUI, javax.swing.plaf.synth.SynthDesktopIconUI, com.sun.java.swing.plaf.motif.MotifDesktopIconUI
Imports
java.awt.*, java.awt.event.*, javax.swing.*, javax.swing.event.*, javax.swing.border.*, javax.swing.plaf.*, java.beans.*

Basic L&F for a minimized window on a desktop.
Authors
David Kloba, Steve Wilson, Rich Schiavi

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
BasicDesktopIconUI.MouseInputHandler

Listens for mouse movements and acts on them.

Field Summary

Modifier and TypeField and Description
protected JInternalFrame.JDesktopIcon
desktopIcon

The instance of JInternalFrame.JDesktopIcon.

protected JInternalFrame
frame

The instance of JInternalFrame.

protected JComponent
iconPane

The title pane component used in the desktop icon.

pack-priv MouseInputListener

Constructor Summary

AccessConstructor and Description
public
BasicDesktopIconUI()

Constructs a new instance of BasicDesktopIconUI.

Method Summary

Modifier and TypeMethod and Description
protected MouseInputListener

Returns:

a new instance of MouseInputListener
createMouseInputListener
()

Returns a new instance of MouseInputListener.

public static ComponentUI

Returns:

a new instance of BasicDesktopIconUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Constructs a new instance of BasicDesktopIconUI.

public void
deiconize()

De-iconifies the internal frame.

public Insets

Returns:

the insets
getInsets
(JComponent
a component
c
)

Returns the insets.

public Dimension
getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Desktop icons can not be resized.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel.

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel.

protected void
installComponents()

Registers components.

protected void
installDefaults()

Installs default properties.

protected void
installListeners()

Registers listeners.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

protected void
uninstallComponents()

Unregisters components.

protected void
uninstallDefaults()

Uninstalls default properties.

protected void
uninstallListeners()

Unregisters listeners.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

Field Detail

desktopIconback to summary
protected JInternalFrame.JDesktopIcon desktopIcon

The instance of JInternalFrame.JDesktopIcon.

frameback to summary
protected JInternalFrame frame

The instance of JInternalFrame.

iconPaneback to summary
protected JComponent iconPane

The title pane component used in the desktop icon.

Since
1.5
mouseInputListenerback to summary
pack-priv MouseInputListener mouseInputListener

Constructor Detail

BasicDesktopIconUIback to summary
public BasicDesktopIconUI()

Constructs a new instance of BasicDesktopIconUI.

Method Detail

createMouseInputListenerback to summary
protected MouseInputListener createMouseInputListener()

Returns a new instance of MouseInputListener.

Returns:MouseInputListener

a new instance of MouseInputListener

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Constructs a new instance of BasicDesktopIconUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

a new instance of BasicDesktopIconUI

deiconizeback to summary
public void deiconize()

De-iconifies the internal frame.

getInsetsback to summary
public Insets getInsets(JComponent c)

Returns the insets.

Parameters
c:JComponent

a component

Returns:Insets

the insets

getMaximumSizeback to summary
public Dimension getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Desktop icons can not be resized. Therefore, we should always return the minimum size of the desktop icon.

See Also
getMinimumSize
getMinimumSizeback to summary
public Dimension getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Doc from javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel. If null is returned, the minimum size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method invokes getPreferredSize and returns that value.

getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Doc from javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

installComponentsback to summary
protected void installComponents()

Registers components.

installDefaultsback to summary
protected void installDefaults()

Installs default properties.

installListenersback to summary
protected void installListeners()

Registers listeners.

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the ComponentUI instance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:

  1. Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
uninstallComponentsback to summary
protected void uninstallComponents()

Unregisters components.

uninstallDefaultsback to summary
protected void uninstallDefaults()

Uninstalls default properties.

uninstallListenersback to summary
protected void uninstallListeners()

Unregisters listeners.

uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.
javax.swing.plaf.basic back to summary

public Class BasicDesktopIconUI.MouseInputHandler

extends MouseInputAdapter
Class Inheritance

Listens for mouse movements and acts on them. This class should be treated as a "protected" inner class. Instantiate it only within subclasses of BasicDesktopIconUI.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv Rectangle

Constructor Summary

AccessConstructor and Description
public
MouseInputHandler()

Constructs a MouseInputHandler.

Method Summary

Modifier and TypeMethod and Description
public void
mouseDragged(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseDragged.

Implements java.awt.event.MouseMotionListener.mouseDragged.

Invoked when a mouse button is pressed on a component and then dragged.

public void
mouseMoved(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseMoved.

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

Overrides java.awt.event.MouseAdapter.mousePressed.

Implements java.awt.event.MouseListener.mousePressed.

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

public void
mouseReleased(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseReleased.

Implements java.awt.event.MouseListener.mouseReleased.

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

public void
moveAndRepaint(JComponent
a component
f
,
int
a new X coordinate
newX
,
int
a new Y coordinate
newY
,
int
a new width
newWidth
,
int
a new height
newHeight
)

Moves and repaints a component f.

Field Detail

__xback to summary
pack-priv int __x
__yback to summary
pack-priv int __y
_xback to summary
pack-priv int _x
_yback to summary
pack-priv int _y
startingBoundsback to summary
pack-priv Rectangle startingBounds

Constructor Detail

MouseInputHandlerback to summary
public MouseInputHandler()

Constructs a MouseInputHandler.

Method Detail

mouseDraggedback to summary
public void mouseDragged(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseDragged.

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.

mouseMovedback to summary
public void mouseMoved(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseMoved.

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.

mousePressedback to summary
public void mousePressed(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mousePressed.

Implements java.awt.event.MouseListener.mousePressed.

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

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

mouseReleasedback to summary
public void mouseReleased(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseReleased.

Implements java.awt.event.MouseListener.mouseReleased.

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

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

moveAndRepaintback to summary
public void moveAndRepaint(JComponent f, int newX, int newY, int newWidth, int newHeight)

Moves and repaints a component f.

Parameters
f:JComponent

a component

newX:int

a new X coordinate

newY:int

a new Y coordinate

newWidth:int

a new width

newHeight:int

a new height