Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
47471145
Commit
47471145
authored
Oct 26, 2018
by
Stefan Schuhbaeck
Browse files
add copy to clipboard action to outputTable
parent
6c45179a
Changes
4
Hide whitespace changes
Inline
Side-by-side
VadereGui/resources/messages.properties
View file @
47471145
...
...
@@ -199,6 +199,7 @@ AdjustPanel.lblStep.text=Timestep
ProjectView.mntmOutputToSceneario.text
=
Generate scenario
ProjectView.mntmRunOutput.text
=
Run offline again
ProjectView.mntmCopyOutputDir.text
=
Copy output path to clipboard
SettingsDialog.chbShowPedestrianIds.text
=
Show PedestrianIds
PostVis.chShowEvacTimeColor.text
=
Color Pedestrians regarding to Evacuation Times
...
...
VadereGui/resources/messages_de_DE.properties
View file @
47471145
...
...
@@ -200,6 +200,7 @@ AdjustPanel.lblStep.text=Zeitschritt
ProjectView.mntmOutputToSceneario.text
=
Generiere Szenario
ProjectView.mntmRunOutput.text
=
Offline erneut starten
ProjectView.mntmCopyOutputDir.text
=
Kopiere Output Pfad in Zwischenablage
SettingsDialog.chbShowPedestrianIds.text
=
Fu
\u
00dfg
\u
00E4nger-Ids anzeigen
PostVis.additional.border.text
=
PostVis
...
...
VadereGui/src/org/vadere/gui/projectview/control/ActionToClipboard.java
0 → 100644
View file @
47471145
package
org.vadere.gui.projectview.control
;
import
java.awt.*
;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.StringSelection
;
import
java.awt.event.ActionEvent
;
import
javax.swing.*
;
public
class
ActionToClipboard
extends
AbstractAction
{
String
data
;
public
ActionToClipboard
(
String
name
,
String
data
){
super
(
name
);
this
.
data
=
data
;
}
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
StringSelection
selection
=
new
StringSelection
(
data
);
Clipboard
clipboard
=
Toolkit
.
getDefaultToolkit
().
getSystemClipboard
();
clipboard
.
setContents
(
selection
,
selection
);
}
}
VadereGui/src/org/vadere/gui/projectview/view/ProjectView.java
View file @
47471145
...
...
@@ -28,6 +28,7 @@ import org.vadere.gui.projectview.control.ActionSaveAsProject;
import
org.vadere.gui.projectview.control.ActionSaveProject
;
import
org.vadere.gui.projectview.control.ActionSeeDiscardChanges
;
import
org.vadere.gui.projectview.control.ActionShowAboutDialog
;
import
org.vadere.gui.projectview.control.ActionToClipboard
;
import
org.vadere.gui.projectview.control.IOutputFileRefreshListener
;
import
org.vadere.gui.projectview.control.IProjectChangeListener
;
import
org.vadere.gui.projectview.control.ShowResultDialogAction
;
...
...
@@ -587,6 +588,35 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
outputListPopupMenu
.
add
(
new
JMenuItem
(
new
ActionRunOutput
(
Messages
.
getString
(
"ProjectView.mntmRunOutput.text"
),
model
)));
JMenu
copyPath
=
new
JMenu
(
Messages
.
getString
(
"ProjectView.mntmCopyOutputDir.text"
));
outputTable
.
getSelectionModel
().
addListSelectionListener
(
new
TableSelectionListener
(
outputTable
)
{
@Override
public
void
onSelect
(
ListSelectionEvent
e
)
{
try
{
OutputBundle
bundle
=
model
.
getSelectedOutputBundle
();
File
outDir
=
bundle
.
getDirectory
();
copyPath
.
removeAll
();
copyPath
.
add
(
new
JMenuItem
(
new
ActionToClipboard
(
outDir
.
getName
()
+
"/"
,
outDir
.
getAbsolutePath
()))
);
File
[]
children
=
outDir
.
listFiles
();
if
(
children
!=
null
){
for
(
File
file
:
children
)
{
String
name
=
file
.
isDirectory
()
?
file
.
getName
()
+
"/"
:
file
.
getName
();
copyPath
.
add
(
new
JMenuItem
(
new
ActionToClipboard
(
name
,
file
.
getAbsolutePath
()))
);
}
}
}
catch
(
IOException
ex
)
{
logger
.
error
(
ex
);
}
}
});
outputListPopupMenu
.
add
(
copyPath
);
JPopupMenu
outputListPopupMenuMultiSelect
=
new
JPopupMenu
();
outputListPopupMenuMultiSelect
.
add
(
new
JMenuItem
(
deleteOutputFileAction
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment