public class IlvVerticalBoundedRangeModel extends IlvAbstractBoundedRangeModel implements IlvVerticalScrollable
IlvVerticalBoundedRangeModel
class implements a model
for bounded-range components, such as a JScrollBar
or a
JSlider
. It also implements the
IlvVerticalScrollable
interface.Constructor and Description |
---|
IlvVerticalBoundedRangeModel()
Creates a new
IlvVerticalBoundedRangeModel with the
following default values:
value = 0
extent = 0
maximum = 100
adjusting = false
|
Modifier and Type | Method and Description |
---|---|
void |
addVerticalScrollListener(VerticalScrollListener listener)
Adds the specified listener to receive vertical scroll events from
this model. scroll events.
|
protected void |
fireMaxVerticalPositionChanged()
Call this method to fire a
maxVerticalPositionChanged event
to all registered listeners . |
protected void |
fireVerticalExtentChanged()
Call this method to fire a
verticalExtentChanged event
to all registered listeners . |
protected void |
fireVerticalPositionChanged()
Call this method to fire a
verticalPositionChanged event
to all registered listeners . |
int |
getExtent()
Returns the model's current extent.
|
int |
getMaximum()
Returns the model's maximum.
|
int |
getMaxVerticalPosition()
Returns the model's maximum position.
|
int |
getMinimum()
Returns the model's minimum acceptable value.
|
int |
getValue()
Returns the model's current value.
|
boolean |
getValueIsAdjusting()
Returns
true if the current changes to the value
property are part of a series of changes. |
int |
getVerticalExtent()
Returns the extent of the model's vertical range.
|
int |
getVerticalPosition()
Returns the beginning of the model's vertical range.
|
void |
removeVerticalScrollListener(VerticalScrollListener listener)
Removes the specified listener so that it will no longer receive
vertical scroll events from this model.
|
void |
setExtent(int extent)
Sets the model's extent.
|
void |
setMaximum(int max)
Sets the model's maximum.
|
void |
setMaxVerticalPosition(int max)
Sets the model's maximum position.
|
void |
setMinimum(int min)
Sets the model's minimum.
|
void |
setRangeProperties(int value,
int extent,
int min,
int max,
boolean adjusting)
This method sets all the model data with a single method call.
|
void |
setValue(int value)
Sets the model's value.
|
void |
setValueIsAdjusting(boolean b)
This attribute indicates that any upcoming changes to the value of the
model should be considered a single event.
|
void |
setVerticalExtent(int extent)
Sets the extent of the model's vertical range.
|
void |
setVerticalPosition(int position)
Sets the beginning of the model's vertical range.
|
addChangeListener, fireStateChanged, removeChangeListener, toString
public IlvVerticalBoundedRangeModel()
IlvVerticalBoundedRangeModel
with the
following default values:
value
= 0extent
= 0maximum
= 100adjusting
= falsepublic int getMinimum()
IlvVerticalScrollable
always has a minimum value of 0.getMinimum
in interface BoundedRangeModel
setMinimum(int)
public void setMinimum(int min)
IlvVerticalScrollable
always has a minimum of 0, this method does nothing.setMinimum
in interface BoundedRangeModel
min
- The minimum.getMinimum()
public int getMaximum()
getMaximum
in interface BoundedRangeModel
getMaxVerticalPosition()
,
setMaximum(int)
,
setExtent(int)
public void setMaximum(int max)
value
and
extent
are trimmed to fit the new 0-max range.
If max < 0
an IllegalArgumentException
will be thrown.setMaximum
in interface BoundedRangeModel
max
- The maximum.setMaxVerticalPosition(int)
,
getMaximum()
public int getValue()
getValue
in interface BoundedRangeModel
getVerticalPosition()
,
setValue(int)
public void setValue(int value)
max value
and is trimmed if necessary.setValue
in interface BoundedRangeModel
value
- The value.setVerticalPosition(int)
,
getValue()
public int getExtent()
getExtent
in interface BoundedRangeModel
getVerticalExtent()
,
setExtent(int)
public void setExtent(int extent)
max value
and is trimmed if necessary.setExtent
in interface BoundedRangeModel
extent
- The extent.setVerticalExtent(int)
,
getExtent()
public boolean getValueIsAdjusting()
true
if the current changes to the value
property are part of a series of changes.getValueIsAdjusting
in interface BoundedRangeModel
valueIsAdjusting
property.setValueIsAdjusting(boolean)
public void setValueIsAdjusting(boolean b)
true
at the start of a series of changes to the
value, and will be set to false
when the value has
finished changing. Normally this allows a listener to only take action
when the final value change is committed, instead of having to do
updates for all intermediate values.
Sliders and scroll bars use this property when a drag is underway.
setValueIsAdjusting
in interface BoundedRangeModel
b
- true
if the upcoming changes to the value
property are part of a series.getValueIsAdjusting()
public void setRangeProperties(int value, int extent, int min, int max, boolean adjusting)
setRangeProperties
in interface BoundedRangeModel
value
- An int
giving the current value.extent
- An int
giving the amount by which the
value can "jump".min
- An int
giving the minimum value.max
- An int
giving the maximum value.adjusting
- A boolean, true
if a series of changes
are in progress.setValue(int)
,
setExtent(int)
,
setMinimum(int)
,
setMaximum(int)
,
setValueIsAdjusting(boolean)
public int getMaxVerticalPosition()
getMaxVerticalPosition
in interface IlvVerticalScrollable
getMaximum()
,
setMaxVerticalPosition(int)
public void setMaxVerticalPosition(int max)
position
and
extent
are trimmed to fit the new 0-max
range. A
maxVerticalPositionChanged event
is then fired to all
registered listeners
. If
max < 0
an IllegalArgumentException
will be thrown.setMaxVerticalPosition
in interface IlvVerticalScrollable
max
- The maximum position.setMaximum(int)
,
getMaxVerticalPosition()
public int getVerticalPosition()
getVerticalPosition
in interface IlvVerticalScrollable
getValue()
,
setVerticalPosition(int)
public void setVerticalPosition(int position)
max value
and
is trimmed if necessary. A
verticalPositionChanged event
is then fired to all
registered listeners
.setVerticalPosition
in interface IlvVerticalScrollable
position
- The new position.setValue(int)
,
getVerticalPosition()
public int getVerticalExtent()
getVerticalExtent
in interface IlvVerticalScrollable
getExtent()
,
setVerticalExtent(int)
public void setVerticalExtent(int extent)
max value
and is
trimmed if necessary. A
verticalExtentChanged event
is then fired to all
registered listeners
.setVerticalExtent
in interface IlvVerticalScrollable
extent
- The new extent.setExtent(int)
,
getVerticalExtent()
public void addVerticalScrollListener(VerticalScrollListener listener)
addVerticalScrollListener
in interface IlvVerticalScrollable
listener
- The listener that will be subscribed to subsequent
scroll events.removeVerticalScrollListener(ilog.views.gantt.event.VerticalScrollListener)
public void removeVerticalScrollListener(VerticalScrollListener listener)
removeVerticalScrollListener
in interface IlvVerticalScrollable
listener
- The listener that will be unsubscribed from receiving
vertical scroll events.addVerticalScrollListener(ilog.views.gantt.event.VerticalScrollListener)
protected void fireMaxVerticalPositionChanged()
maxVerticalPositionChanged event
to all registered listeners
.setMaxVerticalPosition(int)
protected void fireVerticalPositionChanged()
verticalPositionChanged event
to all registered listeners
.setVerticalPosition(int)
protected void fireVerticalExtentChanged()
verticalExtentChanged event
to all registered listeners
.setVerticalExtent(int)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.