Package pivot.util

Examples of pivot.util.CalendarDate


    public void setDate(CalendarDate calendarDate) {
        this.calendarDate = calendarDate;
    }

    public final void setDate(String calendarDate) {
        setDate(new CalendarDate(calendarDate));
    }
View Full Code Here


            numericSpinner.setSpinnerData(numericSpinnerData);
            numericSpinner.setSelectedIndex(0);
        }

        private void initializeDateSpinner(Spinner dateSpinner) {
            CalendarDate lowerBound = new CalendarDate(2008, 0, 0);
            CalendarDate upperBound = new CalendarDate(2019, 11, 30);
            CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound, upperBound);

            CalendarDate today = new CalendarDate();
            dateSpinner.setSpinnerData(spinnerData);
            dateSpinner.setSelectedItem(today);
        }
View Full Code Here

        numericSpinner.setSpinnerData(numericSpinnerData);
        numericSpinner.setSelectedIndex(0);
    }

    private void initializeDateSpinner(Spinner dateSpinner) {
        CalendarDate lowerBound = new CalendarDate(2008, 0, 0);
        CalendarDate upperBound = new CalendarDate(2019, 11, 30);
        CalendarDateSpinnerData spinnerData = new CalendarDateSpinnerData(lowerBound, upperBound);

        CalendarDate today = new CalendarDate();
        dateSpinner.setSpinnerData(spinnerData);
        dateSpinner.setSelectedItem(today);
    }
View Full Code Here

                    graphics.fillRect(0, 0, width, height);
                }
            }

            // Paint a border if this button represents today
            CalendarDate date = (CalendarDate)dateButton.getButtonData();
            if (date.equals(today)) {
                graphics.setColor(dividerColor);
                graphics.drawRect(0, 0, width - 1, height - 1);
            }

            // Paint the content
View Full Code Here

                dateButton.press();
            } else if (keyCode == Keyboard.KeyCode.UP
                || keyCode == Keyboard.KeyCode.DOWN
                || keyCode == Keyboard.KeyCode.LEFT
                || keyCode == Keyboard.KeyCode.RIGHT) {
                CalendarDate date = (CalendarDate)dateButton.getButtonData();

                int cellIndex = getCellIndex(date.getYear(), date.getMonth(), date.getDay());
                int rowIndex = cellIndex / 7;
                int columnIndex = cellIndex % 7;

                Component nextButton;
                switch (keyCode) {
View Full Code Here

    public class MonthSpinnerItemRenderer extends SpinnerItemRenderer {
        @Override
        public void render(Object item, Spinner spinner) {
            Calendar calendar = (Calendar)getComponent();

            CalendarDate date = new CalendarDate();
            date.set(date.getYear(), (Integer)item, 0);

            SimpleDateFormat monthFormat = new SimpleDateFormat("MMMM",
                calendar.getLocale());
            item = monthFormat.format(date.toCalendar().getTime());

            super.render(item, spinner);
        }
View Full Code Here

        }
    }

    private class DateButtonDataRenderer extends ButtonDataRenderer {
        public void render(Object data, Button button, boolean highlighted) {
            CalendarDate date = (CalendarDate)data;
            super.render(date.getDay() + 1, button, highlighted);

            if (button.isSelected()) {
                label.getStyles().put("color", button.getStyles().get("selectionColor"));
            }
        }
View Full Code Here

            public void selectionChanged(Group group, Button previousSelection) {
                Calendar calendar = (Calendar)getComponent();

                Button selection = group.getSelection();
                if (selection == null) {
                    CalendarDate selectedDate = calendar.getSelectedDate();

                    // If no date was selected, or the selection changed as a
                    // result of the user toggling the date button (as opposed
                    // to changing the month or year), clear the selection
                    if (selectedDate == null
                        || (selectedDate.getYear() == yearSpinner.getSelectedIndex()
                            && selectedDate.getMonth() == monthSpinner.getSelectedIndex())) {
                        calendar.setSelectedDate((CalendarDate)null);
                    }
                } else {
                    calendar.setSelectedDate((CalendarDate)selection.getButtonData());
                }
View Full Code Here

                } else {
                    day = k - firstIndex;
                    dateButton.setEnabled(true);
                }

                dateButton.setButtonData(new CalendarDate(year, month, day));
            }
        }

        today = new CalendarDate();
    }
View Full Code Here

    // Calendar button selection events
    public void selectedDateChanged(CalendarButton calendarButton,
        CalendarDate previousSelectedDate) {
        // Set the selected date as the button data
        CalendarDate date = calendarButton.getSelectedDate();
        calendarButton.setButtonData(date);

        calendar.setSelectedDate(date);
        calendar.setYear(date.getYear());
        calendar.setMonth(date.getMonth());
    }
View Full Code Here

TOP

Related Classes of pivot.util.CalendarDate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.