public abstract class Shape extends Figure
When customizing shapes, you shouldn't override paintFigure(). Override fillShape() and outlineShape() methods instead.
Figure.FigureIterator, Figure.IdentitySearch
IFigure.NoInsets
Modifier and Type | Field and Description |
---|---|
protected int |
lineStyle
Deprecated.
Use
setLineStyle(int) instead. |
protected int |
lineWidth
Deprecated.
Use
setLineWidth(int) or
setLineWidthFloat(float) instead. |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
Constructor and Description |
---|
Shape()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
fillShape(Graphics graphics)
Fills the interior of the shape with the background color.
|
java.lang.Integer |
getAlpha() |
java.lang.Integer |
getAntialias() |
LineAttributes |
getLineAttributes()
Returns line attributes used when drawing this shape.
|
int |
getLineCap()
Returns the line cap style of this shape's outline.
|
float[] |
getLineDash()
Returns the line dash style of this shape's outline.
|
float |
getLineDashOffset()
Returns the line dash offset of this shape's outline.
|
int |
getLineJoin()
Returns the line join style of this shape's outline.
|
float |
getLineMiterLimit()
Returns the line dash miter limit of this shape's outline.
|
int |
getLineStyle()
Returns the line style of this shape's outline.
|
int |
getLineWidth()
Returns the line width of this shape's outline.
|
float |
getLineWidthFloat()
Returns the line width of this shape's outline.
|
protected abstract void |
outlineShape(Graphics graphics)
Outlines this shape using the foreground color.
|
void |
paintFigure(Graphics graphics)
Paints the shape.
|
void |
setAlpha(int value) |
void |
setAlpha(java.lang.Integer value) |
void |
setAntialias(int value) |
void |
setAntialias(java.lang.Integer value) |
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 |
setLineAttributes(LineAttributes la)
Sets all line attributes at once.
|
void |
setLineCap(int cap)
Sets the line cap style of this shape's outline.
|
void |
setLineDash(float[] dash)
Sets the line dash style of this shape's outline.
|
void |
setLineDashOffset(float dashOffset)
Sets the line dash offset of this shape's outline.
|
void |
setLineJoin(int join)
Sets the line join style of this shape's outline.
|
void |
setLineMiterLimit(float miterLimit)
Sets the line dash miter limit of this shape's outline.
|
void |
setLineStyle(int style)
Sets the line style of this shape's outline.
|
void |
setLineWidth(int w)
Sets the line width to be used to outline the shape.
|
void |
setLineWidthFloat(float value)
Sets the line width of this shape's outline.
|
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.
|
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, 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, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, 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
protected int lineWidth
setLineWidth(int)
or
setLineWidthFloat(float)
instead.protected int lineStyle
setLineStyle(int)
instead.protected abstract void fillShape(Graphics graphics)
graphics
- the graphics objectprotected abstract void outlineShape(Graphics graphics)
graphics
- the graphics objectpublic void paintFigure(Graphics graphics)
paintFigure
in class Figure
graphics
- The Graphics used to paintFigure.paintFigure(Graphics)
public void setFill(boolean b)
b
- fill statepublic void setFillXOR(boolean b)
b
- XOR fill statepublic void setOutline(boolean b)
b
- true
if the shape should be outlinedpublic void setOutlineXOR(boolean b)
b
- true
if the outline should be XOR'edpublic void setXOR(boolean b)
b
- true
if the outline and fill should be XOR'edpublic java.lang.Integer getAlpha()
public java.lang.Integer getAntialias()
public LineAttributes getLineAttributes()
Performance note: creates and returns a clone.
public int getLineWidth()
public float getLineWidthFloat()
LineAttributes.width
public int getLineJoin()
LineAttributes.join
public int getLineCap()
LineAttributes.cap
public int getLineStyle()
LineAttributes.style
public float[] getLineDash()
LineAttributes.dash
public float getLineDashOffset()
LineAttributes.dashOffset
public float getLineMiterLimit()
LineAttributes.miterLimit
public void setAlpha(java.lang.Integer value)
public void setAlpha(int value)
public void setAntialias(java.lang.Integer value)
value
- GC.setAntialias(int)
public void setAntialias(int value)
public void setLineAttributes(LineAttributes la)
la
- LineAttributes
public void setLineWidth(int w)
w
- the new widthpublic void setLineWidthFloat(float value)
value
- LineAttributes.width
public void setLineJoin(int join)
join
- LineAttributes.join
public void setLineCap(int cap)
cap
- LineAttributes.cap
public void setLineStyle(int style)
style
- the new line styleLineAttributes.style
public void setLineDash(float[] dash)
dash
- LineAttributes.dash
public void setLineDashOffset(float dashOffset)
dashOffset
- LineAttributes.dashOffset
public void setLineMiterLimit(float miterLimit)
miterLimit
- LineAttributes.miterLimit
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.