Commit 384b02ef authored by Kristof Szabados's avatar Kristof Szabados
Browse files

function renamed from clone to newInstance to indicate, that this is not

cloning the object, but creating a new one with base settings.
parent 25a96cb3
......@@ -55,8 +55,7 @@ public class LayoutEntry extends JRadioButtonMenuItem {
* In case of <code>static</code> LayoutEntry attributes this method should
* be used in order to have separate event handlers.
*/
@Override
public LayoutEntry clone() {
public LayoutEntry newInstance() {
return new LayoutEntry(shortName, wholeName);
}
......
......@@ -38,7 +38,7 @@ public class ComponentGraphEditor extends GraphEditor {
protected void initWindow() {
super.initWindow();
JRadioButtonMenuItem isom = Layouts.LAYOUT_ISOM.clone();
JRadioButtonMenuItem isom = Layouts.LAYOUT_ISOM.newInstance();
isom.addActionListener(layoutListener);
layoutGroup.add(isom);
layoutMenu.add(isom);
......@@ -46,13 +46,13 @@ public class ComponentGraphEditor extends GraphEditor {
JMenu dagMenu = new JMenu("Directed layouts");
layoutMenu.add(dagMenu);
JRadioButtonMenuItem tdag = Layouts.LAYOUT_TDAG.clone();
JRadioButtonMenuItem tdag = Layouts.LAYOUT_TDAG.newInstance();
tdag.setSelected(true);
tdag.addActionListener(layoutListener);
dagMenu.add(tdag);
layoutGroup.add(tdag);
JRadioButtonMenuItem rtdag = Layouts.LAYOUT_RTDAG.clone();
JRadioButtonMenuItem rtdag = Layouts.LAYOUT_RTDAG.newInstance();
rtdag.addActionListener(layoutListener);
dagMenu.add(rtdag);
layoutGroup.add(rtdag);
......
......@@ -120,7 +120,7 @@ public abstract class GraphEditor extends EditorPart implements Searchable<NodeD
public GraphEditor() {
super();
handlers = new HashSet<AbstractHandler>();
chosenLayout = Layouts.LAYOUT_TDAG.clone();
chosenLayout = Layouts.LAYOUT_TDAG.newInstance();
errorHandler = new GUIErrorHandler();
}
......@@ -466,7 +466,7 @@ public abstract class GraphEditor extends EditorPart implements Searchable<NodeD
}
errorHandler.reportException("Error while creating layout", exc);
}
chosenLayout = layout.clone();
chosenLayout = layout.newInstance();
monitor.done();
}
};
......
......@@ -74,13 +74,13 @@ public class ModuleGraphEditor extends GraphEditor {
protected final JMenuItem locationKnotCluster = new JMenuItem("By module location");
protected final JMenuItem locationGraphCluster = new JMenuItem("By module location");
protected final JMenuItem closeGraphClusters = new JMenuItem("Leave cluster graph");
protected final JRadioButtonMenuItem isom = Layouts.LAYOUT_ISOM.clone();
protected final JRadioButtonMenuItem kk = Layouts.LAYOUT_KK.clone();
protected final JRadioButtonMenuItem fr = Layouts.LAYOUT_FR.clone();
protected final JRadioButtonMenuItem spring = Layouts.LAYOUT_SPRING.clone();
protected final JRadioButtonMenuItem circle = Layouts.LAYOUT_CIRCLE.clone();
protected final JRadioButtonMenuItem tdag = Layouts.LAYOUT_TDAG.clone();
protected final JRadioButtonMenuItem rtdag = Layouts.LAYOUT_RTDAG.clone();
protected final JRadioButtonMenuItem isom = Layouts.LAYOUT_ISOM.newInstance();
protected final JRadioButtonMenuItem kk = Layouts.LAYOUT_KK.newInstance();
protected final JRadioButtonMenuItem fr = Layouts.LAYOUT_FR.newInstance();
protected final JRadioButtonMenuItem spring = Layouts.LAYOUT_SPRING.newInstance();
protected final JRadioButtonMenuItem circle = Layouts.LAYOUT_CIRCLE.newInstance();
protected final JRadioButtonMenuItem tdag = Layouts.LAYOUT_TDAG.newInstance();
protected final JRadioButtonMenuItem rtdag = Layouts.LAYOUT_RTDAG.newInstance();
protected final JMenu metricLayoutMenu = new JMenu("Metric layouts");
public static final String ID = "org.eclipse.titanium.graph.editors.ModuleGraphEditor";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment