Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Draw2d
3.3

org.eclipse.draw2d
Class TitleBarBorder

java.lang.Object
  extended by

org.eclipse.draw2d.AbstractBorder
      extended by

org.eclipse.draw2d.AbstractLabeledBorder
          extended by
org.eclipse.draw2d.TitleBarBorder
All Implemented Interfaces:
Border, LabeledBorder

public class TitleBarBorder
extends AbstractLabeledBorder

Border provides a title bar on the Figure for which this is the border of. Generally used in conjunction with other borders to create window-like effects. Also provides for alignment of the text in the bar.

See Also:
FrameBorder

Field Summary
 
Fields inherited from class org.eclipse.draw2d. AbstractBorder
tempRect
 
Constructor Summary
TitleBarBorder ()
          Constructs a TitleBarBorder with its label set to the name of this class.
TitleBarBorder (java.lang.String s)
          Constructs a TitleBarBorder with its label set to the passed String.
 
Method Summary
protected   Insets calculateInsets ( IFigure figure)
          Calculates and returns the Insets for this border.
protected  Color getBackgroundColor ()
          Returns the background Color of this TitleBarBorder.
protected   Insets getPadding ()
          Returns this TitleBarBorder's padding.
 int getTextAlignment ()
          Returns the alignment of the text in the title bar.
 boolean isOpaque ()
          Returns true thereby filling up all the contents within its boundaries, eleminating the need by the figure to clip the boundaries and do the same.
 void paint ( IFigure figure, Graphics g, Insets insets)
          Paints the border.
 void setBackgroundColor (Color color)
          Sets the background color of the area within the boundaries of this border.
 void setPadding ( Insets pad)
          Sets the padding space of this TitleBarBorder to the passed value.
 void setPadding (int all)
          Sets the padding space to be applied on all sides of the border.
 void setTextAlignment (int align)
          Sets the alignment of the text in the title bar.
 
Methods inherited from class org.eclipse.draw2d. AbstractLabeledBorder
getFont, getInsets, getLabel, getPreferredSize, getTextColor, getTextExtents, invalidate, setFont, setLabel, setTextColor
 
Methods inherited from class org.eclipse.draw2d. AbstractBorder
getPaintRectangle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TitleBarBorder

public TitleBarBorder()
Constructs a TitleBarBorder with its label set to the name of this class.

Since:
2.0

TitleBarBorder

public TitleBarBorder(java.lang.String s)
Constructs a TitleBarBorder with its label set to the passed String.

Parameters:
s - text of the label
Since:
2.0
Method Detail

calculateInsets

protected 
Insets calculateInsets(
IFigure figure)
Calculates and returns the Insets for this border.

Specified by:
calculateInsets in class AbstractLabeledBorder
Parameters:
figure - the figure on which Insets calculations are based
Returns:
the calculated Insets
Since:
2.0

getBackgroundColor

protected Color getBackgroundColor()
Returns the background Color of this TitleBarBorder.

Returns:
the background color
Since:
2.0

getPadding

protected 
Insets getPadding()
Returns this TitleBarBorder's padding. Padding provides spacing along the sides of the TitleBarBorder. The default value is no padding along all sides.

Returns:
the Insets representing the space along the sides of the TitleBarBorder
Since:
2.0

getTextAlignment

public int getTextAlignment()
Returns the alignment of the text in the title bar. Possible values are PositionConstants.LEFT, PositionConstants.CENTER and PositionConstants.RIGHT.

Returns:
the text alignment
Since:
2.0

isOpaque

public boolean isOpaque()
Returns true thereby filling up all the contents within its boundaries, eleminating the need by the figure to clip the boundaries and do the same.

Specified by:
isOpaque in interface Border
Overrides:
isOpaque in class AbstractBorder
See Also:
Border.isOpaque()

paint

public void paint(
IFigure figure,
                  
Graphics g,
                  
Insets insets)
Description copied from interface: Border
Paints the border. The border should paint inside figure's IFigure.getBounds(), inset by the parameter insets. The border generally should not paint inside its own insets. More specifically, Border b should paint inside the rectangle: figure.getBounds().getCropped(insets) and outside of the rectangle: figure.getBounds().getCropped(insets).getCropped(getInsets()) where inside is defined as Rectangle.contains(int, int).

Parameters:
figure - The figure this border belongs to
g - The graphics object used for painting
insets - The insets
See Also:
Border.paint(IFigure, Graphics, Insets)

setBackgroundColor

public void setBackgroundColor(Color color)
Sets the background color of the area within the boundaries of this border. This is required as this border takes responsibility for filling up the region, as TitleBarBorders are always opaque.

Parameters:
color - the background color
Since:
2.0

setPadding

public void setPadding(int all)
Sets the padding space to be applied on all sides of the border. The default value is no padding on all sides.

Parameters:
all - the value of the padding on all sides
Since:
2.0

setPadding

public void setPadding(
Insets pad)
Sets the padding space of this TitleBarBorder to the passed value. The default value is no padding on all sides.

Parameters:
pad - the padding
Since:
2.0

setTextAlignment

public void setTextAlignment(int align)
Sets the alignment of the text in the title bar. Possible values are PositionConstants.LEFT, PositionConstants.CENTER and PositionConstants.RIGHT.

Parameters:
align - the new text alignment
Since:
2.0

Eclipse Draw2d
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire