1 package org.simantics.modeling.ui.diagram.monitor;
3 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.diagram.stubs.DiagramResource;
8 import org.simantics.ui.fonts.FontDescriptor;
10 public class CurrentFontSizeFactory extends ReadFactoryImpl<Resource, String> {
13 public String perform(ReadGraph graph, Resource monitor) throws DatabaseException {
15 DiagramResource DIA = DiagramResource.getInstance(graph);
16 FontDescriptor fd = graph.getPossibleRelatedAdapter(monitor, DIA.HasFont, FontDescriptor.class);
17 if(fd != null) return String.valueOf(fd.getSize());