idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
26,300 | public static RecurrenceIterator join ( RecurrenceIterator a , RecurrenceIterator ... b ) { List < RecurrenceIterator > incl = new ArrayList < RecurrenceIterator > ( ) ; incl . add ( a ) ; incl . addAll ( Arrays . asList ( b ) ) ; return new CompoundIteratorImpl ( incl , Collections . < RecurrenceIterator > emptyList ( ) ) ; } | a recurrence iterator that returns the union of the given recurrence iterators . |
26,301 | private static int [ ] filterBySetPos ( int [ ] members , int [ ] bySetPos ) { members = Util . uniquify ( members ) ; IntSet iset = new IntSet ( ) ; for ( int pos : bySetPos ) { if ( pos == 0 ) { continue ; } if ( pos < 0 ) { pos += members . length ; } else { -- pos ; } if ( pos >= 0 && pos < members . length ) { iset . add ( members [ pos ] ) ; } } return iset . toIntArray ( ) ; } | Given an array like BYMONTH = 2 3 4 5 and a set pos like BYSETPOS = 1 - 1 reduce both clauses to a single one BYMONTH = 2 5 in the preceding . |
26,302 | public static DateIterator createDateIterator ( String rdata , Date start , TimeZone tzid , boolean strict ) throws ParseException { return new RecurrenceIteratorWrapper ( RecurrenceIteratorFactory . createRecurrenceIterator ( rdata , dateToDateValue ( start , true ) , tzid , strict ) ) ; } | given a block of RRULE EXRULE RDATE and EXDATE content lines parse them into a single date iterator . |
26,303 | public static DateIterable createDateIterable ( String rdata , Date start , TimeZone tzid , boolean strict ) throws ParseException { return new RecurrenceIterableWrapper ( RecurrenceIteratorFactory . createRecurrenceIterable ( rdata , dateToDateValue ( start , true ) , tzid , strict ) ) ; } | given a block of RRULE EXRULE RDATE and EXDATE content lines parse them into a single date iterable . |
26,304 | public final GoogleEntry createEntry ( ZonedDateTime start , boolean fullDay ) { GoogleEntry entry = new GoogleEntry ( ) ; entry . setTitle ( "New Entry " + generateEntryConsecutive ( ) ) ; entry . setInterval ( new Interval ( start . toLocalDate ( ) , start . toLocalTime ( ) , start . toLocalDate ( ) , start . toLocalTime ( ) . plusHours ( 1 ) ) ) ; entry . setFullDay ( fullDay ) ; entry . setAttendeesCanInviteOthers ( true ) ; entry . setAttendeesCanSeeOthers ( true ) ; return entry ; } | Creates a new google entry by using the given parameters this assigns a default name by using a consecutive number . The entry is of course associated to this calendar but it is not sent to google for storing . |
26,305 | static Predicate < DateValue > countCondition ( final int count ) { return new Predicate < DateValue > ( ) { int count_ = count ; public boolean apply ( DateValue value ) { return -- count_ >= 0 ; } public String toString ( ) { return "CountCondition:" + count_ ; } } ; } | constructs a condition that fails after passing count dates . |
26,306 | static Predicate < DateValue > untilCondition ( final DateValue until ) { return new Predicate < DateValue > ( ) { public boolean apply ( DateValue date ) { return date . compareTo ( until ) <= 0 ; } public String toString ( ) { return "UntilCondition:" + until ; } } ; } | constructs a condition that passes for every date on or before until . |
26,307 | public static PeriodValue createFromDuration ( DateValue start , DateValue dur ) { DateValue end = TimeUtils . add ( start , dur ) ; if ( end instanceof TimeValue && ! ( start instanceof TimeValue ) ) { start = TimeUtils . dayStart ( start ) ; } return new PeriodValueImpl ( start , end ) ; } | returns a period with the given start date and duration . |
26,308 | public boolean intersects ( PeriodValue pv ) { DateValue sa = this . start , ea = this . end , sb = pv . start ( ) , eb = pv . end ( ) ; return sa . compareTo ( eb ) < 0 && sb . compareTo ( ea ) < 0 ; } | true iff this period overlaps the given period . |
26,309 | public static LocalDate adjustToFirstDayOfWeek ( LocalDate date , DayOfWeek firstDayOfWeek ) { LocalDate newDate = date . with ( DAY_OF_WEEK , firstDayOfWeek . getValue ( ) ) ; if ( newDate . isAfter ( date ) ) { newDate = newDate . minusWeeks ( 1 ) ; } return newDate ; } | Adjusts the given date to a new date that marks the beginning of the week where the given date is located . If Monday is the first day of the week and the given date is a Wednesday then this method will return a date that is two days earlier than the given date . |
26,310 | public static LocalDate adjustToLastDayOfWeek ( LocalDate date , DayOfWeek firstDayOfWeek ) { LocalDate startOfWeek = adjustToFirstDayOfWeek ( date , firstDayOfWeek ) ; return startOfWeek . plusDays ( 6 ) ; } | Adjusts the given date to a new date that marks the end of the week where the given date is located . If Monday is the first day of the week and the given date is a Wednesday then this method will return a date that is four days later than the given date . This method calculates the first day of the week and then adds six days to it . |
26,311 | public Instant adjustTime ( Instant instant , ZoneId zoneId , boolean roundUp , DayOfWeek firstDayOfWeek ) { requireNonNull ( instant ) ; requireNonNull ( zoneId ) ; requireNonNull ( firstDayOfWeek ) ; ZonedDateTime zonedDateTime = ZonedDateTime . ofInstant ( instant , zoneId ) ; if ( roundUp ) { zonedDateTime = zonedDateTime . plus ( getAmount ( ) , getUnit ( ) ) ; } zonedDateTime = Util . truncate ( zonedDateTime , getUnit ( ) , getAmount ( ) , firstDayOfWeek ) ; return Instant . from ( zonedDateTime ) ; } | Adjusts the given instant either rounding it up or down . |
26,312 | public final ReadOnlyObjectProperty < T > dateControlProperty ( ) { if ( dateControl == null ) { dateControl = new ReadOnlyObjectWrapper < > ( this , "dateControl" , _dateControl ) ; } return dateControl . getReadOnlyProperty ( ) ; } | The date control where the entry view is shown . |
26,313 | public final boolean isReadOnly ( ) { Entry < ? > entry = getEntry ( ) ; Calendar calendar = entry . getCalendar ( ) ; if ( calendar != null ) { return calendar . isReadOnly ( ) ; } return false ; } | Convenience method to determine whether the entry belongs to a calendar that is read - only . |
26,314 | public static DateValue parseDateValue ( String s , TimeZone tzid ) throws ParseException { Matcher m = DATE_VALUE . matcher ( s ) ; if ( ! m . matches ( ) ) { throw new ParseException ( s , 0 ) ; } int year = Integer . parseInt ( m . group ( 1 ) ) , month = Integer . parseInt ( m . group ( 2 ) ) , day = Integer . parseInt ( m . group ( 3 ) ) ; if ( null != m . group ( 4 ) ) { int hour = Integer . parseInt ( m . group ( 4 ) ) , minute = Integer . parseInt ( m . group ( 5 ) ) , second = Integer . parseInt ( m . group ( 6 ) ) ; boolean utc = null != m . group ( 7 ) ; DateValue dv = new DTBuilder ( year , month , day , hour , minute , second ) . toDateTime ( ) ; if ( ! utc && null != tzid ) { dv = TimeUtils . toUtc ( dv , tzid ) ; } return dv ; } else { return new DTBuilder ( year , month , day ) . toDate ( ) ; } } | parses a date of the form yyyymmdd or yyyymmdd T hhMMss converting from the given timezone to UTC . |
26,315 | public void insertCalendar ( GoogleCalendar calendar ) throws IOException { com . google . api . services . calendar . model . Calendar cal ; cal = converter . convert ( calendar , com . google . api . services . calendar . model . Calendar . class ) ; cal = dao . calendars ( ) . insert ( cal ) . execute ( ) ; calendar . setId ( cal . getId ( ) ) ; } | Inserts a calendar into the google calendar . |
26,316 | public void updateCalendar ( GoogleCalendar calendar ) throws IOException { CalendarListEntry calendarListEntry = converter . convert ( calendar , CalendarListEntry . class ) ; dao . calendarList ( ) . update ( calendarListEntry . getId ( ) , calendarListEntry ) . execute ( ) ; } | Saves the updates done on the calendar into google calendar api . |
26,317 | public void deleteCalendar ( GoogleCalendar calendar ) throws IOException { dao . calendars ( ) . delete ( calendar . getId ( ) ) . execute ( ) ; } | Performs an immediate delete request on the google calendar api . |
26,318 | public GoogleEntry insertEntry ( GoogleEntry entry , GoogleCalendar calendar ) throws IOException { Event event = converter . convert ( entry , Event . class ) ; event = dao . events ( ) . insert ( calendar . getId ( ) , event ) . execute ( ) ; entry . setId ( event . getId ( ) ) ; entry . setUserObject ( event ) ; return entry ; } | Performs an immediate insert operation on google server by sending the information provided by the given google entry . The entry is associated to this calendar . |
26,319 | public GoogleEntry updateEntry ( GoogleEntry entry ) throws IOException { GoogleCalendar calendar = ( GoogleCalendar ) entry . getCalendar ( ) ; Event event = converter . convert ( entry , Event . class ) ; dao . events ( ) . update ( calendar . getId ( ) , event . getId ( ) , event ) . execute ( ) ; return entry ; } | Performs an immediate update operation on google server by sending the information stored by the given google entry . |
26,320 | public void deleteEntry ( GoogleEntry entry , GoogleCalendar calendar ) throws IOException { dao . events ( ) . delete ( calendar . getId ( ) , entry . getId ( ) ) . execute ( ) ; } | Sends a delete request to the google server for the given entry . |
26,321 | public GoogleEntry moveEntry ( GoogleEntry entry , GoogleCalendar from , GoogleCalendar to ) throws IOException { dao . events ( ) . move ( from . getId ( ) , entry . getId ( ) , to . getId ( ) ) . execute ( ) ; return entry ; } | Moves an entry from one calendar to another . |
26,322 | public List < GoogleCalendar > getCalendars ( ) throws IOException { List < CalendarListEntry > calendarListEntries = dao . calendarList ( ) . list ( ) . execute ( ) . getItems ( ) ; List < GoogleCalendar > calendars = new ArrayList < > ( ) ; if ( calendarListEntries != null && ! calendarListEntries . isEmpty ( ) ) { for ( int i = 0 ; i < calendarListEntries . size ( ) ; i ++ ) { CalendarListEntry calendarListEntry = calendarListEntries . get ( i ) ; GoogleCalendar calendar = converter . convert ( calendarListEntry , GoogleCalendar . class ) ; calendar . setStyle ( com . calendarfx . model . Calendar . Style . getStyle ( i ) ) ; calendars . add ( calendar ) ; } } return calendars ; } | Gets the list of all calendars available in the account . |
26,323 | public List < GoogleEntry > getEntries ( GoogleCalendar calendar , LocalDate startDate , LocalDate endDate , ZoneId zoneId ) throws IOException { if ( ! calendar . existsInGoogle ( ) ) { return new ArrayList < > ( 0 ) ; } ZonedDateTime st = ZonedDateTime . of ( startDate , LocalTime . MIN , zoneId ) ; ZonedDateTime et = ZonedDateTime . of ( endDate , LocalTime . MAX , zoneId ) ; String calendarId = URLDecoder . decode ( calendar . getId ( ) , "UTF-8" ) ; List < Event > events = dao . events ( ) . list ( calendarId ) . setTimeMin ( new DateTime ( Date . from ( st . toInstant ( ) ) ) ) . setTimeMax ( new DateTime ( Date . from ( et . toInstant ( ) ) ) ) . setSingleEvents ( false ) . setShowDeleted ( false ) . execute ( ) . getItems ( ) ; return toGoogleEntries ( events ) ; } | Gets a list of entries belonging to the given calendar defined between the given range of time . Recurring events are not expanded always recurrence is handled manually within the framework . |
26,324 | public List < GoogleEntry > getEntries ( GoogleCalendar calendar , String searchText ) throws IOException { if ( ! calendar . existsInGoogle ( ) ) { return new ArrayList < > ( 0 ) ; } String calendarId = URLDecoder . decode ( calendar . getId ( ) , "UTF-8" ) ; List < Event > events = dao . events ( ) . list ( calendarId ) . setQ ( searchText ) . setSingleEvents ( false ) . setShowDeleted ( false ) . execute ( ) . getItems ( ) ; return toGoogleEntries ( events ) ; } | Gets a list of entries that matches the given text . Recurring events are not expanded always recurrence is handled manually within the framework . |
26,325 | public final GoogleCalendar createCalendar ( String name , Calendar . Style style ) { GoogleCalendar calendar = new GoogleCalendar ( ) ; calendar . setName ( name ) ; calendar . setStyle ( style ) ; return calendar ; } | Creates one single calendar with the given name and style . |
26,326 | public GoogleCalendar getPrimaryCalendar ( ) { return ( GoogleCalendar ) getCalendars ( ) . stream ( ) . filter ( calendar -> ( ( GoogleCalendar ) calendar ) . isPrimary ( ) ) . findFirst ( ) . orElse ( null ) ; } | Gets the calendar marked as primary calendar for the google account . |
26,327 | public List < GoogleCalendar > getGoogleCalendars ( ) { List < GoogleCalendar > googleCalendars = new ArrayList < > ( ) ; for ( Calendar calendar : getCalendars ( ) ) { if ( ! ( calendar instanceof GoogleCalendar ) ) { continue ; } googleCalendars . add ( ( GoogleCalendar ) calendar ) ; } return googleCalendars ; } | Gets all the google calendars hold by this source . |
26,328 | public final void removeCalendarListeners ( ListChangeListener < Calendar > ... listeners ) { if ( listeners != null ) { for ( ListChangeListener < Calendar > listener : listeners ) { getCalendars ( ) . removeListener ( listener ) ; } } } | Removes the listener from the ones being notified . |
26,329 | public final Map < LocalDate , List < Entry < ? > > > findEntries ( LocalDate startDate , LocalDate endDate , ZoneId zoneId ) { fireEvents = false ; Map < LocalDate , List < Entry < ? > > > result ; try { result = doGetEntries ( startDate , endDate , zoneId ) ; } finally { fireEvents = true ; } return result ; } | Queries the calendar for all entries within the time interval defined by the start date and end date . |
26,330 | public final void addEventHandler ( EventHandler < CalendarEvent > l ) { if ( l != null ) { if ( MODEL . isLoggable ( FINER ) ) { MODEL . finer ( getName ( ) + ": adding event handler: " + l ) ; } eventHandlers . add ( l ) ; } } | Adds an event handler for calendar events . Handlers will be called when an entry gets added removed changes etc . |
26,331 | public final void removeEventHandler ( EventHandler < CalendarEvent > l ) { if ( l != null ) { if ( MODEL . isLoggable ( FINER ) ) { MODEL . finer ( getName ( ) + ": removing event handler: " + l ) ; } eventHandlers . remove ( l ) ; } } | Removes an event handler from the calendar . |
26,332 | public final void fireEvent ( CalendarEvent evt ) { if ( fireEvents && ! batchUpdates ) { if ( MODEL . isLoggable ( FINER ) ) { MODEL . finer ( getName ( ) + ": fireing event: " + evt ) ; } requireNonNull ( evt ) ; Event . fireEvent ( this , evt ) ; } } | Fires the given calendar event to all event handlers currently registered with this calendar . |
26,333 | public static List < Slice > split ( LocalDate start , LocalDate end ) { Objects . requireNonNull ( start ) ; Objects . requireNonNull ( end ) ; Preconditions . checkArgument ( ! start . isAfter ( end ) ) ; List < Slice > slices = Lists . newArrayList ( ) ; LocalDate startOfMonth = start . withDayOfMonth ( 1 ) ; LocalDate endOfMonth = YearMonth . from ( end ) . atEndOfMonth ( ) ; do { slices . add ( new Slice ( startOfMonth , YearMonth . from ( startOfMonth ) . atEndOfMonth ( ) ) ) ; startOfMonth = startOfMonth . plus ( 1 , ChronoUnit . MONTHS ) ; } while ( startOfMonth . isBefore ( endOfMonth ) || startOfMonth . isEqual ( endOfMonth ) ) ; return slices ; } | Splits the given period into multiple slices of one month long . |
26,334 | public final boolean contains ( E entry ) { TreeEntry < E > e = getEntry ( entry ) ; return e != null ; } | Method to determine if the interval tree contains the given entry . |
26,335 | private TreeEntry < E > getEntry ( Entry < ? > entry ) { TreeEntry < E > t = root ; while ( t != null ) { int cmp = compareLongs ( getLow ( entry ) , t . low ) ; if ( cmp == 0 ) cmp = compareLongs ( getHigh ( entry ) , t . high ) ; if ( cmp == 0 ) cmp = entry . hashCode ( ) - t . value . hashCode ( ) ; if ( cmp < 0 ) { t = t . left ; } else if ( cmp > 0 ) { t = t . right ; } else { return t ; } } return null ; } | Method to find entry by period . Period start period end and object key are used to identify each entry . |
26,336 | private void setDateControl ( DateControl control ) { requireNonNull ( control ) ; control . addEventFilter ( RequestEvent . REQUEST , evt -> addEvent ( evt , LogEntryType . REQUEST_EVENT ) ) ; control . addEventFilter ( LoadEvent . LOAD , evt -> addEvent ( evt , LogEntryType . LOAD_EVENT ) ) ; for ( Calendar calendar : control . getCalendars ( ) ) { calendar . addEventHandler ( calendarListener ) ; } ListChangeListener < ? super Calendar > l = change -> { while ( change . next ( ) ) { if ( change . wasAdded ( ) ) { for ( Calendar c : change . getAddedSubList ( ) ) { c . addEventHandler ( calendarListener ) ; } } else if ( change . wasRemoved ( ) ) { for ( Calendar c : change . getRemoved ( ) ) { c . removeEventHandler ( calendarListener ) ; } } } } ; control . getCalendars ( ) . addListener ( l ) ; Bindings . bindBidirectional ( datePicker . valueProperty ( ) , control . dateProperty ( ) ) ; Bindings . bindBidirectional ( todayPicker . valueProperty ( ) , control . todayProperty ( ) ) ; Bindings . bindBidirectional ( timeField . valueProperty ( ) , control . timeProperty ( ) ) ; timeField . setDisable ( false ) ; } | Sets the control that will be monitored by the developer console . |
26,337 | public void setDayDateTimeFormatter ( DateTimeFormatter formatter ) { if ( getFormatterMap ( ) . get ( ViewType . DAY_VIEW ) == null ) { getFormatterMap ( ) . put ( ViewType . DAY_VIEW , formatter ) ; } else { getFormatterMap ( ) . replace ( ViewType . DAY_VIEW , formatter ) ; } } | Sets the DateTimeFormatter on the Day Label located in the day page . Notice that this is also affecting the page that is going to be printed . |
26,338 | public void setWeekDateTimeFormatter ( DateTimeFormatter formatter ) { if ( getFormatterMap ( ) . get ( ViewType . WEEK_VIEW ) == null ) { getFormatterMap ( ) . put ( ViewType . WEEK_VIEW , formatter ) ; } else { getFormatterMap ( ) . replace ( ViewType . WEEK_VIEW , formatter ) ; } } | Sets the DateTimeFormatter on the Week Label located in the week page . Notice that this is also affecting the page that is going to be printed . |
26,339 | public void setMonthDateTimeFormatter ( DateTimeFormatter formatter ) { if ( getFormatterMap ( ) . get ( ViewType . MONTH_VIEW ) == null ) { getFormatterMap ( ) . put ( ViewType . MONTH_VIEW , formatter ) ; } else { getFormatterMap ( ) . replace ( ViewType . MONTH_VIEW , formatter ) ; } } | Sets the DateTimeFormatter on the Month Label located in the month page . Notice that this is also affecting the page that is going to be printed . |
26,340 | private void removeDataBindings ( ) { Bindings . unbindContent ( detailedDayView . getCalendarSources ( ) , getCalendarSources ( ) ) ; Bindings . unbindContentBidirectional ( detailedDayView . getCalendarVisibilityMap ( ) , getCalendarVisibilityMap ( ) ) ; Bindings . unbindContent ( detailedWeekView . getCalendarSources ( ) , getCalendarSources ( ) ) ; Bindings . unbindContentBidirectional ( detailedWeekView . getCalendarVisibilityMap ( ) , getCalendarVisibilityMap ( ) ) ; Bindings . unbindContent ( monthView . getCalendarSources ( ) , getCalendarSources ( ) ) ; Bindings . unbindContentBidirectional ( monthView . getCalendarVisibilityMap ( ) , getCalendarVisibilityMap ( ) ) ; } | Removes all bindings related with the calendar sources and visibility map . |
26,341 | private DetailedDayView createDetailedDayView ( ) { DetailedDayView newDetailedDayView = new DetailedDayView ( ) ; newDetailedDayView . setShowScrollBar ( false ) ; newDetailedDayView . setShowToday ( false ) ; newDetailedDayView . setEnableCurrentTimeMarker ( false ) ; newDetailedDayView . weekFieldsProperty ( ) . bind ( weekFieldsProperty ( ) ) ; newDetailedDayView . showAllDayViewProperty ( ) . bind ( showAllDayEntriesProperty ( ) ) ; newDetailedDayView . showAgendaViewProperty ( ) . bind ( showEntryDetailsProperty ( ) ) ; newDetailedDayView . layoutProperty ( ) . bind ( layoutProperty ( ) ) ; newDetailedDayView . dateProperty ( ) . bind ( pageStartDateProperty ( ) ) ; newDetailedDayView . addEventFilter ( MouseEvent . ANY , weakMouseHandler ) ; configureDetailedDayView ( newDetailedDayView , true ) ; return newDetailedDayView ; } | Default configuration for Detailed Day view in the preview Pane . |
26,342 | protected void configureDetailedDayView ( DetailedDayView newDetailedDayView , boolean trimTimeBounds ) { newDetailedDayView . getDayView ( ) . setStartTime ( LocalTime . MIN ) ; newDetailedDayView . getDayView ( ) . setEndTime ( LocalTime . MAX ) ; newDetailedDayView . getDayView ( ) . setEarlyLateHoursStrategy ( DayViewBase . EarlyLateHoursStrategy . HIDE ) ; newDetailedDayView . getDayView ( ) . setHoursLayoutStrategy ( DayViewBase . HoursLayoutStrategy . FIXED_HOUR_COUNT ) ; newDetailedDayView . getDayView ( ) . setVisibleHours ( 24 ) ; newDetailedDayView . getDayView ( ) . setTrimTimeBounds ( trimTimeBounds ) ; } | The idea of this method is to be able to change the default configuration of the detailed day view in the preview pane . |
26,343 | private DetailedWeekView createDetailedWeekView ( ) { DetailedWeekView newDetailedWeekView = new DetailedWeekView ( ) ; newDetailedWeekView . setShowScrollBar ( false ) ; newDetailedWeekView . layoutProperty ( ) . bind ( layoutProperty ( ) ) ; newDetailedWeekView . setEnableCurrentTimeMarker ( false ) ; newDetailedWeekView . showAllDayViewProperty ( ) . bind ( showAllDayEntriesProperty ( ) ) ; newDetailedWeekView . weekFieldsProperty ( ) . bind ( weekFieldsProperty ( ) ) ; newDetailedWeekView . setStartTime ( LocalTime . MIN ) ; newDetailedWeekView . setEndTime ( LocalTime . MAX ) ; newDetailedWeekView . setEarlyLateHoursStrategy ( DayViewBase . EarlyLateHoursStrategy . HIDE ) ; newDetailedWeekView . setHoursLayoutStrategy ( DayViewBase . HoursLayoutStrategy . FIXED_HOUR_COUNT ) ; newDetailedWeekView . setVisibleHours ( 24 ) ; newDetailedWeekView . addEventFilter ( MouseEvent . ANY , weakMouseHandler ) ; newDetailedWeekView . dateProperty ( ) . bind ( pageStartDateProperty ( ) ) ; configureDetailedWeekView ( newDetailedWeekView , true ) ; return newDetailedWeekView ; } | Default configuration for Detailed Week view in the preview Pane . |
26,344 | protected void configureDetailedWeekView ( DetailedWeekView newDetailedWeekView , boolean trimTimeBounds ) { newDetailedWeekView . getWeekView ( ) . setShowToday ( false ) ; newDetailedWeekView . getWeekView ( ) . setTrimTimeBounds ( trimTimeBounds ) ; } | The idea of this method is to be able to change the default configuration of the detailed week view in the preview pane . |
26,345 | protected MonthView createMonthView ( ) { MonthView newMonthView = new MonthView ( ) ; newMonthView . setShowToday ( false ) ; newMonthView . setShowCurrentWeek ( false ) ; newMonthView . weekFieldsProperty ( ) . bind ( weekFieldsProperty ( ) ) ; newMonthView . showFullDayEntriesProperty ( ) . bind ( showAllDayEntriesProperty ( ) ) ; newMonthView . showTimedEntriesProperty ( ) . bind ( showTimedEntriesProperty ( ) ) ; newMonthView . addEventFilter ( MouseEvent . ANY , weakMouseHandler ) ; newMonthView . dateProperty ( ) . bind ( pageStartDateProperty ( ) ) ; return newMonthView ; } | Default configuration for Month view in the preview Pane . |
26,346 | public final Calendar getCalendar ( ) { Calendar calendar = calendarSelector . getCalendar ( ) ; if ( calendar == null ) { calendar = entry . getCalendar ( ) ; } return calendar ; } | Returns the currently selected calendar . |
26,347 | public ZonedDateTime getStartZonedDateTime ( ) { if ( zonedStartDateTime == null ) { zonedStartDateTime = ZonedDateTime . of ( startDate , startTime , zoneId ) ; } return zonedStartDateTime ; } | A convenience method to retrieve a zoned date time based on the start date start time and time zone id . |
26,348 | public ZonedDateTime getEndZonedDateTime ( ) { if ( zonedEndDateTime == null ) { zonedEndDateTime = ZonedDateTime . of ( endDate , endTime , zoneId ) ; } return zonedEndDateTime ; } | A convenience method to retrieve a zoned date time based on the end date end time and time zone id . |
26,349 | public Interval withTimes ( LocalTime startTime , LocalTime endTime ) { requireNonNull ( startTime ) ; requireNonNull ( endTime ) ; return new Interval ( this . startDate , startTime , this . endDate , endTime , this . zoneId ) ; } | Returns a new interval based on this interval but with a different start and end time . |
26,350 | public Interval withStartDate ( LocalDate date ) { requireNonNull ( date ) ; return new Interval ( date , startTime , endDate , endTime , zoneId ) ; } | Returns a new interval based on this interval but with a different start date . |
26,351 | public Interval withEndDate ( LocalDate date ) { requireNonNull ( date ) ; return new Interval ( startDate , startTime , date , endTime , zoneId ) ; } | Returns a new interval based on this interval but with a different end date . |
26,352 | public Interval withStartTime ( LocalTime time ) { requireNonNull ( time ) ; return new Interval ( startDate , time , endDate , endTime , zoneId ) ; } | Returns a new interval based on this interval but with a different start time . |
26,353 | public Interval withStartDateTime ( LocalDateTime dateTime ) { requireNonNull ( dateTime ) ; return new Interval ( dateTime . toLocalDate ( ) , dateTime . toLocalTime ( ) , endDate , endTime ) ; } | Returns a new interval based on this interval but with a different start date and time . |
26,354 | public Interval withEndTime ( LocalTime time ) { requireNonNull ( time ) ; return new Interval ( startDate , startTime , endDate , time , zoneId ) ; } | Returns a new interval based on this interval but with a different end time . |
26,355 | public Interval withEndDateTime ( LocalDateTime dateTime ) { requireNonNull ( dateTime ) ; return new Interval ( startDate , startTime , dateTime . toLocalDate ( ) , dateTime . toLocalTime ( ) ) ; } | Returns a new interval based on this interval but with a different end date and time . |
26,356 | public Interval withZoneId ( ZoneId zone ) { requireNonNull ( zone ) ; return new Interval ( startDate , startTime , endDate , endTime , zone ) ; } | Returns a new interval based on this interval but with a different time zone id . |
26,357 | public LocalDateTime getStartDateTime ( ) { if ( startDateTime == null ) { startDateTime = LocalDateTime . of ( getStartDate ( ) , getStartTime ( ) ) ; } return startDateTime ; } | Utility method to get the local start date time . This method combines the start date and the start time to create a date time object . |
26,358 | public LocalDateTime getEndDateTime ( ) { if ( endDateTime == null ) { endDateTime = LocalDateTime . of ( getEndDate ( ) , getEndTime ( ) ) ; } return endDateTime ; } | Utility method to get the local end date time . This method combines the end date and the end time to create a date time object . |
26,359 | public static < T > Predicate < T > not ( Predicate < ? super T > predicate ) { assert null != predicate ; return new NotPredicate < T > ( predicate ) ; } | Returns a Predicate that evaluates to true iff the given Predicate evaluates to false . |
26,360 | protected void parse ( String icalString , IcalSchema schema ) throws ParseException { String paramText ; String content ; { String unfolded = IcalParseUtil . unfoldIcal ( icalString ) ; Matcher m = CONTENT_LINE_RE . matcher ( unfolded ) ; if ( ! m . matches ( ) ) { schema . badContent ( icalString ) ; } setName ( m . group ( 1 ) . toUpperCase ( ) ) ; paramText = m . group ( 2 ) ; if ( null == paramText ) { paramText = "" ; } content = m . group ( 3 ) ; } Map < String , String > params = new HashMap < String , String > ( ) ; String rest = paramText ; while ( ! "" . equals ( rest ) ) { Matcher m = PARAM_RE . matcher ( rest ) ; if ( ! m . find ( ) ) { schema . badPart ( rest , null ) ; } rest = rest . substring ( m . end ( 0 ) ) ; String k = m . group ( 1 ) . toUpperCase ( ) ; String v = m . group ( 2 ) ; if ( null == v ) { v = m . group ( 3 ) ; } if ( params . containsKey ( k ) ) { schema . dupePart ( k ) ; } params . put ( k , v ) ; } schema . applyObjectSchema ( this . name , params , content , this ) ; } | parse the ical object from the given ical content using the given schema . Modifies the current object in place . |
26,361 | public Map < String , String > getExtParams ( ) { if ( null == extParams ) { extParams = new LinkedHashMap < String , String > ( ) ; } return extParams ; } | a map of any extension parameters such as the X - FOO = BAR in RRULE ; X - FOO = BAR . Maps the parameter name X - FOO to the parameter value BAR . |
26,362 | public DateValue next ( ) { if ( null == this . pendingUtc_ ) { this . fetchNext ( ) ; } DateValue next = this . pendingUtc_ ; this . pendingUtc_ = null ; return next ; } | fetch and return the next date in this recurrence . |
26,363 | public DateTimeValue toDateTime ( ) { normalize ( ) ; return new DateTimeValueImpl ( year , month , day , hour , minute , second ) ; } | produces a normalized date time using zero for the time fields if none were provided . |
26,364 | public final ObservableMap < Object , Object > getProperties ( ) { if ( properties == null ) { properties = FXCollections . observableMap ( new HashMap < > ( ) ) ; MapChangeListener < ? super Object , ? super Object > changeListener = change -> { if ( change . getKey ( ) . equals ( "com.calendarfx.recurrence.source" ) ) { if ( change . getValueAdded ( ) != null ) { @ SuppressWarnings ( "unchecked" ) Entry < T > source = ( Entry < T > ) change . getValueAdded ( ) ; recurrenceSourceProperty ( ) ; recurrenceSource . set ( source ) ; } } else if ( change . getKey ( ) . equals ( "com.calendarfx.recurrence.id" ) ) { if ( change . getValueAdded ( ) != null ) { setRecurrenceId ( ( String ) change . getValueAdded ( ) ) ; } } } ; properties . addListener ( changeListener ) ; } return properties ; } | Returns an observable map of properties on this entry for use primarily by application developers . |
26,365 | public final void changeStartDate ( LocalDate date , boolean keepDuration ) { requireNonNull ( date ) ; Interval interval = getInterval ( ) ; LocalDateTime newStartDateTime = getStartAsLocalDateTime ( ) . with ( date ) ; LocalDateTime endDateTime = getEndAsLocalDateTime ( ) ; if ( keepDuration ) { endDateTime = newStartDateTime . plus ( getDuration ( ) ) ; setInterval ( newStartDateTime , endDateTime , getZoneId ( ) ) ; } else { if ( newStartDateTime . isAfter ( endDateTime ) ) { interval = interval . withEndDateTime ( newStartDateTime . plus ( interval . getDuration ( ) ) ) ; } setInterval ( interval . withStartDate ( date ) ) ; } } | Changes the start date of the entry interval . |
26,366 | public final void changeStartTime ( LocalTime time , boolean keepDuration ) { requireNonNull ( time ) ; Interval interval = getInterval ( ) ; LocalDateTime newStartDateTime = getStartAsLocalDateTime ( ) . with ( time ) ; LocalDateTime endDateTime = getEndAsLocalDateTime ( ) ; if ( keepDuration ) { endDateTime = newStartDateTime . plus ( getDuration ( ) ) ; setInterval ( newStartDateTime , endDateTime ) ; } else { if ( newStartDateTime . isAfter ( endDateTime . minus ( getMinimumDuration ( ) ) ) ) { interval = interval . withEndDateTime ( newStartDateTime . plus ( getMinimumDuration ( ) ) ) ; } setInterval ( interval . withStartTime ( time ) ) ; } } | Changes the start time of the entry interval . |
26,367 | public final void changeEndDate ( LocalDate date , boolean keepDuration ) { requireNonNull ( date ) ; Interval interval = getInterval ( ) ; LocalDateTime newEndDateTime = getEndAsLocalDateTime ( ) . with ( date ) ; LocalDateTime startDateTime = getStartAsLocalDateTime ( ) ; if ( keepDuration ) { startDateTime = newEndDateTime . minus ( getDuration ( ) ) ; setInterval ( startDateTime , newEndDateTime , getZoneId ( ) ) ; } else { if ( newEndDateTime . isBefore ( startDateTime ) ) { interval = interval . withStartDateTime ( newEndDateTime . minus ( interval . getDuration ( ) ) ) ; } setInterval ( interval . withEndDate ( date ) ) ; } } | Changes the end date of the entry interval . |
26,368 | public final void changeEndTime ( LocalTime time , boolean keepDuration ) { requireNonNull ( time ) ; Interval interval = getInterval ( ) ; LocalDateTime newEndDateTime = getEndAsLocalDateTime ( ) . with ( time ) ; LocalDateTime startDateTime = getStartAsLocalDateTime ( ) ; if ( keepDuration ) { startDateTime = newEndDateTime . minus ( getDuration ( ) ) ; setInterval ( startDateTime , newEndDateTime , getZoneId ( ) ) ; } else { if ( newEndDateTime . isBefore ( startDateTime . plus ( getMinimumDuration ( ) ) ) ) { interval = interval . withStartDateTime ( newEndDateTime . minus ( getMinimumDuration ( ) ) ) ; } setInterval ( interval . withEndTime ( time ) ) ; } } | Changes the end time of the entry interval . |
26,369 | public final boolean isRecurring ( ) { return recurrenceRule != null && ! ( recurrenceRule . get ( ) == null ) && ! recurrenceRule . get ( ) . trim ( ) . equals ( "" ) ; } | Determines if the entry describes a recurring event . |
26,370 | public final ReadOnlyObjectProperty < LocalDate > recurrenceEndProperty ( ) { if ( recurrenceEnd == null ) { recurrenceEnd = new ReadOnlyObjectWrapper < > ( this , "recurrenceEnd" , _recurrenceEnd ) ; } return recurrenceEnd . getReadOnlyProperty ( ) ; } | The property used to store the end time of the recurrence rule . |
26,371 | public final void setId ( String id ) { requireNonNull ( id ) ; if ( MODEL . isLoggable ( FINE ) ) { MODEL . fine ( "setting id to " + id ) ; } this . id = id ; } | Assigns a new ID to the entry . IDs do not have to be unique . If several entries share the same ID it means that they are representing the same real world entry . An entry spanning multiple days will be shown via several entries in the month view . Clicking on one of them will select all of them as they all represent the same thing . |
26,372 | public final ObjectProperty < T > userObjectProperty ( ) { if ( userObject == null ) { userObject = new SimpleObjectProperty < T > ( this , "userObject" ) { public void set ( T newObject ) { T oldUserObject = get ( ) ; if ( oldUserObject != newObject ) { super . set ( newObject ) ; Calendar calendar = getCalendar ( ) ; if ( calendar != null ) { calendar . fireEvent ( new CalendarEvent ( CalendarEvent . ENTRY_USER_OBJECT_CHANGED , calendar , Entry . this , oldUserObject ) ) ; } } } } ; } return userObject ; } | A property used to store a reference to an optional user object . The user object is usually the reason why the entry was created . |
26,373 | public final ReadOnlyObjectProperty < ZoneId > zoneIdProperty ( ) { if ( zoneId == null ) { zoneId = new ReadOnlyObjectWrapper < > ( this , "zoneId" , getInterval ( ) . getZoneId ( ) ) ; } return zoneId . getReadOnlyProperty ( ) ; } | A property used to store a time zone for the entry . The time zone is needed for properly interpreting the dates and times of the entry . |
26,374 | public final StringProperty locationProperty ( ) { if ( location == null ) { location = new SimpleStringProperty ( null , "location" ) { public void set ( String newLocation ) { String oldLocation = get ( ) ; if ( ! Util . equals ( oldLocation , newLocation ) ) { super . set ( newLocation ) ; Calendar calendar = getCalendar ( ) ; if ( calendar != null ) { calendar . fireEvent ( new CalendarEvent ( CalendarEvent . ENTRY_LOCATION_CHANGED , calendar , Entry . this , oldLocation ) ) ; } } } } ; } return location ; } | A property used to store a free - text location specification for the given entry . This could be as simple as New York or a full address as in 128 Madison Avenue New York USA . |
26,375 | public final boolean isShowing ( LocalDate startDate , LocalDate endDate , ZoneId zoneId ) { return isShowing ( this , startDate , endDate , zoneId ) ; } | Checks whether the entry will be visible within the given start and end dates . This method takes recurrence into consideration and will return true if any recurrence of this entry will be displayed inside the given time interval . |
26,376 | public void setSize ( int width , int height ) { final float r = width * 0.75f / SIN ; final float y = COS * r ; final float h = r - y ; final float or = height * 0.75f / SIN ; final float oy = COS * or ; final float oh = or - oy ; mRadius = r ; mBaseGlowScale = h > 0 ? Math . min ( oh / h , 1.f ) : 1.f ; mBounds . set ( mBounds . left , mBounds . top , width , ( int ) Math . min ( height , h ) ) ; } | Set the size of this edge effect in pixels . |
26,377 | private MenuItem createNewMenuItem ( int group , int id , int categoryOrder , int ordering , CharSequence title , int defaultShowAsAction ) { return new MenuItem ( group , id , categoryOrder , title ) ; } | Layoutlib overrides this method to return its custom implementation of MenuItem |
26,378 | private static int getOrdering ( int categoryOrder ) { final int index = ( categoryOrder & CATEGORY_MASK ) >> CATEGORY_SHIFT ; if ( index < 0 || index >= sCategoryToOrder . length ) { throw new IllegalArgumentException ( "order does not contain a valid category." ) ; } return ( sCategoryToOrder [ index ] << CATEGORY_SHIFT ) | ( categoryOrder & USER_MASK ) ; } | Returns the ordering across all items . This will grab the category from the upper bits find out how to order the category with respect to other categories and combine it with the lower bits . |
26,379 | public Drawable createFromStream ( InputStream is , String srcName ) { return createFromResourceStream ( null , is , srcName ) ; } | Create a drawable from an inputstream |
26,380 | private void drawShape ( Canvas canvas , Paint paint , Path path , ShapeAppearanceModel shapeAppearanceModel , RectF bounds ) { if ( shapeAppearanceModel . isRoundRect ( ) ) { float cornerSize = shapeAppearanceModel . getTopRightCorner ( ) . getCornerSize ( ) ; canvas . drawRoundRect ( bounds , cornerSize , cornerSize , paint ) ; } else { canvas . drawPath ( path , paint ) ; } } | Draw the path or try to draw a round rect if possible . |
26,381 | private void drawCompatShadow ( Canvas canvas ) { for ( int index = 0 ; index < 4 ; index ++ ) { cornerShadowOperation [ index ] . draw ( shadowRenderer , drawableState . shadowCompatRadius , canvas ) ; edgeShadowOperation [ index ] . draw ( shadowRenderer , drawableState . shadowCompatRadius , canvas ) ; } } | Draws a shadow using gradients which can be used in the cases where native elevation can t . This draws the shadow in multiple parts . It draws the shadow for each corner and edge separately . Then it fills in the center space with the main shadow colored paint . If there is no shadow offset this will skip the drawing of the center filled shadow since that will be completely covered by the shape . |
26,382 | public void setButtonDrawable ( Drawable d ) { if ( drawable != d ) { if ( drawable != null ) { drawable . setCallback ( null ) ; unscheduleDrawable ( drawable ) ; } drawable = d ; if ( d != null ) { d . setCallback ( this ) ; if ( d . isStateful ( ) ) { d . setState ( getDrawableState ( ) ) ; } d . setVisible ( getVisibility ( ) == VISIBLE , false ) ; setMinHeight ( d . getIntrinsicHeight ( ) ) ; updateButtonTint ( ) ; } } } | Set the button graphic to a given Drawable |
26,383 | public void addState ( int [ ] specs , Animator animation , Animator . AnimatorListener listener ) { Tuple tuple = new Tuple ( specs , animation , listener ) ; animation . addListener ( mAnimationListener ) ; mTuples . add ( tuple ) ; } | Associates the given Animation with the provided drawable state specs so that it will be run when the View s drawable state matches the specs . |
26,384 | public void setState ( int [ ] state ) { Tuple match = null ; final int count = mTuples . size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { final Tuple tuple = mTuples . get ( i ) ; if ( StateSet . stateSetMatches ( tuple . mSpecs , state ) ) { match = tuple ; break ; } } if ( match == lastMatch ) { return ; } if ( lastMatch != null ) { cancel ( ) ; } lastMatch = match ; View view = ( View ) viewRef . get ( ) ; if ( match != null && view != null && view . getVisibility ( ) == View . VISIBLE ) { start ( match ) ; } } | Called by View |
26,385 | public static void applyTheme ( Drawable d , Resources . Theme t ) { IMPL . applyTheme ( d , t ) ; } | Applies the specified theme to this Drawable and its children . |
26,386 | public void adjustChildren ( int widthMeasureSpec , int heightMeasureSpec ) { if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "adjustChildren: " + mHost + " widthMeasureSpec: " + View . MeasureSpec . toString ( widthMeasureSpec ) + " heightMeasureSpec: " + View . MeasureSpec . toString ( heightMeasureSpec ) ) ; } int widthHint = View . MeasureSpec . getSize ( widthMeasureSpec ) ; int heightHint = View . MeasureSpec . getSize ( heightMeasureSpec ) ; for ( int i = 0 , N = mHost . getChildCount ( ) ; i < N ; i ++ ) { View view = mHost . getChildAt ( i ) ; ViewGroup . LayoutParams params = view . getLayoutParams ( ) ; if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "should adjust " + view + " " + params ) ; } if ( params instanceof PercentLayoutParams ) { PercentLayoutInfo info = ( ( PercentLayoutParams ) params ) . getPercentLayoutInfo ( ) ; if ( Log . isLoggable ( TAG , Log . DEBUG ) ) { Log . d ( TAG , "using " + info ) ; } if ( info != null ) { if ( params instanceof ViewGroup . MarginLayoutParams ) { info . fillMarginLayoutParams ( ( ViewGroup . MarginLayoutParams ) params , widthHint , heightHint ) ; } else { info . fillLayoutParams ( params , widthHint , heightHint ) ; } } } } } | Iterates over children and changes their width and height to one calculated from percentage values . |
26,387 | public final void enter ( boolean fast ) { cancel ( ) ; mSoftwareAnimator = createSoftwareEnter ( fast ) ; if ( mSoftwareAnimator != null ) { mSoftwareAnimator . start ( ) ; } } | Starts a ripple enter animation . |
26,388 | public void lineTo ( float x , float y ) { PathLineOperation operation = new PathLineOperation ( ) ; operation . x = x ; operation . y = y ; operations . add ( operation ) ; LineShadowOperation shadowOperation = new LineShadowOperation ( operation , endX , endY ) ; addShadowCompatOperation ( shadowOperation , ANGLE_UP + shadowOperation . getAngle ( ) , ANGLE_UP + shadowOperation . getAngle ( ) ) ; endX = x ; endY = y ; } | Add a line to the ShapePath . |
26,389 | public void quadToPoint ( float controlX , float controlY , float toX , float toY ) { PathQuadOperation operation = new PathQuadOperation ( ) ; operation . controlX = controlX ; operation . controlY = controlY ; operation . endX = toX ; operation . endY = toY ; operations . add ( operation ) ; endX = toX ; endY = toY ; } | Add a quad to the ShapePath . |
26,390 | public void addArc ( float left , float top , float right , float bottom , float startAngle , float sweepAngle ) { PathArcOperation operation = new PathArcOperation ( left , top , right , bottom ) ; operation . startAngle = startAngle ; operation . sweepAngle = sweepAngle ; operations . add ( operation ) ; ArcShadowOperation arcShadowOperation = new ArcShadowOperation ( operation ) ; float endAngle = startAngle + sweepAngle ; boolean drawShadowInsideBounds = sweepAngle < 0 ; addShadowCompatOperation ( arcShadowOperation , drawShadowInsideBounds ? ( 180 + startAngle ) % 360 : startAngle , drawShadowInsideBounds ? ( 180 + endAngle ) % 360 : endAngle ) ; endX = ( left + right ) * 0.5f + ( right - left ) / 2 * ( float ) Math . cos ( Math . toRadians ( startAngle + sweepAngle ) ) ; endY = ( top + bottom ) * 0.5f + ( bottom - top ) / 2 * ( float ) Math . sin ( Math . toRadians ( startAngle + sweepAngle ) ) ; } | Add an arc to the ShapePath . |
26,391 | ShadowCompatOperation createShadowCompatOperation ( final Matrix transform ) { addConnectingShadowIfNecessary ( endShadowAngle ) ; final List < ShadowCompatOperation > operations = new ArrayList < > ( shadowCompatOperations ) ; return new ShadowCompatOperation ( ) { public void draw ( Matrix matrix , ShadowRenderer shadowRenderer , int shadowElevation , Canvas canvas ) { for ( ShadowCompatOperation op : operations ) { op . draw ( transform , shadowRenderer , shadowElevation , canvas ) ; } } } ; } | Creates a ShadowCompatOperation to draw compatibility shadow under the matrix transform for the whole path defined by this ShapePath . |
26,392 | private void setTargetDensity ( DisplayMetrics metrics ) { if ( mDensity != metrics . density ) { mDensity = metrics . density ; invalidateSelf ( false ) ; } } | Set the density at which this drawable will be rendered . |
26,393 | private void tryBackgroundEnter ( boolean focused ) { if ( mBackground == null ) { mBackground = new RippleBackground ( this , mHotspotBounds ) ; } mBackground . setup ( mState . mMaxRadius , mDensity ) ; mBackground . enter ( focused ) ; } | Creates an active hotspot at the specified location . |
26,394 | private void tryRippleEnter ( ) { if ( mExitingRipplesCount >= MAX_RIPPLES ) { return ; } if ( mRipple == null ) { final float x ; final float y ; if ( mHasPending ) { mHasPending = false ; x = mPendingX ; y = mPendingY ; } else { x = mHotspotBounds . exactCenterX ( ) ; y = mHotspotBounds . exactCenterY ( ) ; } final boolean isBounded = isBounded ( ) ; mRipple = new RippleForeground ( this , mHotspotBounds , x , y , isBounded ) ; } mRipple . setup ( mState . mMaxRadius , mDensity ) ; mRipple . enter ( false ) ; } | Attempts to start an enter animation for the active hotspot . Fails if there are too many animating ripples . |
26,395 | private void tryRippleExit ( ) { if ( mRipple != null ) { if ( mExitingRipples == null ) { mExitingRipples = new RippleForeground [ MAX_RIPPLES ] ; } mExitingRipples [ mExitingRipplesCount ++ ] = mRipple ; mRipple . exit ( ) ; mRipple = null ; } } | Attempts to start an exit animation for the active hotspot . Fails if there is no active hotspot . |
26,396 | private void clearHotspots ( ) { if ( mRipple != null ) { mRipple . end ( ) ; mRipple = null ; mRippleActive = false ; } if ( mBackground != null ) { mBackground . end ( ) ; mBackground = null ; mBackgroundActive = false ; } cancelExitingRipples ( ) ; } | Cancels and removes the active ripple all exiting ripples and the background . Nothing will be drawn after this method is called . |
26,397 | private void onHotspotBoundsChanged ( ) { final int count = mExitingRipplesCount ; final RippleForeground [ ] ripples = mExitingRipples ; for ( int i = 0 ; i < count ; i ++ ) { ripples [ i ] . onHotspotBoundsChanged ( ) ; } if ( mRipple != null ) { mRipple . onHotspotBoundsChanged ( ) ; } if ( mBackground != null ) { mBackground . onHotspotBoundsChanged ( ) ; } } | Notifies all the animating ripples that the hotspot bounds have changed . |
26,398 | public void drawEdgeShadow ( Canvas canvas , Matrix transform , RectF bounds , int elevation ) { bounds . bottom += elevation ; bounds . offset ( 0 , - elevation ) ; edgeColors [ 0 ] = shadowEndColor ; edgeColors [ 1 ] = shadowMiddleColor ; edgeColors [ 2 ] = shadowStartColor ; edgeShadowPaint . setShader ( new LinearGradient ( bounds . left , bounds . top , bounds . left , bounds . bottom , edgeColors , edgePositions , Shader . TileMode . CLAMP ) ) ; canvas . save ( ) ; canvas . concat ( transform ) ; canvas . drawRect ( bounds , edgeShadowPaint ) ; canvas . restore ( ) ; } | Draws an edge shadow on the canvas in the current bounds with the matrix transform applied . |
26,399 | public void drawCornerShadow ( Canvas canvas , Matrix matrix , RectF bounds , int elevation , float startAngle , float sweepAngle ) { Path arcBounds = scratch ; arcBounds . rewind ( ) ; arcBounds . moveTo ( bounds . centerX ( ) , bounds . centerY ( ) ) ; arcBounds . arcTo ( bounds , startAngle , sweepAngle ) ; arcBounds . close ( ) ; bounds . inset ( - elevation , - elevation ) ; cornerColors [ 0 ] = 0 ; cornerColors [ 1 ] = shadowStartColor ; cornerColors [ 2 ] = shadowMiddleColor ; cornerColors [ 3 ] = shadowEndColor ; float startRatio = 1f - ( elevation / ( bounds . width ( ) / 2f ) ) ; float midRatio = startRatio + ( ( 1f - startRatio ) / 2f ) ; cornerPositions [ 1 ] = startRatio ; cornerPositions [ 2 ] = midRatio ; cornerShadowPaint . setShader ( new RadialGradient ( bounds . centerX ( ) , bounds . centerY ( ) , bounds . width ( ) / 2 , cornerColors , cornerPositions , Shader . TileMode . CLAMP ) ) ; canvas . save ( ) ; canvas . concat ( matrix ) ; cornerShadowPaint . setStyle ( Paint . Style . STROKE ) ; cornerShadowPaint . setStrokeWidth ( elevation * 2 ) ; canvas . drawArc ( bounds , startAngle , sweepAngle , false , cornerShadowPaint ) ; canvas . restore ( ) ; } | Draws a corner shadow on the canvas in the current bounds with the matrix transform applied . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.