Java Doc for DefaultBoundedRangeModel.java in  » 6.0-JDK-Core » swing » javax » swing » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.DefaultBoundedRangeModel

DefaultBoundedRangeModel
public class DefaultBoundedRangeModel implements BoundedRangeModel,Serializable(Code)
A generic implementation of BoundedRangeModel.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .
version:
   1.54 05/05/07
author:
   David Kloba
author:
   Hans Muller
See Also:   BoundedRangeModel



Field Summary
protected transient  ChangeEventchangeEvent
     Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property.
protected  EventListenerListlistenerList
     The listeners waiting for model changes.

Constructor Summary
public  DefaultBoundedRangeModel()
     Initializes all of the properties with default values.
public  DefaultBoundedRangeModel(int value, int extent, int min, int max)
     Initializes value, extent, minimum and maximum.

Method Summary
public  voidaddChangeListener(ChangeListener l)
     Adds a ChangeListener.
protected  voidfireStateChanged()
     Runs each ChangeListener's stateChanged method.
public  ChangeListener[]getChangeListeners()
     Returns an array of all the change listeners registered on this DefaultBoundedRangeModel.
public  intgetExtent()
     Returns the model's extent.
public  T[]getListeners(Class<T> listenerType)
     Returns an array of all the objects currently registered as FooListeners upon this model.
public  intgetMaximum()
     Returns the model's maximum.
public  intgetMinimum()
     Returns the model's minimum.
public  intgetValue()
     Returns the model's current value.
public  booleangetValueIsAdjusting()
     Returns true if the value is in the process of changing as a result of actions being taken by the user.
public  voidremoveChangeListener(ChangeListener l)
     Removes a ChangeListener.
public  voidsetExtent(int n)
    
public  voidsetMaximum(int n)
    
public  voidsetMinimum(int n)
    
public  voidsetRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting)
     Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
 minimum <= value <= value+extent <= maximum
 

At most, one ChangeEvent is generated.

public  voidsetValue(int n)
     Sets the current value of the model.
public  voidsetValueIsAdjusting(boolean b)
     Sets the valueIsAdjusting property.
public  StringtoString()
     Returns a string that displays all of the BoundedRangeModel properties.

Field Detail
changeEvent
protected transient ChangeEvent changeEvent(Code)
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".



listenerList
protected EventListenerList listenerList(Code)
The listeners waiting for model changes.




Constructor Detail
DefaultBoundedRangeModel
public DefaultBoundedRangeModel()(Code)
Initializes all of the properties with default values. Those values are:
  • value = 0
  • extent = 0
  • minimum = 0
  • maximum = 100
  • adjusting = false



DefaultBoundedRangeModel
public DefaultBoundedRangeModel(int value, int extent, int min, int max)(Code)
Initializes value, extent, minimum and maximum. Adjusting is false. Throws an IllegalArgumentException if the following constraints aren't satisfied:
 min <= value <= value+extent <= max
 




Method Detail
addChangeListener
public void addChangeListener(ChangeListener l)(Code)
Adds a ChangeListener. The change listeners are run each time any one of the Bounded Range model properties changes.
Parameters:
  l - the ChangeListener to add
See Also:   DefaultBoundedRangeModel.removeChangeListener
See Also:   BoundedRangeModel.addChangeListener



fireStateChanged
protected void fireStateChanged()(Code)
Runs each ChangeListener's stateChanged method.
See Also:   DefaultBoundedRangeModel.setRangeProperties
See Also:   EventListenerList



getChangeListeners
public ChangeListener[] getChangeListeners()(Code)
Returns an array of all the change listeners registered on this DefaultBoundedRangeModel. all of this model's ChangeListeners or an emptyarray if no change listeners are currently registered
See Also:   DefaultBoundedRangeModel.addChangeListener
See Also:   DefaultBoundedRangeModel.removeChangeListener
since:
   1.4



getExtent
public int getExtent()(Code)
Returns the model's extent. the model's extent
See Also:   DefaultBoundedRangeModel.setExtent
See Also:   BoundedRangeModel.getExtent



getListeners
public T[] getListeners(Class<T> listenerType)(Code)
Returns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a DefaultBoundedRangeModel instance m for its change listeners with the following code:

ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));
If no such listeners exist, this method returns an empty array.
Parameters:
  listenerType - the type of listeners requested;this parameter should specify an interfacethat descends from java.util.EventListener an array of all objects registered asFooListenerson this model,or an empty array if no suchlisteners have been added
exception:
  ClassCastException - if listenerType doesn'tspecify a class or interface that implementsjava.util.EventListener
See Also:   DefaultBoundedRangeModel.getChangeListeners
since:
   1.3



getMaximum
public int getMaximum()(Code)
Returns the model's maximum. the model's maximum
See Also:   DefaultBoundedRangeModel.setMaximum
See Also:   BoundedRangeModel.getMaximum



getMinimum
public int getMinimum()(Code)
Returns the model's minimum. the model's minimum
See Also:   DefaultBoundedRangeModel.setMinimum
See Also:   BoundedRangeModel.getMinimum



getValue
public int getValue()(Code)
Returns the model's current value. the model's current value
See Also:   DefaultBoundedRangeModel.setValue
See Also:   BoundedRangeModel.getValue



getValueIsAdjusting
public boolean getValueIsAdjusting()(Code)
Returns true if the value is in the process of changing as a result of actions being taken by the user. the value of the valueIsAdjusting property
See Also:   DefaultBoundedRangeModel.setValue
See Also:   BoundedRangeModel.getValueIsAdjusting



removeChangeListener
public void removeChangeListener(ChangeListener l)(Code)
Removes a ChangeListener.
Parameters:
  l - the ChangeListener to remove
See Also:   DefaultBoundedRangeModel.addChangeListener
See Also:   BoundedRangeModel.removeChangeListener



setExtent
public void setExtent(int n)(Code)
Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:   BoundedRangeModel.setExtent



setMaximum
public void setMaximum(int n)(Code)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:   BoundedRangeModel.setMaximum



setMinimum
public void setMinimum(int n)(Code)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:   DefaultBoundedRangeModel.getMinimum
See Also:   BoundedRangeModel.setMinimum



setRangeProperties
public void setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting)(Code)
Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
 minimum <= value <= value+extent <= maximum
 

At most, one ChangeEvent is generated.
See Also:   BoundedRangeModel.setRangeProperties
See Also:   DefaultBoundedRangeModel.setValue
See Also:   DefaultBoundedRangeModel.setExtent
See Also:   DefaultBoundedRangeModel.setMinimum
See Also:   DefaultBoundedRangeModel.setMaximum
See Also:   DefaultBoundedRangeModel.setValueIsAdjusting




setValue
public void setValue(int n)(Code)
Sets the current value of the model. For a slider, that determines where the knob appears. Ensures that the new value, n falls within the model's constraints:
 minimum <= value <= value+extent <= maximum
 

See Also:   BoundedRangeModel.setValue



setValueIsAdjusting
public void setValueIsAdjusting(boolean b)(Code)
Sets the valueIsAdjusting property.
See Also:   DefaultBoundedRangeModel.getValueIsAdjusting
See Also:   DefaultBoundedRangeModel.setValue
See Also:   BoundedRangeModel.setValueIsAdjusting



toString
public String toString()(Code)
Returns a string that displays all of the BoundedRangeModel properties.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.