Class TopPanel

  extended byorg.eclipse.draw2d.Figure
All Implemented Interfaces:
Direct Known Subclasses:

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.

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
Field Summary
protected background
protected  boolean canMinimize
protected foreground
protected  boolean isOpen
protected  int maxNameLength
protected  String myName
protected  IButtonHolderPart myPart
protected 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
Constructor Summary
TopPanel(String myName, int surrPageNo, boolean canMinimize, boolean isOpen, background, foreground, IButtonHolderPart thePart, 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( background, 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


protected IButtonHolderPart myPart


protected boolean isOpen


protected boolean canMinimize


protected String myName


protected int maxNameLength


protected int surrPageNo


protected background


protected foreground


protected org.eclipse.draw2d.Clickable[] otherButtons


protected objectTypeIcon
Constructor Detail


public TopPanel()


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

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


protected org.eclipse.draw2d.Label buildIdentifierIcon()


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.

text - the new tooltip text.


protected void doBuild()


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

name - the new text to appear as the title.


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


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

isOpen - the new isOpen status.


public static BaseObject getCurrentObject()


public void setColours( background,
updates the display of this object to use new colours.

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