jas2.plot
Class Axis
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- jas2.plot.PlotComponent
-
- jas2.plot.Axis
-
- All Implemented Interfaces:
- HasPopupItems, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- Direct Known Subclasses:
- ColorMapAxis, ManagedAxis
public class Axis extends PlotComponent implements HasPopupItems
This class represents a plot axis as a GUI component. It depends on a subclass ofAxisTypeto implement the type-specific properties necessary for a meaningful axis.- See Also:
AxisType, Serialized Form
-
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field and Description static intHORIZONTALRepresents horizontal orientation for both labels and axes.static intVERTICALRepresents vertical orientation for both labels and axes.-
Fields inherited from class jas2.plot.PlotComponent
BEVEL_IN, BEVEL_OUT, ETCHED, LINE, NONE, OTHER, SHADOW
-
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor and Description Axis()This consturctor is primarily for object deserialization.Axis(AxisType type, boolean onLeftSide)Creates a vertical axis object.Axis(AxisType type, int axisOrientation)Creates a new axis object.Axis(AxisType type, int axisOrientation, boolean onLeftSide)Creates a new axis object.Axis(int axisOrientation)Creates a new axis object, using a numeric axis (classDoubleAxis).Axis(int axisOrientation, boolean onLeftSide)Creates a numerical axis object (uses classDoubleAxis).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ColorgetAxisColor()intgetAxisOrientation()java.awt.ColorgetAxisOriginDotColor()floatgetAxisWidth()java.awt.ColorgetMajorTickMarkColor()intgetMaxLocation()Used by superclasses to convert coordinates.intgetMinLocation()Used by superclasses to convert coordinates.java.awt.ColorgetMinorTickMarkColor()booleangetOnLeftSide()java.awt.ColorgetTextColor()AxisTypegetType()Returns the AxisType for this axis.voidmodifyPopupMenu(javax.swing.JPopupMenu menu, java.awt.Component source)Modify the given menu object.voidsetAxisColor(java.awt.Color newColor)voidsetAxisOriginDotColor(java.awt.Color newColor)voidsetAxisWidth(float newWidth)voidsetBounds(int x, int y, int width, int height)This method is public as an implementation side-effect; do not call.voidsetFont(java.awt.Font font)voidsetMajorTickMarkColor(java.awt.Color newColor)voidsetMinorTickMarkColor(java.awt.Color newColor)voidsetOnLeftSide(boolean left)voidsetTextColor(java.awt.Color newColor)voidsetType(AxisType type)Sets the AxisType for this axis.-
Methods inherited from class jas2.plot.PlotComponent
getBorderType, isPaintingBackground, paintComponent, setBackground, setBorderType
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
VERTICAL
public static final int VERTICAL
Represents vertical orientation for both labels and axes.- See Also:
- Constant Field Values
-
HORIZONTAL
public static final int HORIZONTAL
Represents horizontal orientation for both labels and axes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Axis
public Axis()
This consturctor is primarily for object deserialization. It creates a vertical axis object with a numeric (classDoubleAxis) which will be on the left side.- See Also:
DoubleAxis
-
Axis
public Axis(AxisType type, int axisOrientation)
Creates a new axis object. If this axis is vertical it will be on the left side of the plot.- Parameters:
type- the AxisType object that represents the data type for this axisaxisOrientation- the orientation of the axis (use constantsAxis.HORIZONTALandAxis.VERTICAL)
-
Axis
public Axis(int axisOrientation)
Creates a new axis object, using a numeric axis (classDoubleAxis). If this axis is vertical it will be on the left side of the plot.- Parameters:
axisOrientation- the orientation of the axis (use constantsAxis.HORIZONTALandAxis.VERTICAL)- See Also:
DoubleAxis
-
Axis
public Axis(int axisOrientation, boolean onLeftSide)Creates a numerical axis object (uses classDoubleAxis).- Parameters:
axisOrientation- the orientation of the axis (use constantsAxis.HORIZONTALandAxis.VERTICAL)onLeftSide- whether this axis is on the left- See Also:
DoubleAxis
-
Axis
public Axis(AxisType type, boolean onLeftSide)
Creates a vertical axis object.- Parameters:
type- the AxisType object that represents the data type for this axisonLeftSide- whether this axis is on the left
-
Axis
public Axis(AxisType type, int axisOrientation, boolean onLeftSide)
Creates a new axis object.- Parameters:
type- the AxisType object that represents the data type for this axisaxisOrientation- the orientation of the axis (use constantsAxis.HORIZONTALandAxis.VERTICAL)onLeftSide- whether this axis is on the left
-
-
Method Detail
-
modifyPopupMenu
public void modifyPopupMenu(javax.swing.JPopupMenu menu, java.awt.Component source)Description copied from interface:HasPopupItemsModify the given menu object.- Specified by:
modifyPopupMenuin interfaceHasPopupItems
-
setType
public final void setType(AxisType type)
Sets the AxisType for this axis.
-
setFont
public final void setFont(java.awt.Font font)
- Overrides:
setFontin classjavax.swing.JComponent
-
getType
public final AxisType getType()
Returns the AxisType for this axis.
-
getMinLocation
public final int getMinLocation()
Used by superclasses to convert coordinates.
-
getMaxLocation
public final int getMaxLocation()
Used by superclasses to convert coordinates.
-
setBounds
public final void setBounds(int x, int y, int width, int height)This method is public as an implementation side-effect; do not call.- Overrides:
setBoundsin classjava.awt.Component
-
getAxisOrientation
public final int getAxisOrientation()
-
getOnLeftSide
public final boolean getOnLeftSide()
-
setOnLeftSide
public final void setOnLeftSide(boolean left)
-
getAxisColor
public java.awt.Color getAxisColor()
-
setAxisWidth
public void setAxisWidth(float newWidth)
-
getAxisWidth
public float getAxisWidth()
-
setAxisColor
public void setAxisColor(java.awt.Color newColor)
-
getAxisOriginDotColor
public java.awt.Color getAxisOriginDotColor()
-
setAxisOriginDotColor
public void setAxisOriginDotColor(java.awt.Color newColor)
-
getMajorTickMarkColor
public java.awt.Color getMajorTickMarkColor()
-
setMajorTickMarkColor
public void setMajorTickMarkColor(java.awt.Color newColor)
-
getMinorTickMarkColor
public java.awt.Color getMinorTickMarkColor()
-
setMinorTickMarkColor
public void setMinorTickMarkColor(java.awt.Color newColor)
-
getTextColor
public java.awt.Color getTextColor()
-
setTextColor
public void setTextColor(java.awt.Color newColor)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG