public class Legend
extends org.eclipse.draw2d.RectangleFigure
Constructor and Description |
---|
Legend(IXYGraph xyGraph)
Construct a legend
|
Modifier and Type | Method and Description |
---|---|
void |
addTrace(Trace trace)
Add a trace to the axis.
|
protected void |
fillShape(org.eclipse.draw2d.Graphics graphics) |
org.eclipse.swt.graphics.Font |
getFont() |
int |
getPreferredHeight() |
org.eclipse.draw2d.geometry.Dimension |
getPreferredSize(int wHint,
int hHint) |
java.util.List<Trace> |
getTraceList() |
boolean |
isDrawBorder() |
protected void |
outlineShape(org.eclipse.draw2d.Graphics graphics) |
boolean |
removeTrace(Trace trace)
Remove a trace from the axis.
|
void |
setDrawBorder(boolean displayDrawBorderAround) |
void |
setPreferredHeight(int preferredHeight) |
void |
setTextFont(org.eclipse.swt.graphics.Font textFont) |
getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setOutline, setOutlineXOR, setXOR
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, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, 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
public Legend(IXYGraph xyGraph)
xyGraph
- the graph for which the legend is createdpublic void addTrace(Trace trace)
trace
- the trace to be added.public boolean removeTrace(Trace trace)
trace
- protected void outlineShape(org.eclipse.draw2d.Graphics graphics)
outlineShape
in class org.eclipse.draw2d.RectangleFigure
protected void fillShape(org.eclipse.draw2d.Graphics graphics)
fillShape
in class org.eclipse.draw2d.RectangleFigure
public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int wHint, int hHint)
getPreferredSize
in interface org.eclipse.draw2d.IFigure
getPreferredSize
in class org.eclipse.draw2d.Figure
public java.util.List<Trace> getTraceList()
public boolean isDrawBorder()
true
if a border is displayed around the legendpublic void setDrawBorder(boolean displayDrawBorderAround)
displayDrawBorderAround
- if true
a border is displayed around the legendpublic int getPreferredHeight()
public void setPreferredHeight(int preferredHeight)
preferredHeight
- the preferred height of this legend. If this value is -1, the height will be computed with default valuespublic org.eclipse.swt.graphics.Font getFont()
getFont
in interface org.eclipse.draw2d.IFigure
getFont
in class org.eclipse.draw2d.Figure
public void setTextFont(org.eclipse.swt.graphics.Font textFont)
textFont
- new font used for the text