Commit a6fa6ecb authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Fix code and comments

parent 5299ffa4
...@@ -4,7 +4,6 @@ import java.awt.Color; ...@@ -4,7 +4,6 @@ import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Font; import java.awt.Font;
import java.awt.Point; import java.awt.Point;
import java.awt.event.ComponentListener;
import java.util.Observer; import java.util.Observer;
import org.vadere.gui.components.control.IMode; import org.vadere.gui.components.control.IMode;
...@@ -21,6 +20,7 @@ import org.vadere.util.geometry.shapes.VShape; ...@@ -21,6 +20,7 @@ import org.vadere.util.geometry.shapes.VShape;
public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<T>, Iterable<ScenarioElement> { public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<T>, Iterable<ScenarioElement> {
@Override
void notifyObservers(); void notifyObservers();
/** /**
...@@ -67,17 +67,20 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel< ...@@ -67,17 +67,20 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<
* *
* @return true if the user is selecting a topography element, otherwise false. * @return true if the user is selecting a topography element, otherwise false.
*/ */
@Override
boolean isSelectionVisible(); boolean isSelectionVisible();
/** /**
* After this call the selction shape will be painted. * After this call the selction shape will be painted.
*/ */
@Override
void showSelection(); void showSelection();
/** /**
* After this call the selction shape will no longer be painted. * After this call the selction shape will no longer be painted.
*/ */
@Override
void hideSelection(); void hideSelection();
/** /**
...@@ -93,14 +96,17 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel< ...@@ -93,14 +96,17 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<
void resetScenario(); void resetScenario();
@Override
ScenarioElement getSelectedElement(); ScenarioElement getSelectedElement();
Color getCursorColor(); Color getCursorColor();
void setCursorColor(Color red); void setCursorColor(Color red);
@Override
void setMouseSelectionMode(IMode selectionMode); void setMouseSelectionMode(IMode selectionMode);
@Override
IMode getMouseSelectionMode(); IMode getMouseSelectionMode();
Cursor getCursor(); Cursor getCursor();
...@@ -128,6 +134,7 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel< ...@@ -128,6 +134,7 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<
* @param position * @param position
* @return * @return
*/ */
@Override
ScenarioElement setSelectedElement(VPoint position); ScenarioElement setSelectedElement(VPoint position);
boolean removeElement(ScenarioElement element); boolean removeElement(ScenarioElement element);
...@@ -142,10 +149,12 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel< ...@@ -142,10 +149,12 @@ public interface IDrawPanelModel<T extends DefaultConfig> extends IDefaultModel<
void setTopography(Topography topography); void setTopography(Topography topography);
@Override
void notifyObservers(final Object string); void notifyObservers(final Object string);
int getBoundId(); int getBoundId();
@Override
void setSelectedElement(ScenarioElement selectedElement); void setSelectedElement(ScenarioElement selectedElement);
VShape translate(Point vector); VShape translate(Point vector);
......
...@@ -25,7 +25,6 @@ import org.vadere.util.geometry.shapes.VShape; ...@@ -25,7 +25,6 @@ import org.vadere.util.geometry.shapes.VShape;
/** /**
* The data of the DrawPanel. Its holds the whole data of one scenario. * The data of the DrawPanel. Its holds the whole data of one scenario.
* *
*
*/ */
public class TopographyCreatorModel extends DefaultModel implements IDrawPanelModel { public class TopographyCreatorModel extends DefaultModel implements IDrawPanelModel {
...@@ -221,13 +220,6 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo ...@@ -221,13 +220,6 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo
return font; return font;
} }
/*
* @Override
* public double getFinishTime() {
* return topographyBuilder.getAttributes().getFinishTime();
* }
*/
@Override @Override
public void setTopographyBound(final VRectangle scenarioBound) { public void setTopographyBound(final VRectangle scenarioBound) {
try { try {
...@@ -437,9 +429,9 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo ...@@ -437,9 +429,9 @@ public class TopographyCreatorModel extends DefaultModel implements IDrawPanelMo
return topographyBuilder.build(); return topographyBuilder.build();
} }
// privte helper methods
private VPoint alignToGrid(final VPoint point) { private VPoint alignToGrid(final VPoint point) {
double factor = Math.max(10, 1 / getGridResolution()); double factor = Math.max(10, 1 / getGridResolution());
return new VPoint(Math.round(point.x * factor) / factor, Math.round(point.y * factor) / factor); return new VPoint(Math.round(point.x * factor) / factor, Math.round(point.y * factor) / factor);
} }
} }
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