net.sf.jguiraffe.gui.platform.swing.builder.components
Class SwingWidgetHandler

java.lang.Object
  extended by net.sf.jguiraffe.gui.platform.swing.builder.components.SwingWidgetHandler
All Implemented Interfaces:
WidgetHandler

 class SwingWidgetHandler
extends java.lang.Object
implements WidgetHandler

A Swing specific implementation of the WidgetHandler interface.

This implementation operates on an underlying Component object and provides access to some of its fundamental properties.

Version:
$Id: SwingWidgetHandler.java 75 2007-07-15 19:19:54Z oheger $
Author:
Oliver Heger

Constructor Summary
SwingWidgetHandler(java.awt.Component component)
          Creates a new instance of SwingWidgetHandler and initializes it with the wrapped component.
 
Method Summary
 Color getBackgroundColor()
          Returns the background color of the underlying widget.
 java.awt.Component getComponent()
          Returns a reference to the underlying component.
 Color getForegroundColor()
          Returns the foreground color of the underlying widget.
 java.lang.Object getWidget()
          Returns the underlying widget.
 boolean isVisible()
          Returns a flag whether the underlying widget is visible.
 void setBackgroundColor(Color c)
          Sets the background color of the underlying widget.
 void setForegroundColor(Color c)
          Sets the foreground color of the underlying widget.
 void setVisible(boolean f)
          Sets the visible flag of the underlying widget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingWidgetHandler

public SwingWidgetHandler(java.awt.Component component)
Creates a new instance of SwingWidgetHandler and initializes it with the wrapped component.

Parameters:
component - the underlying component
Method Detail

getComponent

public java.awt.Component getComponent()
Returns a reference to the underlying component.

Returns:
the underlying AWT component

getBackgroundColor

public Color getBackgroundColor()
Returns the background color of the underlying widget.

Specified by:
getBackgroundColor in interface WidgetHandler
Returns:
the background color of the underlying widget

getForegroundColor

public Color getForegroundColor()
Returns the foreground color of the underlying widget.

Specified by:
getForegroundColor in interface WidgetHandler
Returns:
the foreground color of the underlying widget

getWidget

public java.lang.Object getWidget()
Returns the underlying widget.

Specified by:
getWidget in interface WidgetHandler
Returns:
the underlying widget

isVisible

public boolean isVisible()
Returns a flag whether the underlying widget is visible.

Specified by:
isVisible in interface WidgetHandler
Returns:
the visible flag of the underlying widget

setBackgroundColor

public void setBackgroundColor(Color c)
Sets the background color of the underlying widget. The passed in platform independent Color object will be transformed into an AWT color object.

Specified by:
setBackgroundColor in interface WidgetHandler
Parameters:
c - the new background color

setForegroundColor

public void setForegroundColor(Color c)
Sets the foreground color of the underlying widget. The passed in platform independent Color object will be transformed into an AWT color object.

Specified by:
setForegroundColor in interface WidgetHandler
Parameters:
c - the new foreground color

setVisible

public void setVisible(boolean f)
Sets the visible flag of the underlying widget.

Specified by:
setVisible in interface WidgetHandler
Parameters:
f - the new visible flag


Copyright 2007 null. All Rights Reserved.