- Pin pin = pinsByName.remove(name);
- callPinRemovedListeners(pin);
- pin.removeRedrawListener(redrawListenerForSubcomponents);
- callRedrawListeners();
+ return bounds.x;
+ }
+
+ /**
+ * Returns the y coordinate of the position of this component. Is a bit faster than {@link #getBounds()} because no objects are created.
+ *
+ * @author Daniel Kirschten
+ */
+ public double getPosY()
+ {
+ return bounds.y;
+ }
+
+ /**
+ * Returns the (graphical) width of this component. Is a bit faster than {@link #getBounds()} because no objects are created.
+ *
+ * @author Daniel Kirschten
+ */
+ public double getWidth()
+ {
+ return bounds.width;
+ }
+
+ /**
+ * Returns the height of this component. Is a bit faster than {@link #getBounds()} because no objects are created.
+ *
+ * @author Daniel Kirschten
+ */
+ public double getHeight()
+ {
+ return bounds.height;
+ }
+
+ /**
+ * Called when this component is clicked. Absolute coordinates of the click are given. Returns true if this component consumed this
+ * click.
+ *
+ * @author Daniel Kirschten
+ */
+ @SuppressWarnings({ "static-method", "unused" }) // this method is inteded to be overridden
+ public boolean clicked(double x, double y)
+ {
+ return false;
+ }
+
+ /**
+ * Render this component to the given gc, in absoulute coordinates.
+ *
+ * @author Daniel Kirschten
+ */
+ public abstract void render(GeneralGC gc, Rectangle visibleRegion);
+
+ // serializing
+
+ @SuppressWarnings("static-method") // this method is intended to be overridden
+ public JsonElement getParams()
+ {
+ return JsonNull.INSTANCE;