Package org.opentrafficsim.editor
Class Dialogs
java.lang.Object
org.opentrafficsim.editor.Dialogs
Object that is part of
OtsEditor and may be used to show dialogs.
Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAsk to clear recent files.booleanShows a dialog in a modal pane to confirm discarding unsaved changes.booleanconfirmGeneral(String message) Shows a dialog in a modal pane to confirm message.confirmLoadAutosaveFile(File file) Ask to load auto save file.booleanRequests the user to confirm the deletion of a node.booleanAsk to remove auto save file (which could not be loaded).booleanAsk to remove temporary file that could not be loaded.voidnotification(String notification) Shows a notification.voidnotification(String notification, String title) Shows a notification.voidshowCircularInputParameters(String message) Show input parameters have a circular dependency.voidshowDescription(String description, String title) Shows a description in a modal pane.voidshowInvalidExpression(String message) Show message about invalid expression.voidshowInvalidMessage(String invalidMessage, String title) Show invalid message.voidShow tree invalid.voidShow unable to run.
-
Constructor Details
-
Dialogs
Constructor.- Parameters:
editor- editor
-
-
Method Details
-
confirmNodeRemoval
Requests the user to confirm the deletion of a node. The default button is "Ok". The window popping up is considered sufficient warning, and in this way a speedy succession of "del" and "enter" may delete a consecutive range of nodes to be deleted.- Parameters:
node- node.- Returns:
trueif the user confirms node removal.
-
confirmDiscardChanges
public boolean confirmDiscardChanges()Shows a dialog in a modal pane to confirm discarding unsaved changes.- Returns:
- whether unsaved changes can be discarded.
-
confirmGeneral
Shows a dialog in a modal pane to confirm message.- Parameters:
message- message to be confirmed- Returns:
- whether message was confirmed.
-
showDescription
Shows a description in a modal pane.- Parameters:
description- description.title- title of the window, may benullbut typically is the name of the node or attribute
-
showInvalidMessage
Show invalid message.- Parameters:
invalidMessage- invalid messagetitle- title, may benull
-
showInvalidToRunMessage
public void showInvalidToRunMessage()Show tree invalid. -
showCircularInputParameters
Show input parameters have a circular dependency.- Parameters:
message- exception message
-
showInvalidExpression
Show message about invalid expression.- Parameters:
message- exception message
-
showUnableToRunFromTempFile
public void showUnableToRunFromTempFile()Show unable to run. -
confirmRemoveRecentFile
public boolean confirmRemoveRecentFile()Ask to remove temporary file that could not be loaded.- Returns:
- whether temporary file may be removed
-
confirmClearRecentFiles
public boolean confirmClearRecentFiles()Ask to clear recent files.- Returns:
- whether all recent files may be removed
-
confirmLoadAutosaveFile
Ask to load auto save file.- Parameters:
file- file- Returns:
- whether to load auto save file,
truemeans load,falsemeans ok to delete, empty means do nothing
-
confirmRemoveAutosaveFile
public boolean confirmRemoveAutosaveFile()Ask to remove auto save file (which could not be loaded).- Returns:
- whether to remove auto save file
-
notification
Shows a notification.- Parameters:
notification- notification, should be short as it is also used as the dialog title
-
notification
Shows a notification.- Parameters:
notification- notificationtitle- dialog title
-