Package org.eclipse.draw2d
Class Shape
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.Shape
- All Implemented Interfaces:
- IFigure
- Direct Known Subclasses:
- AbstractPointListShape,- Ellipse,- RectangleFigure,- RoundedRectangle,- Triangle
Provides abstract support for a variety of shapes.
 
When customizing shapes, you shouldn't override paintFigure(). Override fillShape() and outlineShape() methods instead.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsets
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected intDeprecated.protected intDeprecated.UsesetLineWidth(int)orsetLineWidthFloat(float)instead.Fields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidFills the interior of the shape with the background color.getAlpha()Returns line attributes used when drawing this shape.intReturns the line cap style of this shape's outline.float[]Returns the line dash style of this shape's outline.floatReturns the line dash offset of this shape's outline.intReturns the line join style of this shape's outline.floatReturns the line dash miter limit of this shape's outline.intReturns the line style of this shape's outline.intReturns the line width of this shape's outline.floatReturns the line width of this shape's outline.protected abstract voidoutlineShape(Graphics graphics) Outlines this shape using the foreground color.voidpaintFigure(Graphics graphics) Paints the shape.voidsetAlpha(int value) voidvoidsetAntialias(int value) voidsetAntialias(Integer value) voidsetFill(boolean b) Sets whether this shape should fill its region or not.voidsetFillXOR(boolean b) Sets whether XOR based fill should be used by the shape.voidSets all line attributes at once.voidsetLineCap(int cap) Sets the line cap style of this shape's outline.voidsetLineDash(float[] dash) Sets the line dash style of this shape's outline.voidsetLineDashOffset(float dashOffset) Sets the line dash offset of this shape's outline.voidsetLineJoin(int join) Sets the line join style of this shape's outline.voidsetLineMiterLimit(float miterLimit) Sets the line dash miter limit of this shape's outline.voidsetLineStyle(int style) Sets the line style of this shape's outline.voidsetLineWidth(int w) Sets the line width to be used to outline the shape.voidsetLineWidthFloat(float value) Sets the line width of this shape's outline.voidsetOutline(boolean b) Sets whether the outline should be drawn for this shape.voidsetOutlineXOR(boolean b) Sets whether XOR based outline should be used for this shape.voidsetXOR(boolean b) Sets whether XOR based fill and XOR based outline should be used for this shape.Methods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, 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
- 
Field Details- 
lineWidthDeprecated.UsesetLineWidth(int)orsetLineWidthFloat(float)instead.The width of this shape's outline.
- 
lineStyleDeprecated.UsesetLineStyle(int)instead.The line style to be used for this shape's outline.
 
- 
- 
Constructor Details- 
Shapepublic Shape()Default constructor.- Since:
- 2.0
 
 
- 
- 
Method Details- 
fillShapeFills the interior of the shape with the background color.- Parameters:
- graphics- the graphics object
 
- 
outlineShapeOutlines this shape using the foreground color.- Parameters:
- graphics- the graphics object
 
- 
paintFigurePaints the shape. Each shape has an outline to draw, and a region to fill within that outline. Disabled shapes must visually depict the disabled state.- Overrides:
- paintFigurein class- Figure
- Parameters:
- graphics- The Graphics used to paint
- See Also:
 
- 
setFillpublic 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
 
- 
setFillXORpublic void setFillXOR(boolean b) Sets whether XOR based fill should be used by the shape. It repaints this figure.- Parameters:
- b- XOR fill state
- Since:
- 2.0
 
- 
setOutlinepublic void setOutline(boolean b) Sets whether the outline should be drawn for this shape.- Parameters:
- b-- trueif the shape should be outlined
- Since:
- 2.0
 
- 
setOutlineXORpublic void setOutlineXOR(boolean b) Sets whether XOR based outline should be used for this shape.- Parameters:
- b-- trueif the outline should be XOR'ed
- Since:
- 2.0
 
- 
setXORpublic void setXOR(boolean b) Sets whether XOR based fill and XOR based outline should be used for this shape.- Parameters:
- b-- trueif the outline and fill should be XOR'ed
- Since:
- 2.0
 
- 
getAlpha- Since:
- 3.5
 
- 
getAntialias- Since:
- 3.5
 
- 
getLineAttributesReturns line attributes used when drawing this shape.- Returns:
- current line attributes
- Since:
- 3.5
- See Also:
 
- 
getLineWidthpublic int getLineWidth()Returns the line width of this shape's outline.- Returns:
- the line width
 
- 
getLineWidthFloatpublic float getLineWidthFloat()Returns the line width of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
getLineJoinpublic int getLineJoin()Returns the line join style of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
getLineCappublic int getLineCap()Returns the line cap style of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
getLineStylepublic int getLineStyle()Returns the line style of this shape's outline.- Returns:
- the line style
- See Also:
 
- 
getLineDashpublic float[] getLineDash()Returns the line dash style of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
getLineDashOffsetpublic float getLineDashOffset()Returns the line dash offset of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
getLineMiterLimitpublic float getLineMiterLimit()Returns the line dash miter limit of this shape's outline.- Since:
- 3.5
- See Also:
 
- 
setAlpha- Since:
- 3.5
 
- 
setAlphapublic void setAlpha(int value) - Since:
- 3.5
 
- 
setAntialias- Parameters:
- value-
- Since:
- 3.5
- See Also:
 
- 
setAntialiaspublic void setAntialias(int value) - Since:
- 3.5
 
- 
setLineAttributesSets all line attributes at once.- Parameters:
- la-
- Since:
- 3.5
- See Also:
 
- 
setLineWidthpublic void setLineWidth(int w) Sets the line width to be used to outline the shape.- Parameters:
- w- the new width
- Since:
- 2.0
 
- 
setLineWidthFloatpublic void setLineWidthFloat(float value) Sets the line width of this shape's outline.- Parameters:
- value-
- Since:
- 3.5
- See Also:
 
- 
setLineJoinpublic void setLineJoin(int join) Sets the line join style of this shape's outline.- Parameters:
- join-
- Since:
- 3.5
- See Also:
 
- 
setLineCappublic void setLineCap(int cap) Sets the line cap style of this shape's outline.- Parameters:
- cap-
- Since:
- 3.5
- See Also:
 
- 
setLineStylepublic void setLineStyle(int style) Sets the line style of this shape's outline.- Parameters:
- style- the new line style
- Since:
- 2.0
- See Also:
 
- 
setLineDashpublic void setLineDash(float[] dash) Sets the line dash style of this shape's outline.- Parameters:
- dash-
- Since:
- 3.5
- See Also:
 
- 
setLineDashOffsetpublic void setLineDashOffset(float dashOffset) Sets the line dash offset of this shape's outline.- Parameters:
- dashOffset-
- Since:
- 3.5
- See Also:
 
- 
setLineMiterLimitpublic void setLineMiterLimit(float miterLimit) Sets the line dash miter limit of this shape's outline.- Parameters:
- miterLimit-
- Since:
- 3.5
- See Also:
 
 
- 
setLineStyle(int)instead.