X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graphviz.ui%2Fsrc%2Forg%2Fsimantics%2Fgraphviz%2Fui%2FGraphvizComponent.java;h=9bcf9433dd47f328ef4b917401bb73ac3add4bbf;hp=6ba556da09d65f1076bb4108e9e2fb35dcca190d;hb=47269fe0acb894f346810417d950a1ab59cdc0ea;hpb=11309f6516278203264b680235cbbe1dc2bde98e diff --git a/bundles/org.simantics.graphviz.ui/src/org/simantics/graphviz/ui/GraphvizComponent.java b/bundles/org.simantics.graphviz.ui/src/org/simantics/graphviz/ui/GraphvizComponent.java index 6ba556da0..9bcf9433d 100644 --- a/bundles/org.simantics.graphviz.ui/src/org/simantics/graphviz/ui/GraphvizComponent.java +++ b/bundles/org.simantics.graphviz.ui/src/org/simantics/graphviz/ui/GraphvizComponent.java @@ -69,8 +69,8 @@ public class GraphvizComponent extends Composite { } private void workaroundJava7FocusProblem(Frame frame) { - String ver = System.getProperty("java.version"); - if (ver.startsWith("1.7") || ver.startsWith("1.8")) { + String ver = System.getProperty("java.version"); //$NON-NLS-1$ + if (ver.startsWith("1.7") || ver.startsWith("1.8")) { //$NON-NLS-1$ //$NON-NLS-2$ try { frame.addWindowListener(new Java7FocusFixListener(this, frame)); } catch (SecurityException e) { @@ -90,7 +90,7 @@ public class GraphvizComponent extends Composite { Frame frame; public Java7FocusFixListener(Control control, Frame frame) throws NoSuchMethodException, SecurityException { - this.shellSetActiveControl = Shell.class.getDeclaredMethod("setActiveControl", Control.class); + this.shellSetActiveControl = Shell.class.getDeclaredMethod("setActiveControl", Control.class); //$NON-NLS-1$ this.frame = frame; this.control = control; } @@ -137,7 +137,7 @@ public class GraphvizComponent extends Composite { initialized.wait(); } } catch (InterruptedException e) { - throw new Error("GraphvizComponent AWT population interrupted for class " + this, e); + throw new Error("GraphvizComponent AWT population interrupted for class " + this, e); //$NON-NLS-1$ } } @@ -147,7 +147,7 @@ public class GraphvizComponent extends Composite { * @param graph */ public void setGraph(Graph graph) { - setGraph(graph, "dot"); + setGraph(graph, "dot"); //$NON-NLS-1$ } /** @@ -210,7 +210,7 @@ public class GraphvizComponent extends Composite { public void save(File file) throws IOException { if (drawable == null) { - throw new IOException("Nothing to save"); + throw new IOException("Nothing to save"); //$NON-NLS-1$ } Graph graph = drawable.getGraph(); String algo = drawable.getAlgorithm(); @@ -222,16 +222,16 @@ public class GraphvizComponent extends Composite { } public String[] getFileExtensions() { - return new String[]{"*.svg","*.dot","*.eps", "*.jpg", "*.jpeg","*.pdf","*.png","*.ps"}; + return new String[]{"*.svg","*.dot","*.eps", "*.jpg", "*.jpeg","*.pdf","*.png","*.ps"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ } public String[] getFileNames() { - return new String[]{"Scalable Vector Graphics Image", "DOT Image", "Encapsulated PostScript Image","JPG Image","JPG Image","Portable Document Format Image","Portable Network Graphics Image","PostScript Image"}; + return new String[]{"Scalable Vector Graphics Image", "DOT Image", "Encapsulated PostScript Image","JPG Image","JPG Image","Portable Document Format Image","Portable Network Graphics Image","PostScript Image"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ } public static String getExtension(File file) { String filename = file.getName(); - int index = filename.lastIndexOf("."); + int index = filename.lastIndexOf("."); //$NON-NLS-1$ if (index < 0) return null; return filename.substring(index+1).toLowerCase();