]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.tests/src/org/simantics/modeling/tests/commands/UnloadDiagram.java
Small but effective HiDPI fixes for platform G2D
[simantics/platform.git] / bundles / org.simantics.modeling.tests / src / org / simantics / modeling / tests / commands / UnloadDiagram.java
1 package org.simantics.modeling.tests.commands;
2
3 import org.simantics.db.exception.DatabaseException;
4 import org.simantics.db.testing.common.CommandSequenceEnvironment;
5 import org.simantics.db.testing.common.WriteCommand;
6
7 public class UnloadDiagram extends WriteCommand<CommandSequenceEnvironment> {
8
9         private LoadDiagram diagram;
10         
11         public UnloadDiagram(LoadDiagram diagram) {
12                 this.diagram = diagram;
13         }
14         
15         @Override
16         public void run(CommandSequenceEnvironment environment) throws DatabaseException {
17                 
18                 diagram.getProvider().dispose();
19                 diagram.getContext().dispose();
20                 diagram.getActivation().deactivate();
21                 diagram.getWorkerThread().stopDispatchingEvents(true);
22                 
23         }
24
25 }