Eclipse Draw2d
2.1

org.eclipse.draw2d
Class Shape

java.lang.Object
  |
  +--org.eclipse.draw2d.Figure
        |
        +--org.eclipse.draw2d.Shape
All Implemented Interfaces:
IFigure
Direct Known Subclasses:
Ellipse, Polyline, RectangleFigure, RoundedRectangle, Triangle

public abstract class Shape
extends Figure

Provides abstract support for a variety of shapes.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator
 
Nested classes inherited from class org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
protected  int lineStyle
           
protected  int lineWidth
           
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
Shape()
          Default constructor.
 
Method Summary
protected abstract  void fillShape(Graphics graphics)
           
 int getLineStyle()
           
 int getLineWidth()
           
 boolean isOpaque()
          Returns the opaque state of this shape.
protected abstract  void outlineShape(Graphics graphics)
           
 void paintFigure(Graphics graphics)
          Paints this Figure's primary representation, or background.
 void setFill(boolean b)
          Sets whether this shape should fill its region or not.
 void setFillXOR(boolean b)
          Sets whether XOR based fill should be used by the shape.
 void setLineStyle(int s)
          Sets the style of line to be used by this shape.
 void setLineWidth(int w)
          Sets the line width to be used by the shape.
 void setOutline(boolean b)
          Sets whether the outline should be drawn for this shape.
 void setOutlineXOR(boolean b)
          Sets whether XOR based outline should be used for this shape.
 void setXOR(boolean b)
          Sets whether XOR based fill and XOR based outline should be used for this shape.
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addFigureListener, addFocusListener, addKeyListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isEnabled, isFocusTraversable, isMouseEventTarget, isRequestFocusEnabled, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeFigureListener, removeFocusListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineWidth

protected int lineWidth

lineStyle

protected int lineStyle
Constructor Detail

Shape

public Shape()
Default constructor.

Since:
2.0
Method Detail

fillShape

protected abstract void fillShape(Graphics graphics)

getLineStyle

public int getLineStyle()

getLineWidth

public int getLineWidth()

isOpaque

public boolean isOpaque()
Returns the opaque state of this shape.

Specified by:
isOpaque in interface IFigure
Overrides:
isOpaque in class Figure
Returns:
Returns false as shapes only draw themselves onto other figures, and generally dont have rectangular dimensions.
Since:
2.0
See Also:
IFigure.isOpaque()

outlineShape

protected abstract void outlineShape(Graphics graphics)

paintFigure

public void paintFigure(Graphics graphics)
Description copied from class: Figure
Paints this Figure's primary representation, or background. Changes made to the graphics to the graphics current state will not affect the subsequent calls to Figure.paintClientArea(Graphics) and Figure.paintBorder(Graphics). Furthermore, it is safe to call graphics.restoreState() within this method, and doing so will restore the graphics to its original state upon entry.

Overrides:
paintFigure in class Figure
Parameters:
graphics - The Graphics used to paint

setFill

public void setFill(boolean b)
Sets whether this shape should fill its region or not. It repaints this figure.

Parameters:
b - Fill state.
Since:
2.0

setFillXOR

public void setFillXOR(boolean b)
Sets whether XOR based fill should be used by the shape. It repaints this figure.

Since:
2.0

setLineWidth

public void setLineWidth(int w)
Sets the line width to be used by the shape.

Parameters:
w - Width of the line to be used.
Since:
2.0

setLineStyle

public void setLineStyle(int s)
Sets the style of line to be used by this shape.

Parameters:
s - Line style.
Since:
2.0

setOutline

public void setOutline(boolean b)
Sets whether the outline should be drawn for this shape.

Parameters:
b - Outline state of the shape.
Since:
2.0

setOutlineXOR

public void setOutlineXOR(boolean b)
Sets whether XOR based outline should be used for this shape.

Parameters:
b - XOR based outline usage state.
Since:
2.0

setXOR

public void setXOR(boolean b)
Sets whether XOR based fill and XOR based outline should be used for this shape.

Parameters:
b - XOR based usage state.
Since:
2.0

Eclipse Draw2d
2.1

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