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.
| Fields inherited from class org.eclipse.draw2d.Figure |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
|
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, findFigureAtExcluding, findMouseEventTargetAt, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocation, getMaximumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, 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, setUpdateManager, 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 |
lineWidth
protected int lineWidth
lineStyle
protected int lineStyle
Shape
public Shape()
- Default constructor.
- Since:
- 2.0
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.
- 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
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.
The client area is painted next. Changes made to the graphics context
here affect the other paint methods.
- Overrides:
paintFigure in class Figure
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.
- Parameters:
XOR - fill state.- 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