diff --git a/src/eva2/gui/BeanInspector.java b/src/eva2/gui/BeanInspector.java index 678e1311..7571761c 100644 --- a/src/eva2/gui/BeanInspector.java +++ b/src/eva2/gui/BeanInspector.java @@ -70,10 +70,8 @@ public class BeanInspector { continue; } System.out.println("getter_1 = " + getter_1.getName() + " getter_2 = " + getter_2.getName()); - //System.out.println("type = "+type.getName() ); Object args_1[] = {}; Object args_2[] = {}; - //System.out.println("m_Target"+m_Target.toString()); try { Object value_1 = getter_1.invoke(obj1, args_1); Object value_2 = getter_2.invoke(obj2, args_2); @@ -340,7 +338,6 @@ public class BeanInspector { //System.out.println("name = "+name ); //System.out.println("type = "+type.getName() ); Object args[] = {}; - //System.out.println("m_obj"+m_obj.toString()); try { nameArray[i] = name; diff --git a/src/eva2/gui/EvAModuleButtonPanelMaker.java b/src/eva2/gui/EvAModuleButtonPanelMaker.java index 842b7b7c..b9fd8f6b 100644 --- a/src/eva2/gui/EvAModuleButtonPanelMaker.java +++ b/src/eva2/gui/EvAModuleButtonPanelMaker.java @@ -1,14 +1,4 @@ package eva2.gui; -/* - * Title: EvA2 - * Description: - * Copyright: Copyright (c) 2003 - * Company: University of Tuebingen, Computer Architecture - * @author Holger Ulmer, Felix Streichert, Hannes Planatscher - * @version: $Revision: 284 $ - * $Date: 2007-11-27 14:37:05 +0100 (Tue, 27 Nov 2007) $ - * $Author: mkron $ - */ import eva2.optimization.OptimizationStateListener; import eva2.optimization.modules.ModuleAdapter; @@ -29,7 +19,7 @@ import java.util.logging.Logger; public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Serializable, PanelMaker { private static final Logger LOGGER = Logger.getLogger(EvAModuleButtonPanelMaker.class.getName()); - private String m_Name = "undefined"; + private String name = "undefined"; private ModuleAdapter moduleAdapter; private boolean runningState; private JButton runButton; @@ -44,7 +34,7 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser * */ public EvAModuleButtonPanelMaker(ModuleAdapter adapter, boolean state) { - m_Name = "GENERAL"; + name = "GENERAL"; runningState = state; moduleAdapter = adapter; } @@ -197,7 +187,7 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser * */ public String getName() { - return m_Name; + return name; } /** diff --git a/src/eva2/gui/HtmlDemo.java b/src/eva2/gui/HtmlDemo.java index f979c6da..7815313f 100644 --- a/src/eva2/gui/HtmlDemo.java +++ b/src/eva2/gui/HtmlDemo.java @@ -1,14 +1,4 @@ package eva2.gui; -/* - * Title: EvA2 - * Description: - * Copyright: Copyright (c) 2003 - * Company: University of Tuebingen, Computer Architecture - * @author Holger Ulmer, Felix Streichert, Hannes Planatscher - * @version: $Revision: 199 $ - * $Date: 2007-10-23 16:58:12 +0200 (Tue, 23 Oct 2007) $ - * $Author: mkron $ - */ import eva2.EvAInfo; import eva2.tools.BasicResourceLoader; @@ -27,21 +17,21 @@ import java.net.URL; * */ public class HtmlDemo { - private JEditorPane m_html; - private String m_name; + private JEditorPane htmlEditorPane; + private String name; /** * */ public HtmlDemo(String name) { - m_name = name; + this.name = name; } /** * */ public JEditorPane getPane() { - return m_html; + return htmlEditorPane; } /** @@ -53,7 +43,7 @@ public class HtmlDemo { } public boolean resourceExists() { - URL url = ClassLoader.getSystemResource("html/" + m_name); + URL url = ClassLoader.getSystemResource("html/" + name); return (url != null); } @@ -68,17 +58,17 @@ public class HtmlDemo { public void show() { try { URL url = null; - url = this.getClass().getClassLoader().getSystemResource("html/" + m_name); + url = this.getClass().getClassLoader().getSystemResource("html/" + name); try { - m_html = new JEditorPane(url); + htmlEditorPane = new JEditorPane(url); } catch (java.io.IOException ioe) { url = this.getClass().getClassLoader().getSystemResource("html/Default.html"); - m_html = new JEditorPane(url); + htmlEditorPane = new JEditorPane(url); } - //m_html = new JEditorPane(htmlDescription); - m_html.setEditable(false); - m_html.addHyperlinkListener(createHyperLinkListener()); + //htmlEditorPane = new JEditorPane(htmlDescription); + htmlEditorPane.setEditable(false); + htmlEditorPane.addHyperlinkListener(createHyperLinkListener()); } catch (MalformedURLException e) { System.out.println("Malformed URL: " + e); @@ -88,13 +78,13 @@ public class HtmlDemo { e.printStackTrace(); return; } - JFrame frame = new JFrame(m_name); + JFrame frame = new JFrame(name); BasicResourceLoader loader = BasicResourceLoader.instance(); byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true); frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); JScrollPane scroller = new JScrollPane(); JViewport vp = scroller.getViewport(); - vp.add(m_html); + vp.add(htmlEditorPane); scroller.setPreferredSize(new Dimension(600, 500)); frame.getContentPane().add(scroller, BorderLayout.CENTER); frame.pack(); @@ -110,11 +100,11 @@ public class HtmlDemo { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e instanceof HTMLFrameHyperlinkEvent) { - ((HTMLDocument) m_html.getDocument()).processHTMLFrameHyperlinkEvent( + ((HTMLDocument) htmlEditorPane.getDocument()).processHTMLFrameHyperlinkEvent( (HTMLFrameHyperlinkEvent) e); } else { try { - m_html.setPage(e.getURL()); + htmlEditorPane.setPage(e.getURL()); } catch (IOException ioe) { System.out.println("IOE: " + ioe); } diff --git a/src/eva2/gui/JDocFrame.java b/src/eva2/gui/JDocFrame.java index 49dabb04..4c2afa9b 100644 --- a/src/eva2/gui/JDocFrame.java +++ b/src/eva2/gui/JDocFrame.java @@ -7,7 +7,7 @@ import java.io.File; * */ public abstract class JDocFrame extends JInternalFrame { - private File m_file; + private File file; private String titleStr; protected boolean changed = false; @@ -24,14 +24,14 @@ public abstract class JDocFrame extends JInternalFrame { */ public JDocFrame(File file) { this(file.getName()); - m_file = file; + this.file = file; } /** * */ public File getFile() { - return m_file; + return file; } /** @@ -45,8 +45,8 @@ public abstract class JDocFrame extends JInternalFrame { * */ public void save() { - if (m_file != null) { - save(m_file); + if (file != null) { + save(file); } } @@ -54,8 +54,8 @@ public abstract class JDocFrame extends JInternalFrame { * */ public void save(File f) { - if (!f.equals(m_file)) { - m_file = f; + if (!f.equals(file)) { + file = f; titleStr = f.getName(); } setChangedImpl(false); diff --git a/src/eva2/gui/JTextoutputFrame.java b/src/eva2/gui/JTextoutputFrame.java index a66cd82f..77def64e 100644 --- a/src/eva2/gui/JTextoutputFrame.java +++ b/src/eva2/gui/JTextoutputFrame.java @@ -128,7 +128,6 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen textArea.setText(null); } else if (src == saveItem) { FileTools.saveObjectWithFileChooser(frame, textArea.getText()); -// File outfile = FileTools.writeString("TextOutput.txt", m_TextArea.getText()); } else { System.err.println("Unknown popup component (JTextoutputFrame)!"); } diff --git a/src/eva2/gui/Main.java b/src/eva2/gui/Main.java index 79bdc8af..4591810c 100644 --- a/src/eva2/gui/Main.java +++ b/src/eva2/gui/Main.java @@ -811,7 +811,7 @@ public class Main extends JFrame implements OptimizationStateListener { newModuleAdapter = comAdapter.getModuleAdapter(selectedModule, optimizationParameters, withGUI ? null : "EvA2"); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Error loading module.", e); - EVAERROR.EXIT("Error while m_ComAdapter.GetModuleAdapter Host: " + e.getMessage()); + EVAERROR.EXIT("Error while comAdapter.GetModuleAdapter Host: " + e.getMessage()); } if (newModuleAdapter == null) { // When launching a Java Web Start application, baseDir will always be null! diff --git a/src/eva2/gui/editor/GenericOptimizationObjectivesEditor.java b/src/eva2/gui/editor/GenericOptimizationObjectivesEditor.java index 37959f2c..abedfc31 100644 --- a/src/eva2/gui/editor/GenericOptimizationObjectivesEditor.java +++ b/src/eva2/gui/editor/GenericOptimizationObjectivesEditor.java @@ -329,7 +329,6 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope * @param a The action listener. */ public void addOkListener(ActionListener a) { - //m_OKButton.addActionListener(a); } /** @@ -338,7 +337,6 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope * @param a The action listener */ public void removeOkListener(ActionListener a) { - //m_OKButton.removeActionListener(a); } /** @@ -453,7 +451,6 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope this.targets[i] = this.editors[i].view; } } - //this.m_OptimizationTargets.setSelectedTargets(list); this.updateCenterComponent(evt); // Let our panel update before guys downstream propertyChangeSupport.firePropertyChange("", optimizationObjectives, optimizationObjectives); } diff --git a/src/eva2/gui/editor/GenericOptimizationObjectivesWithParamEditor.java b/src/eva2/gui/editor/GenericOptimizationObjectivesWithParamEditor.java index a915bf4b..70b87180 100644 --- a/src/eva2/gui/editor/GenericOptimizationObjectivesWithParamEditor.java +++ b/src/eva2/gui/editor/GenericOptimizationObjectivesWithParamEditor.java @@ -401,7 +401,6 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme * @param a The action listener. */ public void addOkListener(ActionListener a) { - //m_OKButton.addActionListener(a); } /** @@ -410,7 +409,6 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme * @param a The action listener */ public void removeOkListener(ActionListener a) { - //m_OKButton.removeActionListener(a); } /** @@ -525,7 +523,6 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme this.targets[i] = this.editors[i].view; } } - //this.m_OptimizationTargets.setSelectedTargets(list); this.updateCenterComponent(evt); // Let our panel update before guys downstream propertyChangeSupport.firePropertyChange("", optimizationObjectivesWithWeights, optimizationObjectivesWithWeights); } diff --git a/src/eva2/gui/editor/StatisticsEditor.java b/src/eva2/gui/editor/StatisticsEditor.java index 0ff264a4..1678392f 100644 --- a/src/eva2/gui/editor/StatisticsEditor.java +++ b/src/eva2/gui/editor/StatisticsEditor.java @@ -88,7 +88,6 @@ public class StatisticsEditor implements PropertyEditor { public void paintValue(Graphics gfx, Rectangle box) { FontMetrics fm = gfx.getFontMetrics(); int vpad = (box.height - fm.getAscent()) / 2; - //String rep = EVAHELP.cutClassName(m_ElementClass.getName()); gfx.drawString("StatisticeEditor", 2, fm.getHeight() + vpad - 3); } diff --git a/src/eva2/gui/editor/StringSelectionEditor.java b/src/eva2/gui/editor/StringSelectionEditor.java index 43cf5cb8..ca9ebb7a 100644 --- a/src/eva2/gui/editor/StringSelectionEditor.java +++ b/src/eva2/gui/editor/StringSelectionEditor.java @@ -46,7 +46,6 @@ public class StringSelectionEditor extends AbstractListSelectionEditor { protected boolean setObject(Object o) { if (o instanceof StringSelection) { strs = (StringSelection) o; -// m_AreaObject.addPropertyChangeListener(this); return true; } else { return false; diff --git a/src/eva2/gui/plot/DPointSetMultiIcon.java b/src/eva2/gui/plot/DPointSetMultiIcon.java index 217cb7e1..2883f3ba 100644 --- a/src/eva2/gui/plot/DPointSetMultiIcon.java +++ b/src/eva2/gui/plot/DPointSetMultiIcon.java @@ -72,7 +72,7 @@ public class DPointSetMultiIcon extends DComponent { protected boolean connectedMI; protected DPointIcon iconMI = null; protected DPointSetMultiIcon.JumpManager jumperMI = new DPointSetMultiIcon.JumpManager(); - protected ArrayList m_IconsMI = new ArrayList(); + protected ArrayList iconsMI = new ArrayList(); protected Stroke strokeMI = new BasicStroke(); protected DIntDoubleMap xMI; @@ -114,7 +114,7 @@ public class DPointSetMultiIcon extends DComponent { public void addDPoint(DPoint p) { xMI.addImage(p.x); yMI.addImage(p.y); - m_IconsMI.add(p.getIcon()); + iconsMI.add(p.getIcon()); rectangle.insert(p); repaint(); } @@ -151,7 +151,7 @@ public class DPointSetMultiIcon extends DComponent { } public ArrayList getIconsMI() { - return this.m_IconsMI; + return this.iconsMI; } /** @@ -167,7 +167,7 @@ public class DPointSetMultiIcon extends DComponent { } else { DPoint result = new DPoint(xMI.getImage(minIndex), yMI.getImage(minIndex)); - result.setIcon((DPointIcon) this.m_IconsMI.get(minIndex)); + result.setIcon((DPointIcon) this.iconsMI.get(minIndex)); return result; } @@ -253,10 +253,10 @@ public class DPointSetMultiIcon extends DComponent { } } - if ((i < this.m_IconsMI.size()) && (this.m_IconsMI.get(i) != null)) { + if ((i < this.iconsMI.size()) && (this.iconsMI.get(i) != null)) { g.setStroke(new BasicStroke()); g.translate(p2.x, p2.y); - ((DPointIcon) this.m_IconsMI.get(i)).paint(g); + ((DPointIcon) this.iconsMI.get(i)).paint(g); g.translate(-p2.x, -p2.y); g.setStroke(strokeMI); } else { @@ -277,17 +277,17 @@ public class DPointSetMultiIcon extends DComponent { //for (int i = 0; i < size; i++) // @todo Streiche: Mal wieder eine index out of bounds exception, dass ist einfach mist... - for (int i = 0; i < this.m_IconsMI.size(); i++) { + for (int i = 0; i < this.iconsMI.size(); i++) { try { p = m.getPoint(xMI.getImage(i), yMI.getImage(i)); if (p == null) { continue; } - if (this.m_IconsMI.get(i) != null) { + if (this.iconsMI.get(i) != null) { g.setStroke(new BasicStroke()); g.translate(p.x, p.y); - ((DPointIcon) this.m_IconsMI.get(i)).paint(g); + ((DPointIcon) this.iconsMI.get(i)).paint(g); g.translate(-p.x, -p.y); g.setStroke(strokeMI); } else { @@ -372,7 +372,7 @@ public class DPointSetMultiIcon extends DComponent { rectangle.insert(p); xMI.setImage(index, p.x); yMI.setImage(index, p.y); - m_IconsMI.set(index, p.getIcon()); + iconsMI.set(index, p.getIcon()); restore(); repaint(); } diff --git a/src/eva2/gui/plot/DataViewer.java b/src/eva2/gui/plot/DataViewer.java index 0e692381..f20fc752 100644 --- a/src/eva2/gui/plot/DataViewer.java +++ b/src/eva2/gui/plot/DataViewer.java @@ -74,7 +74,7 @@ public class DataViewer implements DataViewerInterface { */ class ViewContainer extends ArrayList { - private DataViewer m_actualPlot; + private DataViewer actualPlot; /** * @@ -100,17 +100,17 @@ class ViewContainer extends ArrayList { * */ public DataViewer getPlot(String name) { - if (m_actualPlot != null) { - if (m_actualPlot.getName().equals(name)) { - return m_actualPlot; + if (actualPlot != null) { + if (actualPlot.getName().equals(name)) { + return actualPlot; } } DataViewer temp = null; for (int i = 0; i < size(); i++) { temp = (DataViewer) (get(i)); if (name.equals(temp.getName())) { - m_actualPlot = temp; - return m_actualPlot; + actualPlot = temp; + return actualPlot; } } return null; diff --git a/src/eva2/gui/plot/FunctionArea.java b/src/eva2/gui/plot/FunctionArea.java index 91495dfe..f37f74f6 100644 --- a/src/eva2/gui/plot/FunctionArea.java +++ b/src/eva2/gui/plot/FunctionArea.java @@ -925,7 +925,6 @@ public class FunctionArea extends DArea implements Serializable { * @return */ public DPointSet printPoints(int i) { - // for (int i = 0; i < m_PointSetContainer.size();i++) { System.out.println(""); System.out.println("GraphPointSet No " + i); @@ -959,9 +958,6 @@ public class FunctionArea extends DArea implements Serializable { if (scF instanceof Exp) { ((Exp) scF).updateMinValue(y); } - if (!checkLogValidYValue(x, y, graphLabel)) { - // if (m_log) toggleLog(); - } getGraphPointSet(graphLabel).addDPoint(x, y); } @@ -1021,9 +1017,6 @@ public class FunctionArea extends DArea implements Serializable { if (scF instanceof Exp) { ((Exp) scF).updateMinValue(y); } - if (!checkLogValidYValue(x, y, GraphLabel)) { - // if (m_log) toggleLog(); - } this.getGraphPointSet(GraphLabel).addDPoint(x, y); this.getGraphPointSet(GraphLabel).setConnectedMode(false); repaint(); @@ -1100,7 +1093,6 @@ public class FunctionArea extends DArea implements Serializable { * */ public void toggleLog() { - // System.out.println("ToggleLog log was: "+m_log); boolean setMinPos = false; if (!log && !checkLoggable()) { System.err.println("Warning: toggling logarithmics scale with values <= 0! Some points will not be displayed."); diff --git a/src/eva2/gui/plot/Graph.java b/src/eva2/gui/plot/Graph.java index a6222bc4..2b6778a0 100644 --- a/src/eva2/gui/plot/Graph.java +++ b/src/eva2/gui/plot/Graph.java @@ -2,15 +2,8 @@ package eva2.gui.plot; import java.io.Serializable; -/* - * Title: EvA2 - * Description: - * Copyright: Copyright (c) 2003 - * Company: University of Tuebingen, Computer Architecture - * @author Holger Ulmer, Felix Streichert, Hannes Planatscher - * @version: $Revision: 322 $ - * $Date: 2007-12-11 17:24:07 +0100 (Tue, 11 Dec 2007) $ - * $Author: mkron $ +/** + * */ public class Graph implements Serializable { @@ -26,7 +19,7 @@ public class Graph implements Serializable { this.plotter = plotter; graphLabel = x; if (plotter == null) { - System.out.println("In constructor m_Plotter == null"); + System.out.println("In constructor plotter == null"); } plotter.setInfoString(graphLabel, info, (float) 1.0); } diff --git a/src/eva2/gui/plot/GraphPointSet.java b/src/eva2/gui/plot/GraphPointSet.java index b3b11ae8..21cd8af0 100644 --- a/src/eva2/gui/plot/GraphPointSet.java +++ b/src/eva2/gui/plot/GraphPointSet.java @@ -1,18 +1,5 @@ package eva2.gui.plot; -/* - * Title: EvA2 - * Description: - * Copyright: Copyright (c) 2003 - * Company: University of Tuebingen, Computer Architecture - * @author Holger Ulmer, Felix Streichert, Hannes Planatscher - * @version: $Revision: 305 $ - * $Date: 2007-12-04 12:10:04 +0100 (Tue, 04 Dec 2007) $ - * $Author: mkron $ - */ -/*==========================================================================* - * IMPORTS - *==========================================================================*/ import eva2.tools.chart2d.*; import eva2.tools.math.Mathematics; @@ -21,9 +8,6 @@ import java.awt.*; import java.io.Serializable; import java.util.ArrayList; -/*==========================================================================* - * CLASS DECLARATION - *==========================================================================*/ /** * @@ -49,21 +33,21 @@ public class GraphPointSet { * Generated serial version identifier */ private static final long serialVersionUID = -5863595580492128866L; - private Color m_Color; - private double[] m_X; - private double[] m_Y; + private Color color; + private double[] x; + private double[] y; /** * @param pointset */ public PointSet(DPointSet pointset) { - m_Color = pointset.getColor(); - m_X = new double[pointset.getSize()]; - m_Y = new double[pointset.getSize()]; + color = pointset.getColor(); + x = new double[pointset.getSize()]; + y = new double[pointset.getSize()]; for (int i = 0; i < pointset.getSize(); i++) { DPoint point = pointset.getDPoint(i); - m_X[i] = point.x; - m_Y[i] = point.y; + x[i] = point.x; + y[i] = point.y; } } @@ -72,9 +56,9 @@ public class GraphPointSet { */ public DPointSet getDPointSet() { DPointSet ret = new DPointSet(100); - ret.setColor(m_Color); - for (int i = 0; i < m_X.length; i++) { - ret.addDPoint(m_X[i], m_Y[i]); + ret.setColor(color); + for (int i = 0; i < x.length; i++) { + ret.addDPoint(x[i], y[i]); } return ret; } @@ -83,74 +67,52 @@ public class GraphPointSet { * @return */ public int getSize() { - return m_X.length; + return x.length; } // /** // * // */ // public DPointSet printPoints() { - // for (int i = 0; i < m_ConnectedPointSet.getSize();i++) { - // DPoint p = m_ConnectedPointSet.getDPoint(i); + // for (int i = 0; i < connectedPointSet.getSize();i++) { + // DPoint p = connectedPointSet.getDPoint(i); // double x = p.x; // double y = p.y; // //System.out.println("point "+i+ " x= "+x+"y= "+y); // } - // return m_ConnectedPointSet.getDPointSet(); + // return connectedPointSet.getDPointSet(); // } } private int colorOffset = 0; - private DArea m_Area; - private int m_CacheIndex = 0; - private int m_CacheSize = 0; - private double[] m_cachex; - private double[] m_cachey; - private Color m_Color; - // private DPointSet m_PointSet_1; - // private DPointSet m_PointSet_2; - // private DPointSet m_PointSet_3; - private DPointSetMultiIcon m_ConnectedPointSet; - private int m_GraphLabel; - private DPointIcon m_Icon; - private String m_InfoString = "Incomplete_Run"; - private boolean m_isStatisticsGraph = false; - private ArrayList m_PointSetContainer = new ArrayList(); + private DArea area; + private int cacheIndex = 0; + private int cacheSize = 0; + private double[] cachex; + private double[] cachey; + private Color color; + private DPointSetMultiIcon connectedPointSet; + private int graphLabel; + private DPointIcon icon; + private String infoString = "Incomplete_Run"; + private boolean isStatisticsGraph = false; + private ArrayList pointSetContainer = new ArrayList(); - private float m_Stroke = (float) 1.0; + private float stroke = (float) 1.0; /** * */ public GraphPointSet(/* int size */int GraphLabel, DArea Area) { // System.out.println("Constructor GraphPointSet "+ GraphLabel); - m_cachex = new double[m_CacheSize]; - m_cachey = new double[m_CacheSize]; - m_Area = Area; - m_GraphLabel = GraphLabel; - m_ConnectedPointSet = new DPointSetMultiIcon(100); - // m_PointSet_1 = new DPointSet(100); - // m_PointSet_2 = new DPointSet(100); - // m_PointSet_3 = new DPointSet(100); - // - // DPointIcon icon1 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, 4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; - // DPointIcon icon2 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, -4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; - // - m_ConnectedPointSet.setStroke(new BasicStroke(m_Stroke)); - m_ConnectedPointSet.setConnected(true); + cachex = new double[cacheSize]; + cachey = new double[cacheSize]; + area = Area; + graphLabel = GraphLabel; + connectedPointSet = new DPointSetMultiIcon(100); + connectedPointSet.setStroke(new BasicStroke(stroke)); + connectedPointSet.setConnected(true); setColor(indexToColor(GraphLabel)); initGraph(Area); @@ -161,39 +123,18 @@ public class GraphPointSet { * @param GraphLabel */ private GraphPointSet(int size, int GraphLabel) { - m_GraphLabel = GraphLabel; - m_cachex = new double[m_CacheSize]; - m_cachey = new double[m_CacheSize]; - m_ConnectedPointSet = new DPointSetMultiIcon(100); - // m_PointSet_1 = new DPointSet(100); - // m_PointSet_2 = new DPointSet(100); - // m_PointSet_3 = new DPointSet(100); - // - // DPointIcon icon1 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, 4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; - // DPointIcon icon2 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, -4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; - // m_PointSet_2.setIcon(icon1); - // m_PointSet_3.setIcon(icon1); - // - m_ConnectedPointSet.setStroke(new BasicStroke(m_Stroke)); + graphLabel = GraphLabel; + cachex = new double[cacheSize]; + cachey = new double[cacheSize]; + connectedPointSet = new DPointSetMultiIcon(100); + connectedPointSet.setStroke(new BasicStroke(stroke)); - m_ConnectedPointSet.setConnected(true); - m_Color = Color.black; + connectedPointSet.setConnected(true); + color = Color.black; - m_Color = indexToColor(GraphLabel); + color = indexToColor(GraphLabel); - m_ConnectedPointSet.setColor(m_Color); + connectedPointSet.setColor(color); } @@ -203,16 +144,16 @@ public class GraphPointSet { */ public void addDPoint(double x, double y) { // System.out.println(" "+x+" "+y); - if (m_CacheIndex == m_CacheSize) { - for (int i = 0; i < m_CacheSize; i++) { - m_ConnectedPointSet.addDPoint(m_cachex[i], m_cachey[i]); + if (cacheIndex == cacheSize) { + for (int i = 0; i < cacheSize; i++) { + connectedPointSet.addDPoint(cachex[i], cachey[i]); } - m_ConnectedPointSet.addDPoint(x, y); - m_CacheIndex = 0; + connectedPointSet.addDPoint(x, y); + cacheIndex = 0; } else { - m_cachex[m_CacheIndex] = x; - m_cachey[m_CacheIndex] = y; - m_CacheIndex++; + cachex[cacheIndex] = x; + cachey[cacheIndex] = y; + cacheIndex++; } } @@ -220,7 +161,7 @@ public class GraphPointSet { * @param p */ public void addDPoint(DPoint p) { - m_ConnectedPointSet.addDPoint(p); + connectedPointSet.addDPoint(p); } /** @@ -233,27 +174,27 @@ public class GraphPointSet { * some data points */ public void addGraph(GraphPointSet set, DMeasures measures, boolean useForce) { - if (set.m_ConnectedPointSet.getSize() != m_ConnectedPointSet.getSize() - && m_ConnectedPointSet.getSize() != 0 && !useForce) { + if (set.connectedPointSet.getSize() != connectedPointSet.getSize() + && connectedPointSet.getSize() != 0 && !useForce) { System.err .println("WARNING addGraph not possible, lost last graph"); - System.err.println(" m_ConnectedPointSet.getSize() " - + m_ConnectedPointSet.getSize()); + System.err.println(" connectedPointSet.getSize() " + + connectedPointSet.getSize()); return; } if (set.getPointSet().getSize() == 0) { System.err.println("Refusing to add empty graph..."); return; } - m_isStatisticsGraph = true; + isStatisticsGraph = true; removeAllPoints(); - m_ConnectedPointSet.setColor(set.getColor()); + connectedPointSet.setColor(set.getColor()); - m_PointSetContainer.add(set.getPointSet()); - int[] index = new int[m_PointSetContainer.size()]; - int[] GraphSize = new int[m_PointSetContainer.size()]; - for (int i = 0; i < m_PointSetContainer.size(); i++) { - GraphSize[i] = ((PointSet) m_PointSetContainer.get(i)).getSize(); + pointSetContainer.add(set.getPointSet()); + int[] index = new int[pointSetContainer.size()]; + int[] GraphSize = new int[pointSetContainer.size()]; + for (int i = 0; i < pointSetContainer.size(); i++) { + GraphSize[i] = ((PointSet) pointSetContainer.get(i)).getSize(); if (GraphSize[i] <= 0) { System.err.println("Warning: invalid graph size of " + GraphSize[i] + " at " + i @@ -267,7 +208,7 @@ public class GraphPointSet { } boolean allSetsHaveMorePoints = true; double nextXValue; - double[] y = new double[m_PointSetContainer.size()]; + double[] y = new double[pointSetContainer.size()]; while (allSetsHaveMorePoints) { // Loop over all point sets, add them up // and calc. mean // this is a bit more complicated because it is allowed that the @@ -277,27 +218,27 @@ public class GraphPointSet { // over all points. However curves may look strange if this happens, // since they consist of // heterogenous points. - nextXValue = m_PointSetContainer.get(0).m_X[index[0]]; - // System.out.println("m_PointSetContainer.size()"+m_PointSetContainer.size()); - for (int i = 1; i < m_PointSetContainer.size(); i++) { // search for + nextXValue = pointSetContainer.get(0).x[index[0]]; + // System.out.println("pointSetContainer.size()"+pointSetContainer.size()); + for (int i = 1; i < pointSetContainer.size(); i++) { // search for // smalles x // value at // next // index // System.out.println("i="+i); - if (nextXValue > m_PointSetContainer.get(i).m_X[index[i]]) { - nextXValue = m_PointSetContainer.get(i).m_X[index[i]]; + if (nextXValue > pointSetContainer.get(i).x[index[i]]) { + nextXValue = pointSetContainer.get(i).x[index[i]]; } } // Stelle nextXValue wird gezeichnet. jetzt alle y werte dazu finden int numberofpoints = 0; - for (int i = 0; i < m_PointSetContainer.size(); i++) { // collect + for (int i = 0; i < pointSetContainer.size(); i++) { // collect // all // points at // next // x-value - if (nextXValue == m_PointSetContainer.get(i).m_X[index[i]]) { - y[i] = m_PointSetContainer.get(i).m_Y[index[i]]; + if (nextXValue == pointSetContainer.get(i).x[index[i]]) { + y[i] = pointSetContainer.get(i).y[index[i]]; index[i]++; numberofpoints++; } else { @@ -310,7 +251,7 @@ public class GraphPointSet { // y.length); // addDPoint(minx,median);// // System.out.println("ymean "+ymean+" y.length "+ y.length); - for (int i = 0; i < m_PointSetContainer.size(); i++) { // Stop if + for (int i = 0; i < pointSetContainer.size(); i++) { // Stop if // one of // the point // sets has @@ -328,35 +269,29 @@ public class GraphPointSet { * @return */ public Color getColor() { - return m_ConnectedPointSet.getColor(); + return connectedPointSet.getColor(); } /** * @return */ public DPointSet getConnectedPointSet() { - return m_ConnectedPointSet.getDPointSet(); + return connectedPointSet.getDPointSet(); } /** * @return */ public int getGraphLabel() { - return m_GraphLabel; + return graphLabel; } - // /** - // * - // */ - // public void setUnconnectedPoint (double x, double y) { - // m_PointSet_1.addDPoint(x,y); - // } /** * */ public String getInfoString() { - return m_InfoString; + return infoString; } /** @@ -364,28 +299,28 @@ public class GraphPointSet { * @return */ public DPoint getNearestDPoint(DPoint p) { - return m_ConnectedPointSet.getNearestDPoint(p); + return connectedPointSet.getNearestDPoint(p); } /** * @return */ public int getPointCount() { - return m_ConnectedPointSet.getSize(); + return connectedPointSet.getSize(); } /** * @return */ public PointSet getPointSet() { - return new PointSet(this.m_ConnectedPointSet.getDPointSet()); + return new PointSet(this.connectedPointSet.getDPointSet()); } /** * @return */ public DPointSetMultiIcon getReference2ConnectedPointSet() { - return m_ConnectedPointSet; + return connectedPointSet; } /** @@ -393,7 +328,7 @@ public class GraphPointSet { */ public void incColor() { colorOffset++; - setColor(indexToColor(m_GraphLabel + colorOffset)); + setColor(indexToColor(graphLabel + colorOffset)); } /** @@ -409,33 +344,16 @@ public class GraphPointSet { * @param Area */ public void initGraph(DArea Area) { - m_Area = Area; - m_Area.addDElement(m_ConnectedPointSet); - ((FunctionArea) m_Area).addGraphPointSet(this); - // gpArea.addDElement(m_PointSet_1); - // gpArea.addDElement(m_PointSet_2); - // gpArea.addDElement(m_PointSet_3); - // DPointIcon icon1 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, 4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; - // DPointIcon icon2 = new DPointIcon(){ - // public void paint( Graphics g ){ - // g.drawLine(-2, 0, 2, 0); - // g.drawLine(0, 0, 0, -4); - // } - // public DBorder getDBorder(){ return new DBorder(4, 4, 4, 4); } - // }; + area = Area; + area.addDElement(connectedPointSet); + ((FunctionArea) area).addGraphPointSet(this); } /** * @return */ public boolean isStatisticsGraph() { - return m_isStatisticsGraph; + return isStatisticsGraph; } /** @@ -443,30 +361,27 @@ public class GraphPointSet { * position. */ public void jump() { - m_ConnectedPointSet.jump(); + connectedPointSet.jump(); } /** * @return */ public DPointSet printPoints() { - for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) { - DPoint p = m_ConnectedPointSet.getDPoint(i); + for (int i = 0; i < connectedPointSet.getSize(); i++) { + DPoint p = connectedPointSet.getDPoint(i); double x = p.x; double y = p.y; System.out.println("point " + i + " x = " + x + "y = " + y); } - return m_ConnectedPointSet.getDPointSet(); + return connectedPointSet.getDPointSet(); } /** * */ public void removeAllPoints() { - m_ConnectedPointSet.removeAllPoints(); - // m_PointSet_1.removeAllPoints(); - // m_PointSet_2.removeAllPoints(); - // m_PointSet_3.removeAllPoints(); + connectedPointSet.removeAllPoints(); } /** @@ -474,16 +389,16 @@ public class GraphPointSet { */ public void removePoint(DPoint x) { System.out.println("removePoint " + x.x + " " + x.y); - DPoint[] buf = new DPoint[m_ConnectedPointSet.getSize()]; - for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) { - buf[i] = m_ConnectedPointSet.getDPoint(i); + DPoint[] buf = new DPoint[connectedPointSet.getSize()]; + for (int i = 0; i < connectedPointSet.getSize(); i++) { + buf[i] = connectedPointSet.getDPoint(i); } - m_ConnectedPointSet.removeAllPoints(); + connectedPointSet.removeAllPoints(); for (int i = 0; i < buf.length; i++) { if (buf[i].x == x.x && buf[i].y == x.y) { System.out.println("point found"); } else { - m_ConnectedPointSet.addDPoint(buf[i]); + connectedPointSet.addDPoint(buf[i]); } } @@ -493,8 +408,8 @@ public class GraphPointSet { * @param c */ public void setColor(Color c) { - m_Color = c; - m_ConnectedPointSet.setColor(m_Color); + color = c; + connectedPointSet.setColor(color); } public void setColorByIndex(int i) { @@ -505,15 +420,15 @@ public class GraphPointSet { * @param p */ public void setConnectedMode(boolean p) { - m_ConnectedPointSet.setConnected(p); + connectedPointSet.setConnected(p); } /** * @param p */ public void setIcon(DPointIcon p) { - this.m_Icon = p; - this.m_ConnectedPointSet.setIcon(p); + this.icon = p; + this.connectedPointSet.setIcon(p); } /** @@ -521,9 +436,9 @@ public class GraphPointSet { * @param stroke */ public void setInfoString(String x, float stroke) { - m_InfoString = x; - m_Stroke = stroke; - // setStroke(new BasicStroke( m_Stroke )); + infoString = x; + this.stroke = stroke; + // setStroke(new BasicStroke( stroke )); } /** @@ -532,7 +447,7 @@ public class GraphPointSet { * @param x */ public void setInfoString(String x) { - m_InfoString = x; + infoString = x; } /** @@ -541,10 +456,10 @@ public class GraphPointSet { * @return the median point of this point set or null if it is empty */ public DPoint getMedPoint() { - if (m_ConnectedPointSet == null) { + if (connectedPointSet == null) { return null; } - int medX = m_ConnectedPointSet.getSize() / 2; - return m_ConnectedPointSet.getDPoint(medX); + int medX = connectedPointSet.getSize() / 2; + return connectedPointSet.getDPoint(medX); } } diff --git a/src/eva2/gui/plot/InterfaceDPointWithContent.java b/src/eva2/gui/plot/InterfaceDPointWithContent.java index 67fdf246..465cb46c 100644 --- a/src/eva2/gui/plot/InterfaceDPointWithContent.java +++ b/src/eva2/gui/plot/InterfaceDPointWithContent.java @@ -4,11 +4,7 @@ import eva2.optimization.individuals.AbstractEAIndividual; import eva2.optimization.problems.InterfaceOptimizationProblem; /** - * Created by IntelliJ IDEA. - * User: streiche - * Date: 08.09.2005 - * Time: 10:16:18 - * To change this template use File | Settings | File Templates. + * */ public interface InterfaceDPointWithContent { public void setEAIndividual(AbstractEAIndividual indy); diff --git a/src/eva2/gui/plot/Plot.java b/src/eva2/gui/plot/Plot.java index ef3f856f..ee638161 100644 --- a/src/eva2/gui/plot/Plot.java +++ b/src/eva2/gui/plot/Plot.java @@ -29,7 +29,7 @@ public class Plot implements PlotInterface, Serializable { */ private static final long serialVersionUID = -9027101244918249825L; private JFileChooser fileChooser; - private JPanel m_ButtonPanel; + private JPanel buttonPanel; private String plotName; private String xAxisText; private String yAxisText; @@ -193,14 +193,14 @@ public class Plot implements PlotInterface, Serializable { byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true); // internalFrame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); - m_ButtonPanel = new JPanel(); + buttonPanel = new JPanel(); plotArea = new FunctionArea(xAxisText, yAxisText); - m_ButtonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); + buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); - installButtons(m_ButtonPanel); + installButtons(buttonPanel); // getContentPane().smultetLayout( new GridLayout(1, 4) ); - internalFrame.add(m_ButtonPanel, BorderLayout.PAGE_END); + internalFrame.add(buttonPanel, BorderLayout.PAGE_END); internalFrame.add(plotArea, BorderLayout.CENTER); // north was not so // nice internalFrame.addInternalFrameListener(new InternalFrameAdapter() {