Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into #1866_ColoredBookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Oct 20, 2023
2 parents 9991e5c + 501aa0a commit d098c5a
Show file tree
Hide file tree
Showing 31 changed files with 1,696 additions and 825 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ TimeLineGraph.donotBreak=Do not split chart
TimeLineGraph.breakByBookmark=Split chart by bookmark
TimeLineGraph.breakByMetadata=Split chart by metadata
TimeLineGraph.breakByCategory=Split chart by category
TimeLineGraph.checkingItemsProgressLabel=Checking items from time chart...
TimeLineGraph.highlightingItemsProgressLabel=Highlighting items from time chart...
TimeLineGraph.PeriodGranularity=Time Scale
TimeLineGraph.Timezone=Time Zone
Expand All @@ -383,6 +384,10 @@ TimeLineGraph.visibleZoominForGranularity=Max zoom in reached for the scale %s.\
TimeLineGraph.visibleZoomoutForGranularity=Max zoom out reached for the scale %s.\n Would you like to change the scale to %s and continue to zoom out?
TimeLineGraph.syncTableSelectionInChartView=Show table highlights in time chart
TimeLineGraph.resetZoom=Reset Zoom
TimeLineGraph.selectAllEventTypes=Select all event types
TimeLineGraph.unselectAllEventTypes=Unselect all event types
TimeLineGraph.checkEventItems=Check corresponding event type items
TimeLineGraph.uncheckEventItems=Uncheck corresponding event type items
IntervalDefinitionDialog.Title=Time line chart defined ranges
IntervalDefinitionDialog.dateFormat=MM/dd/yyyy
IntervalDefinitionDialog.hourFormat=HH:mm:ss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ TimeLineGraph.donotBreak=Chart nicht aufteilen
TimeLineGraph.breakByBookmark=Chart nach Lesezeichen aufteilen
TimeLineGraph.breakByMetadata=Chart nach Metadaten aufteilen
TimeLineGraph.breakByCategory=Chart nach Kategorie aufteilen
TimeLineGraph.checkingItemsProgressLabel=Checking items from time chart...[TBT]
TimeLineGraph.highlightingItemsProgressLabel=Elemente vom Zeit-Chart hervorheben...
TimeLineGraph.PeriodGranularity=Zeitskala
TimeLineGraph.Timezone=Zeitzone
Expand All @@ -383,6 +384,10 @@ TimeLineGraph.visibleZoominForGranularity=Maximale Vergrößerung für den Maßs
TimeLineGraph.visibleZoomoutForGranularity=Maximale Verkleinerung für die Skala %s erreicht.\n Möchten Sie die Skala auf %s ändern und mit der Verkleinerung fortfahren?
TimeLineGraph.syncTableSelectionInChartView=Tabellenauswahl im Zeitdiagramm anzeigen
TimeLineGraph.resetZoom=Zoom zurücksetzen
TimeLineGraph.selectAllEventTypes=Select all event types(TBT)
TimeLineGraph.unselectAllEventTypes=Unselect all event types(TBT)
TimeLineGraph.checkEventItems=Check corresponding event type items(TBT)
TimeLineGraph.uncheckEventItems=Uncheck corresponding event type items(TBT)
IntervalDefinitionDialog.Title=Zeitlininechart festgelegte Bereiche
IntervalDefinitionDialog.dateFormat=MM/dd/yyyy
IntervalDefinitionDialog.hourFormat=HH:mm:ss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ TimeLineGraph.donotBreak=No dividir gráfico
TimeLineGraph.breakByBookmark=Dividir gráfico por marcador
TimeLineGraph.breakByMetadata=Dividir gráfico por metadatos
TimeLineGraph.breakByCategory=Dividir gráfico por categoría
TimeLineGraph.checkingItemsProgressLabel=Checking items from time chart...[TBT]
TimeLineGraph.highlightingItemsProgressLabel=Resaltar elementos del gráfico de tiempos...
TimeLineGraph.PeriodGranularity=Escala de tiempo
TimeLineGraph.Timezone=Zona horaria
Expand All @@ -383,6 +384,10 @@ TimeLineGraph.visibleZoominForGranularity=Se ha alcanzado el zoom máximo para l
TimeLineGraph.visibleZoomoutForGranularity=Máximo zoom out alcanzado para la escala %s.\n ¿Desea cambiar la escala a %s y seguir reduciendo?
TimeLineGraph.syncTableSelectionInChartView=Mostrar lo más destacado de la tabla en el gráfico temporal
TimeLineGraph.resetZoom=Restablecer zoom
TimeLineGraph.selectAllEventTypes=Select all event types(TBT)
TimeLineGraph.unselectAllEventTypes=Unselect all event types(TBT)
TimeLineGraph.checkEventItems=Check corresponding event type items(TBT)
TimeLineGraph.uncheckEventItems=Uncheck corresponding event type items(TBT)
IntervalDefinitionDialog.Title=Rangos definidos en el gráfico de tiempo
IntervalDefinitionDialog.dateFormat=MM/dd/yyyy
IntervalDefinitionDialog.hourFormat=HH:mm:ss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ TimeLineGraph.donotBreak=Non dividere il grafico
TimeLineGraph.breakByBookmark=Dividi grafico per segnalibro
TimeLineGraph.breakByMetadata=Dividi grafico per metadati
TimeLineGraph.breakByCategory=Dividi grafico per categoria
TimeLineGraph.checkingItemsProgressLabel=Checking items from time chart...[TBT]
TimeLineGraph.highlightingItemsProgressLabel=Evidenzio gli elementi del grafico temporale...
TimeLineGraph.PeriodGranularity=Scala temporale
TimeLineGraph.Timezone=Fuso orario
Expand All @@ -383,6 +384,10 @@ TimeLineGraph.visibleZoominForGranularity=Zoom massimo raggiunto per la scala %s
TimeLineGraph.visibleZoomoutForGranularity=Zoom minimo raggiunto per la scala %s.\n Si desidera cambiare la scala in %s e continuare a rimpicciolire?
TimeLineGraph.syncTableSelectionInChartView=Mostra i punti salienti della tabella nel grafico temporale
TimeLineGraph.resetZoom=Reimposta Zoom
TimeLineGraph.selectAllEventTypes=Select all event types(TBT)
TimeLineGraph.unselectAllEventTypes=Unselect all event types(TBT)
TimeLineGraph.checkEventItems=Check corresponding event type items(TBT)
TimeLineGraph.uncheckEventItems=Uncheck corresponding event type items(TBT)
IntervalDefinitionDialog.Title=Grafico sequenza temporale con intervalli definiti
IntervalDefinitionDialog.dateFormat=dd/MM/yyyy
IntervalDefinitionDialog.hourFormat=HH:mm:ss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ TimeLineGraph.donotBreak=Não separar gráfico
TimeLineGraph.breakByBookmark=Separar gráfico por marcador
TimeLineGraph.breakByMetadata=Separar gráfico por metadado
TimeLineGraph.breakByCategory=Separar gráfico por categoria
TimeLineGraph.checkingItemsProgressLabel=Marcando itens do timeline...
TimeLineGraph.highlightingItemsProgressLabel=Destacando itens do timeline...
TimeLineGraph.PeriodGranularity=Granularidade da periodicidade
TimeLineGraph.Timezone=Time Zone
Expand All @@ -383,6 +384,10 @@ TimeLineGraph.visibleZoominForGranularity=Máximo zoom alcançado para a contabi
TimeLineGraph.visibleZoomoutForGranularity=Máximo intervalo de visualização alcançado para a contabilização por %s.\n Gostaria de mudar para contabilização por %s e continuar a operação de zoom out?
TimeLineGraph.syncTableSelectionInChartView=Sincroniza destacamento no gráfico de linha do tempo
TimeLineGraph.resetZoom=Resetar Zoom
TimeLineGraph.selectAllEventTypes=Selecionar todos os eventos
TimeLineGraph.unselectAllEventTypes=Deselecionar todos os eventos
TimeLineGraph.checkEventItems=Marcar os itens dos eventos selecionados
TimeLineGraph.uncheckEventItems=Desmarcar os itens dos eventos selecionados
IntervalDefinitionDialog.Title=Intervalos definidos no gráfico
IntervalDefinitionDialog.dateFormat=MM/dd/yyyy
IntervalDefinitionDialog.hourFormat=HH:mm:ss
Expand Down
107 changes: 106 additions & 1 deletion iped-app/src/main/java/iped/app/timelinegraph/DateUtil.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
package iped.app.timelinegraph;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

import org.jfree.data.time.Day;
import org.jfree.data.time.FixedMillisecond;
import org.jfree.data.time.Hour;
import org.jfree.data.time.Millisecond;
import org.jfree.data.time.Month;
import org.jfree.data.time.Quarter;
import org.jfree.data.time.Second;
import org.jfree.data.time.TimePeriod;
import org.jfree.data.time.Week;
import org.jfree.data.time.Year;

import iped.app.ui.Messages;
import iped.jfextensions.model.Minute;

public class DateUtil {
static public String getTimezoneOffsetInformation(TimeZone tz) {
Expand Down Expand Up @@ -63,4 +72,100 @@ static public String getTimePeriodName(Class<? extends TimePeriod> tpclass) {
return Messages.getString("TimeLineGraph." + tpclass.getSimpleName());
}

public static Date ISO8601DateParse(Class<? extends TimePeriod> timePeriodClass, byte[] b) {
try {
if (b.length < 18)
return null;
int year = (b[0] - 48) * 1000 + (b[1] - 48) * 100 + (b[2] - 48) * 10 + (b[3] - 48) - 1900;
int month = ((b[5] - 48) * 10 + (b[6] - 48)) - 1;
int day = (b[8] - 48) * 10 + (b[9] - 48);
long time = ((b[11] - 48) * 10 + (b[12] - 48)) * 3600000 + ((b[14] - 48) * 10 + (b[15] - 48)) * 60000 + ((b[17] - 48) * 10 + (b[18] - 48)) * 1000 + computerTimezoneOffset;
if (time >= 24 * 3600000) {
day += 1;
time = time % 24 * 3600000;
} else {
if (time < 0) {
day -= 1;
time = 24 * 3600000 + time;
}
}

if (timePeriodClass == Day.class) {
return new Date(year, month, day);
} else if (timePeriodClass == Hour.class) {
int hour = (int) Math.floorDiv(time, 1000 * 60 * 60);
return new Date(year, month, day, hour, 0, 0);
} else if (timePeriodClass == Year.class) {
Date d = new Date(year, month, day);
return new Date(d.getYear(), 0, 1);
} else if (timePeriodClass == Quarter.class) {
Date d = new Date(year, month, day);
return new Date(d.getYear(), Math.floorDiv(d.getMonth(), 3) * 3, 1);
} else if (timePeriodClass == Month.class) {
Date d = new Date(year, month, day);
return new Date(d.getYear(), d.getMonth(), 1);
} else if (timePeriodClass == Week.class) {
Calendar calendar = Calendar.getInstance();
Date d = new Date(year, month, day);
calendar.setTime(d);
int week;
// sometimes the last few days of the year are considered to fall in
// the *first* week of the following year. Refer to the Javadocs for
// GregorianCalendar.
int tempWeek = calendar.get(Calendar.WEEK_OF_YEAR);
if (tempWeek == 1 && calendar.get(Calendar.MONTH) == Calendar.DECEMBER) {
week = 1;
year = (short) (calendar.get(Calendar.YEAR) + 1);
} else {
week = (byte) Math.min(tempWeek, Week.LAST_WEEK_IN_YEAR);
int yyyy = calendar.get(Calendar.YEAR);
// alternatively, sometimes the first few days of the year are
// considered to fall in the *last* week of the previous year...
if (calendar.get(Calendar.MONTH) == Calendar.JANUARY && week >= 52) {
yyyy--;
}
year = (short) yyyy;
}
Calendar c = (Calendar) calendar.clone();
c.clear();
c.set(Calendar.YEAR, year);
c.set(Calendar.WEEK_OF_YEAR, week);
c.set(Calendar.DAY_OF_WEEK, c.getFirstDayOfWeek());
c.set(Calendar.HOUR, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);

return c.getTime();
} else if (timePeriodClass == Minute.class) {
int hour = (int) Math.floorDiv(time, 1000 * 60 * 60);
int minute = (int) Math.floorDiv(time, 1000 * 60) - hour * 60;
return new Date(year, month, day, hour, minute, 0);
} else if (timePeriodClass == iped.jfextensions.model.Minute.class) {
int hour = (int) Math.floorDiv(time, 1000 * 60 * 60);
int minute = (int) Math.floorDiv(time, 1000 * 60) - hour * 60;
return new Date(year, month, day, hour, minute, 0);
} else if (timePeriodClass == Second.class) {
int hour = (int) Math.floorDiv(time, 1000 * 60 * 60);
int minute = (int) Math.floorDiv(time, 1000 * 60) - hour * 60;
int second = (int) Math.floorDiv(time, 1000) - hour * 60 * 60 - minute * 60;
return new Date(year, month, day, hour, minute, second);
} else if (timePeriodClass == Millisecond.class) {
return new Date(new Date(year, month, day).getTime() + time);
} else if (timePeriodClass == FixedMillisecond.class) {
return new Date(new Date(year, month, day).getTime() + time);
}
} catch (Exception e) {
return null;

}
throw new RuntimeException(timePeriodClass.getName() + " not handled!");
}

public static Date ISO8601DateParse(Class<? extends TimePeriod> timePeriodClass, String timeStr) {
TimePeriod t = null;
byte b[] = timeStr.getBytes();
return ISO8601DateParse(timePeriodClass, b);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class IpedChartPanel extends ChartPanel implements KeyListener {
ArrayList<Date[]> definedFilters = new ArrayList<Date[]>();
HashSet<String> excludedEvents = new HashSet<String>();
HashSet<String> hiddenEvents = new HashSet<String>();
HashSet<String> selectedEvents = new HashSet<String>();
private static final String resPath = '/' + App.class.getPackageName().replace('.', '/') + '/';

Date startFilterDate = null;
Expand Down Expand Up @@ -1004,6 +1005,14 @@ public void setHiddenEvents(HashSet<String> hiddenEvents) {
this.hiddenEvents = hiddenEvents;
}

public HashSet<String> getSelectedEvents() {
return selectedEvents;
}

public void setSelectedEvents(HashSet<String> selectedEvents) {
this.selectedEvents = selectedEvents;
}

@Override
public void updateUI() {
super.updateUI();
Expand Down
Loading

0 comments on commit d098c5a

Please sign in to comment.