tabs.hair
Class HairButton

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by tabs.hair.HairButton
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

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

Instances of this class represents a clickable button with that contains the hair thumbnail

Note that although this class is a subclass of Canvas, it does not make sense to add children to it, or set a layout on it.


Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
HairButton(org.eclipse.swt.widgets.Composite parent, int style)
          Creates a new instance of this class given it's parent composite and a style value describing its behavior and appearance.
 
Method Summary
 org.eclipse.swt.graphics.Color getBackground()
           
 org.eclipse.swt.graphics.Image getBackgroundImage()
           
 java.awt.image.BufferedImage[] getImages(HairStyleXMLHandler handler, org.xml.sax.XMLReader parser)
          Return the hair images given a handler and XML parser
 void setAssociatedXML(java.io.File associatedXML)
           
 void setBackground(org.eclipse.swt.graphics.Color bkColor)
           
 void setBackgroundImage(org.eclipse.swt.graphics.Image image)
           
 void setSelected(boolean isSelected)
          Change the selection state of this button
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBounds, getCursor, getDragDetect, 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, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBounds, setBounds, setCapture, setCursor, setDragDetect, 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

HairButton

public HairButton(org.eclipse.swt.widgets.Composite parent,
                  int style)
Creates a new instance of this class given it's parent composite and a style value describing its behavior and appearance.

The style value is either one of the style constants defined in class SWT which is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those SWT style constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.

Parameters:
parent - the parent for the button
style - the button's style
See Also:
SWT, Widget.getStyle()
Method Detail

setSelected

public void setSelected(boolean isSelected)
Change the selection state of this button

Parameters:
isSelected - the new button state

setBackground

public void setBackground(org.eclipse.swt.graphics.Color bkColor)
Overrides:
setBackground in class org.eclipse.swt.widgets.Control

getBackground

public org.eclipse.swt.graphics.Color getBackground()
Overrides:
getBackground in class org.eclipse.swt.widgets.Control

setBackgroundImage

public void setBackgroundImage(org.eclipse.swt.graphics.Image image)
Overrides:
setBackgroundImage in class org.eclipse.swt.widgets.Control

getBackgroundImage

public org.eclipse.swt.graphics.Image getBackgroundImage()
Overrides:
getBackgroundImage in class org.eclipse.swt.widgets.Control

setAssociatedXML

public void setAssociatedXML(java.io.File associatedXML)

getImages

public java.awt.image.BufferedImage[] getImages(HairStyleXMLHandler handler,
                                                org.xml.sax.XMLReader parser)
Return the hair images given a handler and XML parser

Parameters:
handler - hair style XML handler
parser - the XML reader parser
Returns:
an array of images containing the hair image, highlights image, shadow image