CH.ifa.draw.contrib
Class DiamondFigure

java.lang.Object
  extended by CH.ifa.draw.standard.AbstractFigure
      extended by CH.ifa.draw.figures.AttributeFigure
          extended by CH.ifa.draw.figures.RectangleFigure
              extended by CH.ifa.draw.contrib.DiamondFigure
All Implemented Interfaces:
Figure, Storable, java.io.Serializable, java.lang.Cloneable

public class DiamondFigure
extends RectangleFigure

A diamond with vertices at the midpoints of its enclosing rectangle

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
DiamondFigure()
           
DiamondFigure(java.awt.Point origin, java.awt.Point corner)
           
 
Method Summary
 java.awt.Insets connectionInsets()
          Returns the connection inset.
 boolean containsPoint(int x, int y)
          Checks if a point is inside the figure.
 void draw(java.awt.Graphics g)
          Draws the figure in the given graphics.
protected  java.awt.Polygon polygon()
          Return the polygon describing the diamond
 
Methods inherited from class CH.ifa.draw.figures.RectangleFigure
basicDisplayBox, basicMoveBy, displayBox, drawBackground, drawFrame, handles, read, write
 
Methods inherited from class CH.ifa.draw.figures.AttributeFigure
getAttribute, getDefaultAttribute, getFillColor, getFrameColor, setAttribute
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, canConnect, center, changed, clone, connectedTextLocator, connectorAt, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, size, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiamondFigure

public DiamondFigure()

DiamondFigure

public DiamondFigure(java.awt.Point origin,
                     java.awt.Point corner)
Method Detail

polygon

protected java.awt.Polygon polygon()
Return the polygon describing the diamond


draw

public void draw(java.awt.Graphics g)
Description copied from class: AttributeFigure
Draws the figure in the given graphics. Draw is a template method calling drawBackground followed by drawFrame.

Specified by:
draw in interface Figure
Overrides:
draw in class AttributeFigure
Parameters:
g - the Graphics to draw into

connectionInsets

public java.awt.Insets connectionInsets()
Description copied from class: AbstractFigure
Returns the connection inset. The connection inset defines the area where the display box of a figure can't be connected. By default the entire display box can be connected.

Specified by:
connectionInsets in interface Figure
Overrides:
connectionInsets in class AbstractFigure

containsPoint

public boolean containsPoint(int x,
                             int y)
Description copied from class: AbstractFigure
Checks if a point is inside the figure.

Specified by:
containsPoint in interface Figure
Overrides:
containsPoint in class AbstractFigure