Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores
* CA 94065 USA or visit www.oracle.com if you need additional information or
* have any questions.
*/
package com.codename1.ui.spinner;
import com.codename1.ui.Component;
import com.codename1.ui.Display;
import com.codename1.ui.Graphics;
import com.codename1.ui.Image;
import com.codename1.ui.List;
import com.codename1.ui.TextArea;
import com.codename1.ui.TextField;
import com.codename1.ui.geom.Dimension;
import com.codename1.ui.list.DefaultListCellRenderer;
import com.codename1.ui.list.ListCellRenderer;
import com.codename1.ui.list.ListModel;
import com.codename1.ui.plaf.Style;
import com.codename1.ui.plaf.UIManager;
import java.util.Calendar;
import java.util.Date;
/**
* A spinner allows us to select a numeric, date or time value using the arrow keys
* in a similar way to a list or a combo box.
*
* @author Shai Almog
* @deprecated use Picker instead
*/
class Spinner extends List {
/**
* Value for create date renderer represnting Day-Month-4 Digit Year
*/
public static final int DATE_FORMAT_DD_MM_YYYY = 1;
/**
* Value for create date renderer represnting Month-Day-4 Digit Year
*/
public static final int DATE_FORMAT_MM_DD_YYYY = 2;
/**
* Value for create date renderer represnting Day-Month-2 Digit Year
*/
public static final int DATE_FORMAT_DD_MM_YY = 11;
/**
* Value for create date renderer represnting Month-Day-2 Digit Year
*/
public static final int DATE_FORMAT_MM_DD_YY = 12;
/**
* Value for create date renderer represnting Day Of Week, Month, Day
*/
public static final int DATE_FORMAT_DOW_MON_DD = 13;
/**
* Value for create date renderer represnting Day Of Week, Month, Day, Year
*/
public static final int DATE_FORMAT_DOW_MON_DD_YY = 14;
/**
* The image appearing on the side of the spinner widget to indicate its "spinnability"
*/
private static Image spinnerHandle;
private long lastKeyInteraction = -1;
private TextField quickType = new TextField();
private boolean monthFirst;
private int currentInputAlign = LEFT;
private static int inputSkipDelay = 2000;
private boolean ios7Mode;
/**
* Creates a new time spinner instance, time is an integer represented in seconds
* since mindnight
*
* @param min lowest value allowed in seconds since midnight
* @param max maximum value allowed in seconds since midnight
* @param currentValue the starting value in seconds since midnight
* @param step increments in the spinner (in seconds)
* @param twentyFourHours show the value as 24 hour values or AM/PM
* @param showSeconds show the value of the seconds as well or hide it
* @return new spinner instance
* @deprecated use TimeSpinner
*/
public static Spinner createTime(int min, int max, int currentValue, int step, boolean twentyFourHours, boolean showSeconds) {
Spinner s = new Spinner(new SpinnerNumberModel(min, max, currentValue, step),
DateTimeRenderer.createTimeRenderer(twentyFourHours, showSeconds));
return s;
}
/**
* Creates a new date spinner instance
*
* @param min lowest value allowed
* @param max maximum value allowed
* @param currentValue the starting value for the mode
* @param separatorChar character to separate the entries during rendering
* @param format formatting type for the field
* @return new spinner instance
* @deprecated use DateSpinner
*/
public static Spinner createDate(long min, long max, long currentValue, char separatorChar, int format) {
Spinner s = new Spinner(new SpinnerDateModel(min, max, currentValue), DateTimeRenderer.createDateRenderer(separatorChar, format));
s.monthFirst = format == DATE_FORMAT_MM_DD_YY || format == DATE_FORMAT_MM_DD_YYYY;
return s;
}
/**
* Creates a new numeric spinner instance
*
* @param min lowest value allowed
* @param max maximum value allowed
* @param currentValue the starting value for the mode
* @param step the value by which we increment the entries in the model
* @return new spinner instance
* @deprecated use NumericSpinner
*/
public static Spinner create(int min, int max, int currentValue, int step) {
Spinner s = new Spinner(new SpinnerNumberModel(min, max, currentValue, step, 0), new SpinnerRenderer