Package hec.gfx2d
Class AxisTics
- All Implemented Interfaces:
G2dToolbarListener
,G2dZoomComponent
,ImageObserver
,MenuContainer
,Serializable
,Observer
,Accessible
- Direct Known Subclasses:
CategoryAxisTics
,LogAxisTics
,ProbabilityAxisTics
,TSAxisTics
Graphic Component that displays tic marks and tic labels for an Axis.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface that will return true if a new axis can be swapped in for an existing Axis.Nested classes/interfaces inherited from class hec.gfx2d.G2dComponent
G2dComponent.DefaultPreferredSizeProvider, G2dComponent.EditPropertyListener
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class hec.gfx2d.G2dComponent
_parent, _popupMenu, BOTTOM, LEFT, RIGHT, TOP
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.boolean
get whether the major tic labels are visibleboolean
Deprecated.boolean
get whether the major tics are visibleboolean
Deprecated.boolean
get whether the minor tic labels are visibleboolean
Deprecated.boolean
get whether the minor tics are visibleprotected void
void
Deprecated.void
This method only works when in the RIGHT alignment positionvoid
protected void
drawAxisLabelsBottom
(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) protected void
drawAxisLabelsTop
(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) protected void
protected void
protected void
protected void
void
void
editProperties
(int selectedTab) getAxis()
Returns a reference to the axis that this object draws.protected boolean
get the Axis Tic Colorget the Axis Tic Color as a Stringprotected boolean
int[]
get the fonts sizes used by this labelint
get the major tic lengthprotected WorldRect
int
get the minor tic lengthhec.gfx2d.AxisTics.PropertiesOKListener
getPropertiesOKListener
(ScalePropertiesPanel scalePanel, G2dAxisLabelPropertiesPanel labelPanel) Returns a tool tip text for the given mouse location.boolean
objectPopupMenu
(LocalPt pt, int modifiers) void
Paints the contents of the panel.void
void
setAxisTicColor
(String colorString) set the tic color to the color represented by colorStringvoid
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
Deprecated.void
setFontSizes
(int sz, int tiny, int min, int max) void
void
void
setLogarithmic
(AxisTics.AxisSwapValidator validator) void
setMajorTicLabelsVisible
(boolean state) set the visibility of major tic labelsvoid
setMajorTicLength
(int ticLength) set the major tic lengthvoid
setMajorTicsVisible
(boolean state) set the the visibility of major ticsvoid
setMinorTicLabelsVisible
(boolean state) set the visibility of minor tic labelsvoid
setMinorTicLength
(int ticLength) set the minor tic lengthvoid
setMinorTicsVisible
(boolean state) set the the visibility of minor ticsvoid
protected int
translateFromAlignmentToAxisPosition
(int alignment) void
update
(Observable o, Object arg) void
zoomByFactor
(double factor) Defines a new zoom region by a given factorvoid
Zooms the axis to the bounds of the local rectangle.Methods inherited from class hec.gfx2d.G2dComponent
getAlignment, getG2dPanel, getMouseAdapter, getPreferredSize, paint, paintComponent, paintGfx, pointerOver, setG2dPanel, setMouseAdapter, setMouseAdapter, setPreferredSizeProvider
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface hec.gfx2d.G2dZoomComponent
getGraphics
-
Constructor Details
-
AxisTics
Default Constructor
-
-
Method Details
-
setAxis
-
getViewport
-
buildMenu
-
setLinear
public void setLinear() -
setLogarithmic
public void setLogarithmic() -
setLogarithmic
-
computeRatingFromOpositeAxis
Deprecated.See following method with correct spelling -
computeRatingFromOppositeAxis
public void computeRatingFromOppositeAxis()This method only works when in the RIGHT alignment position -
createPopupMenu
public void createPopupMenu()- Overrides:
createPopupMenu
in classG2dComponent
-
createEditMenu
-
setProperties
-
getProperties
-
update
-
getMinimumSize
- Overrides:
getMinimumSize
in classJComponent
-
getPreferredSizeLocal
- Overrides:
getPreferredSizeLocal
in classG2dComponent
-
paintGfx
Description copied from class:G2dComponent
Paints the contents of the panel.- Overrides:
paintGfx
in classG2dComponent
-
drawTicsRight
-
drawTicsLeft
-
drawTicsTop
-
drawTicsBottom
-
drawAxisLabelsBottom
protected void drawAxisLabelsBottom(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) -
drawAxisLabelsTop
protected void drawAxisLabelsTop(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) -
getAxis
Returns a reference to the axis that this object draws. -
setFontSizes
public void setFontSizes(int sz, int tiny, int min, int max) -
getFontSizes
public int[] getFontSizes()get the fonts sizes used by this label- Returns:
- [0] the normal font size
[1] the tiny font size
[2] the min font size
[3] the max font size
-
objectPopupMenu
- Overrides:
objectPopupMenu
in classG2dComponent
-
getToolTipText
Returns a tool tip text for the given mouse location. In this method we loop over the glyphs and see if they have any tool tips. The first one that has one is returned;- Overrides:
getToolTipText
in classG2dComponent
-
getCanSwapAxis
protected boolean getCanSwapAxis() -
getAxisSwapped
protected boolean getAxisSwapped() -
translateFromAlignmentToAxisPosition
protected int translateFromAlignmentToAxisPosition(int alignment) -
editProperties
public void editProperties()- Overrides:
editProperties
in classG2dComponent
-
editProperties
public void editProperties(int selectedTab) -
getPropertiesOKListener
public hec.gfx2d.AxisTics.PropertiesOKListener getPropertiesOKListener(ScalePropertiesPanel scalePanel, G2dAxisLabelPropertiesPanel labelPanel) -
zoomIn
Zooms the axis to the bounds of the local rectangle. The local rectangle is in the coorinate system of the AxisTics.- Specified by:
zoomIn
in interfaceG2dZoomComponent
- Parameters:
rc
- - the rectangle of the new zoom area in local coordinates
-
zoomByFactor
public void zoomByFactor(double factor) Description copied from interface:G2dZoomComponent
Defines a new zoom region by a given factor- Specified by:
zoomByFactor
in interfaceG2dZoomComponent
-
setMajorTicsVisible
public void setMajorTicsVisible(boolean state) set the the visibility of major tics -
setDrawMajorTicsOn
Deprecated.set the major tics to draw -
setDrawMajorTicsOff
Deprecated.set the major tics not to draw -
areMajorTicsVisible
public boolean areMajorTicsVisible()get whether the major tics are visible- Returns:
- whether the major tics are visible
-
areMajorTicsDrawn
Deprecated.get whether the major tics are drawn -
setMajorTicLabelsVisible
public void setMajorTicLabelsVisible(boolean state) set the visibility of major tic labels -
setDrawMajorTicLabelsOn
Deprecated.set the major tic labels to draw -
setDrawMajorTicLabelsOff
Deprecated.set the major tic labels not to draw -
areMajorTicLabelsVisible
public boolean areMajorTicLabelsVisible()get whether the major tic labels are visible- Returns:
- whether the major tic labels are visible
-
areMajorTicLabelsDrawn
Deprecated.get whether the major tic labels are drawn -
setMinorTicsVisible
public void setMinorTicsVisible(boolean state) set the the visibility of minor tics -
setDrawMinorTicsOn
Deprecated.set the minor tics to draw -
setDrawMinorTicsOff
Deprecated.set the minor tics not to draw -
areMinorTicsVisible
public boolean areMinorTicsVisible()get whether the minor tics are visible- Returns:
- whether the minor tics are visible
-
areMinorTicsDrawn
Deprecated.get whether the minor tics are drawn -
setMinorTicLabelsVisible
public void setMinorTicLabelsVisible(boolean state) set the visibility of minor tic labels -
setDrawMinorTicLabelsOn
Deprecated.set the minor tic labels to draw -
setDrawMinorTicLabelsOff
Deprecated.set the minor tic labels not to draw -
areMinorTicLabelsVisible
public boolean areMinorTicLabelsVisible()get whether the minor tic labels are visible- Returns:
- whether the minor tic labels are visible
-
areMinorTicLabelsDrawn
Deprecated.get whether the minor tic labels are drawn -
setMajorTicLength
public void setMajorTicLength(int ticLength) set the major tic length- Parameters:
ticLength
- the major tic length
-
getMajorTicLength
public int getMajorTicLength()get the major tic length- Returns:
- the major tic length
-
setMinorTicLength
public void setMinorTicLength(int ticLength) set the minor tic length- Parameters:
ticLength
- the minor tic length
-
getMinorTicLength
public int getMinorTicLength()get the minor tic length- Returns:
- the minor tic length
-
setAxisTicColor
set the tic color to the color represented by colorString- Parameters:
colorString
- the color to set the tics to
-
getAxisTicColor
get the Axis Tic Color- Returns:
- the Axis Tic color
-
getAxisTicColorString
get the Axis Tic Color as a String- Returns:
- the Axis Tic color string
-
getMaxBounds
-