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

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 CompoundBorder

java.lang.Object
  extended by

org.eclipse.draw2d.AbstractBorder
      extended by
org.eclipse.draw2d.CompoundBorder
All Implemented Interfaces:
Border
Direct Known Subclasses:
FrameBorder

public class CompoundBorder
extends AbstractBorder

CompoundBorder allows for the nesting of two borders. The nested borders are referred to as the inner and outer borders.


Field Summary
protected   Border inner
          The inner Border.
protected   Border outer
          The outer Border.
 
Fields inherited from class org.eclipse.draw2d. AbstractBorder
tempRect
 
Constructor Summary
CompoundBorder ()
          Constructs a default CompoundBorder with no borders under it.
CompoundBorder ( Border outer, Border inner)
          Constructs a CompoundBorder with the two borders specified as input.
 
Method Summary
  Border getInnerBorder ()
          Returns the inner border of this CompoundBorder.
  Insets getInsets ( IFigure figure)
          Returns the total insets required to hold both the inner and outer borders of this CompoundBorder.
  Border getOuterBorder ()
          Returns the outer border of this CompoundBorder.
  Dimension getPreferredSize ( IFigure fig)
          Returns the preferred width and height that this border would like to display itself properly.
 boolean isOpaque ()
          Returns true if this border is opaque.
 void paint ( IFigure figure, Graphics g, Insets insets)
          Paints the border.
 
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
 

Field Detail

inner

protected 
Border inner
The inner Border.


outer

protected 
Border outer
The outer Border.

Constructor Detail

CompoundBorder

public CompoundBorder()
Constructs a default CompoundBorder with no borders under it.

Since:
2.0

CompoundBorder

public CompoundBorder(
Border outer,
                      
Border inner)
Constructs a CompoundBorder with the two borders specified as input.

Parameters:
outer - Border which is drawn on the outside
inner - Border which is drawn inside the outer border
Since:
2.0
Method Detail

getInnerBorder

public 
Border getInnerBorder()
Returns the inner border of this CompoundBorder.

Returns:
The inner border
Since:
2.0

getInsets

public 
Insets getInsets(
IFigure figure)
Returns the total insets required to hold both the inner and outer borders of this CompoundBorder.

Parameters:
figure - Figure for which this is the border
Returns:
The total insets for this border
Since:
2.0

getPreferredSize

public 
Dimension getPreferredSize(
IFigure fig)
Description copied from interface: Border
Returns the preferred width and height that this border would like to display itself properly.

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

getOuterBorder

public 
Border getOuterBorder()
Returns the outer border of this CompoundBorder.

Returns:
The outer border
Since:
2.0

isOpaque

public boolean isOpaque()
Returns true if this border is opaque. Return value is dependent on the opaque state of both the borders it contains. Both borders have to be opaque for this border to be opaque. In the absence of any of the borders, this border is not opaque.

Specified by:
isOpaque in interface Border
Overrides:
isOpaque in class AbstractBorder
Returns:
true if this border is opaque
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)

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