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

java.lang.Object
  extended by net.sf.jguiraffe.gui.platform.swing.builder.components.SwingComponentHandler
      extended by net.sf.jguiraffe.gui.platform.swing.builder.components.SwingStaticTextComponentHandler
All Implemented Interfaces:
StaticTextData, StaticTextHandler, ComponentHandler, SwingEventSource

 class SwingStaticTextComponentHandler
extends SwingComponentHandler
implements StaticTextHandler

A concrete ComponentHandler implementation for dealing with static text elements. This implementation will maintain a label component whose properties can be queried or altered using StaticTextData objects.

Version:
$Id: SwingStaticTextComponentHandler.java 70 2007-06-16 15:26:59Z oheger $
Author:
Oliver Heger

Constructor Summary
SwingStaticTextComponentHandler(javax.swing.JLabel label)
          Creates a new instance of SwingStaticTextComponentHandler that wraps the passed in label component.
 
Method Summary
 TextIconAlignment getAlignment()
          Returns the alignment of the managed label.
 java.lang.Object getData()
          Returns a data object for this component.
 java.lang.Object getIcon()
          Returns the label's icon.
 javax.swing.JLabel getLabel()
          Returns the internally wrapped label component.
 java.lang.String getText()
          Returns the text of the managed label.
 java.lang.Class getType()
          Returns the data type of this component handler.
 void setAlignment(TextIconAlignment alignment)
          Sets the alignment of the managed label.
 void setData(java.lang.Object data)
          Sets data for this component.
 void setIcon(java.lang.Object icon)
          Sets the icon of the managed label.
 void setText(java.lang.String s)
          Sets the text of the managed label.
 
Methods inherited from class net.sf.jguiraffe.gui.platform.swing.builder.components.SwingComponentHandler
addActionListener, addChangeListener, addFocusListener, fireChangeEvent, getComponent, getJComponent, getOuterComponent, isEnabled, registerChangeListener, removeActionListener, removeChangeListener, removeFocusListener, setEnabled, unregisterChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jguiraffe.gui.forms.ComponentHandler
getComponent, getOuterComponent, isEnabled, setEnabled
 

Constructor Detail

SwingStaticTextComponentHandler

public SwingStaticTextComponentHandler(javax.swing.JLabel label)
Creates a new instance of SwingStaticTextComponentHandler that wraps the passed in label component.

Parameters:
label - the component to be managed by this handler
Method Detail

getLabel

public javax.swing.JLabel getLabel()
Returns the internally wrapped label component.

Returns:
the underlying label

getData

public java.lang.Object getData()
Returns a data object for this component. This is a StaticTextData object in this case.

Specified by:
getData in interface ComponentHandler
Returns:
a data object for this component

getType

public java.lang.Class getType()
Returns the data type of this component handler.

Specified by:
getType in interface ComponentHandler
Returns:
the data type

setData

public void setData(java.lang.Object data)
Sets data for this component. The passed in data object can be of various types.

Specified by:
setData in interface ComponentHandler
Parameters:
data - the data object

getAlignment

public TextIconAlignment getAlignment()
Returns the alignment of the managed label.

Specified by:
getAlignment in interface StaticTextData
Returns:
the alignment

getIcon

public java.lang.Object getIcon()
Returns the label's icon.

Specified by:
getIcon in interface StaticTextData
Returns:
the icon

getText

public java.lang.String getText()
Returns the text of the managed label.

Specified by:
getText in interface StaticTextData
Returns:
the text

setAlignment

public void setAlignment(TextIconAlignment alignment)
Sets the alignment of the managed label.

Specified by:
setAlignment in interface StaticTextData
Parameters:
alignment - the new alignment

setIcon

public void setIcon(java.lang.Object icon)
Sets the icon of the managed label. The passed in object must implement the Icon interface of Swing.

Specified by:
setIcon in interface StaticTextData
Parameters:
icon - the new icon

setText

public void setText(java.lang.String s)
Sets the text of the managed label.

Specified by:
setText in interface StaticTextData
Parameters:
s - the new text


Copyright 2007 null. All Rights Reserved.