Commit fd353205 authored by Jakob Schöttl's avatar Jakob Schöttl

Fix and simplify code

parent 0ecc2ddd
......@@ -9,7 +9,6 @@ import javax.swing.undo.UndoableEditSupport;
import org.vadere.gui.topographycreator.model.AgentWrapper;
import org.vadere.gui.topographycreator.model.IDrawPanelModel;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.scenario.ScenarioElement;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
......@@ -24,7 +23,7 @@ public class ActionInsertCopiedElement extends TopographyAction {
private static final long serialVersionUID = 5049099647921341318L;
private final UndoableEditSupport undoSupport;
public ActionInsertCopiedElement(final String name, final IDrawPanelModel model,
public ActionInsertCopiedElement(final String name, final IDrawPanelModel<?> model,
final UndoableEditSupport undoSupport) {
super(name, model);
this.undoSupport = undoSupport;
......@@ -32,7 +31,7 @@ public class ActionInsertCopiedElement extends TopographyAction {
@Override
public void actionPerformed(ActionEvent e) {
IDrawPanelModel model = getScenarioPanelModel();
IDrawPanelModel<?> model = getScenarioPanelModel();
ScenarioElement elementToCopy = model.getCopiedElement();
if (elementToCopy == null) {
......
......@@ -15,19 +15,19 @@ import org.vadere.gui.topographycreator.model.IDrawPanelModel;
public abstract class TopographyAction extends AbstractAction {
private static final long serialVersionUID = 7643236418545161283L;
private final IDrawPanelModel panelModel;
private final IDrawPanelModel<?> panelModel;
public TopographyAction(final String name, final ImageIcon icon, final IDrawPanelModel panelModel) {
public TopographyAction(final String name, final ImageIcon icon, final IDrawPanelModel<?> panelModel) {
super(name, icon);
this.panelModel = panelModel;
}
public TopographyAction(final String name, final IDrawPanelModel panelModel) {
public TopographyAction(final String name, final IDrawPanelModel<?> panelModel) {
super(name);
this.panelModel = panelModel;
}
protected IDrawPanelModel getScenarioPanelModel() {
protected IDrawPanelModel<?> getScenarioPanelModel() {
return panelModel;
}
}
......@@ -340,8 +340,6 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo
return getSelectedElement().getShape().translatePrecise(alignToGrid(vector));
}
// can return null!
@Override
public int getBoundId() {
return boundId;
......
......@@ -65,9 +65,9 @@ public abstract class Agent extends DynamicElement {
this.setTargets(new LinkedList<>(other.targetIds));
this.setNextTargetListIndex(other.nextTargetListIndex);
this.setPosition(other.position);
this.setVelocity(other.velocity);
this.setFreeFlowSpeed(other.freeFlowSpeed);
this.position = other.position;
this.velocity = other.velocity;
this.freeFlowSpeed = other.freeFlowSpeed;
}
public LinkedList<Integer> getTargets() {
......
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