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 interfaceInterface 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.EditPropertyListenerNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested 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, TOPFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.booleanget whether the major tic labels are visiblebooleanDeprecated.booleanget whether the major tics are visiblebooleanDeprecated.booleanget whether the minor tic labels are visiblebooleanDeprecated.booleanget whether the minor tics are visibleprotected voidvoidDeprecated.voidThis method only works when in the RIGHT alignment positionvoidprotected voiddrawAxisLabelsBottom(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) protected voiddrawAxisLabelsTop(Graphics g, FontMetrics metrics, int ioff, int space, Rectangle rc) protected voidprotected voidprotected voidprotected voidvoidvoideditProperties(int selectedTab) getAxis()Returns a reference to the axis that this object draws.protected booleanget the Axis Tic Colorget the Axis Tic Color as a Stringprotected booleanint[]get the fonts sizes used by this labelintget the major tic lengthprotected WorldRectintget the minor tic lengthhec.gfx2d.AxisTics.PropertiesOKListenergetPropertiesOKListener(ScalePropertiesPanel scalePanel, G2dAxisLabelPropertiesPanel labelPanel) Returns a tool tip text for the given mouse location.booleanobjectPopupMenu(LocalPt pt, int modifiers) voidPaints the contents of the panel.voidvoidsetAxisTicColor(String colorString) set the tic color to the color represented by colorStringvoidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidDeprecated.voidsetFontSizes(int sz, int tiny, int min, int max) voidvoidvoidsetLogarithmic(AxisTics.AxisSwapValidator validator) voidsetMajorTicLabelsVisible(boolean state) set the visibility of major tic labelsvoidsetMajorTicLength(int ticLength) set the major tic lengthvoidsetMajorTicsVisible(boolean state) set the the visibility of major ticsvoidsetMinorTicLabelsVisible(boolean state) set the visibility of minor tic labelsvoidsetMinorTicLength(int ticLength) set the minor tic lengthvoidsetMinorTicsVisible(boolean state) set the the visibility of minor ticsvoidprotected inttranslateFromAlignmentToAxisPosition(int alignment) voidupdate(Observable o, Object arg) voidzoomByFactor(double factor) Defines a new zoom region by a given factorvoidZooms 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, setPreferredSizeProviderMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
createPopupMenuin classG2dComponent
-
createEditMenu
-
setProperties
-
getProperties
-
update
-
getMinimumSize
- Overrides:
getMinimumSizein classJComponent
-
getPreferredSizeLocal
- Overrides:
getPreferredSizeLocalin classG2dComponent
-
paintGfx
Description copied from class:G2dComponentPaints the contents of the panel.- Overrides:
paintGfxin 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:
objectPopupMenuin 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:
getToolTipTextin classG2dComponent
-
getCanSwapAxis
protected boolean getCanSwapAxis() -
getAxisSwapped
protected boolean getAxisSwapped() -
translateFromAlignmentToAxisPosition
protected int translateFromAlignmentToAxisPosition(int alignment) -
editProperties
public void editProperties()- Overrides:
editPropertiesin 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:
zoomInin interfaceG2dZoomComponent- Parameters:
rc- - the rectangle of the new zoom area in local coordinates
-
zoomByFactor
public void zoomByFactor(double factor) Description copied from interface:G2dZoomComponentDefines a new zoom region by a given factor- Specified by:
zoomByFactorin 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
-