GEF v2.0

org.eclipse.gef.handles
Class CornerTriangleBorder

java.lang.Object
  |
  +--org.eclipse.draw2d.AbstractBorder
        |
        +--org.eclipse.gef.handles.CornerTriangleBorder
All Implemented Interfaces:
Border

public final class CornerTriangleBorder
extends AbstractBorder

A Border with a triangle in each corner.


Fields inherited from class org.eclipse.draw2d.AbstractBorder
tempRect
 
Constructor Summary
CornerTriangleBorder(boolean isPrimary)
          Creates a new CornerTriangleBorder.
 
Method Summary
protected  Color getBorderColor()
          Returns the outline color based on what is returned by isPrimary().
protected  Color getFillColor()
          Returns the fill color based on what is returned by isPrimary().
 Insets getInsets(IFigure figure)
           
 boolean isOpaque()
           
 boolean isPrimary()
          Returns true if this border is for the primary object in the selection.
 void paint(IFigure figure, Graphics graphics, Insets insets)
          Paints the border.
 void setPrimary(boolean isPrimary)
          Sets this border as primary if isPrimary is true.
 
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
 

Constructor Detail

CornerTriangleBorder

public CornerTriangleBorder(boolean isPrimary)
Creates a new CornerTriangleBorder.
Parameters:
isPrimary - Determines this border's color.
Method Detail

isOpaque

public boolean isOpaque()
Overrides:
isOpaque in class AbstractBorder

getInsets

public Insets getInsets(IFigure figure)
Overrides:
getInsets in class AbstractBorder

paint

public void paint(IFigure figure,
                  Graphics graphics,
                  Insets insets)
Paints the border. If this is a border for the primary selection, it's painted black. Otherwise, it's painted white.
Overrides:
paint in class AbstractBorder
Parameters:
figure - The IFigure this border will be painted on
graphics - The Graphics.
insets - The Insets.

getBorderColor

protected Color getBorderColor()
Returns the outline color based on what is returned by isPrimary().
Returns:
The outline color.

getFillColor

protected Color getFillColor()
Returns the fill color based on what is returned by isPrimary().
Returns:
The fill color.

isPrimary

public boolean isPrimary()
Returns true if this border is for the primary object in the selection. Otherwise, returns false.
Returns:
Whether or not this is a primary border.

setPrimary

public void setPrimary(boolean isPrimary)
Sets this border as primary if isPrimary is true.
Parameters:
isPrimary - True if this border is for the primary object in the selection.

GEF v2.0