|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component net.sourceforge.webcompmath.draw.Drawable net.sourceforge.webcompmath.draw.beans.WCMAxisTickBean
public class WCMAxisTickBean
This class provides a convenient way to create a labeled tick mark for one of the axes. The label is optional. The location of the tick mark is specified by a Value, and hence can be tied to various other WCM components.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ABOVE_RIGHT
Indicates that the preferred label position is above (for x axis) or to the right (for y axis) of the axis. |
static int |
BELOW_LEFT
Indicates that the preferred label position is below (for x axis) or to the left (for y axis) of the axis. |
Fields inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
canvas, coords |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WCMAxisTickBean()
Default constructor. |
|
WCMAxisTickBean(boolean xAxis,
Value coord,
java.lang.String labelText)
Constructor for a new WCMAxisTickBean. |
Method Summary | |
---|---|
void |
compute()
Normally only called by a controller |
void |
draw(java.awt.Graphics g,
boolean coordsChanged)
Draw the tick and label. |
Value |
getCoord()
Get the value that defines the coordinate location of the tick mark. |
java.awt.Color |
getLabelColor()
Get the label color. |
java.awt.Font |
getLabelFont()
Get the font. |
java.lang.String |
getLabelText()
Get the label text. |
int |
getLineWidth()
Get the line width. |
int |
getPosition()
Get the label position, one of BELOW_LEFT or ABOVE_RIGHT |
java.awt.Color |
getTickColor()
Get the tick color. |
boolean |
getVisible()
Return true if this WCMAxisTickBean is visible, false if it is hidden. |
boolean |
isXAxis()
Get whether tick is on the x axis |
void |
needsRedraw()
This routine should be called if the appearance of the WCMAxisTickBean changes so that the rectangular area that it occupies has to be redrawn. |
void |
setCoord(Value coord)
Set the value that defines the coordinate location of the tick mark. |
void |
setLabelColor(java.awt.Color labelColor)
Set the label color. |
void |
setLabelFont(java.awt.Font labelFont)
Set the font that is used for drawing the label. |
void |
setLabelText(java.lang.String labelText)
Set the label text. |
void |
setLineWidth(int lineWidth)
Set the line width. |
protected void |
setOwnerData(DisplayCanvas canvas,
CoordinateRect coords)
Override to set the owner data for the embedded drawables and add them to a coordinate rect. |
void |
setPosition(int position)
Set the label position, one of BELOW_LEFT or ABOVE_RIGHT |
void |
setTickColor(java.awt.Color tickColor)
Set the tick color. |
void |
setVisible(boolean show)
Set the visibility of this WCMAxisTickBean. |
void |
setXAxis(boolean axis)
Set whether the tick is on the x axis |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ABOVE_RIGHT
public static final int BELOW_LEFT
Constructor Detail |
---|
public WCMAxisTickBean()
public WCMAxisTickBean(boolean xAxis, Value coord, java.lang.String labelText)
xAxis
- true if tick is on x axis, false for y axiscoord
- the coordinate of the ticklabelText
- the label for the tickMethod Detail |
---|
public void draw(java.awt.Graphics g, boolean coordsChanged)
draw
in class Drawable
g
- The graphics context in which the Drawble is to be drawn. (The
drawing can change the color in g, but should not permanently
change font, painting mode, etc. Thus, every drawable is
responsible for setting the color it wants to use.)coordsChanged
- Indicates whether the CoordinateRect has changed.Drawable.draw(java.awt.Graphics,
boolean)
public void compute()
compute
in interface Computable
Computable.compute()
protected void setOwnerData(DisplayCanvas canvas, CoordinateRect coords)
setOwnerData
in class Drawable
canvas
- DisplayCanvas to usecoords
- CoordinateRect to useDrawable.setOwnerData(net.sourceforge.webcompmath.draw.DisplayCanvas,
net.sourceforge.webcompmath.draw.CoordinateRect)
public boolean getVisible()
getVisible
in class Drawable
Drawable.getVisible()
public void needsRedraw()
needsRedraw
in class Drawable
Drawable.needsRedraw()
public void setVisible(boolean show)
setVisible
in class Drawable
show
- true or falseDrawable.setVisible(boolean)
public Value getCoord()
public void setCoord(Value coord)
coord
- the coord to setpublic java.awt.Font getLabelFont()
public void setLabelFont(java.awt.Font labelFont)
labelFont
- the font to setpublic java.lang.String getLabelText()
public void setLabelText(java.lang.String labelText)
labelText
- the label to setpublic java.awt.Color getLabelColor()
public void setLabelColor(java.awt.Color labelColor)
labelColor
- the labelColor to setpublic int getPosition()
public void setPosition(int position)
position
- the position to setpublic int getLineWidth()
public void setLineWidth(int lineWidth)
lineWidth
- the lineWidth to setpublic java.awt.Color getTickColor()
public void setTickColor(java.awt.Color tickColor)
tickColor
- the tickColor to setpublic boolean isXAxis()
public void setXAxis(boolean axis)
axis
- true for x axis, false for y axis.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |