TOC

Overview

Audience

This document is intended to be used by application builders who would like to build Java applications which provide time increment/decrement functionality. The application developer is expected to be familiar with the Java language and the JavaBeans architecture. The developer should be familiar with building applications by linking beans in an application builder tool. Familiarity with the functionality of TimeSpinner would be advantageous, though not mandatory. No knowledge about the implementation of TimeSpinner required in order to use these beans.


previous How to Use This Guide

Guide Conventions

Typographical Conventions

Conventions Description Example
Text in italics figures, reference to chapters and other sections, task name etc. Figure 1, Overview, etc.
  • Round bullets
list of points
  • DigitalSpinner Bean
  • DateSpinner Bean
  • TimeSpinner Bean
Text in Courier font

names of classes,methods, events, part of code included in the document, etc.

ActionPerformed

Images

Image Used to
previous navigate to the previous sub-heading
previous navigate to the previous main heading
toc return to the Table of Contents
note represent a Note information

Guide Organization

Overview - introduces the user to the TimeSpinner bean. Provides information like intended audience, guide conventions, guide organization and copyrights

Bean at a Glance - gives a brief overview of the bean. It also provides information on the commonly used methods, events and properties.

Bean Description - explains the bean in detail. It provides information on dependencies, security, customization, etc.

Summaries - summarizes the properties, methods and events of the bean.

Reference to Properties - links to the respective properties.

Reference to Methods - links to the respective methods.

Reference to Events - links to the respective events.

Support Classes - provides information on the public classes.

See Also- links to related topics


previous Copyrights And Trademarks

Copyright © 1998 IBM Corp.

All rights reserved.

IBM and VisualAge are trademarks of International Business Machines in the United States and/or other countries.

* Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc, in the U.S. and other countries.


TOC

Bean at a Glance

Bean Overview

public class TimeSpinner extends Spinner
This bean is a component with two small direction buttons that lets the user modify the value in an input field or possibly enter a new legal value of time directly on the input field. By setting the value of a specified property, the user can separately increase/decrease the hour, minute and second values.  


previousCommonly used Methods, Events and Properties

Creation Methods

TimeSpinner()
TimeSpinner(int style)

Key Properties

currentValue

minValue

maxValue

hourStepValue

minuteStepValue

secondStepValue

elapsedMinutes

timeFormat

isSecondsDisplayEnabled

Commonly used Methods

getCurrent()
     Gets the current value of TimeSpinner.
setCurrent(Time cur_val)
     Sets the current value of TimeSpinner.


Key Events

Increment - The event is fired to all registered ActionListeners when the currrent value of TimeSpinner increases.
Decrement - The event is fired to all registered ActionListeners when the currrent value of TimeSpinner decreases.
 


up

Bean Description

Functional Overview

The TimeSpinner allows


previousDependencies

The TimeSpinner requires the services of


previousSecurity

Only Java security restrictions apply.


previousUser Interface

The bean has a user-friendly GUI. Refer to the section User Interface in the Spinner Overall bean documentation for detailed information.


previousIntrospection

public class TimeSpinnerBeanInfo


up

Summaries

Property Summary

<Name> [Constrained | Bound | Indexed ] <Datatype> <Description> <default value> <access type> 
hourStepValue Bound int the setp value of hour 1 Read / Write
minuteStepValue Bound int the setp value of minute 1 Read / Write
secondStepValue Bound int the setp value of second 1 Read / Write
minValue Bound Time minimum value of time 0:00:00 Read / Write
maxValue Bound Time maximum value of time 23:59:59 Read / Write
currentValue Bound Time current value of time 12:00:00 Read / Write
elapsedMinutes Bound int minutes between minimum and maximum value 1439 Read / Write
isSecondDisplayEnabled Bound boolean second displayed or not true Read / Write
timeFormat Bound int selection of 12/24 hour time formats 0 Read / Write


previousMethod Summary


previousEvent Summary

As Listener :


up

Reference to Properties

 

 


up

Reference to Methods

public void addActionListener(ActionListener l)

Adds the specified action listener to receive action events.

         Parameters:
                 l - the ActionListener to be added.
 

public Time getCurrent()

Gets the current time value.

         Returns:
                 the current time value.
 

public int getElapsedMinutes()

Gets the elapsed minutes between minimum and maximum value.

        Returns:
               the elapsed minutes between minimum and maximum value.
 

public int getHourCurrent()

Gets current hour value.

        Returns:
               the current hour value.
 

 public int getHourMin()
Gets maximum hour value.

       Returns:
              the hour maximum value.
 

public int getHourMax()

Gets maximum hour value.

       Returns:
              the hour maximum value.
 

public int getHourStep()

Gets the increment value of hour.

         Returns:
                 the increment value of hour.


public Time getMax()

Gets the maximum value.

         Returns:
                 the maximum value.
 

public Time getMin()

Gets the minimum value.

         Returns:
                 the minimum value.
 

public int getMinuteCurrent()

Gets the current minute value.

       Returns:
             the current minute value.
 

public int getMinuteMax()

Gets the maximum minute value.

       Returns:
            the minute maximum value.
 

public int getMinuteMin()

Gets maximum minute value.

       Returns:
            the minute maximum value.
 

public int getMinuteStep()

Gets the increment value of minute.

         Returns:
                 the increment valueof minute.
 

public int getSecondCurrent()

Gets current second value.

         Returns:
                the current second value.
 

public int getSecondMax()

Gets maximum second value.

        Returns:
               the second maximum value.
 

public int getSecondMin()

Gets minimum second value.

        Returns:
               the second minimum value.
 

public int getSecondStep()

Gets the increment value of second.

         Returns:
                 the increment value of second.
 

public int getTimeFormat()

Gets the time format.

         Returns:
                 the time format.
 

public boolean isSecondDisplayEnabled()

Returns 'true' if the time display option is selected.

        Returns:
                the time display option.
 

public void removeActionListener(ActionListener l)

Removes the specified action listener so it no longer receives action events.

         Parameters:
                 l - the ActionListener to be removed.
 

public void setCurrent(Time cur_val)

Sets the current time value.

         Parameters:
                 cur_val - the desired time value.
 

public void setElapsedMinutes(int val)

Sets the elapsed minutes between minimum and maximum value ( when the elapsed minutes changes, the maximum value is changed accordingly).

         Parameters:
                 val - the desired elapsed minutes between minimum and maximum value.
 

public void setHourCurrent(int cur_val)

Sets the current hour value.

         Parameters:
                cur_val - the desired hour value.
 

public void setHourMin(int min_val)

Sets the minimum hour value.

       Parameters:
              min_val - the desired minimum hour value.
 

public void setHourMax(int max_val)

Sets the maximum hour value.

       Parameters:
              max_val - the desired maximum hour value.
 

public void setHourStep(int step_val)

Sets the increment value of hour.

         Parameters:
                 step_val - the desired step value of hour.
 

public void setMax(Time max_val)

Sets the maximum value.

         Parameters:
                 max_val - the desired maximum value.
 

public void setMin(Time min_val)

Sets the minimum value.

         Parameters:
                 min_val - the desired minimum value.
 

public void setMinuteCurrent(int cur_val)

Sets the current minute value.

       Parameters:
             cur_val - the desired minute value.
 

public void setMinuteMax(int max_value)

Sets the maximum minute value.

       Parameters:
            max_val - the desired maximum minute value.
 

public void setMinuteMin(int min_val)

Sets the minimum minute value.

       Parameters:
           min_val - the desired minimum minute value.
 

public void setMinuteStep(int step_val)

Sets the increment value of minute.

        Parameters:
                step_val - the desired step value of minute.
 

public void setSecondCurrent(int cur_val)

Sets the current second value.

       Parameters:
            cur_val - the desired second value.
 

public void setSecondDisplayEnabled(boolean disp_flag)

Sets the time display option.

        Parameters:
                disp_flag - boolean indicator of the time display status.
 

public void setSecondMax(int max_val)

Sets the maximum second value.

         Parameters:
                max_val - the desired maximum second value.
 

public void setSecondMin(int min_val)

Sets the minimum second value.

        Parameters:
               min_val - the desired second minimum value.
 

public void setSecondStep(int step_val)

Sets the increment value of second.

        Parameters:
                step_val - the desired step value of second.
 

public void setTimeFormat(int format)

Sets the time format.

         Parameters:
                 format - the desired time format.

public TimeSpinner()

Constructor for TimeSpinner. Constructs a TimeSpinner with default settings. The GUI is constructed and initialized with pre-set values.
 

public TimeSpinner(int style)

Constructor for TimeSpinner. Constructs a TimeSpinner with specified time format.

 


up

Reference to Events

The TimeSpinner fires the following events:

  1.  increment/decrement event to

As Listener

    public class java.awt.event ActionEvent
    Specifies that the TimeSpinner current value increment/decrement

    public interface java.awt.event.ActionListener
    Event listener interface for ActionEvent. The methods contained in the interface are:


up

Support Classes

 
None.


up

See Also

Java Programming Language

Java Beans Specifications


This document is last updated in V1.0 on 04/02/1998