use of com.kyj.fx.voeditor.visual.framework.model.GagoyleDate in project Gargoyle by callakrsos.
the class DateUtil method getPeriodDays.
/**
* year의 month에 해당하는 일자 목록을 리턴받는다.
*
* @작성자 : KYJ
* @작성일 : 2016. 2. 19.
* @param year
* @param month
* @return
*/
public static List<GagoyleDate> getPeriodDays(int year, int month) {
GregorianCalendar today = new GregorianCalendar(year, month, 0);
int maxday = today.getActualMaximum((GregorianCalendar.DAY_OF_MONTH));
TimeZone timeZone = today.getTimeZone();
List<GagoyleDate> dateList = new ArrayList<>();
for (int i = 1; i <= maxday; i++) dateList.add(new GagoyleDate(timeZone, year, month, i));
return dateList;
}
use of com.kyj.fx.voeditor.visual.framework.model.GagoyleDate in project Gargoyle by callakrsos.
the class DateUtil method getLastDateByWeek.
public static GagoyleDate getLastDateByWeek(int year, int week) {
Calendar instance = GregorianCalendar.getInstance();
instance.setWeekDate(year, week, Calendar.SUNDAY);
TimeZone timeZone = instance.getTimeZone();
return new GagoyleDate(timeZone, instance.get(GregorianCalendar.YEAR), instance.get(GregorianCalendar.MONTH), instance.get(GregorianCalendar.DAY_OF_MONTH) + 6);
}
use of com.kyj.fx.voeditor.visual.framework.model.GagoyleDate in project Gargoyle by callakrsos.
the class DateUtil method getFirstDateByWeek.
/**
* 첫번째 주차 날짜정보 리턴.
*
* @작성자 : KYJ
* @작성일 : 2016. 7. 14.
* @param year
* @param week
* @return
*/
public static GagoyleDate getFirstDateByWeek(int year, int week) {
Calendar instance = GregorianCalendar.getInstance();
instance.setWeekDate(year, week, Calendar.SUNDAY);
TimeZone timeZone = instance.getTimeZone();
return new GagoyleDate(timeZone, instance.get(GregorianCalendar.YEAR), instance.get(GregorianCalendar.MONTH), instance.get(GregorianCalendar.DAY_OF_MONTH));
}
use of com.kyj.fx.voeditor.visual.framework.model.GagoyleDate in project Gargoyle by callakrsos.
the class SVNHistoryWalkTest method historyWalkAnalysisGroupingTest.
@Test
public void historyWalkAnalysisGroupingTest() throws SVNException {
List<GagoyleDate> periodDaysByWeek = DateUtil.getPeriodDaysByWeek();
GagoyleDate start = periodDaysByWeek.get(0);
GagoyleDate end = periodDaysByWeek.get(periodDaysByWeek.size() - 1);
Calendar instance = Calendar.getInstance();
instance.set(2016, 6, 1);
Date time = instance.getTime();
long startRevision = localServerManager2.getRevision(/*start.toDate()*/
time);
long endRevision = localServerManager2.getRevision(end.toDate());
System.out.println("start " + start.toDateString() + " end : " + end.toDateString());
System.out.println("startRevision " + startRevision + " endRevision : " + endRevision);
Collection<SVNLogEntry> allLogs = localServerManager2.getAllLogs(startRevision, endRevision);
// allLogs.
SimpleDateFormat format = new SimpleDateFormat(DateUtil.SYSTEM_DATEFORMAT_YYYY_MM_DD);
TreeMap<String, Long> collect = allLogs.stream().collect(Collectors.groupingBy(v -> format.format(v.getDate()), TreeMap::new, Collectors.mapping(v -> 1, Collectors.counting())));
// Map<String, Long> collect = allLogs.stream()
// .collect(Collectors.groupingBy(v -> format.format(v.getDate()), Collectors.mapping(v -> 1, Collectors.counting())));
System.out.println(collect);
}
use of com.kyj.fx.voeditor.visual.framework.model.GagoyleDate in project Gargoyle by callakrsos.
the class ScmCommitComposite method scmHistoryWalk.
private void scmHistoryWalk() throws SVNException {
List<GagoyleDate> periodDaysByWeek = DateUtil.getPeriodDaysByWeek(supplier.getWeekSize());
Collection<SVNLogEntry> allLogs = supplier.getAllLogs();
// supplier.createStream(allLogs);
TreeMap<String, Long> dayOfMonths = allLogs.stream().collect(Collectors.groupingBy(v -> FxSVNHistoryDataSupplier.YYYYMMDD_EEE_PATTERN.format(v.getDate()), () -> new TreeMap<>(), Collectors.counting()));
Map<String, Long> dayOfWeeks = new LinkedHashMap<>();
//초기값 세팅. [중요한건 정렬순서를 유지해아하므로. 초기값을 넣어준것.]
for (GagoyleDate d : DateUtil.getPeriodDaysByWeek()) {
String eee = FxSVNHistoryDataSupplier.EEE_PATTERN.format(d.toDate());
dayOfWeeks.put(eee, new Long(0));
}
//실제값 add
dayOfWeeks.putAll(allLogs.stream().collect(Collectors.groupingBy(v -> FxSVNHistoryDataSupplier.EEE_PATTERN.format(v.getDate()), Collectors.counting())));
{
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
ObservableList<Data<String, Long>> convert = convert(FxSVNHistoryDataSupplier.YYYYMMDD_EEE_PATTERN, periodDaysByWeek, dayOfMonths, true);
Series<String, Long> series = new Series<>(SERIES_LABEL, convert);
barChartDayOfMonth.getData().add(series);
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
ObservableList<Data<String, Long>> convert = convert(FxSVNHistoryDataSupplier.EEE_PATTERN, DateUtil.getPeriodDaysByWeek(), dayOfWeeks, false);
Series<String, Long> series = new Series<>(SERIES_LABEL, convert);
lineChartDayOfWeek.getData().add(series);
}
}
Aggregations