Skip to content

Commit

Permalink
codacy issues fixed for org.opt4j.viewer.*
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhglass committed Apr 7, 2018
1 parent 0d694b9 commit e97758b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* SOFTWARE.
*******************************************************************************/


package org.opt4j.viewer;

import java.awt.BorderLayout;
Expand Down Expand Up @@ -259,18 +258,22 @@ public void stateChanged(ChangeEvent e) {

@Override
public void columnAdded(TableColumnModelEvent arg0) {
// nothing to be done
}

@Override
public void columnMarginChanged(ChangeEvent arg0) {
// nothing to be done
}

@Override
public void columnMoved(TableColumnModelEvent arg0) {
// nothing to be done
}

@Override
public void columnRemoved(TableColumnModelEvent arg0) {
// nothing to be done
}

@Override
Expand Down Expand Up @@ -342,7 +345,7 @@ protected void sortIndividiualMouseListeners() {
*/
@Override
public synchronized void init(Viewport viewport) {

// nothing to be done
}

protected boolean updateOrder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*******************************************************************************/

package org.opt4j.viewer;

import java.awt.geom.Point2D;
Expand Down Expand Up @@ -79,7 +79,7 @@ protected static class PlotDataObjective {
protected final List<Point2D.Double> meanValues = new CopyOnWriteArrayList<Point2D.Double>();
protected final int MAXVALUES = 2000;

final Set<Double> currentIteration = new HashSet<Double>();
protected final Set<Double> currentIteration = new HashSet<Double>();

PlotDataObjective(Objective objective) {
this.objective = objective;
Expand All @@ -98,7 +98,7 @@ public void update(Objectives objectives) {
}
}

protected synchronized void simplify(List<java.awt.geom.Point2D.Double> values) {
protected synchronized void simplify(List<Point2D.Double> values) {
if (values.size() > MAXVALUES) {
List<Point2D.Double> copy = new ArrayList<Point2D.Double>(values);

Expand Down Expand Up @@ -167,17 +167,15 @@ public void complete(int iteration) {
}
}

private void addValue(double min, List<java.awt.geom.Point2D.Double> points, int iteration) {
if (!Double.isInfinite(min)) {
if (points.isEmpty() || points.get(points.size() - 1).getY() != min) {
if (!points.isEmpty()) {
Point2D.Double steppoint = new Point2D.Double(iteration, points.get(points.size() - 1).getY());
points.add(steppoint);
}

Point2D.Double point = new Point2D.Double(iteration, min);
points.add(point);
private void addValue(double min, List<Point2D.Double> points, int iteration) {
if (!Double.isInfinite(min) && (points.isEmpty() || points.get(points.size() - 1).getY() != min)) {
if (!points.isEmpty()) {
Point2D.Double steppoint = new Point2D.Double(iteration, points.get(points.size() - 1).getY());
points.add(steppoint);
}

Point2D.Double point = new Point2D.Double(iteration, min);
points.add(point);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public JPanel getPanel() {
*/
@Override
public void init(Viewport viewport) {

// nothing to be done
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void registerAtObjectivesMonitor(ObjectivesMonitor objectivesMonitor) {
*/
@Override
public void init(Viewport viewport) {

// nothing to be done
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ protected final JTable getTable() {
*/
@Override
public synchronized void init(Viewport viewport) {

// nothing to be done
}

/*
Expand Down
1 change: 1 addition & 0 deletions opt4j-viewer/src/main/java/org/opt4j/viewer/StatusBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public void iterationComplete(int iteration) {
*/
@Override
public void optimizationStarted(Optimizer optimizer) {
// nothing to be done
}

/*
Expand Down
1 change: 1 addition & 0 deletions opt4j-viewer/src/main/java/org/opt4j/viewer/Viewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public void windowClosing(WindowEvent e) {
break;
default:
control.doStop();
break;
}
frame.dispose();
}
Expand Down
8 changes: 0 additions & 8 deletions opt4j-viewer/src/main/java/org/opt4j/viewer/Viewport.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ public class Viewport {

protected final Map<Widget, JInternalFrame> widgets = new HashMap<Widget, JInternalFrame>();

/**
* Constructs a {@link Viewport} for {@link Widget}s.
*
*/
public Viewport() {

}

/**
* Initialization. This method has to be called once after construction.
*/
Expand Down

0 comments on commit e97758b

Please sign in to comment.