Skip to content

Commit

Permalink
Public access to detached windows and updataButtons function
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgobbo committed May 16, 2022
1 parent c9eccc0 commit 0cf0217
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/main/java/ch/psi/pshell/ui/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ void removeProcessorComponents(Processor processor) {
}
}

void updateButtons() {
public void updateButtons() {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(() -> {
updateButtons();
Expand Down Expand Up @@ -654,7 +654,7 @@ public List<String> getTitles(){
}

@Override
public void onTitleClosed(String title){
public void onTitleClosed(String title){
//Do nothing... only close titles graphically
}
});
Expand Down Expand Up @@ -984,6 +984,15 @@ public PlotPanel getPlotPanel(String plotTitle, boolean create) {
}
HashMap<String, Component> detachedPlots = new HashMap<>();
HashMap<String, Component> detachedScripts = new HashMap<>();


public HashMap<String, Component> getDetachedPlots(){
return detachedPlots;
}

public HashMap<String, Component> getDetachedScripts(){
return detachedScripts;
}

boolean canDetach(Component c) {
if (c == currentScriptEditor) {
Expand Down Expand Up @@ -1300,6 +1309,22 @@ public List<Processor> getProcessors() {
}
return ret;
}

public List<DataPanel> getDataFilePanels() {
ArrayList<DataPanel> ret = new ArrayList();
for (int i = 0; i < tabDoc.getTabCount(); i++) {
Component c = tabDoc.getComponentAt(i);
if (c instanceof DataPanel) {
ret.add((DataPanel) c);
}
}
for (String key : detachedScripts.keySet()) {
if (detachedScripts.get(key) instanceof DataPanel) {
ret.add((DataPanel) detachedScripts.get(key));
}
}
return ret;
}

public List<QueueProcessor> getQueues() {
ArrayList<QueueProcessor> ret = new ArrayList();
Expand Down

0 comments on commit 0cf0217

Please sign in to comment.