com.tensegrity.gui.swt.control.panels.slidepanel
Class SlidePanelTitle

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended bycom.tensegrity.gui.swt.control.panels.slidepanel.SlidePanelTitle
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class SlidePanelTitle
extends org.eclipse.swt.widgets.Canvas

Defines the title of a SlidePanel. Besides a textual representation the SlidePanelTitle contains two buttons for expanding/collapsing and/or closing the SlidePanel.

Additionally this class provides various methods to adjust the look of the SlidePanelTitle, e.g. drawGradient(boolean) or setFontColor(Color)

Version:
$Id: SlidePanelTitle.java,v 1.4 2005/09/29 13:53:33 ArndHouben Exp $
Author:
ArndHouben

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
SlidePanelTitle(SlidePanel slidePanel, int style)
          Creates a new title object for a SlidePanel with no gradient background and a black font color.
 
Method Summary
 org.eclipse.swt.graphics.Point computeSize(int wHint, int hHint, boolean changed)
           
 void drawBorders(boolean left, boolean top, boolean right, boolean bottom)
          Specifies which borders should be drawn arround the title component.
 void drawGradient(boolean b)
          Sets if the title background should drawn as a horizontal gradient or not
 void insets(int left, int top, int right, int bottom)
          Specifies the insets between the title contents and its borders in pixels.
 void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
          Sets the color to use for drawing surrounding title border
 void setFontColor(org.eclipse.swt.graphics.Color c)
          Sets the font color to use
 void setTitle(java.lang.String title)
          Sets the title to display
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
checkSubclass, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlidePanelTitle

public SlidePanelTitle(SlidePanel slidePanel,
                       int style)
Creates a new title object for a SlidePanel with no gradient background and a black font color.

Parameters:
slidePanel - the SlidePanel this title belnongs to
style - SWT style bits
Method Detail

drawBorders

public final void drawBorders(boolean left,
                              boolean top,
                              boolean right,
                              boolean bottom)
Specifies which borders should be drawn arround the title component. The borders are painted using the currently set border color or, if none is that, the current foreground color.

Parameters:
left - set to true if the title should have a left border, false otherwise
top - set to true if the title should have a top border, false otherwise
right - set to true if the title should have a right border, false otherwise
bottom - set to true if the title should have a bottom border, false otherwise

setBorderColor

public final void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
Sets the color to use for drawing surrounding title border

Parameters:
borderColor - the new border color

insets

public final void insets(int left,
                         int top,
                         int right,
                         int bottom)
Specifies the insets between the title contents and its borders in pixels. As default an inset of 6 pixels is set in each direction.

Parameters:
left - space between left border and content
top - space between top border and content
right - space between right border and content
bottom - space between bottom border and content

drawGradient

public final void drawGradient(boolean b)
Sets if the title background should drawn as a horizontal gradient or not

Parameters:
b - set to true to enable gradient background, otherwise set false.

setFontColor

public final void setFontColor(org.eclipse.swt.graphics.Color c)
Sets the font color to use

Parameters:
c - the new font color

setTitle

public final void setTitle(java.lang.String title)
Sets the title to display

Parameters:
title - the new title

computeSize

public final org.eclipse.swt.graphics.Point computeSize(int wHint,
                                                        int hHint,
                                                        boolean changed)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.