Skip to content

Commit

Permalink
Workaround for #640 Error which would (previously) cause a bunch of s…
Browse files Browse the repository at this point in the history
…cary errors to appear due to a bug in the jdk when using three monitors.
  • Loading branch information
kayila committed Oct 30, 2019
1 parent 43e1c57 commit ea31a5a
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/main/java/net/rptools/maptool/client/ui/MapToolFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,14 @@ private void configureDocking() {
.loadInitialLayout(
MapToolFrame.class.getClassLoader().getResourceAsStream(INITIAL_LAYOUT_XML));
} catch (ParserConfigurationException | SAXException | IOException e) {
MapTool.showError("msg.error.layoutInitial", e);
}
try {
getDockingManager()
.loadLayoutDataFromFile(AppUtil.getAppHome("config").getAbsolutePath() + "/layout.dat");
} catch (IllegalArgumentException e) {
MapTool.showError("msg.error.layoutParse", e);
}
getDockingManager()
.loadLayoutDataFromFile(AppUtil.getAppHome("config").getAbsolutePath() + "/layout.dat");
}

public DockableFrame getFrame(MTFrame frame) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,15 @@ private void refresh() {
}

Collections.sort(fileList, filenameComparator);
MapTool.getFrame().getAssetPanel().updateGlobalSearchLabel(fileList.size());
try {
MapTool.getFrame().getAssetPanel().updateGlobalSearchLabel(fileList.size());
} catch (NullPointerException e) {
// This currently throws a NPE if the frame was not finished initializing when runs. For now,
// lets log a message
// and continue.
log.warn(
"NullPointerException encountered while trying to update ImageFileImagePanelModel global search label", e);
}
}

private static class ListFilesSwingWorker extends SwingWorker<Void, Integer> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@
import net.rptools.maptool.model.Token;
import net.rptools.maptool.model.Zone;
import net.rptools.maptool.server.ServerPolicy;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class TokenPanelTreeModel implements TreeModel, ModelChangeListener {

private static final Logger log = LogManager.getLogger(TokenPanelTreeModel.class);

private static final String _TOKENS = "panel.MapExplorer.View.TOKENS";
private static final String _PLAYERS = "panel.MapExplorer.View.PLAYERS";
private static final String _GROUPS = "panel.MapExplorer.View.GROUPS";
Expand Down Expand Up @@ -209,7 +214,14 @@ private void updateInternal() {

// Plan to show all of the views in order to keep the order
for (TokenFilter filter : filterList) {
if (filter.view.isAdmin && !MapTool.getPlayer().isGM()) {
try {
if (filter.view.isAdmin && !MapTool.getPlayer().isGM()) {
continue;
}
} catch (NullPointerException e) {
// This seems to happen when there was a problem creating the initial window. Lets just
// ignore this filter for now
log.warn("NullPointerException encountered while trying to update TokenPanelTreeModel", e);
continue;
}
currentViewList.add(filter.view);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,8 @@ msg.error.invalidLocalhost = "localhost" is not a valid addre
# JVM Related
msg.error.jvm.options = "{0}" is an invalid memory setting.<br><br>Be sure to enter a valid Java JVM value that includes a memory size that ends in K, M, or G.<br>e.g. 4M, 6G, 2048M, 1024K, etc.<br><br><b>Warning:</b> An improper setting could prevent MapTool from starting.
msg.error.lafSetup = Exception during look and feel setup.
msg.error.layoutParse = Could not parse the layout file.
msg.error.layoutInitial = Could not load the initial layout.
msg.error.layoutParse = Error parsing the layout file.
msg.error.loadingIconImage = Could not load icon image.
msg.error.loadingQuickMaps = Error loading quickmaps.
msg.error.macro.buttonGroupDnDFail = Drag & Drop problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,7 @@ msg.error.fogexpose = Du musst ein SL sein, um den Kri
msg.error.gmRequired = Nur SL d\u00FCrfen das.
msg.error.invalidLocalhost = "localhost" ist keine g\u00FCltige Adresse?! \u00DCberpr\u00FCfe Deine /etc/hosts Datei.
msg.error.lafSetup = Ausnahmefall w\u00E4hrend der Einrichtung des Erscheinungsbildes.
msg.error.layoutInitial = Das ursprüngliche Layout konnte nicht geladen werden.
msg.error.layoutParse = Kann die Gestaltungsdatei nicht analysieren.
msg.error.loadingIconImage = Kann das Symbolbild nicht laden.
msg.error.loadingQuickMaps = Fehler beim Laden der Schnellkarten.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ msg.error.fogexpose = Debe ser un GM para cambiar la N
msg.error.gmRequired = S\u00F3lo los GM pueden hacer eso.
msg.error.invalidLocalhost = 'localhost' no es una direcci\u00F3n v\u00E1lida?! Revisa tu archivo /etc/hosts.
msg.error.lafSetup = Excepci\u00F3n durante el ajuste de aspecto.
msg.error.layoutInitial = No se pudo cargar el diseño inicial.
msg.error.layoutParse = Imposible procesa el archivo de disposici\u00F3n.
msg.error.loadingIconImage = Imposible cargar im\u00E1gen de icono.
msg.error.loadingQuickMaps = Error al cargar mapas r\u00E1pidos.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ msg.error.fogexpose = Vous devez \u00EAtre MJ pour cha
msg.error.gmRequired = Seuls les MJ peuvent faire cela.
msg.error.invalidLocalhost = 'localhost' n'est pas une adresse valide ?! V\u00E9rifiez votre fichier /etc/hosts.
msg.error.lafSetup = Une exception s'est produite durant la mise en place de l'interface ("look and feel")
msg.error.layoutInitial = Impossible de charger la mise en page initiale.
msg.error.layoutParse = Le fichier de disposition n'a pu \u00EAtre analys\u00E9
msg.error.loadingIconImage = L'ic\u00F4ne n'a pas pu \u00EAtre charg\u00E9e
msg.error.loadingQuickMaps = Erreur durant le chargement des cartes rapides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ msg.error.fogexpose = Devi essere un GM per cambiare l
msg.error.gmRequired = Solo un GM pu\u00C3\u00B2 farlo.
msg.error.invalidLocalhost = 'localhost' non \u00C3\u00A8 un indirizzo valido?! Controlla il tuo file /etc/hosts.
msg.error.lafSetup = Eccezione durante il setup look and feel.
msg.error.layoutInitial = Impossibile caricare il layout iniziale.
msg.error.layoutParse = Impossibile analizzare il file di layout.
msg.error.loadingIconImage = Impossibile caricare l''immagine icona.
msg.error.loadingQuickMaps = Errore caricando una mappa veloce.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ msg.error.fogexpose = \u4E0D\u660E\u9818\u57DF\u3092\u
msg.error.gmRequired = \u3053\u306E\u64CD\u4F5C\u306FGM\u5C02\u7528\u3067\u3059\u3002
msg.error.invalidLocalhost = \u300Clocalhost\u300D\u304C\u6B63\u3057\u3044\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002/etc/hosts \u30D5\u30A1\u30A4\u30EB\u3092\u78BA\u8A8D\u3057\u3066\u4E0B\u3055\u3044\u3002
msg.error.lafSetup = Look and feel \u306E\u69CB\u6210\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002
msg.error.layoutInitial = \u521D\u671F\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002
msg.error.layoutParse = layout file \u3092\u30D1\u30FC\u30B9\u3067\u304D\u307E\u305B\u3093\u3002
msg.error.loadingIconImage = \u30A2\u30A4\u30B3\u30F3\u753B\u50CF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002
msg.error.loadingQuickMaps = \u30AF\u30A4\u30C3\u30AF\u30DE\u30C3\u30D7\u306E\u8AAD\u307F\u8FBC\u307F\u4E2D\u306B\u30A8\u30E9\u30FC\u767A\u751F\u3002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ msg.error.fogexpose = Musisz byc GM zeby zmienic "fog
msg.error.gmRequired = Tylko GM moze to zrobic.
msg.error.invalidLocalhost = 'localhost' nie jest wlasciwym adresem?! Check your /etc/hosts file.
msg.error.lafSetup = Exception during look and feel setup
msg.error.layoutInitial = Nie mo\u017Cna za\u0142adowa\u0107 pocz\u0105tkowego uk\u0142adu.
msg.error.layoutParse = Could not parse the layout file
msg.error.loadingIconImage = Nie mozna zaladowac obrazka ikony
msg.error.loadingQuickMaps = Blad wczytywania szybkiej mapy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ msg.error.fogexpose = \u0422\u0440\u0435\u0431\u0443\u
msg.error.gmRequired = \u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u043B\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0413\u041C.
msg.error.invalidLocalhost = 'localhost' \u043D\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0430\u0434\u0440\u0435\u0441?! \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0432\u0430\u0448 /etc/hosts \u0444\u0430\u0439\u043B.
msg.error.lafSetup = \u0418\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043F\u0440\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0435 \u043E\u0431\u0437\u043E\u0440\u0430 \u0438 \u043E\u0449\u0443\u0449\u0435\u043D\u0438\u044F.
msg.error.layoutInitial = \u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 \u043C\u0430\u043A\u0435\u0442.
msg.error.layoutParse = \u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B \u0441\u0445\u0435\u043C\u044B.
msg.error.loadingIconImage = \u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u044F\u0440\u043B\u044B\u043A\u0430.
msg.error.loadingQuickMaps = \u041E\u0448\u0438\u0431\u043A\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0431\u044B\u0441\u0442\u0440\u044B\u0445 \u043A\u0430\u0440\u0442.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ msg.error.fogexpose = \u53EA\u6709\u6E38\u620F\u4E3B\u
msg.error.gmRequired = \u53EA\u6709\u6E38\u620F\u4E3B\u6301\u4EBA\u53EF\u4EE5\u8FD9\u4E48\u505A
msg.error.invalidLocalhost = \u672C\u5730\u4E3B\u673A\uFF08localhost\uFF09\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u5730\u5740\uFF01\u68C0\u67E5\u4F60\u7684hosts\u6587\u4EF6\u3002
msg.error.lafSetup = look and feel\u8BBE\u7F6E\u4E2D\u9047\u5230\u5F02\u5E38\u3002
msg.error.layoutInitial = \u65E0\u6CD5\u52A0\u8F7D\u521D\u59CB\u5E03\u5C40\u3002
msg.error.layoutParse = \u65E0\u6CD5\u89E3\u6790\u5E03\u5C40\u6587\u4EF6\u3002
msg.error.loadingIconImage = \u65E0\u6CD5\u8BFB\u53D6\u56FE\u6807\u56FE\u7247\u3002
msg.error.loadingQuickMaps = \u8BFB\u53D6\u5FEB\u901F\u5730\u56FE\u9519\u8BEF\u3002
Expand Down

0 comments on commit ea31a5a

Please sign in to comment.