Package pivot.util

Examples of pivot.util.CalendarDate


                    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);
                GraphicsUtilities.drawRect(graphics, 0, 0, width, height);
            }

            // 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();

                Calendar calendar = (Calendar)TerraCalendarSkin.this.getComponent();
                int cellIndex = getCellIndex(date.getYear(), date.getMonth(), date.getDay(),
                    calendar.getLocale());
                int rowIndex = cellIndex / 7;
                int columnIndex = cellIndex % 7;

                Component nextButton;
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();

        updateSelection(calendar.getSelectedDate());
    }
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.