Modelers

org.topcased.draw2d.figures
Class ComposedLabel

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.topcased.draw2d.figures.ComposedLabel
All Implemented Interfaces:
org.eclipse.draw2d.IFigure, ILabel
Direct Known Subclasses:
ComposedLabelFigure

public class ComposedLabel
extends org.eclipse.draw2d.Figure
implements ILabel

Composed label is a figure that contains one, two or three parts. Each part is a label. Parts can be indentified as prefix, main and suffix. The main part can be editable. The orientation is parametrizable.
creation : 10 juin 2005


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
ComposedLabel()
          The default constructor The composed label has a main label and is horizontal
ComposedLabel(ILabel mainFig, boolean isHorizontal)
          Constructor for a composed label with only one part
ComposedLabel(ILabel prefixLbl, ILabel mainFig, ILabel suffixLbl, boolean isHorizontal)
          Constructor for a composed label whith several parts.
 
Method Summary
 ILabel getMain()
          Get main figure
 ILabel getPrefix()
          Get prefix label
 ILabel getSuffix()
          Get suffix label
 java.lang.String getText()
          Get the text of the label
 void setIcon(org.eclipse.swt.graphics.Image image)
          Deprecated. A setter method should be available for each Label of the ComposedLabel
 void setMain(java.lang.String text)
          Set text for main part.
 void setPrefix(java.lang.String text)
          Set text for prefix part.
 void setPrefixIcon(org.eclipse.swt.graphics.Image icon)
          Set icon for prefix part.
 void setSelected(boolean b)
          If main part is editable, select or deselect it according a given parameter
 void setSuffix(java.lang.String text)
          Set text for suffix part.
 void setText(java.lang.String s)
          Set the new text to the label
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 

Constructor Detail

ComposedLabel

public ComposedLabel()
The default constructor The composed label has a main label and is horizontal


ComposedLabel

public ComposedLabel(ILabel mainFig,
                     boolean isHorizontal)
Constructor for a composed label with only one part

Parameters:
mainFig - Main label
isHorizontal - orientation. If true, it's horizontal

ComposedLabel

public ComposedLabel(ILabel prefixLbl,
                     ILabel mainFig,
                     ILabel suffixLbl,
                     boolean isHorizontal)
Constructor for a composed label whith several parts. Prefix and suffix can be null

Parameters:
prefixLbl - prefix part. If null, no prefix is added to the figure
mainFig - main part
suffixLbl - suffix part. If null, no suffix is added to the figure
isHorizontal - orientation. If true, it's horizontal
Method Detail

setPrefix

public void setPrefix(java.lang.String text)
Set text for prefix part. If the new text is null or empty, the Label is removed

Parameters:
text - the new text

setPrefixIcon

public void setPrefixIcon(org.eclipse.swt.graphics.Image icon)
Set icon for prefix part. If the new icon is null or empty, the Image is removed

Parameters:
icon - the new icon

setSuffix

public void setSuffix(java.lang.String text)
Set text for suffix part. If the new text is null or empty, the Label is removed

Parameters:
text - the new text

setMain

public void setMain(java.lang.String text)
Set text for main part. The Figure is always visible.

Parameters:
text - the new text

setIcon

public void setIcon(org.eclipse.swt.graphics.Image image)
Deprecated. A setter method should be available for each Label of the ComposedLabel

Set Icon

Parameters:
image - the icon

getPrefix

public ILabel getPrefix()
Get prefix label

Returns:
a label object

getSuffix

public ILabel getSuffix()
Get suffix label

Returns:
a label object

getMain

public ILabel getMain()
Get main figure

Returns:
the main IFigure

setSelected

public void setSelected(boolean b)
If main part is editable, select or deselect it according a given parameter

Parameters:
b - selection state

setText

public void setText(java.lang.String s)
Description copied from interface: ILabel
Set the new text to the label

Specified by:
setText in interface ILabel
Parameters:
s - the new text
See Also:
ILabel.setText(java.lang.String)

getText

public java.lang.String getText()
Description copied from interface: ILabel
Get the text of the label

Specified by:
getText in interface ILabel
Returns:
the text of the label
See Also:
ILabel.getText()

Modelers

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.