tabs
Class LensTab

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 tabs.TabContainer
                      extended by tabs.LensTab
All Implemented Interfaces:
java.lang.Comparable<TabContainer>, org.eclipse.swt.graphics.Drawable

public class LensTab
extends TabContainer

Instances of this class represents a tab that can be used to paint the eyes colors, giving the same effect of the contact lenses


Field Summary
protected  boolean imageAreaRedrawAllowed
          flag to indicate whether the tab has or not access to call for redrawing the image area
 
Fields inherited from class tabs.TabContainer
tabsContainer
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
LensTab(TabsContainer parent, int style, int tabLayerPosition)
          Constructs a new instance of this class given its parent, a style value describing its behavior and appearance and this instance's position in the TabsContainer array
 
Method Summary
 void clear()
          Abstract method to be implemented by every tab that clears the tab's image in the drawing area
 void createBottomComposite()
          This method initializes bottomComposite
 void disposeData()
           
 void drawCurrentLayer(java.awt.Graphics2D g2d)
          Abstract method to be implemented by every tab that draws the resulting image on the DrawingContainer using is't g2d
 java.lang.Object getCurrentState()
          Abstract method to be implemented by every tab that returns an Object containing the tab's current state
 java.awt.image.BufferedImage getLayerImage()
          Abstract method to be implemented by every tab that returns the resulting image which will be drawn above original image
 boolean hasEyesPath()
          Check whether this tab instance has an associated eyes lens path
 java.awt.event.MouseListener mouseListener()
          Abstract method to be implemented by every tab which returns a mouse listener that is notified when the mouse is in the project's drawing area
 java.awt.event.MouseMotionListener mouseMotionListener()
          Abstract method to be implemented by every tab which returns a mouse motion listener that is notified when the mouse is in the project's drawing area
 void originalImageChanged()
          Abstract method to be implemented by every tab that is notified whenever the original drawing area's image has changed it's position, size or rotation
 void setCurrentState(java.lang.Object o)
          Abstract method to be implemented by every tab that changes the current tab state to the new given tab state
 void setEyesPath(java.awt.geom.GeneralPath[] eyesPaths)
          Set the lens path to the given one; if the new lens path is null nothing is done
 
Methods inherited from class tabs.TabContainer
compareTo, dispose, getTabImage, getTabLayerPosition, getTabToolTipText, setTabImage, setTabToolTipText
 
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, getBackground, getBackgroundImage, 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, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, 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, 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
 

Field Detail

imageAreaRedrawAllowed

protected boolean imageAreaRedrawAllowed
flag to indicate whether the tab has or not access to call for redrawing the image area

Constructor Detail

LensTab

public LensTab(TabsContainer parent,
               int style,
               int tabLayerPosition)
Constructs a new instance of this class given its parent, a style value describing its behavior and appearance and this instance's position in the TabsContainer array

Parameters:
parent - a TabsContainer which will be the parent of the new instance
style - the style of the tab
tabLayerPosition - the tab's position in the TabsContainer array
Method Detail

createBottomComposite

public void createBottomComposite()
This method initializes bottomComposite


setEyesPath

public void setEyesPath(java.awt.geom.GeneralPath[] eyesPaths)
Set the lens path to the given one; if the new lens path is null nothing is done

Parameters:
eyesPaths - the new lens path or null

hasEyesPath

public boolean hasEyesPath()
Check whether this tab instance has an associated eyes lens path

Returns:
true if the eyes lens path is found, false otherwise

getLayerImage

public java.awt.image.BufferedImage getLayerImage()
Description copied from class: TabContainer
Abstract method to be implemented by every tab that returns the resulting image which will be drawn above original image

Specified by:
getLayerImage in class TabContainer
Returns:
the resulting image layer for this tab

drawCurrentLayer

public void drawCurrentLayer(java.awt.Graphics2D g2d)
Description copied from class: TabContainer
Abstract method to be implemented by every tab that draws the resulting image on the DrawingContainer using is't g2d

Specified by:
drawCurrentLayer in class TabContainer
Parameters:
g2d - DrawingContainer's Graphics2D

clear

public void clear()
Description copied from class: TabContainer
Abstract method to be implemented by every tab that clears the tab's image in the drawing area

Specified by:
clear in class TabContainer

getCurrentState

public java.lang.Object getCurrentState()
Description copied from class: TabContainer
Abstract method to be implemented by every tab that returns an Object containing the tab's current state

Specified by:
getCurrentState in class TabContainer

setCurrentState

public void setCurrentState(java.lang.Object o)
Description copied from class: TabContainer
Abstract method to be implemented by every tab that changes the current tab state to the new given tab state

Specified by:
setCurrentState in class TabContainer

mouseListener

public java.awt.event.MouseListener mouseListener()
Description copied from class: TabContainer
Abstract method to be implemented by every tab which returns a mouse listener that is notified when the mouse is in the project's drawing area

Specified by:
mouseListener in class TabContainer

mouseMotionListener

public java.awt.event.MouseMotionListener mouseMotionListener()
Description copied from class: TabContainer
Abstract method to be implemented by every tab which returns a mouse motion listener that is notified when the mouse is in the project's drawing area

Specified by:
mouseMotionListener in class TabContainer

originalImageChanged

public void originalImageChanged()
Description copied from class: TabContainer
Abstract method to be implemented by every tab that is notified whenever the original drawing area's image has changed it's position, size or rotation

Specified by:
originalImageChanged in class TabContainer

disposeData

public void disposeData()
Specified by:
disposeData in class TabContainer