uk.ac.kcl.cch.jb.pliny.figures
Class TopPanel

java.lang.Object
  extended byorg.eclipse.draw2d.Figure
      extended byuk.ac.kcl.cch.jb.pliny.figures.TopPanel
All Implemented Interfaces:
org.eclipse.draw2d.IFigure
Direct Known Subclasses:
ContainmentItemFigure

public class TopPanel
extends org.eclipse.draw2d.Figure

provides a draw2d Figure that displays the title area of a annotation/reference area's Reference Object.

Author:
John Bradley

Nested Class Summary
 class TopPanel.OpenButtonMouseMotionListener
          A listener to see when the mouse is placed over the top-left icon.
 
Nested classes inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
protected  org.eclipse.swt.graphics.Color background
           
protected  boolean canMinimize
           
protected  org.eclipse.swt.graphics.Color foreground
           
protected  boolean isOpen
           
protected  int maxNameLength
           
protected  String myName
           
protected  IButtonHolderPart myPart
           
protected  org.eclipse.swt.graphics.Image objectTypeIcon
           
protected  org.eclipse.draw2d.Clickable[] otherButtons
           
protected  int surrPageNo
           
 
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
TopPanel()
           
TopPanel(String myName, int surrPageNo, boolean canMinimize, boolean isOpen, org.eclipse.swt.graphics.Color background, org.eclipse.swt.graphics.Color foreground, IButtonHolderPart thePart, org.eclipse.swt.graphics.Image topLeftIcon, org.eclipse.draw2d.Clickable[] otherButtons)
          creates an instance of this object, and sets up the various pieces of information needed to display it.
 
Method Summary
protected  org.eclipse.draw2d.Label buildIdentifierIcon()
           
protected  void doBuild()
           
static BaseObject getCurrentObject()
           
 org.eclipse.draw2d.Label getTitleLabel()
          returns the draw2d Label component of this figure that contains the title.
 void setColours(org.eclipse.swt.graphics.Color background, org.eclipse.swt.graphics.Color foreground)
          updates the display of this object to use new colours.
 void setIsOpen(boolean isOpen)
          handles the update of the title bar when the isOpen status is changed by the user.
 void setName(String name)
          changes the text that appears in the title area to the new specified text.
 void setToolTipText(String text)
          provides the text to appear as the tooltip for the textual label part of this figure.
 
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
 

Field Detail

myPart

protected IButtonHolderPart myPart

isOpen

protected boolean isOpen

canMinimize

protected boolean canMinimize

myName

protected String myName

maxNameLength

protected int maxNameLength

surrPageNo

protected int surrPageNo

background

protected org.eclipse.swt.graphics.Color background

foreground

protected org.eclipse.swt.graphics.Color foreground

otherButtons

protected org.eclipse.draw2d.Clickable[] otherButtons

objectTypeIcon

protected org.eclipse.swt.graphics.Image objectTypeIcon
Constructor Detail

TopPanel

public TopPanel()

TopPanel

public TopPanel(String myName,
                int surrPageNo,
                boolean canMinimize,
                boolean isOpen,
                org.eclipse.swt.graphics.Color background,
                org.eclipse.swt.graphics.Color foreground,
                IButtonHolderPart thePart,
                org.eclipse.swt.graphics.Image topLeftIcon,
                org.eclipse.draw2d.Clickable[] otherButtons)
creates an instance of this object, and sets up the various pieces of information needed to display it.

Parameters:
myName - the text to display as the "name field" in the title area.
surrPageNo - the page number to display in the title area. If no page number is wanted, set this to zero.
canMinimize - controls whether the minimize/expand button should appear in the area.
isOpen - controls whether the minimize or expand icon initially appears.
background - provides the background colour to be used.
foreground - provides the foreground colour to be used.
thePart - the GEF Part that holds this TopPanel object.
topLeftIcon - the SWT Image object that is to be used as the top left icon.
otherButtons - an array of other buttons that should be displayed towards the right end of the title area.
Method Detail

buildIdentifierIcon

protected org.eclipse.draw2d.Label buildIdentifierIcon()

setToolTipText

public void setToolTipText(String text)
provides the text to appear as the tooltip for the textual label part of this figure. Overrides the inherited function so that the tooltip is only attached to the title area, and not the bar overall.

Parameters:
text - the new tooltip text.

doBuild

protected void doBuild()

setName

public void setName(String name)
changes the text that appears in the title area to the new specified text.

Parameters:
name - the new text to appear as the title.

getTitleLabel

public org.eclipse.draw2d.Label getTitleLabel()
returns the draw2d Label component of this figure that contains the title.


setIsOpen

public void setIsOpen(boolean isOpen)
handles the update of the title bar when the isOpen status is changed by the user.

Parameters:
isOpen - the new isOpen status.

getCurrentObject

public static BaseObject getCurrentObject()

setColours

public void setColours(org.eclipse.swt.graphics.Color background,
                       org.eclipse.swt.graphics.Color foreground)
updates the display of this object to use new colours.

Parameters:
background - the new background colour to use
foreground - the new foreground colour to use