JComponentPack 1.5.0

com.zfqjava.swing
Class JRulerBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.zfqjava.swing.JRulerBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class JRulerBar
extends JComponent
implements Accessible, Scrollable

JRulerBar provides a component that is useful for displaying ruler.

See Also:
Serialized Form

Nested Class Summary
protected  class JRulerBar.AccessibleJRulerBar
          This class implements accessibility support for the JRulerBar class.
 
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 javax.swing.JComponent
accessibleContext, 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
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
JRulerBar()
           
JRulerBar(int orientation)
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener to the rulerBar.
protected  void fireStateChanged()
          Send a ChangeEvent, whose source is this RulerBar, to each listener.
 AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JRulerBar.
 ChangeListener[] getChangeListeners()
          Returns an array of all the ChangeListeners added to this JRulerBar with addChangeListener().
 int getMajorTickSpacing()
          Returns the major tick spacing.
 int getMinorTickSpacing()
          Returns the minor tick spacing.
 BoundedRangeModel getModel()
          Returns data model that handles the rulers three fundamental properties: minimum, maximum, value.
 int getOrientation()
          Returns the orientation.
 Dimension getPreferredScrollableViewportSize()
           
 Dimension getPreferredSize()
           
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
           
 int getTinyTickSpacing()
          Returns the tiny tick spacing.
 boolean isLabelPainted()
          Returns the major label painted.
 boolean isMajorTickPainted()
          Returns the major tick painted.
 boolean isMinorTickPainted()
          Returns the minor tick painted.
 boolean isTinyTickPainted()
          Returns the tiny tick painted.
protected  void paintComponent(Graphics g)
           
protected  String paramString()
          Returns a string representation of this JRulerBar.
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener from the rulerBar.
 void setLabelPainted(boolean labelPainted)
          Sets the major label painted.
 void setMajorTickPainted(boolean majorTickPainted)
          Sets the major tick painted.
 void setMajorTickSpacing(int majorTickSpacing)
          Sets the major tick spacing.
 void setMinorTickPainted(boolean minorTickPainted)
          Sets the minor tick painted.
 void setMinorTickSpacing(int minorTickSpacing)
          Sets the minor tick spacing.
 void setModel(BoundedRangeModel model)
          Sets the model that handles the rulers three fundamental properties: minimum, maximum, value.
 void setOrientation(int orientation)
          Sets the orientation.
 void setTinyTickPainted(boolean tinyTickPainted)
          Sets the tiny tick painted.
 void setTinyTickSpacing(int tinyTickSpacing)
          Sets the tiny tick spacing.
 
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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, updateUI
 
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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JRulerBar

public JRulerBar()

JRulerBar

public JRulerBar(int orientation)
Method Detail

getModel

public BoundedRangeModel getModel()
Returns data model that handles the rulers three fundamental properties: minimum, maximum, value.

See Also:
setModel(javax.swing.BoundedRangeModel)

setModel

public void setModel(BoundedRangeModel model)
Sets the model that handles the rulers three fundamental properties: minimum, maximum, value.

See Also:
getModel()

getOrientation

public int getOrientation()
Returns the orientation.
One of 2 legal values:

Returns:
the orientation
See Also:
setOrientation(int)

setOrientation

public void setOrientation(int orientation)
Sets the orientation.
One of 2 legal values:

Parameters:
orientation - the orientation
See Also:
getOrientation()

setMajorTickSpacing

public void setMajorTickSpacing(int majorTickSpacing)
Sets the major tick spacing.

Parameters:
majorTickSpacing - the spacing
See Also:
getMajorTickSpacing()

getMajorTickSpacing

public int getMajorTickSpacing()
Returns the major tick spacing.

Returns:
the spacing
See Also:
setMajorTickSpacing(int)

setMinorTickSpacing

public void setMinorTickSpacing(int minorTickSpacing)
Sets the minor tick spacing.

Parameters:
minorTickSpacing - the spacing
See Also:
getMinorTickSpacing()

getMinorTickSpacing

public int getMinorTickSpacing()
Returns the minor tick spacing.

Returns:
the spacing
See Also:
setMinorTickSpacing(int)

setTinyTickSpacing

public void setTinyTickSpacing(int tinyTickSpacing)
Sets the tiny tick spacing.

Parameters:
tinyTickSpacing - the spacing
See Also:
getTinyTickSpacing()

getTinyTickSpacing

public int getTinyTickSpacing()
Returns the tiny tick spacing.

Returns:
the spacing
See Also:
setTinyTickSpacing(int)

setMajorTickPainted

public void setMajorTickPainted(boolean majorTickPainted)
Sets the major tick painted.

Parameters:
majorTickPainted - the painted
See Also:
isMajorTickPainted()

isMajorTickPainted

public boolean isMajorTickPainted()
Returns the major tick painted.

Returns:
the painted
See Also:
setMajorTickPainted(boolean)

setMinorTickPainted

public void setMinorTickPainted(boolean minorTickPainted)
Sets the minor tick painted.

Parameters:
minorTickPainted - the painted
See Also:
isMinorTickPainted()

isMinorTickPainted

public boolean isMinorTickPainted()
Returns the minor tick painted.

Returns:
the painted
See Also:
setMinorTickPainted(boolean)

setTinyTickPainted

public void setTinyTickPainted(boolean tinyTickPainted)
Sets the tiny tick painted.

Parameters:
tinyTickPainted - the painted
See Also:
isTinyTickPainted()

isTinyTickPainted

public boolean isTinyTickPainted()
Returns the tiny tick painted.

Returns:
the painted
See Also:
setTinyTickPainted(boolean)

setLabelPainted

public void setLabelPainted(boolean labelPainted)
Sets the major label painted.

Parameters:
labelPainted - the painted
See Also:
isLabelPainted()

isLabelPainted

public boolean isLabelPainted()
Returns the major label painted.

Returns:
the painted
See Also:
setLabelPainted(boolean)

paintComponent

protected void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Specified by:
getScrollableUnitIncrement in interface Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Specified by:
getScrollableBlockIncrement in interface Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface Scrollable

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the rulerBar.

Parameters:
l - the ChangeListener to add
See Also:
fireStateChanged(), removeChangeListener(javax.swing.event.ChangeListener)

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the rulerBar.

Parameters:
l - the ChangeListener to remove
See Also:
fireStateChanged(), addChangeListener(javax.swing.event.ChangeListener)

getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added to this JRulerBar with addChangeListener().

Returns:
all of the ChangeListeners added or an empty array if no listeners have been added

fireStateChanged

protected void fireStateChanged()
Send a ChangeEvent, whose source is this RulerBar, to each listener. This method method is called each time a ChangeEvent is received from the model.

See Also:
addChangeListener(javax.swing.event.ChangeListener), EventListenerList

paramString

protected String paramString()
Returns a string representation of this JRulerBar. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class JComponent
Returns:
a string representation of this JRulerBar.

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JRulerBar. For JRulerBars, the AccessibleContext takes the form of an AccessibleJRulerBar. A new AccessibleJRulerBar instance is created if necessary.

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleJRulerBar that serves as the AccessibleContext of this JRulerBar

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.