/** * Returns the earliest selected date. * * * @return the first Date in the selection or null if empty. */ public Date getFirstSelectionDate() { return getSelectionModel().getFirstSelectionDate(); }
/** * Sets what the first day of the week is; e.g., * <code>Calendar.SUNDAY</code> in US, <code>Calendar.MONDAY</code> * in France. * * @param firstDayOfWeek The first day of the week. * @see java.util.Calendar */ public void setFirstDayOfWeek(int firstDayOfWeek) { getSelectionModel().setFirstDayOfWeek(firstDayOfWeek); }
/** * Set the selection mode for this JXMonthView. * @param selectionMode The selection mode to use for this {@code JXMonthView} */ public void setSelectionMode(final SelectionMode selectionMode) { getSelectionModel().setSelectionMode(selectionMode); }
/** * Clear any selection from the selection model */ public void clearSelection() { getSelectionModel().clearSelection(); }
/** * Get the current selection * * @return sorted set of selected dates */ public SortedSet<Date> getSelection() { return getSelectionModel().getSelection(); }
/** * Sets the selection interval to the selection model. * * @param startDate Start of date range to set the selection to * @param endDate End of date range to set the selection to */ public void setSelectionInterval(final Date startDate, final Date endDate) { getSelectionModel().setSelectionInterval(startDate, endDate); }
/** * Set the selection mode for this JXMonthView. * @param selectionMode The selection mode to use for this {@code JXMonthView} */ public void setSelectionMode(final SelectionMode selectionMode) { getSelectionModel().setSelectionMode(selectionMode); }
/** * Returns the earliest selected date. * * @return the first Date in the selection or null if empty. */ public Date getLastSelectionDate() { return getSelectionModel().getLastSelectionDate(); }
/** * Set the upper bound date that is allowed to be selected. <p> * * @param upperBound the upper bound, null means none. */ public void setUpperBound(Date upperBound) { getSelectionModel().setUpperBound(upperBound); }
/** * Get the current selection * * @return sorted set of selected dates */ public SortedSet<Date> getSelection() { return getSelectionModel().getSelection(); }
/** * Set the lower bound date that is allowed to be selected. <p> * * * @param lowerBound the lower bound, null means none. */ public void setLowerBound(Date lowerBound) { getSelectionModel().setLowerBound(lowerBound); }
/** * Return the lower bound date that is allowed to be selected for this * model. * * @return lower bound date or null if not set */ public Date getLowerBound() { return getSelectionModel().getLowerBound(); }
/** * Identifies whether or not the date passed is an unselectable date. * <p> * * @param date date which to test for unselectable status * @return true if the date is unselectable, false otherwise */ public boolean isUnselectableDate(Date date) { return getSelectionModel().isUnselectableDate(date); }
/** * Return true if the selection is empty, false otherwise * * @return true if the selection is empty, false otherwise */ public boolean isSelectionEmpty() { return getSelectionModel().isSelectionEmpty(); }
/** * Get the current selection * * @return sorted set of selected dates */ public SortedSet<Date> getSelection() { return getSelectionModel().getSelection(); }
/** * Set the selection mode for this JXMonthView. * @param selectionMode The selection mode to use for this {@code JXMonthView} */ public void setSelectionMode(final SelectionMode selectionMode) { getSelectionModel().setSelectionMode(selectionMode); }
/** * Return true if the selection is empty, false otherwise * * @return true if the selection is empty, false otherwise */ public boolean isSelectionEmpty() { return getSelectionModel().isSelectionEmpty(); }
/** * Return the lower bound date that is allowed to be selected for this * model. * * @return lower bound date or null if not set */ public Date getLowerBound() { return getSelectionModel().getLowerBound(); }
/** * Call back from listening to model firstDayOfWeek change. */ private void updateFirstDayOfWeek() { int oldFirstDayOfWeek = this.firstDayOfWeek; firstDayOfWeek = getSelectionModel().getFirstDayOfWeek(); cal.setFirstDayOfWeek(firstDayOfWeek); anchor.setFirstDayOfWeek(firstDayOfWeek); firePropertyChange("firstDayOfWeek", oldFirstDayOfWeek, firstDayOfWeek); }
protected void installListeners() { propertyChangeListener = createPropertyChangeListener(); mouseListener = createMouseListener(); mouseMotionListener = createMouseMotionListener(); monthView.addPropertyChangeListener(propertyChangeListener); monthView.addMouseListener(mouseListener); monthView.addMouseMotionListener(mouseMotionListener); monthView.getSelectionModel().addDateSelectionListener(getHandler()); }