repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java | RecurrenceIteratorFactory.join | 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());
} | java | 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());
} | [
"public",
"static",
"RecurrenceIterator",
"join",
"(",
"RecurrenceIterator",
"a",
",",
"RecurrenceIterator",
"...",
"b",
")",
"{",
"List",
"<",
"RecurrenceIterator",
">",
"incl",
"=",
"new",
"ArrayList",
"<",
"RecurrenceIterator",
">",
"(",
")",
";",
"incl",
"... | a recurrence iterator that returns the union of the given recurrence
iterators. | [
"a",
"recurrence",
"iterator",
"that",
"returns",
"the",
"union",
"of",
"the",
"given",
"recurrence",
"iterators",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java#L501-L508 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java | RecurrenceIteratorFactory.filterBySetPos | 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; // Zero-index.
}
if (pos >= 0 && pos < members.length) {
iset.add(members[pos]);
}
}
return iset.toIntArray();
} | java | 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; // Zero-index.
}
if (pos >= 0 && pos < members.length) {
iset.add(members[pos]);
}
}
return iset.toIntArray();
} | [
"private",
"static",
"int",
"[",
"]",
"filterBySetPos",
"(",
"int",
"[",
"]",
"members",
",",
"int",
"[",
"]",
"bySetPos",
")",
"{",
"members",
"=",
"Util",
".",
"uniquify",
"(",
"members",
")",
";",
"IntSet",
"iset",
"=",
"new",
"IntSet",
"(",
")",
... | 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. | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/RecurrenceIteratorFactory.java#L585-L602 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/compat/javautil/DateIteratorFactory.java | DateIteratorFactory.createDateIterator | 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));
} | java | 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));
} | [
"public",
"static",
"DateIterator",
"createDateIterator",
"(",
"String",
"rdata",
",",
"Date",
"start",
",",
"TimeZone",
"tzid",
",",
"boolean",
"strict",
")",
"throws",
"ParseException",
"{",
"return",
"new",
"RecurrenceIteratorWrapper",
"(",
"RecurrenceIteratorFacto... | given a block of RRULE, EXRULE, RDATE, and EXDATE content lines, parse
them into a single date iterator.
@param rdata RRULE, EXRULE, RDATE, and EXDATE lines.
@param start the first occurrence of the series.
@param tzid the local timezone -- used to interpret start and any dates in
RDATE and EXDATE lines that don't have TZID params.
@param strict true if any failure to parse should result in a
ParseException. false causes bad content lines to be logged and ignored. | [
"given",
"a",
"block",
"of",
"RRULE",
"EXRULE",
"RDATE",
"and",
"EXDATE",
"content",
"lines",
"parse",
"them",
"into",
"a",
"single",
"date",
"iterator",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/compat/javautil/DateIteratorFactory.java#L58-L65 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/compat/javautil/DateIteratorFactory.java | DateIteratorFactory.createDateIterable | 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));
} | java | 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));
} | [
"public",
"static",
"DateIterable",
"createDateIterable",
"(",
"String",
"rdata",
",",
"Date",
"start",
",",
"TimeZone",
"tzid",
",",
"boolean",
"strict",
")",
"throws",
"ParseException",
"{",
"return",
"new",
"RecurrenceIterableWrapper",
"(",
"RecurrenceIteratorFacto... | given a block of RRULE, EXRULE, RDATE, and EXDATE content lines, parse
them into a single date iterable.
@param rdata RRULE, EXRULE, RDATE, and EXDATE lines.
@param start the first occurrence of the series.
@param tzid the local timezone -- used to interpret start and any dates in
RDATE and EXDATE lines that don't have TZID params.
@param strict true if any failure to parse should result in a
ParseException. false causes bad content lines to be logged and ignored. | [
"given",
"a",
"block",
"of",
"RRULE",
"EXRULE",
"RDATE",
"and",
"EXDATE",
"content",
"lines",
"parse",
"them",
"into",
"a",
"single",
"date",
"iterable",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/compat/javautil/DateIteratorFactory.java#L77-L84 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleCalendar.java | GoogleCalendar.createEntry | 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;
} | java | 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;
} | [
"public",
"final",
"GoogleEntry",
"createEntry",
"(",
"ZonedDateTime",
"start",
",",
"boolean",
"fullDay",
")",
"{",
"GoogleEntry",
"entry",
"=",
"new",
"GoogleEntry",
"(",
")",
";",
"entry",
".",
"setTitle",
"(",
"\"New Entry \"",
"+",
"generateEntryConsecutive",... | 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.
@param start
The start date/time of the new entry.
@param fullDay
A flag indicating if the new entry is going to be full day.
@return The new google entry created, this is not send to server side.
@see #generateEntryConsecutive() | [
"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",
... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleCalendar.java#L143-L151 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Conditions.java | Conditions.countCondition | static Predicate<DateValue> countCondition(final int count) {
return new Predicate<DateValue>() {
int count_ = count;
public boolean apply(DateValue value) {
return --count_ >= 0;
}
@Override
public String toString() {
return "CountCondition:" + count_;
}
};
} | java | static Predicate<DateValue> countCondition(final int count) {
return new Predicate<DateValue>() {
int count_ = count;
public boolean apply(DateValue value) {
return --count_ >= 0;
}
@Override
public String toString() {
return "CountCondition:" + count_;
}
};
} | [
"static",
"Predicate",
"<",
"DateValue",
">",
"countCondition",
"(",
"final",
"int",
"count",
")",
"{",
"return",
"new",
"Predicate",
"<",
"DateValue",
">",
"(",
")",
"{",
"int",
"count_",
"=",
"count",
";",
"public",
"boolean",
"apply",
"(",
"DateValue",
... | constructs a condition that fails after passing count dates. | [
"constructs",
"a",
"condition",
"that",
"fails",
"after",
"passing",
"count",
"dates",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Conditions.java#L34-L47 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/Conditions.java | Conditions.untilCondition | static Predicate<DateValue> untilCondition(final DateValue until) {
return new Predicate<DateValue>() {
public boolean apply(DateValue date) {
return date.compareTo(until) <= 0;
}
@Override
public String toString() {
return "UntilCondition:" + until;
}
};
} | java | static Predicate<DateValue> untilCondition(final DateValue until) {
return new Predicate<DateValue>() {
public boolean apply(DateValue date) {
return date.compareTo(until) <= 0;
}
@Override
public String toString() {
return "UntilCondition:" + until;
}
};
} | [
"static",
"Predicate",
"<",
"DateValue",
">",
"untilCondition",
"(",
"final",
"DateValue",
"until",
")",
"{",
"return",
"new",
"Predicate",
"<",
"DateValue",
">",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"DateValue",
"date",
")",
"{",
"return",
"d... | constructs a condition that passes for every date on or before until.
@param until non null. | [
"constructs",
"a",
"condition",
"that",
"passes",
"for",
"every",
"date",
"on",
"or",
"before",
"until",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/Conditions.java#L53-L64 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/PeriodValueImpl.java | PeriodValueImpl.createFromDuration | 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);
} | java | 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);
} | [
"public",
"static",
"PeriodValue",
"createFromDuration",
"(",
"DateValue",
"start",
",",
"DateValue",
"dur",
")",
"{",
"DateValue",
"end",
"=",
"TimeUtils",
".",
"add",
"(",
"start",
",",
"dur",
")",
";",
"if",
"(",
"end",
"instanceof",
"TimeValue",
"&&",
... | returns a period with the given start date and duration.
@param start non null.
@param dur a positive duration represented as a DateValue. | [
"returns",
"a",
"period",
"with",
"the",
"given",
"start",
"date",
"and",
"duration",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/PeriodValueImpl.java#L49-L55 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/PeriodValueImpl.java | PeriodValueImpl.intersects | 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;
} | java | 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;
} | [
"public",
"boolean",
"intersects",
"(",
"PeriodValue",
"pv",
")",
"{",
"DateValue",
"sa",
"=",
"this",
".",
"start",
",",
"ea",
"=",
"this",
".",
"end",
",",
"sb",
"=",
"pv",
".",
"start",
"(",
")",
",",
"eb",
"=",
"pv",
".",
"end",
"(",
")",
"... | true iff this period overlaps the given period. | [
"true",
"iff",
"this",
"period",
"overlaps",
"the",
"given",
"period",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/PeriodValueImpl.java#L80-L87 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/util/Util.java | Util.adjustToFirstDayOfWeek | 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;
} | java | 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;
} | [
"public",
"static",
"LocalDate",
"adjustToFirstDayOfWeek",
"(",
"LocalDate",
"date",
",",
"DayOfWeek",
"firstDayOfWeek",
")",
"{",
"LocalDate",
"newDate",
"=",
"date",
".",
"with",
"(",
"DAY_OF_WEEK",
",",
"firstDayOfWeek",
".",
"getValue",
"(",
")",
")",
";",
... | 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.
@param date the date to adjust
@param firstDayOfWeek the day of week that is considered the start of the week ("Monday" in Germany, "Sunday" in the US)
@return the date of the first day of the week
@see #adjustToLastDayOfWeek(LocalDate, DayOfWeek)
@see DateControl#getFirstDayOfWeek() | [
"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"... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/util/Util.java#L272-L279 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/util/Util.java | Util.adjustToLastDayOfWeek | public static LocalDate adjustToLastDayOfWeek(LocalDate date, DayOfWeek firstDayOfWeek) {
LocalDate startOfWeek = adjustToFirstDayOfWeek(date, firstDayOfWeek);
return startOfWeek.plusDays(6);
} | java | public static LocalDate adjustToLastDayOfWeek(LocalDate date, DayOfWeek firstDayOfWeek) {
LocalDate startOfWeek = adjustToFirstDayOfWeek(date, firstDayOfWeek);
return startOfWeek.plusDays(6);
} | [
"public",
"static",
"LocalDate",
"adjustToLastDayOfWeek",
"(",
"LocalDate",
"date",
",",
"DayOfWeek",
"firstDayOfWeek",
")",
"{",
"LocalDate",
"startOfWeek",
"=",
"adjustToFirstDayOfWeek",
"(",
"date",
",",
"firstDayOfWeek",
")",
";",
"return",
"startOfWeek",
".",
"... | 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.
@param date the date to adjust
@param firstDayOfWeek the day of week that is considered the start of the week ("Monday" in Germany, "Sunday" in the US)
@return the date of the first day of the week
@see #adjustToFirstDayOfWeek(LocalDate, DayOfWeek)
@see DateControl#getFirstDayOfWeek() | [
"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",
"g... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/util/Util.java#L294-L297 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/VirtualGrid.java | VirtualGrid.adjustTime | 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);
} | java | 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);
} | [
"public",
"Instant",
"adjustTime",
"(",
"Instant",
"instant",
",",
"ZoneId",
"zoneId",
",",
"boolean",
"roundUp",
",",
"DayOfWeek",
"firstDayOfWeek",
")",
"{",
"requireNonNull",
"(",
"instant",
")",
";",
"requireNonNull",
"(",
"zoneId",
")",
";",
"requireNonNull... | Adjusts the given instant either rounding it up or down.
@param instant
the instant to adjust
@param zoneId
the time zone
@param roundUp
the rounding direction
@param firstDayOfWeek
the first day of the week (needed for rounding weeks)
@return the adjusted instant | [
"Adjusts",
"the",
"given",
"instant",
"either",
"rounding",
"it",
"up",
"or",
"down",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/VirtualGrid.java#L165-L181 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/EntryViewBase.java | EntryViewBase.dateControlProperty | public final ReadOnlyObjectProperty<T> dateControlProperty() {
if (dateControl == null) {
dateControl = new ReadOnlyObjectWrapper<>(this, "dateControl", _dateControl); //$NON-NLS-1$
}
return dateControl.getReadOnlyProperty();
} | java | public final ReadOnlyObjectProperty<T> dateControlProperty() {
if (dateControl == null) {
dateControl = new ReadOnlyObjectWrapper<>(this, "dateControl", _dateControl); //$NON-NLS-1$
}
return dateControl.getReadOnlyProperty();
} | [
"public",
"final",
"ReadOnlyObjectProperty",
"<",
"T",
">",
"dateControlProperty",
"(",
")",
"{",
"if",
"(",
"dateControl",
"==",
"null",
")",
"{",
"dateControl",
"=",
"new",
"ReadOnlyObjectWrapper",
"<>",
"(",
"this",
",",
"\"dateControl\"",
",",
"_dateControl"... | The date control where the entry view is shown.
@return the date control | [
"The",
"date",
"control",
"where",
"the",
"entry",
"view",
"is",
"shown",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/EntryViewBase.java#L498-L504 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/EntryViewBase.java | EntryViewBase.isReadOnly | public final boolean isReadOnly() {
Entry<?> entry = getEntry();
Calendar calendar = entry.getCalendar();
if (calendar != null) {
return calendar.isReadOnly();
}
return false;
} | java | public final boolean isReadOnly() {
Entry<?> entry = getEntry();
Calendar calendar = entry.getCalendar();
if (calendar != null) {
return calendar.isReadOnly();
}
return false;
} | [
"public",
"final",
"boolean",
"isReadOnly",
"(",
")",
"{",
"Entry",
"<",
"?",
">",
"entry",
"=",
"getEntry",
"(",
")",
";",
"Calendar",
"calendar",
"=",
"entry",
".",
"getCalendar",
"(",
")",
";",
"if",
"(",
"calendar",
"!=",
"null",
")",
"{",
"retur... | Convenience method to determine whether the entry belongs to a calendar
that is read-only.
@return true if the entry can not be edited by the user | [
"Convenience",
"method",
"to",
"determine",
"whether",
"the",
"entry",
"belongs",
"to",
"a",
"calendar",
"that",
"is",
"read",
"-",
"only",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/EntryViewBase.java#L851-L859 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/IcalParseUtil.java | IcalParseUtil.parseDateValue | 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();
}
} | java | 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();
}
} | [
"public",
"static",
"DateValue",
"parseDateValue",
"(",
"String",
"s",
",",
"TimeZone",
"tzid",
")",
"throws",
"ParseException",
"{",
"Matcher",
"m",
"=",
"DATE_VALUE",
".",
"matcher",
"(",
"s",
")",
";",
"if",
"(",
"!",
"m",
".",
"matches",
"(",
")",
... | parses a date of the form yyyymmdd or yyyymmdd'T'hhMMss converting from
the given timezone to UTC. | [
"parses",
"a",
"date",
"of",
"the",
"form",
"yyyymmdd",
"or",
"yyyymmdd",
"T",
"hhMMss",
"converting",
"from",
"the",
"given",
"timezone",
"to",
"UTC",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/IcalParseUtil.java#L51-L75 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.insertCalendar | 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());
} | java | 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());
} | [
"public",
"void",
"insertCalendar",
"(",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"com",
".",
"google",
".",
"api",
".",
"services",
".",
"calendar",
".",
"model",
".",
"Calendar",
"cal",
";",
"cal",
"=",
"converter",
".",
"convert",
... | Inserts a calendar into the google calendar.
@param calendar The calendar to be inserted.
@throws IOException For unexpected errors. | [
"Inserts",
"a",
"calendar",
"into",
"the",
"google",
"calendar",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L59-L64 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.updateCalendar | public void updateCalendar(GoogleCalendar calendar) throws IOException {
CalendarListEntry calendarListEntry = converter.convert(calendar, CalendarListEntry.class);
dao.calendarList().update(calendarListEntry.getId(), calendarListEntry).execute();
} | java | public void updateCalendar(GoogleCalendar calendar) throws IOException {
CalendarListEntry calendarListEntry = converter.convert(calendar, CalendarListEntry.class);
dao.calendarList().update(calendarListEntry.getId(), calendarListEntry).execute();
} | [
"public",
"void",
"updateCalendar",
"(",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"CalendarListEntry",
"calendarListEntry",
"=",
"converter",
".",
"convert",
"(",
"calendar",
",",
"CalendarListEntry",
".",
"class",
")",
";",
"dao",
".",
"ca... | Saves the updates done on the calendar into google calendar api.
@param calendar The calendar to be updated.
@throws IOException For unexpected errors. | [
"Saves",
"the",
"updates",
"done",
"on",
"the",
"calendar",
"into",
"google",
"calendar",
"api",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L72-L75 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.deleteCalendar | public void deleteCalendar(GoogleCalendar calendar) throws IOException {
dao.calendars().delete(calendar.getId()).execute();
} | java | public void deleteCalendar(GoogleCalendar calendar) throws IOException {
dao.calendars().delete(calendar.getId()).execute();
} | [
"public",
"void",
"deleteCalendar",
"(",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"dao",
".",
"calendars",
"(",
")",
".",
"delete",
"(",
"calendar",
".",
"getId",
"(",
")",
")",
".",
"execute",
"(",
")",
";",
"}"
] | Performs an immediate delete request on the google calendar api.
@param calendar The calendar to be removed.
@throws IOException For unexpected errors | [
"Performs",
"an",
"immediate",
"delete",
"request",
"on",
"the",
"google",
"calendar",
"api",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L83-L85 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.insertEntry | 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;
} | java | 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;
} | [
"public",
"GoogleEntry",
"insertEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"Event",
"event",
"=",
"converter",
".",
"convert",
"(",
"entry",
",",
"Event",
".",
"class",
")",
";",
"event",
"=",
"... | 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.
@param entry The entry to be inserted in a backend google calendar.
@param calendar The calendar in which the entry will be inserted.
@return The same instance received.
@throws IOException For unexpected errors | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L97-L103 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.updateEntry | 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;
} | java | 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;
} | [
"public",
"GoogleEntry",
"updateEntry",
"(",
"GoogleEntry",
"entry",
")",
"throws",
"IOException",
"{",
"GoogleCalendar",
"calendar",
"=",
"(",
"GoogleCalendar",
")",
"entry",
".",
"getCalendar",
"(",
")",
";",
"Event",
"event",
"=",
"converter",
".",
"convert",... | Performs an immediate update operation on google server by sending the
information stored by the given google entry.
@param entry The entry to be updated in a backend google calendar.
@return The same instance received.
@throws IOException For unexpected errors | [
"Performs",
"an",
"immediate",
"update",
"operation",
"on",
"google",
"server",
"by",
"sending",
"the",
"information",
"stored",
"by",
"the",
"given",
"google",
"entry",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L113-L118 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.deleteEntry | public void deleteEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
dao.events().delete(calendar.getId(), entry.getId()).execute();
} | java | public void deleteEntry(GoogleEntry entry, GoogleCalendar calendar) throws IOException {
dao.events().delete(calendar.getId(), entry.getId()).execute();
} | [
"public",
"void",
"deleteEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"calendar",
")",
"throws",
"IOException",
"{",
"dao",
".",
"events",
"(",
")",
".",
"delete",
"(",
"calendar",
".",
"getId",
"(",
")",
",",
"entry",
".",
"getId",
"(",
"... | Sends a delete request to the google server for the given entry.
@param entry The entry to be deleted from the backend google calendar.
@param calendar The calendar from the entry was deleted.
@throws IOException For unexpected errors. | [
"Sends",
"a",
"delete",
"request",
"to",
"the",
"google",
"server",
"for",
"the",
"given",
"entry",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L127-L129 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.moveEntry | public GoogleEntry moveEntry(GoogleEntry entry, GoogleCalendar from, GoogleCalendar to) throws IOException {
dao.events().move(from.getId(), entry.getId(), to.getId()).execute();
return entry;
} | java | public GoogleEntry moveEntry(GoogleEntry entry, GoogleCalendar from, GoogleCalendar to) throws IOException {
dao.events().move(from.getId(), entry.getId(), to.getId()).execute();
return entry;
} | [
"public",
"GoogleEntry",
"moveEntry",
"(",
"GoogleEntry",
"entry",
",",
"GoogleCalendar",
"from",
",",
"GoogleCalendar",
"to",
")",
"throws",
"IOException",
"{",
"dao",
".",
"events",
"(",
")",
".",
"move",
"(",
"from",
".",
"getId",
"(",
")",
",",
"entry"... | Moves an entry from one calendar to another.
@param entry The entry to be moved.
@param from The current calendar.
@param to The future calendar.
@return The entry updated.
@throws IOException For unexpected errors. | [
"Moves",
"an",
"entry",
"from",
"one",
"calendar",
"to",
"another",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L140-L143 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.getCalendars | 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;
} | java | 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;
} | [
"public",
"List",
"<",
"GoogleCalendar",
">",
"getCalendars",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"CalendarListEntry",
">",
"calendarListEntries",
"=",
"dao",
".",
"calendarList",
"(",
")",
".",
"list",
"(",
")",
".",
"execute",
"(",
")",
... | Gets the list of all calendars available in the account.
@return A non-null list of all calendars.
@throws IOException For unexpected errors. | [
"Gets",
"the",
"list",
"of",
"all",
"calendars",
"available",
"in",
"the",
"account",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L151-L165 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.getEntries | 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);
} | java | 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);
} | [
"public",
"List",
"<",
"GoogleEntry",
">",
"getEntries",
"(",
"GoogleCalendar",
"calendar",
",",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
",",
"ZoneId",
"zoneId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"calendar",
".",
"existsInGoogle",... | 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.
@param calendar The calendar owner of the entries.
@param startDate The start date, not nullable.
@param endDate The end date, not nullable
@param zoneId The timezone in which the dates are represented.
@return A non-null list of entries.
@throws IOException For unexpected errors | [
"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... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L178-L197 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java | GoogleCalendarService.getEntries | 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);
} | java | 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);
} | [
"public",
"List",
"<",
"GoogleEntry",
">",
"getEntries",
"(",
"GoogleCalendar",
"calendar",
",",
"String",
"searchText",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"calendar",
".",
"existsInGoogle",
"(",
")",
")",
"{",
"return",
"new",
"ArrayList",
"... | Gets a list of entries that matches the given text. Recurring events
are not expanded, always recurrence is handled manually within the framework.
@param calendar The calendar owner of the entries.
@param searchText The search text
@return A non-null list of entries.
@throws IOException For unexpected errors | [
"Gets",
"a",
"list",
"of",
"entries",
"that",
"matches",
"the",
"given",
"text",
".",
"Recurring",
"events",
"are",
"not",
"expanded",
"always",
"recurrence",
"is",
"handled",
"manually",
"within",
"the",
"framework",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/service/GoogleCalendarService.java#L208-L224 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java | GoogleAccount.createCalendar | public final GoogleCalendar createCalendar(String name, Calendar.Style style) {
GoogleCalendar calendar = new GoogleCalendar();
calendar.setName(name);
calendar.setStyle(style);
return calendar;
} | java | public final GoogleCalendar createCalendar(String name, Calendar.Style style) {
GoogleCalendar calendar = new GoogleCalendar();
calendar.setName(name);
calendar.setStyle(style);
return calendar;
} | [
"public",
"final",
"GoogleCalendar",
"createCalendar",
"(",
"String",
"name",
",",
"Calendar",
".",
"Style",
"style",
")",
"{",
"GoogleCalendar",
"calendar",
"=",
"new",
"GoogleCalendar",
"(",
")",
";",
"calendar",
".",
"setName",
"(",
"name",
")",
";",
"cal... | Creates one single calendar with the given name and style.
@param name The name of the calendar.
@param style The style of the calendar.
@return The new google calendar. | [
"Creates",
"one",
"single",
"calendar",
"with",
"the",
"given",
"name",
"and",
"style",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java#L51-L56 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java | GoogleAccount.getPrimaryCalendar | public GoogleCalendar getPrimaryCalendar() {
return (GoogleCalendar) getCalendars().stream()
.filter(calendar -> ((GoogleCalendar) calendar).isPrimary())
.findFirst()
.orElse(null);
} | java | public GoogleCalendar getPrimaryCalendar() {
return (GoogleCalendar) getCalendars().stream()
.filter(calendar -> ((GoogleCalendar) calendar).isPrimary())
.findFirst()
.orElse(null);
} | [
"public",
"GoogleCalendar",
"getPrimaryCalendar",
"(",
")",
"{",
"return",
"(",
"GoogleCalendar",
")",
"getCalendars",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"calendar",
"->",
"(",
"(",
"GoogleCalendar",
")",
"calendar",
")",
".",
"isPrimary"... | Gets the calendar marked as primary calendar for the google account.
@return The primary calendar, {@code null} if not loaded. | [
"Gets",
"the",
"calendar",
"marked",
"as",
"primary",
"calendar",
"for",
"the",
"google",
"account",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java#L63-L68 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java | GoogleAccount.getGoogleCalendars | public List<GoogleCalendar> getGoogleCalendars() {
List<GoogleCalendar> googleCalendars = new ArrayList<>();
for (Calendar calendar : getCalendars()) {
if (!(calendar instanceof GoogleCalendar)) {
continue;
}
googleCalendars.add((GoogleCalendar) calendar);
}
return googleCalendars;
} | java | public List<GoogleCalendar> getGoogleCalendars() {
List<GoogleCalendar> googleCalendars = new ArrayList<>();
for (Calendar calendar : getCalendars()) {
if (!(calendar instanceof GoogleCalendar)) {
continue;
}
googleCalendars.add((GoogleCalendar) calendar);
}
return googleCalendars;
} | [
"public",
"List",
"<",
"GoogleCalendar",
">",
"getGoogleCalendars",
"(",
")",
"{",
"List",
"<",
"GoogleCalendar",
">",
"googleCalendars",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Calendar",
"calendar",
":",
"getCalendars",
"(",
")",
")",
... | Gets all the google calendars hold by this source.
@return The list of google calendars, always a new list. | [
"Gets",
"all",
"the",
"google",
"calendars",
"hold",
"by",
"this",
"source",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java#L75-L84 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java | GoogleAccount.removeCalendarListeners | @SafeVarargs
public final void removeCalendarListeners(ListChangeListener<Calendar>... listeners) {
if (listeners != null) {
for (ListChangeListener<Calendar> listener : listeners) {
getCalendars().removeListener(listener);
}
}
} | java | @SafeVarargs
public final void removeCalendarListeners(ListChangeListener<Calendar>... listeners) {
if (listeners != null) {
for (ListChangeListener<Calendar> listener : listeners) {
getCalendars().removeListener(listener);
}
}
} | [
"@",
"SafeVarargs",
"public",
"final",
"void",
"removeCalendarListeners",
"(",
"ListChangeListener",
"<",
"Calendar",
">",
"...",
"listeners",
")",
"{",
"if",
"(",
"listeners",
"!=",
"null",
")",
"{",
"for",
"(",
"ListChangeListener",
"<",
"Calendar",
">",
"li... | Removes the listener from the ones being notified.
@param listeners The listener | [
"Removes",
"the",
"listener",
"from",
"the",
"ones",
"being",
"notified",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/model/GoogleAccount.java#L105-L112 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.findEntries | 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;
} | java | 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;
} | [
"public",
"final",
"Map",
"<",
"LocalDate",
",",
"List",
"<",
"Entry",
"<",
"?",
">",
">",
">",
"findEntries",
"(",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
",",
"ZoneId",
"zoneId",
")",
"{",
"fireEvents",
"=",
"false",
";",
"Map",
"<",
"... | Queries the calendar for all entries within the time interval defined by
the start date and end date.
@param startDate the start of the time interval
@param endDate the end of the time interval
@param zoneId the time zone for which to find entries
@return a map filled with list of entries for given days | [
"Queries",
"the",
"calendar",
"for",
"all",
"entries",
"within",
"the",
"time",
"interval",
"defined",
"by",
"the",
"start",
"date",
"and",
"end",
"date",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L270-L282 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.addEventHandler | public final void addEventHandler(EventHandler<CalendarEvent> l) {
if (l != null) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": adding event handler: " + l); //$NON-NLS-1$
}
eventHandlers.add(l);
}
} | java | public final void addEventHandler(EventHandler<CalendarEvent> l) {
if (l != null) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": adding event handler: " + l); //$NON-NLS-1$
}
eventHandlers.add(l);
}
} | [
"public",
"final",
"void",
"addEventHandler",
"(",
"EventHandler",
"<",
"CalendarEvent",
">",
"l",
")",
"{",
"if",
"(",
"l",
"!=",
"null",
")",
"{",
"if",
"(",
"MODEL",
".",
"isLoggable",
"(",
"FINER",
")",
")",
"{",
"MODEL",
".",
"finer",
"(",
"getN... | Adds an event handler for calendar events. Handlers will be called when
an entry gets added, removed, changes, etc.
@param l the event handler to add | [
"Adds",
"an",
"event",
"handler",
"for",
"calendar",
"events",
".",
"Handlers",
"will",
"be",
"called",
"when",
"an",
"entry",
"gets",
"added",
"removed",
"changes",
"etc",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L838-L845 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.removeEventHandler | public final void removeEventHandler(EventHandler<CalendarEvent> l) {
if (l != null) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": removing event handler: " + l); //$NON-NLS-1$
}
eventHandlers.remove(l);
}
} | java | public final void removeEventHandler(EventHandler<CalendarEvent> l) {
if (l != null) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": removing event handler: " + l); //$NON-NLS-1$
}
eventHandlers.remove(l);
}
} | [
"public",
"final",
"void",
"removeEventHandler",
"(",
"EventHandler",
"<",
"CalendarEvent",
">",
"l",
")",
"{",
"if",
"(",
"l",
"!=",
"null",
")",
"{",
"if",
"(",
"MODEL",
".",
"isLoggable",
"(",
"FINER",
")",
")",
"{",
"MODEL",
".",
"finer",
"(",
"g... | Removes an event handler from the calendar.
@param l the event handler to remove | [
"Removes",
"an",
"event",
"handler",
"from",
"the",
"calendar",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L852-L859 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.fireEvent | public final void fireEvent(CalendarEvent evt) {
if (fireEvents && !batchUpdates) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": fireing event: " + evt); //$NON-NLS-1$
}
requireNonNull(evt);
Event.fireEvent(this, evt);
}
} | java | public final void fireEvent(CalendarEvent evt) {
if (fireEvents && !batchUpdates) {
if (MODEL.isLoggable(FINER)) {
MODEL.finer(getName() + ": fireing event: " + evt); //$NON-NLS-1$
}
requireNonNull(evt);
Event.fireEvent(this, evt);
}
} | [
"public",
"final",
"void",
"fireEvent",
"(",
"CalendarEvent",
"evt",
")",
"{",
"if",
"(",
"fireEvents",
"&&",
"!",
"batchUpdates",
")",
"{",
"if",
"(",
"MODEL",
".",
"isLoggable",
"(",
"FINER",
")",
")",
"{",
"MODEL",
".",
"finer",
"(",
"getName",
"(",... | Fires the given calendar event to all event handlers currently registered
with this calendar.
@param evt the event to fire | [
"Fires",
"the",
"given",
"calendar",
"event",
"to",
"all",
"event",
"handlers",
"currently",
"registered",
"with",
"this",
"calendar",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L869-L878 | train |
dlemmermann/CalendarFX | CalendarFXGoogle/src/main/java/com/calendarfx/google/view/data/Slice.java | Slice.split | 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;
} | java | 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;
} | [
"public",
"static",
"List",
"<",
"Slice",
">",
"split",
"(",
"LocalDate",
"start",
",",
"LocalDate",
"end",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"start",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"end",
")",
";",
"Preconditions",
".",
... | Splits the given period into multiple slices of one month long.
@param start the start of the period.
@param end the end of the period.
@return The list of slices result of the splitting. | [
"Splits",
"the",
"given",
"period",
"into",
"multiple",
"slices",
"of",
"one",
"month",
"long",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXGoogle/src/main/java/com/calendarfx/google/view/data/Slice.java#L114-L131 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/IntervalTree.java | IntervalTree.contains | public final boolean contains(E entry) {
TreeEntry<E> e = getEntry(entry);
return e != null;
} | java | public final boolean contains(E entry) {
TreeEntry<E> e = getEntry(entry);
return e != null;
} | [
"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.
@param entry
the entry to check
@return true if the entry is a member of this tree | [
"Method",
"to",
"determine",
"if",
"the",
"interval",
"tree",
"contains",
"the",
"given",
"entry",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/IntervalTree.java#L109-L112 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/IntervalTree.java | IntervalTree.getEntry | 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;
} | java | 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;
} | [
"private",
"TreeEntry",
"<",
"E",
">",
"getEntry",
"(",
"Entry",
"<",
"?",
">",
"entry",
")",
"{",
"TreeEntry",
"<",
"E",
">",
"t",
"=",
"root",
";",
"while",
"(",
"t",
"!=",
"null",
")",
"{",
"int",
"cmp",
"=",
"compareLongs",
"(",
"getLow",
"("... | Method to find entry by period. Period start, period end and object key
are used to identify each entry.
@param entry the calendar entry
@return appropriate entry, or null if not found | [
"Method",
"to",
"find",
"entry",
"by",
"period",
".",
"Period",
"start",
"period",
"end",
"and",
"object",
"key",
"are",
"used",
"to",
"identify",
"each",
"entry",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/IntervalTree.java#L247-L266 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/impl/com/calendarfx/view/DeveloperConsoleSkin.java | DeveloperConsoleSkin.setDateControl | 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));
// listen to calendars
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);
} | java | 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));
// listen to calendars
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);
} | [
"private",
"void",
"setDateControl",
"(",
"DateControl",
"control",
")",
"{",
"requireNonNull",
"(",
"control",
")",
";",
"control",
".",
"addEventFilter",
"(",
"RequestEvent",
".",
"REQUEST",
",",
"evt",
"->",
"addEvent",
"(",
"evt",
",",
"LogEntryType",
".",... | Sets the control that will be "monitored" by the developer console.
@param control
the monitored control | [
"Sets",
"the",
"control",
"that",
"will",
"be",
"monitored",
"by",
"the",
"developer",
"console",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/impl/com/calendarfx/view/DeveloperConsoleSkin.java#L225-L262 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.setDayDateTimeFormatter | 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);
}
} | java | 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);
}
} | [
"public",
"void",
"setDayDateTimeFormatter",
"(",
"DateTimeFormatter",
"formatter",
")",
"{",
"if",
"(",
"getFormatterMap",
"(",
")",
".",
"get",
"(",
"ViewType",
".",
"DAY_VIEW",
")",
"==",
"null",
")",
"{",
"getFormatterMap",
"(",
")",
".",
"put",
"(",
"... | 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.
@param formatter
the DateTimeFormatter | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L242-L248 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.setWeekDateTimeFormatter | 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);
}
} | java | 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);
}
} | [
"public",
"void",
"setWeekDateTimeFormatter",
"(",
"DateTimeFormatter",
"formatter",
")",
"{",
"if",
"(",
"getFormatterMap",
"(",
")",
".",
"get",
"(",
"ViewType",
".",
"WEEK_VIEW",
")",
"==",
"null",
")",
"{",
"getFormatterMap",
"(",
")",
".",
"put",
"(",
... | 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.
@param formatter
the DateTimeFormatter | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L257-L263 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.setMonthDateTimeFormatter | 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);
}
} | java | 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);
}
} | [
"public",
"void",
"setMonthDateTimeFormatter",
"(",
"DateTimeFormatter",
"formatter",
")",
"{",
"if",
"(",
"getFormatterMap",
"(",
")",
".",
"get",
"(",
"ViewType",
".",
"MONTH_VIEW",
")",
"==",
"null",
")",
"{",
"getFormatterMap",
"(",
")",
".",
"put",
"(",... | 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.
@param formatter
the DateTimeFormatter | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L272-L278 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.removeDataBindings | 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());
} | java | 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());
} | [
"private",
"void",
"removeDataBindings",
"(",
")",
"{",
"Bindings",
".",
"unbindContent",
"(",
"detailedDayView",
".",
"getCalendarSources",
"(",
")",
",",
"getCalendarSources",
"(",
")",
")",
";",
"Bindings",
".",
"unbindContentBidirectional",
"(",
"detailedDayView... | Removes all bindings related with the calendar sources and visibility
map. | [
"Removes",
"all",
"bindings",
"related",
"with",
"the",
"calendar",
"sources",
"and",
"visibility",
"map",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L738-L754 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.createDetailedDayView | 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;
} | java | 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;
} | [
"private",
"DetailedDayView",
"createDetailedDayView",
"(",
")",
"{",
"DetailedDayView",
"newDetailedDayView",
"=",
"new",
"DetailedDayView",
"(",
")",
";",
"newDetailedDayView",
".",
"setShowScrollBar",
"(",
"false",
")",
";",
"newDetailedDayView",
".",
"setShowToday",... | Default configuration for Detailed Day view in the preview Pane.
@return | [
"Default",
"configuration",
"for",
"Detailed",
"Day",
"view",
"in",
"the",
"preview",
"Pane",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L772-L787 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.configureDetailedDayView | 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);
} | java | 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);
} | [
"protected",
"void",
"configureDetailedDayView",
"(",
"DetailedDayView",
"newDetailedDayView",
",",
"boolean",
"trimTimeBounds",
")",
"{",
"newDetailedDayView",
".",
"getDayView",
"(",
")",
".",
"setStartTime",
"(",
"LocalTime",
".",
"MIN",
")",
";",
"newDetailedDayVi... | The idea of this method is to be able to change the default configuration
of the detailed day view in the preview pane.
Especially being able to show all the hours in the the print view
@param newDetailedDayView
view.
@param trimTimeBounds
define if trim or not the hours in the day view | [
"The",
"idea",
"of",
"this",
"method",
"is",
"to",
"be",
"able",
"to",
"change",
"the",
"default",
"configuration",
"of",
"the",
"detailed",
"day",
"view",
"in",
"the",
"preview",
"pane",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L800-L810 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.createDetailedWeekView | 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;
} | java | 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;
} | [
"private",
"DetailedWeekView",
"createDetailedWeekView",
"(",
")",
"{",
"DetailedWeekView",
"newDetailedWeekView",
"=",
"new",
"DetailedWeekView",
"(",
")",
";",
"newDetailedWeekView",
".",
"setShowScrollBar",
"(",
"false",
")",
";",
"newDetailedWeekView",
".",
"layoutP... | Default configuration for Detailed Week view in the preview Pane.
@return | [
"Default",
"configuration",
"for",
"Detailed",
"Week",
"view",
"in",
"the",
"preview",
"Pane",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L817-L836 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.configureDetailedWeekView | protected void configureDetailedWeekView(
DetailedWeekView newDetailedWeekView, boolean trimTimeBounds) {
newDetailedWeekView.getWeekView().setShowToday(false);
newDetailedWeekView.getWeekView().setTrimTimeBounds(trimTimeBounds);
} | java | protected void configureDetailedWeekView(
DetailedWeekView newDetailedWeekView, boolean trimTimeBounds) {
newDetailedWeekView.getWeekView().setShowToday(false);
newDetailedWeekView.getWeekView().setTrimTimeBounds(trimTimeBounds);
} | [
"protected",
"void",
"configureDetailedWeekView",
"(",
"DetailedWeekView",
"newDetailedWeekView",
",",
"boolean",
"trimTimeBounds",
")",
"{",
"newDetailedWeekView",
".",
"getWeekView",
"(",
")",
".",
"setShowToday",
"(",
"false",
")",
";",
"newDetailedWeekView",
".",
... | The idea of this method is to be able to change the default configuration
of the detailed week view in the preview pane.
Especially being able to show all the hours in the the print view
@param newDetailedWeekView
view.
@param trimTimeBounds
define if trim or not the hours in the week view | [
"The",
"idea",
"of",
"this",
"method",
"is",
"to",
"be",
"able",
"to",
"change",
"the",
"default",
"configuration",
"of",
"the",
"detailed",
"week",
"view",
"in",
"the",
"preview",
"pane",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L849-L853 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java | PrintablePage.createMonthView | 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;
} | java | 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;
} | [
"protected",
"MonthView",
"createMonthView",
"(",
")",
"{",
"MonthView",
"newMonthView",
"=",
"new",
"MonthView",
"(",
")",
";",
"newMonthView",
".",
"setShowToday",
"(",
"false",
")",
";",
"newMonthView",
".",
"setShowCurrentWeek",
"(",
"false",
")",
";",
"ne... | Default configuration for Month view in the preview Pane.
@return | [
"Default",
"configuration",
"for",
"Month",
"view",
"in",
"the",
"preview",
"Pane",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/print/PrintablePage.java#L860-L872 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/view/popover/EntryHeaderView.java | EntryHeaderView.getCalendar | public final Calendar getCalendar() {
Calendar calendar = calendarSelector.getCalendar();
if (calendar == null) {
calendar = entry.getCalendar();
}
return calendar;
} | java | public final Calendar getCalendar() {
Calendar calendar = calendarSelector.getCalendar();
if (calendar == null) {
calendar = entry.getCalendar();
}
return calendar;
} | [
"public",
"final",
"Calendar",
"getCalendar",
"(",
")",
"{",
"Calendar",
"calendar",
"=",
"calendarSelector",
".",
"getCalendar",
"(",
")",
";",
"if",
"(",
"calendar",
"==",
"null",
")",
"{",
"calendar",
"=",
"entry",
".",
"getCalendar",
"(",
")",
";",
"... | Returns the currently selected calendar.
@return the selected calendar | [
"Returns",
"the",
"currently",
"selected",
"calendar",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/view/popover/EntryHeaderView.java#L119-L126 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.getStartZonedDateTime | public ZonedDateTime getStartZonedDateTime() {
if (zonedStartDateTime == null) {
zonedStartDateTime = ZonedDateTime.of(startDate, startTime, zoneId);
}
return zonedStartDateTime;
} | java | public ZonedDateTime getStartZonedDateTime() {
if (zonedStartDateTime == null) {
zonedStartDateTime = ZonedDateTime.of(startDate, startTime, zoneId);
}
return zonedStartDateTime;
} | [
"public",
"ZonedDateTime",
"getStartZonedDateTime",
"(",
")",
"{",
"if",
"(",
"zonedStartDateTime",
"==",
"null",
")",
"{",
"zonedStartDateTime",
"=",
"ZonedDateTime",
".",
"of",
"(",
"startDate",
",",
"startTime",
",",
"zoneId",
")",
";",
"}",
"return",
"zone... | A convenience method to retrieve a zoned date time based on the start
date, start time, and time zone id.
@return the zoned start time | [
"A",
"convenience",
"method",
"to",
"retrieve",
"a",
"zoned",
"date",
"time",
"based",
"on",
"the",
"start",
"date",
"start",
"time",
"and",
"time",
"zone",
"id",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L204-L210 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.getEndZonedDateTime | public ZonedDateTime getEndZonedDateTime() {
if (zonedEndDateTime == null) {
zonedEndDateTime = ZonedDateTime.of(endDate, endTime, zoneId);
}
return zonedEndDateTime;
} | java | public ZonedDateTime getEndZonedDateTime() {
if (zonedEndDateTime == null) {
zonedEndDateTime = ZonedDateTime.of(endDate, endTime, zoneId);
}
return zonedEndDateTime;
} | [
"public",
"ZonedDateTime",
"getEndZonedDateTime",
"(",
")",
"{",
"if",
"(",
"zonedEndDateTime",
"==",
"null",
")",
"{",
"zonedEndDateTime",
"=",
"ZonedDateTime",
".",
"of",
"(",
"endDate",
",",
"endTime",
",",
"zoneId",
")",
";",
"}",
"return",
"zonedEndDateTi... | A convenience method to retrieve a zoned date time based on the end date,
end time, and time zone id.
@return the zoned end time | [
"A",
"convenience",
"method",
"to",
"retrieve",
"a",
"zoned",
"date",
"time",
"based",
"on",
"the",
"end",
"date",
"end",
"time",
"and",
"time",
"zone",
"id",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L249-L255 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withTimes | public Interval withTimes(LocalTime startTime, LocalTime endTime) {
requireNonNull(startTime);
requireNonNull(endTime);
return new Interval(this.startDate, startTime, this.endDate, endTime, this.zoneId);
} | java | public Interval withTimes(LocalTime startTime, LocalTime endTime) {
requireNonNull(startTime);
requireNonNull(endTime);
return new Interval(this.startDate, startTime, this.endDate, endTime, this.zoneId);
} | [
"public",
"Interval",
"withTimes",
"(",
"LocalTime",
"startTime",
",",
"LocalTime",
"endTime",
")",
"{",
"requireNonNull",
"(",
"startTime",
")",
";",
"requireNonNull",
"(",
"endTime",
")",
";",
"return",
"new",
"Interval",
"(",
"this",
".",
"startDate",
",",
... | Returns a new interval based on this interval but with a different start
and end time.
@param startTime the new start time
@param endTime the new end time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"and",
"end",
"time",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L306-L310 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withStartDate | public Interval withStartDate(LocalDate date) {
requireNonNull(date);
return new Interval(date, startTime, endDate, endTime, zoneId);
} | java | public Interval withStartDate(LocalDate date) {
requireNonNull(date);
return new Interval(date, startTime, endDate, endTime, zoneId);
} | [
"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.
@param date the new start date
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"date",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L319-L322 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withEndDate | public Interval withEndDate(LocalDate date) {
requireNonNull(date);
return new Interval(startDate, startTime, date, endTime, zoneId);
} | java | public Interval withEndDate(LocalDate date) {
requireNonNull(date);
return new Interval(startDate, startTime, date, endTime, zoneId);
} | [
"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.
@param date the new end date
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"end",
"date",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L331-L334 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withStartTime | public Interval withStartTime(LocalTime time) {
requireNonNull(time);
return new Interval(startDate, time, endDate, endTime, zoneId);
} | java | public Interval withStartTime(LocalTime time) {
requireNonNull(time);
return new Interval(startDate, time, endDate, endTime, zoneId);
} | [
"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.
@param time the new start time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"time",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L343-L346 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withStartDateTime | public Interval withStartDateTime(LocalDateTime dateTime) {
requireNonNull(dateTime);
return new Interval(dateTime.toLocalDate(), dateTime.toLocalTime(), endDate, endTime);
} | java | public Interval withStartDateTime(LocalDateTime dateTime) {
requireNonNull(dateTime);
return new Interval(dateTime.toLocalDate(), dateTime.toLocalTime(), endDate, endTime);
} | [
"public",
"Interval",
"withStartDateTime",
"(",
"LocalDateTime",
"dateTime",
")",
"{",
"requireNonNull",
"(",
"dateTime",
")",
";",
"return",
"new",
"Interval",
"(",
"dateTime",
".",
"toLocalDate",
"(",
")",
",",
"dateTime",
".",
"toLocalTime",
"(",
")",
",",
... | Returns a new interval based on this interval but with a different start date
and time.
@param dateTime the new start date and time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"date",
"and",
"time",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L355-L358 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withEndTime | public Interval withEndTime(LocalTime time) {
requireNonNull(time);
return new Interval(startDate, startTime, endDate, time, zoneId);
} | java | public Interval withEndTime(LocalTime time) {
requireNonNull(time);
return new Interval(startDate, startTime, endDate, time, zoneId);
} | [
"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.
@param time the new end time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"end",
"time",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L367-L370 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withEndDateTime | public Interval withEndDateTime(LocalDateTime dateTime) {
requireNonNull(dateTime);
return new Interval(startDate, startTime, dateTime.toLocalDate(), dateTime.toLocalTime());
} | java | public Interval withEndDateTime(LocalDateTime dateTime) {
requireNonNull(dateTime);
return new Interval(startDate, startTime, dateTime.toLocalDate(), dateTime.toLocalTime());
} | [
"public",
"Interval",
"withEndDateTime",
"(",
"LocalDateTime",
"dateTime",
")",
"{",
"requireNonNull",
"(",
"dateTime",
")",
";",
"return",
"new",
"Interval",
"(",
"startDate",
",",
"startTime",
",",
"dateTime",
".",
"toLocalDate",
"(",
")",
",",
"dateTime",
"... | Returns a new interval based on this interval but with a different end
date and time.
@param dateTime the new end date and time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"end",
"date",
"and",
"time",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L379-L382 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withZoneId | public Interval withZoneId(ZoneId zone) {
requireNonNull(zone);
return new Interval(startDate, startTime, endDate, endTime, zone);
} | java | public Interval withZoneId(ZoneId zone) {
requireNonNull(zone);
return new Interval(startDate, startTime, endDate, endTime, zone);
} | [
"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.
@param zone the new time zone
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"time",
"zone",
"id",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L391-L394 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.getStartDateTime | public LocalDateTime getStartDateTime() {
if (startDateTime == null) {
startDateTime = LocalDateTime.of(getStartDate(), getStartTime());
}
return startDateTime;
} | java | public LocalDateTime getStartDateTime() {
if (startDateTime == null) {
startDateTime = LocalDateTime.of(getStartDate(), getStartTime());
}
return startDateTime;
} | [
"public",
"LocalDateTime",
"getStartDateTime",
"(",
")",
"{",
"if",
"(",
"startDateTime",
"==",
"null",
")",
"{",
"startDateTime",
"=",
"LocalDateTime",
".",
"of",
"(",
"getStartDate",
"(",
")",
",",
"getStartTime",
"(",
")",
")",
";",
"}",
"return",
"star... | 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.
@return the start local date time
@see #getStartDate()
@see #getStartTime() | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L404-L410 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.getEndDateTime | public LocalDateTime getEndDateTime() {
if (endDateTime == null) {
endDateTime = LocalDateTime.of(getEndDate(), getEndTime());
}
return endDateTime;
} | java | public LocalDateTime getEndDateTime() {
if (endDateTime == null) {
endDateTime = LocalDateTime.of(getEndDate(), getEndTime());
}
return endDateTime;
} | [
"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.
@return the end local date time
@see #getEndDate()
@see #getEndTime() | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L429-L435 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/util/Predicates.java | Predicates.not | public static <T> Predicate<T> not(Predicate<? super T> predicate) {
assert null != predicate;
return new NotPredicate<T>(predicate);
} | java | public static <T> Predicate<T> not(Predicate<? super T> predicate) {
assert null != predicate;
return new NotPredicate<T>(predicate);
} | [
"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. | [
"Returns",
"a",
"Predicate",
"that",
"evaluates",
"to",
"true",
"iff",
"the",
"given",
"Predicate",
"evaluates",
"to",
"false",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/util/Predicates.java#L53-L56 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/AbstractIcalObject.java | AbstractIcalObject.parse | 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);
}
// parse parameters
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);
}
// parse the content and individual attribute values
schema.applyObjectSchema(this.name, params, content, this);
} | java | 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);
}
// parse parameters
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);
}
// parse the content and individual attribute values
schema.applyObjectSchema(this.name, params, content, this);
} | [
"protected",
"void",
"parse",
"(",
"String",
"icalString",
",",
"IcalSchema",
"schema",
")",
"throws",
"ParseException",
"{",
"String",
"paramText",
";",
"String",
"content",
";",
"{",
"String",
"unfolded",
"=",
"IcalParseUtil",
".",
"unfoldIcal",
"(",
"icalStri... | parse the ical object from the given ical content using the given schema.
Modifies the current object in place.
@param schema rules for processing individual parameters and body content. | [
"parse",
"the",
"ical",
"object",
"from",
"the",
"given",
"ical",
"content",
"using",
"the",
"given",
"schema",
".",
"Modifies",
"the",
"current",
"object",
"in",
"place",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/AbstractIcalObject.java#L56-L97 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/values/AbstractIcalObject.java | AbstractIcalObject.getExtParams | public Map<String, String> getExtParams() {
if (null == extParams) {
extParams = new LinkedHashMap<String, String>();
}
return extParams;
} | java | public Map<String, String> getExtParams() {
if (null == extParams) {
extParams = new LinkedHashMap<String, String>();
}
return extParams;
} | [
"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. | [
"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... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/values/AbstractIcalObject.java#L113-L118 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/iter/RRuleIteratorImpl.java | RRuleIteratorImpl.next | public DateValue next() {
if (null == this.pendingUtc_) {
this.fetchNext();
}
DateValue next = this.pendingUtc_;
this.pendingUtc_ = null;
return next;
} | java | public DateValue next() {
if (null == this.pendingUtc_) {
this.fetchNext();
}
DateValue next = this.pendingUtc_;
this.pendingUtc_ = null;
return next;
} | [
"public",
"DateValue",
"next",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"this",
".",
"pendingUtc_",
")",
"{",
"this",
".",
"fetchNext",
"(",
")",
";",
"}",
"DateValue",
"next",
"=",
"this",
".",
"pendingUtc_",
";",
"this",
".",
"pendingUtc_",
"=",
"nu... | fetch and return the next date in this recurrence. | [
"fetch",
"and",
"return",
"the",
"next",
"date",
"in",
"this",
"recurrence",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/iter/RRuleIteratorImpl.java#L175-L182 | train |
dlemmermann/CalendarFX | CalendarFXRecurrence/src/main/java/com/google/ical/util/DTBuilder.java | DTBuilder.toDateTime | public DateTimeValue toDateTime() {
normalize();
return new DateTimeValueImpl(year, month, day, hour, minute, second);
} | java | public DateTimeValue toDateTime() {
normalize();
return new DateTimeValueImpl(year, month, day, hour, minute, second);
} | [
"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.
@return not null | [
"produces",
"a",
"normalized",
"date",
"time",
"using",
"zero",
"for",
"the",
"time",
"fields",
"if",
"none",
"were",
"provided",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXRecurrence/src/main/java/com/google/ical/util/DTBuilder.java#L83-L86 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.getProperties | 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")) { //$NON-NLS-1$
if (change.getValueAdded() != null) {
@SuppressWarnings("unchecked")
Entry<T> source = (Entry<T>) change.getValueAdded();
// lookup of property first to instantiate
recurrenceSourceProperty();
recurrenceSource.set(source);
}
} else if (change.getKey().equals("com.calendarfx.recurrence.id")) { //$NON-NLS-1$
if (change.getValueAdded() != null) {
setRecurrenceId((String) change.getValueAdded());
}
}
};
properties.addListener(changeListener);
}
return properties;
} | java | 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")) { //$NON-NLS-1$
if (change.getValueAdded() != null) {
@SuppressWarnings("unchecked")
Entry<T> source = (Entry<T>) change.getValueAdded();
// lookup of property first to instantiate
recurrenceSourceProperty();
recurrenceSource.set(source);
}
} else if (change.getKey().equals("com.calendarfx.recurrence.id")) { //$NON-NLS-1$
if (change.getValueAdded() != null) {
setRecurrenceId((String) change.getValueAdded());
}
}
};
properties.addListener(changeListener);
}
return properties;
} | [
"public",
"final",
"ObservableMap",
"<",
"Object",
",",
"Object",
">",
"getProperties",
"(",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"properties",
"=",
"FXCollections",
".",
"observableMap",
"(",
"new",
"HashMap",
"<>",
"(",
")",
")",
... | Returns an observable map of properties on this entry for use primarily
by application developers.
@return an observable map of properties on this entry for use primarily
by application developers | [
"Returns",
"an",
"observable",
"map",
"of",
"properties",
"on",
"this",
"entry",
"for",
"use",
"primarily",
"by",
"application",
"developers",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L160-L185 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.changeStartDate | 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 {
/*
* We might have a problem if the new start time is AFTER the current end time.
*/
if (newStartDateTime.isAfter(endDateTime)) {
interval = interval.withEndDateTime(newStartDateTime.plus(interval.getDuration()));
}
setInterval(interval.withStartDate(date));
}
} | java | 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 {
/*
* We might have a problem if the new start time is AFTER the current end time.
*/
if (newStartDateTime.isAfter(endDateTime)) {
interval = interval.withEndDateTime(newStartDateTime.plus(interval.getDuration()));
}
setInterval(interval.withStartDate(date));
}
} | [
"public",
"final",
"void",
"changeStartDate",
"(",
"LocalDate",
"date",
",",
"boolean",
"keepDuration",
")",
"{",
"requireNonNull",
"(",
"date",
")",
";",
"Interval",
"interval",
"=",
"getInterval",
"(",
")",
";",
"LocalDateTime",
"newStartDateTime",
"=",
"getSt... | Changes the start date of the entry interval.
@param date the new start date
@param keepDuration if true then this method will also change the end date and time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the {@link #minimumDurationProperty()}. | [
"Changes",
"the",
"start",
"date",
"of",
"the",
"entry",
"interval",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L397-L419 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.changeStartTime | 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 {
/*
* We might have a problem if the new start time is AFTER the current end time.
*/
if (newStartDateTime.isAfter(endDateTime.minus(getMinimumDuration()))) {
interval = interval.withEndDateTime(newStartDateTime.plus(getMinimumDuration()));
}
setInterval(interval.withStartTime(time));
}
} | java | 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 {
/*
* We might have a problem if the new start time is AFTER the current end time.
*/
if (newStartDateTime.isAfter(endDateTime.minus(getMinimumDuration()))) {
interval = interval.withEndDateTime(newStartDateTime.plus(getMinimumDuration()));
}
setInterval(interval.withStartTime(time));
}
} | [
"public",
"final",
"void",
"changeStartTime",
"(",
"LocalTime",
"time",
",",
"boolean",
"keepDuration",
")",
"{",
"requireNonNull",
"(",
"time",
")",
";",
"Interval",
"interval",
"=",
"getInterval",
"(",
")",
";",
"LocalDateTime",
"newStartDateTime",
"=",
"getSt... | Changes the start time of the entry interval.
@param time the new start time
@param keepDuration if true then this method will also change the end time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the {@link #minimumDurationProperty()}. | [
"Changes",
"the",
"start",
"time",
"of",
"the",
"entry",
"interval",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L441-L462 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.changeEndDate | 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 {
/*
* We might have a problem if the new end time is BEFORE the current start time.
*/
if (newEndDateTime.isBefore(startDateTime)) {
interval = interval.withStartDateTime(newEndDateTime.minus(interval.getDuration()));
}
setInterval(interval.withEndDate(date));
}
} | java | 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 {
/*
* We might have a problem if the new end time is BEFORE the current start time.
*/
if (newEndDateTime.isBefore(startDateTime)) {
interval = interval.withStartDateTime(newEndDateTime.minus(interval.getDuration()));
}
setInterval(interval.withEndDate(date));
}
} | [
"public",
"final",
"void",
"changeEndDate",
"(",
"LocalDate",
"date",
",",
"boolean",
"keepDuration",
")",
"{",
"requireNonNull",
"(",
"date",
")",
";",
"Interval",
"interval",
"=",
"getInterval",
"(",
")",
";",
"LocalDateTime",
"newEndDateTime",
"=",
"getEndAsL... | Changes the end date of the entry interval.
@param date the new end date
@param keepDuration if true then this method will also change the start date and time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the {@link #minimumDurationProperty()}. | [
"Changes",
"the",
"end",
"date",
"of",
"the",
"entry",
"interval",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L484-L505 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.changeEndTime | 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 {
/*
* We might have a problem if the new end time is BEFORE the current start time.
*/
if (newEndDateTime.isBefore(startDateTime.plus(getMinimumDuration()))) {
interval = interval.withStartDateTime(newEndDateTime.minus(getMinimumDuration()));
}
setInterval(interval.withEndTime(time));
}
} | java | 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 {
/*
* We might have a problem if the new end time is BEFORE the current start time.
*/
if (newEndDateTime.isBefore(startDateTime.plus(getMinimumDuration()))) {
interval = interval.withStartDateTime(newEndDateTime.minus(getMinimumDuration()));
}
setInterval(interval.withEndTime(time));
}
} | [
"public",
"final",
"void",
"changeEndTime",
"(",
"LocalTime",
"time",
",",
"boolean",
"keepDuration",
")",
"{",
"requireNonNull",
"(",
"time",
")",
";",
"Interval",
"interval",
"=",
"getInterval",
"(",
")",
";",
"LocalDateTime",
"newEndDateTime",
"=",
"getEndAsL... | Changes the end time of the entry interval.
@param time the new end time
@param keepDuration if true then this method will also change the start time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means that the start time will be before the end time and that the
duration of the entry will be at least the duration defined by the {@link #minimumDurationProperty()}. | [
"Changes",
"the",
"end",
"time",
"of",
"the",
"entry",
"interval",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L527-L548 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.isRecurring | public final boolean isRecurring() {
return recurrenceRule != null && !(recurrenceRule.get() == null) && !recurrenceRule.get().trim().equals(""); //$NON-NLS-1$
} | java | public final boolean isRecurring() {
return recurrenceRule != null && !(recurrenceRule.get() == null) && !recurrenceRule.get().trim().equals(""); //$NON-NLS-1$
} | [
"public",
"final",
"boolean",
"isRecurring",
"(",
")",
"{",
"return",
"recurrenceRule",
"!=",
"null",
"&&",
"!",
"(",
"recurrenceRule",
".",
"get",
"(",
")",
"==",
"null",
")",
"&&",
"!",
"recurrenceRule",
".",
"get",
"(",
")",
".",
"trim",
"(",
")",
... | Determines if the entry describes a recurring event.
@return true if the entry is recurring
@see #recurrenceRuleProperty() | [
"Determines",
"if",
"the",
"entry",
"describes",
"a",
"recurring",
"event",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L645-L647 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.recurrenceEndProperty | public final ReadOnlyObjectProperty<LocalDate> recurrenceEndProperty() {
if (recurrenceEnd == null) {
recurrenceEnd = new ReadOnlyObjectWrapper<>(this, "recurrenceEnd", _recurrenceEnd); //$NON-NLS-1$
}
return recurrenceEnd.getReadOnlyProperty();
} | java | public final ReadOnlyObjectProperty<LocalDate> recurrenceEndProperty() {
if (recurrenceEnd == null) {
recurrenceEnd = new ReadOnlyObjectWrapper<>(this, "recurrenceEnd", _recurrenceEnd); //$NON-NLS-1$
}
return recurrenceEnd.getReadOnlyProperty();
} | [
"public",
"final",
"ReadOnlyObjectProperty",
"<",
"LocalDate",
">",
"recurrenceEndProperty",
"(",
")",
"{",
"if",
"(",
"recurrenceEnd",
"==",
"null",
")",
"{",
"recurrenceEnd",
"=",
"new",
"ReadOnlyObjectWrapper",
"<>",
"(",
"this",
",",
"\"recurrenceEnd\"",
",",
... | The property used to store the end time of the recurrence rule.
@return the recurrence rule end time
@see #recurrenceRuleProperty() | [
"The",
"property",
"used",
"to",
"store",
"the",
"end",
"time",
"of",
"the",
"recurrence",
"rule",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L786-L792 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.setId | public final void setId(String id) {
requireNonNull(id);
if (MODEL.isLoggable(FINE)) {
MODEL.fine("setting id to " + id); //$NON-NLS-1$
}
this.id = id;
} | java | public final void setId(String id) {
requireNonNull(id);
if (MODEL.isLoggable(FINE)) {
MODEL.fine("setting id to " + id); //$NON-NLS-1$
}
this.id = id;
} | [
"public",
"final",
"void",
"setId",
"(",
"String",
"id",
")",
"{",
"requireNonNull",
"(",
"id",
")",
";",
"if",
"(",
"MODEL",
".",
"isLoggable",
"(",
"FINE",
")",
")",
"{",
"MODEL",
".",
"fine",
"(",
"\"setting id to \"",
"+",
"id",
")",
";",
"//$NON... | 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.
@param id the new ID of the entry | [
"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... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L820-L826 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.userObjectProperty | public final ObjectProperty<T> userObjectProperty() {
if (userObject == null) {
userObject = new SimpleObjectProperty<T>(this, "userObject") { //$NON-NLS-1$
@Override
public void set(T newObject) {
T oldUserObject = get();
// We do not use .equals() here to allow to reset the object even if is "looks" the same e.g. if it
// has some .equals() method implemented which just compares an id/business key.
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;
} | java | public final ObjectProperty<T> userObjectProperty() {
if (userObject == null) {
userObject = new SimpleObjectProperty<T>(this, "userObject") { //$NON-NLS-1$
@Override
public void set(T newObject) {
T oldUserObject = get();
// We do not use .equals() here to allow to reset the object even if is "looks" the same e.g. if it
// has some .equals() method implemented which just compares an id/business key.
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;
} | [
"public",
"final",
"ObjectProperty",
"<",
"T",
">",
"userObjectProperty",
"(",
")",
"{",
"if",
"(",
"userObject",
"==",
"null",
")",
"{",
"userObject",
"=",
"new",
"SimpleObjectProperty",
"<",
"T",
">",
"(",
"this",
",",
"\"userObject\"",
")",
"{",
"//$NON... | A property used to store a reference to an optional user object. The user
object is usually the reason why the entry was created.
@return the user object property | [
"A",
"property",
"used",
"to",
"store",
"a",
"reference",
"to",
"an",
"optional",
"user",
"object",
".",
"The",
"user",
"object",
"is",
"usually",
"the",
"reason",
"why",
"the",
"entry",
"was",
"created",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L918-L940 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.zoneIdProperty | public final ReadOnlyObjectProperty<ZoneId> zoneIdProperty() {
if (zoneId == null) {
zoneId = new ReadOnlyObjectWrapper<>(this, "zoneId", getInterval().getZoneId()); //$NON-NLS-1$
}
return zoneId.getReadOnlyProperty();
} | java | public final ReadOnlyObjectProperty<ZoneId> zoneIdProperty() {
if (zoneId == null) {
zoneId = new ReadOnlyObjectWrapper<>(this, "zoneId", getInterval().getZoneId()); //$NON-NLS-1$
}
return zoneId.getReadOnlyProperty();
} | [
"public",
"final",
"ReadOnlyObjectProperty",
"<",
"ZoneId",
">",
"zoneIdProperty",
"(",
")",
"{",
"if",
"(",
"zoneId",
"==",
"null",
")",
"{",
"zoneId",
"=",
"new",
"ReadOnlyObjectWrapper",
"<>",
"(",
"this",
",",
"\"zoneId\"",
",",
"getInterval",
"(",
")",
... | 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.
@return the time zone property | [
"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",
"."
] | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L976-L982 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.locationProperty | public final StringProperty locationProperty() {
if (location == null) {
location = new SimpleStringProperty(null, "location") { //$NON-NLS-1$
@Override
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;
} | java | public final StringProperty locationProperty() {
if (location == null) {
location = new SimpleStringProperty(null, "location") { //$NON-NLS-1$
@Override
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;
} | [
"public",
"final",
"StringProperty",
"locationProperty",
"(",
")",
"{",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"location",
"=",
"new",
"SimpleStringProperty",
"(",
"null",
",",
"\"location\"",
")",
"{",
"//$NON-NLS-1$",
"@",
"Override",
"public",
"void... | 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".
@return the location of the event specified by the entry | [
"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",
... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1062-L1083 | train |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.isShowing | public final boolean isShowing(LocalDate startDate, LocalDate endDate, ZoneId zoneId) {
return isShowing(this, startDate, endDate, zoneId);
} | java | public final boolean isShowing(LocalDate startDate, LocalDate endDate, ZoneId zoneId) {
return isShowing(this, startDate, endDate, zoneId);
} | [
"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.
@param startDate the start date of the search interval
@param endDate the end date of the search interval
@param zoneId the time zone
@return true if the entry or any of its recurrences is showing | [
"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",
"... | f2b91c2622c3f29d004485b6426b23b86c331f96 | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L1487-L1489 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/EdgeEffect.java | EdgeEffect.setSize | 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));
} | java | 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));
} | [
"public",
"void",
"setSize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"final",
"float",
"r",
"=",
"width",
"*",
"0.75f",
"/",
"SIN",
";",
"final",
"float",
"y",
"=",
"COS",
"*",
"r",
";",
"final",
"float",
"h",
"=",
"r",
"-",
"y",
"... | Set the size of this edge effect in pixels.
@param width Effect width in pixels
@param height Effect height in pixels | [
"Set",
"the",
"size",
"of",
"this",
"edge",
"effect",
"in",
"pixels",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/EdgeEffect.java#L87-L99 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/internal/Menu.java | Menu.createNewMenuItem | private MenuItem createNewMenuItem(int group, int id, int categoryOrder, int ordering,
CharSequence title, int defaultShowAsAction) {
return new MenuItem(group, id, categoryOrder, title);
} | java | private MenuItem createNewMenuItem(int group, int id, int categoryOrder, int ordering,
CharSequence title, int defaultShowAsAction) {
return new MenuItem(group, id, categoryOrder, title);
} | [
"private",
"MenuItem",
"createNewMenuItem",
"(",
"int",
"group",
",",
"int",
"id",
",",
"int",
"categoryOrder",
",",
"int",
"ordering",
",",
"CharSequence",
"title",
",",
"int",
"defaultShowAsAction",
")",
"{",
"return",
"new",
"MenuItem",
"(",
"group",
",",
... | Layoutlib overrides this method to return its custom implementation of MenuItem | [
"Layoutlib",
"overrides",
"this",
"method",
"to",
"return",
"its",
"custom",
"implementation",
"of",
"MenuItem"
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/internal/Menu.java#L258-L261 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/internal/Menu.java | Menu.getOrdering | 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);
} | java | 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);
} | [
"private",
"static",
"int",
"getOrdering",
"(",
"int",
"categoryOrder",
")",
"{",
"final",
"int",
"index",
"=",
"(",
"categoryOrder",
"&",
"CATEGORY_MASK",
")",
">>",
"CATEGORY_SHIFT",
";",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"sCategoryToOrder... | 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.
@param categoryOrder The category order for a particular item (if it has not been or/add with
a category, the default category is assumed).
@return An ordering integer that can be used to order this item across all the items (even
from other categories). | [
"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",
... | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/internal/Menu.java#L528-L536 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/CarbonResources.java | CarbonResources.createFromStream | public Drawable createFromStream(InputStream is, String srcName) {
return createFromResourceStream(null, is, srcName);
} | java | public Drawable createFromStream(InputStream is, String srcName) {
return createFromResourceStream(null, is, srcName);
} | [
"public",
"Drawable",
"createFromStream",
"(",
"InputStream",
"is",
",",
"String",
"srcName",
")",
"{",
"return",
"createFromResourceStream",
"(",
"null",
",",
"is",
",",
"srcName",
")",
";",
"}"
] | Create a drawable from an inputstream | [
"Create",
"a",
"drawable",
"from",
"an",
"inputstream"
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/CarbonResources.java#L91-L93 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/MaterialShapeDrawable.java | MaterialShapeDrawable.drawShape | 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);
}
} | java | 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);
}
} | [
"private",
"void",
"drawShape",
"(",
"Canvas",
"canvas",
",",
"Paint",
"paint",
",",
"Path",
"path",
",",
"ShapeAppearanceModel",
"shapeAppearanceModel",
",",
"RectF",
"bounds",
")",
"{",
"if",
"(",
"shapeAppearanceModel",
".",
"isRoundRect",
"(",
")",
")",
"{... | Draw the path or try to draw a round rect if possible. | [
"Draw",
"the",
"path",
"or",
"try",
"to",
"draw",
"a",
"round",
"rect",
"if",
"possible",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/MaterialShapeDrawable.java#L353-L365 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/MaterialShapeDrawable.java | MaterialShapeDrawable.drawCompatShadow | private void drawCompatShadow(Canvas canvas) {
// Draw the fake shadow for each of the corners and edges.
for (int index = 0; index < 4; index++) {
cornerShadowOperation[index].draw(shadowRenderer, drawableState.shadowCompatRadius, canvas);
edgeShadowOperation[index].draw(shadowRenderer, drawableState.shadowCompatRadius, canvas);
}
} | java | private void drawCompatShadow(Canvas canvas) {
// Draw the fake shadow for each of the corners and edges.
for (int index = 0; index < 4; index++) {
cornerShadowOperation[index].draw(shadowRenderer, drawableState.shadowCompatRadius, canvas);
edgeShadowOperation[index].draw(shadowRenderer, drawableState.shadowCompatRadius, canvas);
}
} | [
"private",
"void",
"drawCompatShadow",
"(",
"Canvas",
"canvas",
")",
"{",
"// Draw the fake shadow for each of the corners and edges.",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"4",
";",
"index",
"++",
")",
"{",
"cornerShadowOperation",
"[",
"index... | 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. | [
"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",
"e... | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/MaterialShapeDrawable.java#L378-L385 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/widget/CheckBox.java | CheckBox.setButtonDrawable | public void setButtonDrawable(Drawable d) {
if (drawable != d) {
if (drawable != null) {
drawable.setCallback(null);
unscheduleDrawable(drawable);
}
drawable = d;
if (d != null) {
d.setCallback(this);
//d.setLayoutDirection(getLayoutDirection());
if (d.isStateful()) {
d.setState(getDrawableState());
}
d.setVisible(getVisibility() == VISIBLE, false);
setMinHeight(d.getIntrinsicHeight());
updateButtonTint();
}
}
} | java | public void setButtonDrawable(Drawable d) {
if (drawable != d) {
if (drawable != null) {
drawable.setCallback(null);
unscheduleDrawable(drawable);
}
drawable = d;
if (d != null) {
d.setCallback(this);
//d.setLayoutDirection(getLayoutDirection());
if (d.isStateful()) {
d.setState(getDrawableState());
}
d.setVisible(getVisibility() == VISIBLE, false);
setMinHeight(d.getIntrinsicHeight());
updateButtonTint();
}
}
} | [
"public",
"void",
"setButtonDrawable",
"(",
"Drawable",
"d",
")",
"{",
"if",
"(",
"drawable",
"!=",
"d",
")",
"{",
"if",
"(",
"drawable",
"!=",
"null",
")",
"{",
"drawable",
".",
"setCallback",
"(",
"null",
")",
";",
"unscheduleDrawable",
"(",
"drawable"... | Set the button graphic to a given Drawable
@param d The Drawable to use as the button graphic | [
"Set",
"the",
"button",
"graphic",
"to",
"a",
"given",
"Drawable"
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/widget/CheckBox.java#L190-L210 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/animation/StateAnimator.java | StateAnimator.addState | public void addState(int[] specs, Animator animation, Animator.AnimatorListener listener) {
Tuple tuple = new Tuple(specs, animation, listener);
animation.addListener(mAnimationListener);
mTuples.add(tuple);
} | java | public void addState(int[] specs, Animator animation, Animator.AnimatorListener listener) {
Tuple tuple = new Tuple(specs, animation, listener);
animation.addListener(mAnimationListener);
mTuples.add(tuple);
} | [
"public",
"void",
"addState",
"(",
"int",
"[",
"]",
"specs",
",",
"Animator",
"animation",
",",
"Animator",
".",
"AnimatorListener",
"listener",
")",
"{",
"Tuple",
"tuple",
"=",
"new",
"Tuple",
"(",
"specs",
",",
"animation",
",",
"listener",
")",
";",
"... | 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.
@param specs drawable state specs to match against
@param animation The Animation to run when the specs match | [
"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",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/animation/StateAnimator.java#L55-L59 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/animation/StateAnimator.java | StateAnimator.setState | 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);
}
} | java | 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);
}
} | [
"public",
"void",
"setState",
"(",
"int",
"[",
"]",
"state",
")",
"{",
"Tuple",
"match",
"=",
"null",
";",
"final",
"int",
"count",
"=",
"mTuples",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
... | Called by View | [
"Called",
"by",
"View"
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/animation/StateAnimator.java#L105-L128 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java | LollipopDrawablesCompat.applyTheme | public static void applyTheme(Drawable d, Resources.Theme t) {
IMPL.applyTheme(d, t);
} | java | public static void applyTheme(Drawable d, Resources.Theme t) {
IMPL.applyTheme(d, t);
} | [
"public",
"static",
"void",
"applyTheme",
"(",
"Drawable",
"d",
",",
"Resources",
".",
"Theme",
"t",
")",
"{",
"IMPL",
".",
"applyTheme",
"(",
"d",
",",
"t",
")",
";",
"}"
] | Applies the specified theme to this Drawable and its children. | [
"Applies",
"the",
"specified",
"theme",
"to",
"this",
"Drawable",
"and",
"its",
"children",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/LollipopDrawablesCompat.java#L62-L64 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/internal/PercentLayoutHelper.java | PercentLayoutHelper.adjustChildren | 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);
}
}
}
}
} | java | 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);
}
}
}
}
} | [
"public",
"void",
"adjustChildren",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"if",
"(",
"Log",
".",
"isLoggable",
"(",
"TAG",
",",
"Log",
".",
"DEBUG",
")",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"adjustChildren: ... | Iterates over children and changes their width and height to one calculated from percentage
values.
@param widthMeasureSpec Width MeasureSpec of the parent ViewGroup.
@param heightMeasureSpec Height MeasureSpec of the parent ViewGroup. | [
"Iterates",
"over",
"children",
"and",
"changes",
"their",
"width",
"and",
"height",
"to",
"one",
"calculated",
"from",
"percentage",
"values",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/internal/PercentLayoutHelper.java#L59-L90 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleComponent.java | RippleComponent.enter | public final void enter(boolean fast) {
cancel();
mSoftwareAnimator = createSoftwareEnter(fast);
if (mSoftwareAnimator != null) {
mSoftwareAnimator.start();
}
} | java | public final void enter(boolean fast) {
cancel();
mSoftwareAnimator = createSoftwareEnter(fast);
if (mSoftwareAnimator != null) {
mSoftwareAnimator.start();
}
} | [
"public",
"final",
"void",
"enter",
"(",
"boolean",
"fast",
")",
"{",
"cancel",
"(",
")",
";",
"mSoftwareAnimator",
"=",
"createSoftwareEnter",
"(",
"fast",
")",
";",
"if",
"(",
"mSoftwareAnimator",
"!=",
"null",
")",
"{",
"mSoftwareAnimator",
".",
"start",
... | Starts a ripple enter animation.
@param fast whether the ripple should enter quickly | [
"Starts",
"a",
"ripple",
"enter",
"animation",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleComponent.java#L73-L81 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.lineTo | 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);
// The previous endX and endY is the starting point for this shadow operation.
addShadowCompatOperation(
shadowOperation,
ANGLE_UP + shadowOperation.getAngle(),
ANGLE_UP + shadowOperation.getAngle());
endX = x;
endY = y;
} | java | 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);
// The previous endX and endY is the starting point for this shadow operation.
addShadowCompatOperation(
shadowOperation,
ANGLE_UP + shadowOperation.getAngle(),
ANGLE_UP + shadowOperation.getAngle());
endX = x;
endY = y;
} | [
"public",
"void",
"lineTo",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"PathLineOperation",
"operation",
"=",
"new",
"PathLineOperation",
"(",
")",
";",
"operation",
".",
"x",
"=",
"x",
";",
"operation",
".",
"y",
"=",
"y",
";",
"operations",
".",... | Add a line to the ShapePath.
@param x the x to which the line should be drawn.
@param y the y to which the line should be drawn. | [
"Add",
"a",
"line",
"to",
"the",
"ShapePath",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L79-L95 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.quadToPoint | 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;
} | java | 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;
} | [
"public",
"void",
"quadToPoint",
"(",
"float",
"controlX",
",",
"float",
"controlY",
",",
"float",
"toX",
",",
"float",
"toY",
")",
"{",
"PathQuadOperation",
"operation",
"=",
"new",
"PathQuadOperation",
"(",
")",
";",
"operation",
".",
"controlX",
"=",
"con... | Add a quad to the ShapePath.
@param controlX the control point x of the arc.
@param controlY the control point y of the arc.
@param toX the end x of the arc.
@param toY the end y of the arc. | [
"Add",
"a",
"quad",
"to",
"the",
"ShapePath",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L105-L115 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.addArc | 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;
// Flip the startAngle and endAngle when drawing the shadow inside the bounds. They represent
// the angles from the center of the circle to the start or end of the arc, respectively. When
// the shadow is drawn inside the arc, it is going the opposite direction.
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));
} | java | 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;
// Flip the startAngle and endAngle when drawing the shadow inside the bounds. They represent
// the angles from the center of the circle to the start or end of the arc, respectively. When
// the shadow is drawn inside the arc, it is going the opposite direction.
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));
} | [
"public",
"void",
"addArc",
"(",
"float",
"left",
",",
"float",
"top",
",",
"float",
"right",
",",
"float",
"bottom",
",",
"float",
"startAngle",
",",
"float",
"sweepAngle",
")",
"{",
"PathArcOperation",
"operation",
"=",
"new",
"PathArcOperation",
"(",
"lef... | Add an arc to the ShapePath.
@param left the X coordinate of the left side of the rectangle containing the arc
oval.
@param top the Y coordinate of the top of the rectangle containing the arc oval.
@param right the X coordinate of the right side of the rectangle containing the arc
oval.
@param bottom the Y coordinate of the bottom of the rectangle containing the arc oval.
@param startAngle start angle of the arc.
@param sweepAngle sweep angle of the arc. | [
"Add",
"an",
"arc",
"to",
"the",
"ShapePath",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L129-L151 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShapePath.java | ShapePath.createShadowCompatOperation | ShadowCompatOperation createShadowCompatOperation(final Matrix transform) {
// If the shadowCompatOperations don't end on the desired endShadowAngle, add an arc to do so.
addConnectingShadowIfNecessary(endShadowAngle);
final List<ShadowCompatOperation> operations = new ArrayList<>(shadowCompatOperations);
return new ShadowCompatOperation() {
@Override
public void draw(
Matrix matrix, ShadowRenderer shadowRenderer, int shadowElevation, Canvas canvas) {
for (ShadowCompatOperation op : operations) {
op.draw(transform, shadowRenderer, shadowElevation, canvas);
}
}
};
} | java | ShadowCompatOperation createShadowCompatOperation(final Matrix transform) {
// If the shadowCompatOperations don't end on the desired endShadowAngle, add an arc to do so.
addConnectingShadowIfNecessary(endShadowAngle);
final List<ShadowCompatOperation> operations = new ArrayList<>(shadowCompatOperations);
return new ShadowCompatOperation() {
@Override
public void draw(
Matrix matrix, ShadowRenderer shadowRenderer, int shadowElevation, Canvas canvas) {
for (ShadowCompatOperation op : operations) {
op.draw(transform, shadowRenderer, shadowElevation, canvas);
}
}
};
} | [
"ShadowCompatOperation",
"createShadowCompatOperation",
"(",
"final",
"Matrix",
"transform",
")",
"{",
"// If the shadowCompatOperations don't end on the desired endShadowAngle, add an arc to do so.",
"addConnectingShadowIfNecessary",
"(",
"endShadowAngle",
")",
";",
"final",
"List",
... | Creates a ShadowCompatOperation to draw compatibility shadow under the matrix transform for
the whole path defined by this ShapePath. | [
"Creates",
"a",
"ShadowCompatOperation",
"to",
"draw",
"compatibility",
"shadow",
"under",
"the",
"matrix",
"transform",
"for",
"the",
"whole",
"path",
"defined",
"by",
"this",
"ShapePath",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShapePath.java#L170-L183 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.setTargetDensity | private void setTargetDensity(DisplayMetrics metrics) {
if (mDensity != metrics.density) {
mDensity = metrics.density;
invalidateSelf(false);
}
} | java | private void setTargetDensity(DisplayMetrics metrics) {
if (mDensity != metrics.density) {
mDensity = metrics.density;
invalidateSelf(false);
}
} | [
"private",
"void",
"setTargetDensity",
"(",
"DisplayMetrics",
"metrics",
")",
"{",
"if",
"(",
"mDensity",
"!=",
"metrics",
".",
"density",
")",
"{",
"mDensity",
"=",
"metrics",
".",
"density",
";",
"invalidateSelf",
"(",
"false",
")",
";",
"}",
"}"
] | Set the density at which this drawable will be rendered.
@param metrics The display metrics for this drawable. | [
"Set",
"the",
"density",
"at",
"which",
"this",
"drawable",
"will",
"be",
"rendered",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L491-L496 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.tryBackgroundEnter | private void tryBackgroundEnter(boolean focused) {
if (mBackground == null) {
mBackground = new RippleBackground(this, mHotspotBounds);
}
mBackground.setup(mState.mMaxRadius, mDensity);
mBackground.enter(focused);
} | java | private void tryBackgroundEnter(boolean focused) {
if (mBackground == null) {
mBackground = new RippleBackground(this, mHotspotBounds);
}
mBackground.setup(mState.mMaxRadius, mDensity);
mBackground.enter(focused);
} | [
"private",
"void",
"tryBackgroundEnter",
"(",
"boolean",
"focused",
")",
"{",
"if",
"(",
"mBackground",
"==",
"null",
")",
"{",
"mBackground",
"=",
"new",
"RippleBackground",
"(",
"this",
",",
"mHotspotBounds",
")",
";",
"}",
"mBackground",
".",
"setup",
"("... | Creates an active hotspot at the specified location. | [
"Creates",
"an",
"active",
"hotspot",
"at",
"the",
"specified",
"location",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L547-L554 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.tryRippleEnter | private void tryRippleEnter() {
if (mExitingRipplesCount >= MAX_RIPPLES) {
// This should never happen unless the user is tapping like a maniac
// or there is a bug that's preventing ripples from being removed.
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);
} | java | private void tryRippleEnter() {
if (mExitingRipplesCount >= MAX_RIPPLES) {
// This should never happen unless the user is tapping like a maniac
// or there is a bug that's preventing ripples from being removed.
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);
} | [
"private",
"void",
"tryRippleEnter",
"(",
")",
"{",
"if",
"(",
"mExitingRipplesCount",
">=",
"MAX_RIPPLES",
")",
"{",
"// This should never happen unless the user is tapping like a maniac",
"// or there is a bug that's preventing ripples from being removed.",
"return",
";",
"}",
... | Attempts to start an enter animation for the active hotspot. Fails if there are too many
animating ripples. | [
"Attempts",
"to",
"start",
"an",
"enter",
"animation",
"for",
"the",
"active",
"hotspot",
".",
"Fails",
"if",
"there",
"are",
"too",
"many",
"animating",
"ripples",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L567-L592 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.tryRippleExit | private void tryRippleExit() {
if (mRipple != null) {
if (mExitingRipples == null) {
mExitingRipples = new RippleForeground[MAX_RIPPLES];
}
mExitingRipples[mExitingRipplesCount++] = mRipple;
mRipple.exit();
mRipple = null;
}
} | java | private void tryRippleExit() {
if (mRipple != null) {
if (mExitingRipples == null) {
mExitingRipples = new RippleForeground[MAX_RIPPLES];
}
mExitingRipples[mExitingRipplesCount++] = mRipple;
mRipple.exit();
mRipple = null;
}
} | [
"private",
"void",
"tryRippleExit",
"(",
")",
"{",
"if",
"(",
"mRipple",
"!=",
"null",
")",
"{",
"if",
"(",
"mExitingRipples",
"==",
"null",
")",
"{",
"mExitingRipples",
"=",
"new",
"RippleForeground",
"[",
"MAX_RIPPLES",
"]",
";",
"}",
"mExitingRipples",
... | Attempts to start an exit animation for the active hotspot. Fails if there is no active
hotspot. | [
"Attempts",
"to",
"start",
"an",
"exit",
"animation",
"for",
"the",
"active",
"hotspot",
".",
"Fails",
"if",
"there",
"is",
"no",
"active",
"hotspot",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L598-L607 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.clearHotspots | private void clearHotspots() {
if (mRipple != null) {
mRipple.end();
mRipple = null;
mRippleActive = false;
}
if (mBackground != null) {
mBackground.end();
mBackground = null;
mBackgroundActive = false;
}
cancelExitingRipples();
} | java | private void clearHotspots() {
if (mRipple != null) {
mRipple.end();
mRipple = null;
mRippleActive = false;
}
if (mBackground != null) {
mBackground.end();
mBackground = null;
mBackgroundActive = false;
}
cancelExitingRipples();
} | [
"private",
"void",
"clearHotspots",
"(",
")",
"{",
"if",
"(",
"mRipple",
"!=",
"null",
")",
"{",
"mRipple",
".",
"end",
"(",
")",
";",
"mRipple",
"=",
"null",
";",
"mRippleActive",
"=",
"false",
";",
"}",
"if",
"(",
"mBackground",
"!=",
"null",
")",
... | Cancels and removes the active ripple, all exiting ripples, and the background. Nothing will
be drawn after this method is called. | [
"Cancels",
"and",
"removes",
"the",
"active",
"ripple",
"all",
"exiting",
"ripples",
"and",
"the",
"background",
".",
"Nothing",
"will",
"be",
"drawn",
"after",
"this",
"method",
"is",
"called",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L613-L627 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java | RippleDrawableICS.onHotspotBoundsChanged | 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();
}
} | java | 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();
}
} | [
"private",
"void",
"onHotspotBoundsChanged",
"(",
")",
"{",
"final",
"int",
"count",
"=",
"mExitingRipplesCount",
";",
"final",
"RippleForeground",
"[",
"]",
"ripples",
"=",
"mExitingRipples",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
... | Notifies all the animating ripples that the hotspot bounds have changed. | [
"Notifies",
"all",
"the",
"animating",
"ripples",
"that",
"the",
"hotspot",
"bounds",
"have",
"changed",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/drawable/ripple/RippleDrawableICS.java#L645-L659 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShadowRenderer.java | ShadowRenderer.drawEdgeShadow | 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();
} | java | 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();
} | [
"public",
"void",
"drawEdgeShadow",
"(",
"Canvas",
"canvas",
",",
"Matrix",
"transform",
",",
"RectF",
"bounds",
",",
"int",
"elevation",
")",
"{",
"bounds",
".",
"bottom",
"+=",
"elevation",
";",
"bounds",
".",
"offset",
"(",
"0",
",",
"-",
"elevation",
... | Draws an edge shadow on the canvas in the current bounds with the matrix transform applied. | [
"Draws",
"an",
"edge",
"shadow",
"on",
"the",
"canvas",
"in",
"the",
"current",
"bounds",
"with",
"the",
"matrix",
"transform",
"applied",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShadowRenderer.java#L100-L122 | train |
ZieIony/Carbon | carbon/src/main/java/carbon/shadow/ShadowRenderer.java | ShadowRenderer.drawCornerShadow | public void drawCornerShadow(
Canvas canvas,
Matrix matrix,
RectF bounds,
int elevation,
float startAngle,
float sweepAngle) {
Path arcBounds = scratch;
// Calculate the arc bounds to prevent drawing shadow in the same part of the arc.
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));
// TODO: handle oval bounds by scaling the canvas.
canvas.save();
canvas.concat(matrix);
cornerShadowPaint.setStyle(Paint.Style.STROKE);
cornerShadowPaint.setStrokeWidth(elevation * 2);
canvas.drawArc(bounds, startAngle, sweepAngle, false, cornerShadowPaint);
canvas.restore();
} | java | public void drawCornerShadow(
Canvas canvas,
Matrix matrix,
RectF bounds,
int elevation,
float startAngle,
float sweepAngle) {
Path arcBounds = scratch;
// Calculate the arc bounds to prevent drawing shadow in the same part of the arc.
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));
// TODO: handle oval bounds by scaling the canvas.
canvas.save();
canvas.concat(matrix);
cornerShadowPaint.setStyle(Paint.Style.STROKE);
cornerShadowPaint.setStrokeWidth(elevation * 2);
canvas.drawArc(bounds, startAngle, sweepAngle, false, cornerShadowPaint);
canvas.restore();
} | [
"public",
"void",
"drawCornerShadow",
"(",
"Canvas",
"canvas",
",",
"Matrix",
"matrix",
",",
"RectF",
"bounds",
",",
"int",
"elevation",
",",
"float",
"startAngle",
",",
"float",
"sweepAngle",
")",
"{",
"Path",
"arcBounds",
"=",
"scratch",
";",
"// Calculate t... | Draws a corner shadow on the canvas in the current bounds with the matrix transform applied. | [
"Draws",
"a",
"corner",
"shadow",
"on",
"the",
"canvas",
"in",
"the",
"current",
"bounds",
"with",
"the",
"matrix",
"transform",
"applied",
"."
] | 78b0a432bd49edc7a6a13ce111cab274085d1693 | https://github.com/ZieIony/Carbon/blob/78b0a432bd49edc7a6a13ce111cab274085d1693/carbon/src/main/java/carbon/shadow/ShadowRenderer.java#L127-L171 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.