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

  




 

 

Runtime

org.eclipse.gmf.runtime.draw2d.ui.figures
Class RectangularDropShadowLineBorder

java.lang.Object
  extended by 

org.eclipse.draw2d.AbstractBorder
      extended by 

org.eclipse.draw2d.LineBorder
          extended by org.eclipse.gmf.runtime.draw2d.ui.internal.figures.LineBorderEx
              extended by 
org.eclipse.gmf.runtime.draw2d.ui.figures.RectangularDropShadowLineBorder
All Implemented Interfaces:
Border, DropShadowBorder, org.eclipse.gmf.runtime.draw2d.ui.internal.figures.TransparentBorder

public class RectangularDropShadowLineBorder
extends org.eclipse.gmf.runtime.draw2d.ui.internal.figures.LineBorderEx
implements DropShadowBorder


Field Summary
 
Fields inherited from class org.eclipse.draw2d. AbstractBorder
tempRect
 
Constructor Summary
RectangularDropShadowLineBorder ()
          Constructs a DropShadowLineBorder with the foreground color and backgroud color of the figure that it is drawing the border for.
RectangularDropShadowLineBorder (int w)
          Constructs a LineBorder of the specified width.
 
Method Summary
protected   RectangularDropShadow getDropShadow ()
           
  Insets getInsets ( IFigure figure)
          Method for determining the inset the border will take up on the shape.
protected  int getShadowHeight ()
          Method for determining the height of the drop shadow border will take up on the shape.
protected  int getShadowWidth ()
          Method for determining the width of the drop shadow border will take up on the shape.
  Insets getTransparentInsets ( IFigure figure)
          Method getTransparentInsets.
 boolean isOpaque ()
          Is this border Opaque or not.
 void paint ( IFigure figure, Graphics g, Insets insets)
          Overridden method for painting the border on the shape.
 void paintDropShadowBorder ( IFigure figure, Graphics g, Insets insets, Rectangle rBox)
          Paint the border of the figure with a dropshadow.
 void paintLineBorder ( IFigure figure, Graphics g, Insets insets)
          Method paintLineBorder.
 void setShouldDrawDropShadow (boolean bDrawDropShadow)
          Sets whether the border will draw a drop shadow with the border edge.
 boolean shouldDrawDropShadow ()
           
protected  boolean shouldDrawShadow ( IFigure figure)
          Method shouldDrawShadow.
 
Methods inherited from class org.eclipse.draw2d. LineBorder
getColor, getStyle, getWidth, setColor, setStyle, setWidth
 
Methods inherited from class org.eclipse.draw2d. AbstractBorder
getPaintRectangle, getPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.draw2d. Border
getPreferredSize
 

Constructor Detail

RectangularDropShadowLineBorder

public RectangularDropShadowLineBorder(int w)
Constructs a LineBorder of the specified width.

Parameters:
w - Width of inset for border in logic points

RectangularDropShadowLineBorder

public RectangularDropShadowLineBorder()
Constructs a DropShadowLineBorder with the foreground color and backgroud color of the figure that it is drawing the border for.

Method Detail

getShadowWidth

protected int getShadowWidth()
Method for determining the width of the drop shadow border will take up on the shape.

Returns:
int the width of the drop shadow

getShadowHeight

protected int getShadowHeight()
Method for determining the height of the drop shadow border will take up on the shape.

Returns:
int the height of the drop shadow

getInsets

public 
Insets getInsets(
IFigure figure)
Method for determining the inset the border will take up on the shape.

Specified by:
getInsets in interface Border
Overrides:
getInsets in class LineBorder
Parameters:
figure - Figure that will be inset from the border
Returns:
Insets the Insets for the border on the given figure.

shouldDrawShadow

protected boolean shouldDrawShadow(
IFigure figure)
Method shouldDrawShadow. Determines if the shadow should be drawn on the figure border. Checks that a drop shadow is the preferred border, and that the drop shadow can be drawn on this figure.

Parameters:
figure - Figure that the border will be drawn on
Returns:
boolean true if the shadow should be drawn, false otherwise.

getTransparentInsets

public 
Insets getTransparentInsets(
IFigure figure)
Description copied from interface: org.eclipse.gmf.runtime.draw2d.ui.internal.figures.TransparentBorder
Method getTransparentInsets. This method allows a border to indicate which part of it's inset is transparent. This is important so that if certain methods wish to ignore this part of the border they can. i.e. When placing resize handles around a shape.

Specified by:
getTransparentInsets in interface org.eclipse.gmf.runtime.draw2d.ui.internal.figures.TransparentBorder
Parameters:
figure - IFigure to calculate the insets of
Returns:
Insets object containing the border offsets which are transparent.
See Also:
TransparentBorder#getTransparentInsets(IFigure)

isOpaque

public boolean isOpaque()
Is this border Opaque or not.

Specified by:
isOpaque in interface Border
Overrides:
isOpaque in class LineBorder
Returns:
boolean true if opaque, false otherwise

paintLineBorder

public void paintLineBorder(
IFigure figure,
                            
Graphics g,
                            
Insets insets)
Method paintLineBorder. Painting the line border on the shape without the dropshadow.

Parameters:
figure - Figure that the border will be painted on
g - Graphics context
insets - Insets value that contrains how the border will be painted.

paintDropShadowBorder

public void paintDropShadowBorder(
IFigure figure,
                                  
Graphics g,
                                  
Insets insets,
                                  
Rectangle rBox)
Paint the border of the figure with a dropshadow.

Parameters:
figure - Figure that the border will be painted on
g - Graphics context
insets - Insets value that contrains how the border will be painted.
rBox - Rectangle representing figure bounds.

paint

public void paint(
IFigure figure,
                  
Graphics g,
                  
Insets insets)
Overridden method for painting the border on the shape.

Specified by:
paint in interface Border
Overrides:
paint in class org.eclipse.gmf.runtime.draw2d.ui.internal.figures.LineBorderEx
Parameters:
figure - Figure that the border will be painted on
g - Graphics context
insets - Insets value that constrains how the border will be painted.

shouldDrawDropShadow

public boolean shouldDrawDropShadow()
Specified by:
shouldDrawDropShadow in interface DropShadowBorder
Returns:
true iff the border painting method will draw a shadow

setShouldDrawDropShadow

public void setShouldDrawDropShadow(boolean bDrawDropShadow)
Description copied from interface: DropShadowBorder
Sets whether the border will draw a drop shadow with the border edge.

Specified by:
setShouldDrawDropShadow in interface DropShadowBorder

getDropShadow

protected 
RectangularDropShadow getDropShadow()
Returns:
Returns the drop shadow image.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.


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