APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot.ui

public Class HighPrecisionJScrollBar

extends JScrollBar
Class Inheritance
Imports
java.awt.event.*, javax.swing.*, javax.swing.event.*, java.math.*, java.util.*

A JScrollBar which uses BigIntegers as the representation for the minimum, maximum, unit increment, etc. Interaction with the buttons and track is accurate to unit and block increments; however, if the scale of the scrollbar (defined by getMaximumHP().subtract(getMinimumHP())) is very large, each interaction with the thumb will necessarily cause extremely large motion of the value.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private BigInteger
private List<ChangeListener>
private boolean
private int
private static final int
private BigInteger
private static final int
private BigInteger
private BigInteger
private static final int
private BigDecimal
private static final int
private BigInteger
private boolean
private BigInteger
private BigInteger
Inherited from javax.swing.JScrollBar:
blockIncrementmodelorientationunitIncrement

Constructor Summary

AccessConstructor and Description
public
public
HighPrecisionJScrollBar(int orientation)

public
HighPrecisionJScrollBar(int orientation, BigInteger value, BigInteger minimum, BigInteger maximum)

value, minimum and maximum should be positive

Method Summary

Modifier and TypeMethod and Description
public void
private void
private void
private void
public BigInteger
public BigInteger
public BigInteger
private BigDecimal
public BigInteger
public BigInteger
public BigInteger
private void
initialize(BigInteger value, BigInteger minimum, BigInteger maximum)

private void
private void
public static void
main(String[] args)

public void
public void
public void
private BigInteger
scaleToHP(int i)

private int
public void
public void
public void
public void
public void
private void
setRange(BigInteger minimum, BigInteger maximum)

public void
public void
setValueHP(BigInteger value)

Note

the real value will always be set to be (value mod unitIncrement) == 0, subtracting off the mod of the passed value if necessary.

public void
private BigInteger
toHPRange(int i)

private int
private void
Inherited from javax.swing.JScrollBar:
addAdjustmentListenerfireAdjustmentValueChangedgetAccessibleContextgetAdjustmentListenersgetBlockIncrementgetBlockIncrementgetMaximumgetMaximumSizegetMinimumgetMinimumSizegetModelgetOrientationgetUIgetUIClassIDgetUnitIncrementgetUnitIncrementgetValuegetValueIsAdjustinggetVisibleAmountparamStringremoveAdjustmentListenersetBlockIncrementsetEnabledsetMaximumsetMaximumSizesetMinimumsetMinimumSizesetModelsetOrientationsetUIsetUnitIncrementsetValuesetValueIsAdjustingsetValuessetVisibleAmountupdateUI

Field Detail

BIG_RANGEback to summary
private static final int BIG_RANGE
BLOCK_INCREMENTback to summary
private static final int BLOCK_INCREMENT
blockIncrementHPback to summary
private BigInteger blockIncrementHP
changeListenersback to summary
private List<ChangeListener> changeListeners
downback to summary
private boolean down
lastValueSeenback to summary
private int lastValueSeen
MAXIMUMback to summary
private static final int MAXIMUM
maximumHPback to summary
private BigInteger maximumHP
MINIMUMback to summary
private static final int MINIMUM
minimumHPback to summary
private BigInteger minimumHP
rangeHPback to summary
private BigInteger rangeHP
SCALEback to summary
private static final int SCALE
scaleFactorback to summary
private BigDecimal scaleFactor
UNIT_INCREMENTback to summary
private static final int UNIT_INCREMENT
unitIncrementHPback to summary
private BigInteger unitIncrementHP
updatingback to summary
private boolean updating
valueHPback to summary
private BigInteger valueHP
visibleHPback to summary
private BigInteger visibleHP

Constructor Detail

HighPrecisionJScrollBarback to summary
public HighPrecisionJScrollBar()
HighPrecisionJScrollBarback to summary
public HighPrecisionJScrollBar(int orientation)
HighPrecisionJScrollBarback to summary
public HighPrecisionJScrollBar(int orientation, BigInteger value, BigInteger minimum, BigInteger maximum)

value, minimum and maximum should be positive

Method Detail

addChangeListenerback to summary
public void addChangeListener(ChangeListener l)
beginUpdateback to summary
private void beginUpdate()
endUpdateback to summary
private void endUpdate()
fireStateChangedback to summary
private void fireStateChanged()
getBlockIncrementHPback to summary
public BigInteger getBlockIncrementHP()
getMaximumHPback to summary
public BigInteger getMaximumHP()
getMinimumHPback to summary
public BigInteger getMinimumHP()
getScaleFactorback to summary
private BigDecimal getScaleFactor()
getUnitIncrementHPback to summary
public BigInteger getUnitIncrementHP()
getValueHPback to summary
public BigInteger getValueHP()
getVisibleAmountHPback to summary
public BigInteger getVisibleAmountHP()
initializeback to summary
private void initialize(BigInteger value, BigInteger minimum, BigInteger maximum)
initializeback to summary
private void initialize()
installListenerback to summary
private void installListener()
mainback to summary
public static void main(String[] args)
pageDownOrRightback to summary
public void pageDownOrRight()
pageUpOrLeftback to summary
public void pageUpOrLeft()
removeChangeListenerback to summary
public void removeChangeListener(ChangeListener l)
scaleToHPback to summary
private BigInteger scaleToHP(int i)
scaleToUnderlyingback to summary
private int scaleToUnderlying(BigInteger i)
scrollDownOrRightback to summary
public void scrollDownOrRight()
scrollUpOrLeftback to summary
public void scrollUpOrLeft()
setBlockIncrementHPback to summary
public void setBlockIncrementHP(BigInteger blockIncrement)
setMaximumHPback to summary
public void setMaximumHP(BigInteger maximum)
setMinimumHPback to summary
public void setMinimumHP(BigInteger minimum)
setRangeback to summary
private void setRange(BigInteger minimum, BigInteger maximum)
setUnitIncrementHPback to summary
public void setUnitIncrementHP(BigInteger unitIncrement)
setValueHPback to summary
public void setValueHP(BigInteger value)

Note

the real value will always be set to be (value mod unitIncrement) == 0, subtracting off the mod of the passed value if necessary.

setVisibleAmountHPback to summary
public void setVisibleAmountHP(BigInteger visibleAmount)
toHPRangeback to summary
private BigInteger toHPRange(int i)
toUnderlyingRangeback to summary
private int toUnderlyingRange(BigInteger i)
updateScrollBarValuesback to summary
private void updateScrollBarValues()