} else {
SelectionNode s = selectionNode.getOrCreateNode(getNodeId("shape", e), SelectionNode.class);
s.init(selectionTransform, bounds, color);
+ Double paddingFactor = diagram.getHint(DiagramHints.SELECTION_PADDING_SCALE_FACTOR);
+ if (paddingFactor != null)
+ s.setPaddingFactor(paddingFactor);
}
}
importJava "org.simantics.modeling.ModelingUtils" where
importSharedOntologyWithUI :: Variable -> <ReadGraph> ()
importSharedOntology :: String -> ()
+ importSharedOntology2 :: String -> <Proc> [Resource]
createSharedOntologyWithUI :: Resource -> <ReadGraph> ()
unlinkSharedOntologyWithUI :: Variable -> [Resource] -> <ReadGraph> ()
createNewVersionWithUI :: Resource -> <ReadGraph> ()
import org.simantics.db.layer0.genericrelation.DependenciesRelation.DependencyChangesRequest;
import org.simantics.db.layer0.genericrelation.DependencyChanges;
import org.simantics.db.layer0.genericrelation.IndexedRelations;
+import org.simantics.db.layer0.migration.MigratedImportResult;
import org.simantics.db.layer0.migration.MigrationUtils;
import org.simantics.db.layer0.request.ActivateModel;
import org.simantics.db.layer0.request.ActiveModels;
}
- public static void importSharedOntology(String fileName) throws Exception {
+ public static MigratedImportResult importSharedOntologyWithResult(String fileName) throws Exception {
try {
DataContainer dc = DataContainers.readFile(new File(fileName));
TransferableGraph1 tg = (TransferableGraph1)dc.content.getValue(TransferableGraph1.BINDING);
Variant draftStatus = dc.metadata.get(DraftStatusBean.EXTENSION_KEY);
- MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
+ return MigrationUtils.importSharedOntology(Simantics.getSession(), tg, draftStatus == null);
} catch (Exception e) {
Logger.defaultLogError(e);
throw e;
}
}
+ public static void importSharedOntology(String fileName) throws Exception {
+ importSharedOntologyWithResult(fileName);
+ }
+
+ public static List<Resource> importSharedOntology2(String fileName) throws Exception {
+ MigratedImportResult result = importSharedOntologyWithResult(fileName);
+ return new ArrayList<Resource>(result.roots);
+ }
+
public static void importSharedOntologyWithUI(ReadGraph graph, final Variable variable) throws DatabaseException {
Display.getDefault().asyncExec(new Runnable() {
protected transient BasicStroke scaledStroke;
protected transient double previousScaleRecip = Double.NaN;
private boolean ignore = false;
+ private double paddingFactor = 5.0;
public void setIgnore(boolean value) {
ignore = value;
}
+
+ public void setPaddingFactor(double factor) {
+ paddingFactor = factor;
+ }
@SyncField({"transform", "bounds", "color"})
public void init(AffineTransform transform, Rectangle2D bounds, Color color) {
}
g.setStroke(scaledStroke);
- double padding = 5.0 * scaleRecip;
+ double padding = paddingFactor * scaleRecip;
double paddingX = padding;
double paddingY = padding;