Remove remaining m_ from eva2.gui

This commit is contained in:
Fabian Becker 2014-02-05 15:11:59 +01:00
parent 8c38ce8cbd
commit 46bff71b69
17 changed files with 160 additions and 296 deletions

View File

@ -70,10 +70,8 @@ public class BeanInspector {
continue; continue;
} }
System.out.println("getter_1 = " + getter_1.getName() + " getter_2 = " + getter_2.getName()); System.out.println("getter_1 = " + getter_1.getName() + " getter_2 = " + getter_2.getName());
//System.out.println("type = "+type.getName() );
Object args_1[] = {}; Object args_1[] = {};
Object args_2[] = {}; Object args_2[] = {};
//System.out.println("m_Target"+m_Target.toString());
try { try {
Object value_1 = getter_1.invoke(obj1, args_1); Object value_1 = getter_1.invoke(obj1, args_1);
Object value_2 = getter_2.invoke(obj2, args_2); Object value_2 = getter_2.invoke(obj2, args_2);
@ -340,7 +338,6 @@ public class BeanInspector {
//System.out.println("name = "+name ); //System.out.println("name = "+name );
//System.out.println("type = "+type.getName() ); //System.out.println("type = "+type.getName() );
Object args[] = {}; Object args[] = {};
//System.out.println("m_obj"+m_obj.toString());
try { try {
nameArray[i] = name; nameArray[i] = name;

View File

@ -1,14 +1,4 @@
package eva2.gui; 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.OptimizationStateListener;
import eva2.optimization.modules.ModuleAdapter; import eva2.optimization.modules.ModuleAdapter;
@ -29,7 +19,7 @@ import java.util.logging.Logger;
public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Serializable, PanelMaker { public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Serializable, PanelMaker {
private static final Logger LOGGER = Logger.getLogger(EvAModuleButtonPanelMaker.class.getName()); private static final Logger LOGGER = Logger.getLogger(EvAModuleButtonPanelMaker.class.getName());
private String m_Name = "undefined"; private String name = "undefined";
private ModuleAdapter moduleAdapter; private ModuleAdapter moduleAdapter;
private boolean runningState; private boolean runningState;
private JButton runButton; private JButton runButton;
@ -44,7 +34,7 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser
* *
*/ */
public EvAModuleButtonPanelMaker(ModuleAdapter adapter, boolean state) { public EvAModuleButtonPanelMaker(ModuleAdapter adapter, boolean state) {
m_Name = "GENERAL"; name = "GENERAL";
runningState = state; runningState = state;
moduleAdapter = adapter; moduleAdapter = adapter;
} }
@ -197,7 +187,7 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser
* *
*/ */
public String getName() { public String getName() {
return m_Name; return name;
} }
/** /**

View File

@ -1,14 +1,4 @@
package eva2.gui; 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.EvAInfo;
import eva2.tools.BasicResourceLoader; import eva2.tools.BasicResourceLoader;
@ -27,21 +17,21 @@ import java.net.URL;
* *
*/ */
public class HtmlDemo { public class HtmlDemo {
private JEditorPane m_html; private JEditorPane htmlEditorPane;
private String m_name; private String name;
/** /**
* *
*/ */
public HtmlDemo(String name) { public HtmlDemo(String name) {
m_name = name; this.name = name;
} }
/** /**
* *
*/ */
public JEditorPane getPane() { public JEditorPane getPane() {
return m_html; return htmlEditorPane;
} }
/** /**
@ -53,7 +43,7 @@ public class HtmlDemo {
} }
public boolean resourceExists() { public boolean resourceExists() {
URL url = ClassLoader.getSystemResource("html/" + m_name); URL url = ClassLoader.getSystemResource("html/" + name);
return (url != null); return (url != null);
} }
@ -68,17 +58,17 @@ public class HtmlDemo {
public void show() { public void show() {
try { try {
URL url = null; URL url = null;
url = this.getClass().getClassLoader().getSystemResource("html/" + m_name); url = this.getClass().getClassLoader().getSystemResource("html/" + name);
try { try {
m_html = new JEditorPane(url); htmlEditorPane = new JEditorPane(url);
} catch (java.io.IOException ioe) { } catch (java.io.IOException ioe) {
url = this.getClass().getClassLoader().getSystemResource("html/Default.html"); url = this.getClass().getClassLoader().getSystemResource("html/Default.html");
m_html = new JEditorPane(url); htmlEditorPane = new JEditorPane(url);
} }
//m_html = new JEditorPane(htmlDescription); //htmlEditorPane = new JEditorPane(htmlDescription);
m_html.setEditable(false); htmlEditorPane.setEditable(false);
m_html.addHyperlinkListener(createHyperLinkListener()); htmlEditorPane.addHyperlinkListener(createHyperLinkListener());
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
System.out.println("Malformed URL: " + e); System.out.println("Malformed URL: " + e);
@ -88,13 +78,13 @@ public class HtmlDemo {
e.printStackTrace(); e.printStackTrace();
return; return;
} }
JFrame frame = new JFrame(m_name); JFrame frame = new JFrame(name);
BasicResourceLoader loader = BasicResourceLoader.instance(); BasicResourceLoader loader = BasicResourceLoader.instance();
byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true); byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true);
frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes));
JScrollPane scroller = new JScrollPane(); JScrollPane scroller = new JScrollPane();
JViewport vp = scroller.getViewport(); JViewport vp = scroller.getViewport();
vp.add(m_html); vp.add(htmlEditorPane);
scroller.setPreferredSize(new Dimension(600, 500)); scroller.setPreferredSize(new Dimension(600, 500));
frame.getContentPane().add(scroller, BorderLayout.CENTER); frame.getContentPane().add(scroller, BorderLayout.CENTER);
frame.pack(); frame.pack();
@ -110,11 +100,11 @@ public class HtmlDemo {
public void hyperlinkUpdate(HyperlinkEvent e) { public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (e instanceof HTMLFrameHyperlinkEvent) { if (e instanceof HTMLFrameHyperlinkEvent) {
((HTMLDocument) m_html.getDocument()).processHTMLFrameHyperlinkEvent( ((HTMLDocument) htmlEditorPane.getDocument()).processHTMLFrameHyperlinkEvent(
(HTMLFrameHyperlinkEvent) e); (HTMLFrameHyperlinkEvent) e);
} else { } else {
try { try {
m_html.setPage(e.getURL()); htmlEditorPane.setPage(e.getURL());
} catch (IOException ioe) { } catch (IOException ioe) {
System.out.println("IOE: " + ioe); System.out.println("IOE: " + ioe);
} }

View File

@ -7,7 +7,7 @@ import java.io.File;
* *
*/ */
public abstract class JDocFrame extends JInternalFrame { public abstract class JDocFrame extends JInternalFrame {
private File m_file; private File file;
private String titleStr; private String titleStr;
protected boolean changed = false; protected boolean changed = false;
@ -24,14 +24,14 @@ public abstract class JDocFrame extends JInternalFrame {
*/ */
public JDocFrame(File file) { public JDocFrame(File file) {
this(file.getName()); this(file.getName());
m_file = file; this.file = file;
} }
/** /**
* *
*/ */
public File getFile() { public File getFile() {
return m_file; return file;
} }
/** /**
@ -45,8 +45,8 @@ public abstract class JDocFrame extends JInternalFrame {
* *
*/ */
public void save() { public void save() {
if (m_file != null) { if (file != null) {
save(m_file); save(file);
} }
} }
@ -54,8 +54,8 @@ public abstract class JDocFrame extends JInternalFrame {
* *
*/ */
public void save(File f) { public void save(File f) {
if (!f.equals(m_file)) { if (!f.equals(file)) {
m_file = f; file = f;
titleStr = f.getName(); titleStr = f.getName();
} }
setChangedImpl(false); setChangedImpl(false);

View File

@ -128,7 +128,6 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
textArea.setText(null); textArea.setText(null);
} else if (src == saveItem) { } else if (src == saveItem) {
FileTools.saveObjectWithFileChooser(frame, textArea.getText()); FileTools.saveObjectWithFileChooser(frame, textArea.getText());
// File outfile = FileTools.writeString("TextOutput.txt", m_TextArea.getText());
} else { } else {
System.err.println("Unknown popup component (JTextoutputFrame)!"); System.err.println("Unknown popup component (JTextoutputFrame)!");
} }

View File

@ -811,7 +811,7 @@ public class Main extends JFrame implements OptimizationStateListener {
newModuleAdapter = comAdapter.getModuleAdapter(selectedModule, optimizationParameters, withGUI ? null : "EvA2"); newModuleAdapter = comAdapter.getModuleAdapter(selectedModule, optimizationParameters, withGUI ? null : "EvA2");
} catch (Exception e) { } catch (Exception e) {
LOGGER.log(Level.SEVERE, "Error loading module.", 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) { if (newModuleAdapter == null) {
// When launching a Java Web Start application, baseDir will always be null! // When launching a Java Web Start application, baseDir will always be null!

View File

@ -329,7 +329,6 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
* @param a The action listener. * @param a The action listener.
*/ */
public void addOkListener(ActionListener a) { 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 * @param a The action listener
*/ */
public void removeOkListener(ActionListener a) { 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.targets[i] = this.editors[i].view;
} }
} }
//this.m_OptimizationTargets.setSelectedTargets(list);
this.updateCenterComponent(evt); // Let our panel update before guys downstream this.updateCenterComponent(evt); // Let our panel update before guys downstream
propertyChangeSupport.firePropertyChange("", optimizationObjectives, optimizationObjectives); propertyChangeSupport.firePropertyChange("", optimizationObjectives, optimizationObjectives);
} }

View File

@ -401,7 +401,6 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
* @param a The action listener. * @param a The action listener.
*/ */
public void addOkListener(ActionListener a) { public void addOkListener(ActionListener a) {
//m_OKButton.addActionListener(a);
} }
/** /**
@ -410,7 +409,6 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
* @param a The action listener * @param a The action listener
*/ */
public void removeOkListener(ActionListener a) { 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.targets[i] = this.editors[i].view;
} }
} }
//this.m_OptimizationTargets.setSelectedTargets(list);
this.updateCenterComponent(evt); // Let our panel update before guys downstream this.updateCenterComponent(evt); // Let our panel update before guys downstream
propertyChangeSupport.firePropertyChange("", optimizationObjectivesWithWeights, optimizationObjectivesWithWeights); propertyChangeSupport.firePropertyChange("", optimizationObjectivesWithWeights, optimizationObjectivesWithWeights);
} }

View File

@ -88,7 +88,6 @@ public class StatisticsEditor implements PropertyEditor {
public void paintValue(Graphics gfx, Rectangle box) { public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics(); FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2; int vpad = (box.height - fm.getAscent()) / 2;
//String rep = EVAHELP.cutClassName(m_ElementClass.getName());
gfx.drawString("StatisticeEditor", 2, fm.getHeight() + vpad - 3); gfx.drawString("StatisticeEditor", 2, fm.getHeight() + vpad - 3);
} }

View File

@ -46,7 +46,6 @@ public class StringSelectionEditor extends AbstractListSelectionEditor {
protected boolean setObject(Object o) { protected boolean setObject(Object o) {
if (o instanceof StringSelection) { if (o instanceof StringSelection) {
strs = (StringSelection) o; strs = (StringSelection) o;
// m_AreaObject.addPropertyChangeListener(this);
return true; return true;
} else { } else {
return false; return false;

View File

@ -72,7 +72,7 @@ public class DPointSetMultiIcon extends DComponent {
protected boolean connectedMI; protected boolean connectedMI;
protected DPointIcon iconMI = null; protected DPointIcon iconMI = null;
protected DPointSetMultiIcon.JumpManager jumperMI = new DPointSetMultiIcon.JumpManager(); protected DPointSetMultiIcon.JumpManager jumperMI = new DPointSetMultiIcon.JumpManager();
protected ArrayList<DPointIcon> m_IconsMI = new ArrayList<DPointIcon>(); protected ArrayList<DPointIcon> iconsMI = new ArrayList<DPointIcon>();
protected Stroke strokeMI = new BasicStroke(); protected Stroke strokeMI = new BasicStroke();
protected DIntDoubleMap xMI; protected DIntDoubleMap xMI;
@ -114,7 +114,7 @@ public class DPointSetMultiIcon extends DComponent {
public void addDPoint(DPoint p) { public void addDPoint(DPoint p) {
xMI.addImage(p.x); xMI.addImage(p.x);
yMI.addImage(p.y); yMI.addImage(p.y);
m_IconsMI.add(p.getIcon()); iconsMI.add(p.getIcon());
rectangle.insert(p); rectangle.insert(p);
repaint(); repaint();
} }
@ -151,7 +151,7 @@ public class DPointSetMultiIcon extends DComponent {
} }
public ArrayList<DPointIcon> getIconsMI() { public ArrayList<DPointIcon> getIconsMI() {
return this.m_IconsMI; return this.iconsMI;
} }
/** /**
@ -167,7 +167,7 @@ public class DPointSetMultiIcon extends DComponent {
} else { } else {
DPoint result = new DPoint(xMI.getImage(minIndex), DPoint result = new DPoint(xMI.getImage(minIndex),
yMI.getImage(minIndex)); yMI.getImage(minIndex));
result.setIcon((DPointIcon) this.m_IconsMI.get(minIndex)); result.setIcon((DPointIcon) this.iconsMI.get(minIndex));
return result; 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.setStroke(new BasicStroke());
g.translate(p2.x, p2.y); 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.translate(-p2.x, -p2.y);
g.setStroke(strokeMI); g.setStroke(strokeMI);
} else { } else {
@ -277,17 +277,17 @@ public class DPointSetMultiIcon extends DComponent {
//for (int i = 0; i < size; i++) //for (int i = 0; i < size; i++)
// @todo Streiche: Mal wieder eine index out of bounds exception, dass ist einfach mist... // @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 { try {
p = m.getPoint(xMI.getImage(i), yMI.getImage(i)); p = m.getPoint(xMI.getImage(i), yMI.getImage(i));
if (p == null) { if (p == null) {
continue; continue;
} }
if (this.m_IconsMI.get(i) != null) { if (this.iconsMI.get(i) != null) {
g.setStroke(new BasicStroke()); g.setStroke(new BasicStroke());
g.translate(p.x, p.y); 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.translate(-p.x, -p.y);
g.setStroke(strokeMI); g.setStroke(strokeMI);
} else { } else {
@ -372,7 +372,7 @@ public class DPointSetMultiIcon extends DComponent {
rectangle.insert(p); rectangle.insert(p);
xMI.setImage(index, p.x); xMI.setImage(index, p.x);
yMI.setImage(index, p.y); yMI.setImage(index, p.y);
m_IconsMI.set(index, p.getIcon()); iconsMI.set(index, p.getIcon());
restore(); restore();
repaint(); repaint();
} }

View File

@ -74,7 +74,7 @@ public class DataViewer implements DataViewerInterface {
*/ */
class ViewContainer extends ArrayList { class ViewContainer extends ArrayList {
private DataViewer m_actualPlot; private DataViewer actualPlot;
/** /**
* *
@ -100,17 +100,17 @@ class ViewContainer extends ArrayList {
* *
*/ */
public DataViewer getPlot(String name) { public DataViewer getPlot(String name) {
if (m_actualPlot != null) { if (actualPlot != null) {
if (m_actualPlot.getName().equals(name)) { if (actualPlot.getName().equals(name)) {
return m_actualPlot; return actualPlot;
} }
} }
DataViewer temp = null; DataViewer temp = null;
for (int i = 0; i < size(); i++) { for (int i = 0; i < size(); i++) {
temp = (DataViewer) (get(i)); temp = (DataViewer) (get(i));
if (name.equals(temp.getName())) { if (name.equals(temp.getName())) {
m_actualPlot = temp; actualPlot = temp;
return m_actualPlot; return actualPlot;
} }
} }
return null; return null;

View File

@ -925,7 +925,6 @@ public class FunctionArea extends DArea implements Serializable {
* @return * @return
*/ */
public DPointSet printPoints(int i) { public DPointSet printPoints(int i) {
// for (int i = 0; i < m_PointSetContainer.size();i++) {
System.out.println(""); System.out.println("");
System.out.println("GraphPointSet No " + i); System.out.println("GraphPointSet No " + i);
@ -959,9 +958,6 @@ public class FunctionArea extends DArea implements Serializable {
if (scF instanceof Exp) { if (scF instanceof Exp) {
((Exp) scF).updateMinValue(y); ((Exp) scF).updateMinValue(y);
} }
if (!checkLogValidYValue(x, y, graphLabel)) {
// if (m_log) toggleLog();
}
getGraphPointSet(graphLabel).addDPoint(x, y); getGraphPointSet(graphLabel).addDPoint(x, y);
} }
@ -1021,9 +1017,6 @@ public class FunctionArea extends DArea implements Serializable {
if (scF instanceof Exp) { if (scF instanceof Exp) {
((Exp) scF).updateMinValue(y); ((Exp) scF).updateMinValue(y);
} }
if (!checkLogValidYValue(x, y, GraphLabel)) {
// if (m_log) toggleLog();
}
this.getGraphPointSet(GraphLabel).addDPoint(x, y); this.getGraphPointSet(GraphLabel).addDPoint(x, y);
this.getGraphPointSet(GraphLabel).setConnectedMode(false); this.getGraphPointSet(GraphLabel).setConnectedMode(false);
repaint(); repaint();
@ -1100,7 +1093,6 @@ public class FunctionArea extends DArea implements Serializable {
* *
*/ */
public void toggleLog() { public void toggleLog() {
// System.out.println("ToggleLog log was: "+m_log);
boolean setMinPos = false; boolean setMinPos = false;
if (!log && !checkLoggable()) { if (!log && !checkLoggable()) {
System.err.println("Warning: toggling logarithmics scale with values <= 0! Some points will not be displayed."); System.err.println("Warning: toggling logarithmics scale with values <= 0! Some points will not be displayed.");

View File

@ -2,15 +2,8 @@ package eva2.gui.plot;
import java.io.Serializable; 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 { public class Graph implements Serializable {
@ -26,7 +19,7 @@ public class Graph implements Serializable {
this.plotter = plotter; this.plotter = plotter;
graphLabel = x; graphLabel = x;
if (plotter == null) { 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); plotter.setInfoString(graphLabel, info, (float) 1.0);
} }

View File

@ -1,18 +1,5 @@
package eva2.gui.plot; 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.chart2d.*;
import eva2.tools.math.Mathematics; import eva2.tools.math.Mathematics;
@ -21,9 +8,6 @@ import java.awt.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
/*==========================================================================*
* CLASS DECLARATION
*==========================================================================*/
/** /**
* *
@ -49,21 +33,21 @@ public class GraphPointSet {
* Generated serial version identifier * Generated serial version identifier
*/ */
private static final long serialVersionUID = -5863595580492128866L; private static final long serialVersionUID = -5863595580492128866L;
private Color m_Color; private Color color;
private double[] m_X; private double[] x;
private double[] m_Y; private double[] y;
/** /**
* @param pointset * @param pointset
*/ */
public PointSet(DPointSet pointset) { public PointSet(DPointSet pointset) {
m_Color = pointset.getColor(); color = pointset.getColor();
m_X = new double[pointset.getSize()]; x = new double[pointset.getSize()];
m_Y = new double[pointset.getSize()]; y = new double[pointset.getSize()];
for (int i = 0; i < pointset.getSize(); i++) { for (int i = 0; i < pointset.getSize(); i++) {
DPoint point = pointset.getDPoint(i); DPoint point = pointset.getDPoint(i);
m_X[i] = point.x; x[i] = point.x;
m_Y[i] = point.y; y[i] = point.y;
} }
} }
@ -72,9 +56,9 @@ public class GraphPointSet {
*/ */
public DPointSet getDPointSet() { public DPointSet getDPointSet() {
DPointSet ret = new DPointSet(100); DPointSet ret = new DPointSet(100);
ret.setColor(m_Color); ret.setColor(color);
for (int i = 0; i < m_X.length; i++) { for (int i = 0; i < x.length; i++) {
ret.addDPoint(m_X[i], m_Y[i]); ret.addDPoint(x[i], y[i]);
} }
return ret; return ret;
} }
@ -83,74 +67,52 @@ public class GraphPointSet {
* @return * @return
*/ */
public int getSize() { public int getSize() {
return m_X.length; return x.length;
} }
// /** // /**
// * // *
// */ // */
// public DPointSet printPoints() { // public DPointSet printPoints() {
// for (int i = 0; i < m_ConnectedPointSet.getSize();i++) { // for (int i = 0; i < connectedPointSet.getSize();i++) {
// DPoint p = m_ConnectedPointSet.getDPoint(i); // DPoint p = connectedPointSet.getDPoint(i);
// double x = p.x; // double x = p.x;
// double y = p.y; // double y = p.y;
// //System.out.println("point "+i+ " x= "+x+"y= "+y); // //System.out.println("point "+i+ " x= "+x+"y= "+y);
// } // }
// return m_ConnectedPointSet.getDPointSet(); // return connectedPointSet.getDPointSet();
// } // }
} }
private int colorOffset = 0; private int colorOffset = 0;
private DArea m_Area; private DArea area;
private int m_CacheIndex = 0; private int cacheIndex = 0;
private int m_CacheSize = 0; private int cacheSize = 0;
private double[] m_cachex; private double[] cachex;
private double[] m_cachey; private double[] cachey;
private Color m_Color; private Color color;
// private DPointSet m_PointSet_1; private DPointSetMultiIcon connectedPointSet;
// private DPointSet m_PointSet_2; private int graphLabel;
// private DPointSet m_PointSet_3; private DPointIcon icon;
private DPointSetMultiIcon m_ConnectedPointSet; private String infoString = "Incomplete_Run";
private int m_GraphLabel; private boolean isStatisticsGraph = false;
private DPointIcon m_Icon; private ArrayList<PointSet> pointSetContainer = new ArrayList<PointSet>();
private String m_InfoString = "Incomplete_Run";
private boolean m_isStatisticsGraph = false;
private ArrayList<PointSet> m_PointSetContainer = new ArrayList<PointSet>();
private float m_Stroke = (float) 1.0; private float stroke = (float) 1.0;
/** /**
* *
*/ */
public GraphPointSet(/* int size */int GraphLabel, DArea Area) { public GraphPointSet(/* int size */int GraphLabel, DArea Area) {
// System.out.println("Constructor GraphPointSet "+ GraphLabel); // System.out.println("Constructor GraphPointSet "+ GraphLabel);
m_cachex = new double[m_CacheSize]; cachex = new double[cacheSize];
m_cachey = new double[m_CacheSize]; cachey = new double[cacheSize];
m_Area = Area; area = Area;
m_GraphLabel = GraphLabel; graphLabel = GraphLabel;
m_ConnectedPointSet = new DPointSetMultiIcon(100); connectedPointSet = new DPointSetMultiIcon(100);
// m_PointSet_1 = new DPointSet(100); connectedPointSet.setStroke(new BasicStroke(stroke));
// m_PointSet_2 = new DPointSet(100); connectedPointSet.setConnected(true);
// 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);
setColor(indexToColor(GraphLabel)); setColor(indexToColor(GraphLabel));
initGraph(Area); initGraph(Area);
@ -161,39 +123,18 @@ public class GraphPointSet {
* @param GraphLabel * @param GraphLabel
*/ */
private GraphPointSet(int size, int GraphLabel) { private GraphPointSet(int size, int GraphLabel) {
m_GraphLabel = GraphLabel; graphLabel = GraphLabel;
m_cachex = new double[m_CacheSize]; cachex = new double[cacheSize];
m_cachey = new double[m_CacheSize]; cachey = new double[cacheSize];
m_ConnectedPointSet = new DPointSetMultiIcon(100); connectedPointSet = new DPointSetMultiIcon(100);
// m_PointSet_1 = new DPointSet(100); connectedPointSet.setStroke(new BasicStroke(stroke));
// 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));
m_ConnectedPointSet.setConnected(true); connectedPointSet.setConnected(true);
m_Color = Color.black; 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) { public void addDPoint(double x, double y) {
// System.out.println(" "+x+" "+y); // System.out.println(" "+x+" "+y);
if (m_CacheIndex == m_CacheSize) { if (cacheIndex == cacheSize) {
for (int i = 0; i < m_CacheSize; i++) { for (int i = 0; i < cacheSize; i++) {
m_ConnectedPointSet.addDPoint(m_cachex[i], m_cachey[i]); connectedPointSet.addDPoint(cachex[i], cachey[i]);
} }
m_ConnectedPointSet.addDPoint(x, y); connectedPointSet.addDPoint(x, y);
m_CacheIndex = 0; cacheIndex = 0;
} else { } else {
m_cachex[m_CacheIndex] = x; cachex[cacheIndex] = x;
m_cachey[m_CacheIndex] = y; cachey[cacheIndex] = y;
m_CacheIndex++; cacheIndex++;
} }
} }
@ -220,7 +161,7 @@ public class GraphPointSet {
* @param p * @param p
*/ */
public void addDPoint(DPoint p) { public void addDPoint(DPoint p) {
m_ConnectedPointSet.addDPoint(p); connectedPointSet.addDPoint(p);
} }
/** /**
@ -233,27 +174,27 @@ public class GraphPointSet {
* some data points * some data points
*/ */
public void addGraph(GraphPointSet set, DMeasures measures, boolean useForce) { public void addGraph(GraphPointSet set, DMeasures measures, boolean useForce) {
if (set.m_ConnectedPointSet.getSize() != m_ConnectedPointSet.getSize() if (set.connectedPointSet.getSize() != connectedPointSet.getSize()
&& m_ConnectedPointSet.getSize() != 0 && !useForce) { && connectedPointSet.getSize() != 0 && !useForce) {
System.err System.err
.println("WARNING addGraph not possible, lost last graph"); .println("WARNING addGraph not possible, lost last graph");
System.err.println(" m_ConnectedPointSet.getSize() " System.err.println(" connectedPointSet.getSize() "
+ m_ConnectedPointSet.getSize()); + connectedPointSet.getSize());
return; return;
} }
if (set.getPointSet().getSize() == 0) { if (set.getPointSet().getSize() == 0) {
System.err.println("Refusing to add empty graph..."); System.err.println("Refusing to add empty graph...");
return; return;
} }
m_isStatisticsGraph = true; isStatisticsGraph = true;
removeAllPoints(); removeAllPoints();
m_ConnectedPointSet.setColor(set.getColor()); connectedPointSet.setColor(set.getColor());
m_PointSetContainer.add(set.getPointSet()); pointSetContainer.add(set.getPointSet());
int[] index = new int[m_PointSetContainer.size()]; int[] index = new int[pointSetContainer.size()];
int[] GraphSize = new int[m_PointSetContainer.size()]; int[] GraphSize = new int[pointSetContainer.size()];
for (int i = 0; i < m_PointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
GraphSize[i] = ((PointSet) m_PointSetContainer.get(i)).getSize(); GraphSize[i] = ((PointSet) pointSetContainer.get(i)).getSize();
if (GraphSize[i] <= 0) { if (GraphSize[i] <= 0) {
System.err.println("Warning: invalid graph size of " System.err.println("Warning: invalid graph size of "
+ GraphSize[i] + " at " + i + GraphSize[i] + " at " + i
@ -267,7 +208,7 @@ public class GraphPointSet {
} }
boolean allSetsHaveMorePoints = true; boolean allSetsHaveMorePoints = true;
double nextXValue; 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 while (allSetsHaveMorePoints) { // Loop over all point sets, add them up
// and calc. mean // and calc. mean
// this is a bit more complicated because it is allowed that the // 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, // over all points. However curves may look strange if this happens,
// since they consist of // since they consist of
// heterogenous points. // heterogenous points.
nextXValue = m_PointSetContainer.get(0).m_X[index[0]]; nextXValue = pointSetContainer.get(0).x[index[0]];
// System.out.println("m_PointSetContainer.size()"+m_PointSetContainer.size()); // System.out.println("pointSetContainer.size()"+pointSetContainer.size());
for (int i = 1; i < m_PointSetContainer.size(); i++) { // search for for (int i = 1; i < pointSetContainer.size(); i++) { // search for
// smalles x // smalles x
// value at // value at
// next // next
// index // index
// System.out.println("i="+i); // System.out.println("i="+i);
if (nextXValue > m_PointSetContainer.get(i).m_X[index[i]]) { if (nextXValue > pointSetContainer.get(i).x[index[i]]) {
nextXValue = m_PointSetContainer.get(i).m_X[index[i]]; nextXValue = pointSetContainer.get(i).x[index[i]];
} }
} }
// Stelle nextXValue wird gezeichnet. jetzt alle y werte dazu finden // Stelle nextXValue wird gezeichnet. jetzt alle y werte dazu finden
int numberofpoints = 0; int numberofpoints = 0;
for (int i = 0; i < m_PointSetContainer.size(); i++) { // collect for (int i = 0; i < pointSetContainer.size(); i++) { // collect
// all // all
// points at // points at
// next // next
// x-value // x-value
if (nextXValue == m_PointSetContainer.get(i).m_X[index[i]]) { if (nextXValue == pointSetContainer.get(i).x[index[i]]) {
y[i] = m_PointSetContainer.get(i).m_Y[index[i]]; y[i] = pointSetContainer.get(i).y[index[i]];
index[i]++; index[i]++;
numberofpoints++; numberofpoints++;
} else { } else {
@ -310,7 +251,7 @@ public class GraphPointSet {
// y.length); // y.length);
// addDPoint(minx,median);// // addDPoint(minx,median);//
// System.out.println("ymean "+ymean+" y.length "+ y.length); // 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 // one of
// the point // the point
// sets has // sets has
@ -328,35 +269,29 @@ public class GraphPointSet {
* @return * @return
*/ */
public Color getColor() { public Color getColor() {
return m_ConnectedPointSet.getColor(); return connectedPointSet.getColor();
} }
/** /**
* @return * @return
*/ */
public DPointSet getConnectedPointSet() { public DPointSet getConnectedPointSet() {
return m_ConnectedPointSet.getDPointSet(); return connectedPointSet.getDPointSet();
} }
/** /**
* @return * @return
*/ */
public int getGraphLabel() { public int getGraphLabel() {
return m_GraphLabel; return graphLabel;
} }
// /**
// *
// */
// public void setUnconnectedPoint (double x, double y) {
// m_PointSet_1.addDPoint(x,y);
// }
/** /**
* *
*/ */
public String getInfoString() { public String getInfoString() {
return m_InfoString; return infoString;
} }
/** /**
@ -364,28 +299,28 @@ public class GraphPointSet {
* @return * @return
*/ */
public DPoint getNearestDPoint(DPoint p) { public DPoint getNearestDPoint(DPoint p) {
return m_ConnectedPointSet.getNearestDPoint(p); return connectedPointSet.getNearestDPoint(p);
} }
/** /**
* @return * @return
*/ */
public int getPointCount() { public int getPointCount() {
return m_ConnectedPointSet.getSize(); return connectedPointSet.getSize();
} }
/** /**
* @return * @return
*/ */
public PointSet getPointSet() { public PointSet getPointSet() {
return new PointSet(this.m_ConnectedPointSet.getDPointSet()); return new PointSet(this.connectedPointSet.getDPointSet());
} }
/** /**
* @return * @return
*/ */
public DPointSetMultiIcon getReference2ConnectedPointSet() { public DPointSetMultiIcon getReference2ConnectedPointSet() {
return m_ConnectedPointSet; return connectedPointSet;
} }
/** /**
@ -393,7 +328,7 @@ public class GraphPointSet {
*/ */
public void incColor() { public void incColor() {
colorOffset++; colorOffset++;
setColor(indexToColor(m_GraphLabel + colorOffset)); setColor(indexToColor(graphLabel + colorOffset));
} }
/** /**
@ -409,33 +344,16 @@ public class GraphPointSet {
* @param Area * @param Area
*/ */
public void initGraph(DArea Area) { public void initGraph(DArea Area) {
m_Area = Area; area = Area;
m_Area.addDElement(m_ConnectedPointSet); area.addDElement(connectedPointSet);
((FunctionArea) m_Area).addGraphPointSet(this); ((FunctionArea) 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); }
// };
} }
/** /**
* @return * @return
*/ */
public boolean isStatisticsGraph() { public boolean isStatisticsGraph() {
return m_isStatisticsGraph; return isStatisticsGraph;
} }
/** /**
@ -443,30 +361,27 @@ public class GraphPointSet {
* position. * position.
*/ */
public void jump() { public void jump() {
m_ConnectedPointSet.jump(); connectedPointSet.jump();
} }
/** /**
* @return * @return
*/ */
public DPointSet printPoints() { public DPointSet printPoints() {
for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) { for (int i = 0; i < connectedPointSet.getSize(); i++) {
DPoint p = m_ConnectedPointSet.getDPoint(i); DPoint p = connectedPointSet.getDPoint(i);
double x = p.x; double x = p.x;
double y = p.y; double y = p.y;
System.out.println("point " + i + " x = " + x + "y = " + y); System.out.println("point " + i + " x = " + x + "y = " + y);
} }
return m_ConnectedPointSet.getDPointSet(); return connectedPointSet.getDPointSet();
} }
/** /**
* *
*/ */
public void removeAllPoints() { public void removeAllPoints() {
m_ConnectedPointSet.removeAllPoints(); connectedPointSet.removeAllPoints();
// m_PointSet_1.removeAllPoints();
// m_PointSet_2.removeAllPoints();
// m_PointSet_3.removeAllPoints();
} }
/** /**
@ -474,16 +389,16 @@ public class GraphPointSet {
*/ */
public void removePoint(DPoint x) { public void removePoint(DPoint x) {
System.out.println("removePoint " + x.x + " " + x.y); System.out.println("removePoint " + x.x + " " + x.y);
DPoint[] buf = new DPoint[m_ConnectedPointSet.getSize()]; DPoint[] buf = new DPoint[connectedPointSet.getSize()];
for (int i = 0; i < m_ConnectedPointSet.getSize(); i++) { for (int i = 0; i < connectedPointSet.getSize(); i++) {
buf[i] = m_ConnectedPointSet.getDPoint(i); buf[i] = connectedPointSet.getDPoint(i);
} }
m_ConnectedPointSet.removeAllPoints(); connectedPointSet.removeAllPoints();
for (int i = 0; i < buf.length; i++) { for (int i = 0; i < buf.length; i++) {
if (buf[i].x == x.x && buf[i].y == x.y) { if (buf[i].x == x.x && buf[i].y == x.y) {
System.out.println("point found"); System.out.println("point found");
} else { } else {
m_ConnectedPointSet.addDPoint(buf[i]); connectedPointSet.addDPoint(buf[i]);
} }
} }
@ -493,8 +408,8 @@ public class GraphPointSet {
* @param c * @param c
*/ */
public void setColor(Color c) { public void setColor(Color c) {
m_Color = c; color = c;
m_ConnectedPointSet.setColor(m_Color); connectedPointSet.setColor(color);
} }
public void setColorByIndex(int i) { public void setColorByIndex(int i) {
@ -505,15 +420,15 @@ public class GraphPointSet {
* @param p * @param p
*/ */
public void setConnectedMode(boolean p) { public void setConnectedMode(boolean p) {
m_ConnectedPointSet.setConnected(p); connectedPointSet.setConnected(p);
} }
/** /**
* @param p * @param p
*/ */
public void setIcon(DPointIcon p) { public void setIcon(DPointIcon p) {
this.m_Icon = p; this.icon = p;
this.m_ConnectedPointSet.setIcon(p); this.connectedPointSet.setIcon(p);
} }
/** /**
@ -521,9 +436,9 @@ public class GraphPointSet {
* @param stroke * @param stroke
*/ */
public void setInfoString(String x, float stroke) { public void setInfoString(String x, float stroke) {
m_InfoString = x; infoString = x;
m_Stroke = stroke; this.stroke = stroke;
// setStroke(new BasicStroke( m_Stroke )); // setStroke(new BasicStroke( stroke ));
} }
/** /**
@ -532,7 +447,7 @@ public class GraphPointSet {
* @param x * @param x
*/ */
public void setInfoString(String 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 * @return the median point of this point set or null if it is empty
*/ */
public DPoint getMedPoint() { public DPoint getMedPoint() {
if (m_ConnectedPointSet == null) { if (connectedPointSet == null) {
return null; return null;
} }
int medX = m_ConnectedPointSet.getSize() / 2; int medX = connectedPointSet.getSize() / 2;
return m_ConnectedPointSet.getDPoint(medX); return connectedPointSet.getDPoint(medX);
} }
} }

View File

@ -4,11 +4,7 @@ import eva2.optimization.individuals.AbstractEAIndividual;
import eva2.optimization.problems.InterfaceOptimizationProblem; 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 interface InterfaceDPointWithContent {
public void setEAIndividual(AbstractEAIndividual indy); public void setEAIndividual(AbstractEAIndividual indy);

View File

@ -29,7 +29,7 @@ public class Plot implements PlotInterface, Serializable {
*/ */
private static final long serialVersionUID = -9027101244918249825L; private static final long serialVersionUID = -9027101244918249825L;
private JFileChooser fileChooser; private JFileChooser fileChooser;
private JPanel m_ButtonPanel; private JPanel buttonPanel;
private String plotName; private String plotName;
private String xAxisText; private String xAxisText;
private String yAxisText; private String yAxisText;
@ -193,14 +193,14 @@ public class Plot implements PlotInterface, Serializable {
byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true); byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true);
// internalFrame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes)); // internalFrame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes));
m_ButtonPanel = new JPanel(); buttonPanel = new JPanel();
plotArea = new FunctionArea(xAxisText, yAxisText); 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) ); // 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 internalFrame.add(plotArea, BorderLayout.CENTER); // north was not so
// nice // nice
internalFrame.addInternalFrameListener(new InternalFrameAdapter() { internalFrame.addInternalFrameListener(new InternalFrameAdapter() {