Commit 3622935d authored by Nico Mack's avatar Nico Mack

Minor refactoring of widget methods.

Minor changes to HtmlBox corona.
parent c95a0f34
......@@ -60,6 +60,7 @@ GLOBAL_STATE_LISTENER_NODE=globalStateListener
HANDLE_NODE=handle
HANDLES_NODE=handles
HEIGHT_NODE=height
HTML_CONTENT_NODE=htmlContent
IMAGE_BASE64_ELEMENT=imageBase64
IMAGE_ELEMENT=image
IMAGES_ELEMENT=images
......
package lu.list.itis.dkd.tui.marker;
import lu.list.itis.dkd.dbc.annotation.Nullable;
import lu.list.itis.dkd.tui.content.Content;
import lu.list.itis.dkd.tui.marker.builder.MarkerBuilder;
import lu.list.itis.dkd.tui.utility.CoronaComparator;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.Positionable;
import lu.list.itis.dkd.tui.widget.corona.Corona;
import com.google.common.collect.Multimap;
import com.google.common.collect.Ordering;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
// ***************************************************************************
// * Class Definition and Members *
// ***************************************************************************
public abstract class Marker implements Comparable<Marker> {
public abstract class Marker implements Positionable {
/** The name given to this marker. */
protected String name;
......@@ -30,8 +29,6 @@ public abstract class Marker implements Comparable<Marker> {
/** The positions where the widget's handles are at. */
protected HashMap<Integer, Point> positions;
protected Map map;
protected int drawPriority = 50;
protected boolean active;
private CoronaComparator coronaComparator;
......@@ -50,7 +47,7 @@ public abstract class Marker implements Comparable<Marker> {
this.name = builder.name;
this.coronas = builder.coronas;
this.positions = builder.positions;
this.drawPriority = builder.drawPriority;
// this.drawPriority = builder.drawPriority;
}
// ---------------------------------------------------------------------------
......@@ -108,8 +105,8 @@ public abstract class Marker implements Comparable<Marker> {
/**
* Method for retrieving all coronas held by any of the handles associated to this marker.
*
* @return A {@link List} holding all coronas that are attached to any of the handles associated
* to this {@link Marker}'s concrete instance.
* @return A {@link List} holding all coronas that are attached to any of the handles associated to
* this {@link Marker}'s concrete instance.
*/
// ---------------------------------------------------------------------------
......@@ -119,6 +116,10 @@ public abstract class Marker implements Comparable<Marker> {
// ---------------------------------------------------------------------------
/**
* @param handleId
* @param position
*/
public void setPosition(Integer handleId, Point position) {
if (positions.containsKey(handleId)) {
positions.put(handleId, position);
......@@ -128,30 +129,50 @@ public abstract class Marker implements Comparable<Marker> {
// ---------------------------------------------------------------------------
/**
* @param handleId
* @return
*/
public @Nullable Point getPosition(Integer handleId) {
return positions.get(handleId);
}
// ---------------------------------------------------------------------------
@Override
public @Nullable Point getPosition() {
return positions.get(this.getHandleId());
}
// ---------------------------------------------------------------------------
/**
* @return
*/
public HashMap<Integer, Point> getPositions() {
return positions;
}
// ---------------------------------------------------------------------------
/**
* Method used for returning the main handle, i.e. the handle with the lowest ID.
*
* @return The main handle which by convention is the handle with the lowest ID.
*/
// ---------------------------------------------------------------------------
@Override
public Integer getHandleId() {
Iterator<Integer> handleIds = positions.keySet().iterator();
if (handleIds.hasNext()) {
return handleIds.next();
}
return null;
List<Integer> keys = new ArrayList<>(positions.keySet());
Collections.sort(keys, Ordering.natural());
return keys.get(0);
}
// ---------------------------------------------------------------------------
/**
* @param isActive
*/
public void setActive(boolean isActive) {
coronas.values().forEach(corona -> corona.setActive(isActive));
this.active = isActive;
......@@ -159,9 +180,9 @@ public abstract class Marker implements Comparable<Marker> {
// ---------------------------------------------------------------------------
/**
* Draws a the visual feedback for any marker. The method will iterate through all coronas and
* call their <code>paint()</code> method. The consistency of their position is ensured due to
* the <code>actionMove(TUIObject)</code> method issuing a call to <code>
* Draws a the visual feedback for any marker. The method will iterate through all coronas and call
* their <code>paint()</code> method. The consistency of their position is ensured due to the
* <code>actionMove(TUIObject)</code> method issuing a call to <code>
* updateCoronas(long)</code>.
*
* @param canvas
......@@ -192,33 +213,21 @@ public abstract class Marker implements Comparable<Marker> {
// ---------------------------------------------------------------------------
/**
* Comparison as defined by the {@link Comparable} interface. This comparison is based on the
* integer comparison of the draw priorities, ordering lower priorities first. This will result
* in lower priority {@link Content} instances being overlapped by prioritized ones.<br>
* integer comparison of the draw priorities, ordering lower priorities first. This will result in
* lower priority {@link Content} instances being overlapped by prioritized ones.<br>
* <br>
*
* {@inheritDoc}
*/
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public int compareTo(@Nullable Marker marker) {
if (marker == null)
throw new NullPointerException();
return Integer.valueOf(getDrawPriority()).compareTo(Integer.valueOf(marker.getDrawPriority()));
}
// ---------------------------------------------------------------------------
/**
* Getter method for the draw priority. The method will have to do the computation to account
* for the initialTranslation and the current position of the widget influencing the content if
* any.
*
* @return The draw priority of this content instance.
*/
// ---------------------------------------------------------------------------
protected int getDrawPriority() {
return drawPriority;
public int compareTo(Positionable o) {
int comparison = 1;
if (o != null) {
comparison = this.getHandleId().compareTo(o.getHandleId());
}
return comparison;
}
}
......@@ -95,6 +95,7 @@ public class Externalization extends NLS {
public static String HANDLE_NODE;
public static String HANDLES_NODE;
public static String HEIGHT_NODE;
public static String HTML_CONTENT_NODE;
public static String IMAGE_BASE64_ELEMENT;
public static String IMAGE_ELEMENT;
public static String IMAGES_ELEMENT;
......
......@@ -48,7 +48,7 @@ import java.util.Comparator;
* @version 2.3.0
*/
@NonNullByDefault
public class Point extends Float implements KdComparator<Point> {
public class Point extends Float implements Comparable<Point>, KdComparator<Point> {
/** Generated serial UID. */
private static final long serialVersionUID = 3034855636052473701L;
private CoordinateState state;
......@@ -206,9 +206,9 @@ public class Point extends Float implements KdComparator<Point> {
* Constructor for initializing a point from XML.
*
* @param rootNode
* The node that contains, as child nodes, all relevant nodes to initialize the
* corresponding fields. If the node is <code>null</code> then a call to
* {@link Point#Point()} will be issued and the result returned.
* The node that contains, as child nodes, all relevant nodes to initialize the corresponding
* fields. If the node is <code>null</code> then a call to {@link Point#Point()} will be
* issued and the result returned.
* @throws BuildException
* Thrown when one or more of the required parameters for the Point could not be set.
*/
......@@ -221,9 +221,9 @@ public class Point extends Float implements KdComparator<Point> {
* Constructor for initializing a point from XML.
*
* @param rootNode
* The node that contains, as child nodes, all relevant nodes to initialize the
* corresponding fields. If the node is <code>null</code> then a call to
* {@link Point#Point()} will be issued and the result returned.
* The node that contains, as child nodes, all relevant nodes to initialize the corresponding
* fields. If the node is <code>null</code> then a call to {@link Point#Point()} will be
* issued and the result returned.
* @param context
* @param callback
* @throws BuildException
......@@ -331,17 +331,16 @@ public class Point extends Float implements KdComparator<Point> {
}
/**
* Method for testing the equality of two points as neither equals not hashCode can be
* implemented due to the objects high mutability. This test for equality ignores orientation
* (z-axis).
* Method for testing the equality of two points as neither equals not hashCode can be implemented
* due to the objects high mutability. This test for equality ignores orientation (z-axis).
*
* @param a
* The first point to test for equality.
* @param b
* The second point to test for equality.
* @return <code>True</code> if and only if a.x == b.x AND a.y == b.y within the delta of a
* floating point number, and both points hold the same class of {@link CoordinateState}
* . Orientation is ignored.
* @return <code>True</code> if and only if a.x == b.x AND a.y == b.y within the delta of a floating
* point number, and both points hold the same class of {@link CoordinateState} .
* Orientation is ignored.
*/
public static boolean areEqual(Point a, Point b) {
if (a.getState().getClass().equals(b.getState().getClass())) {
......@@ -359,16 +358,16 @@ public class Point extends Float implements KdComparator<Point> {
}
/**
* Method for testing the equality of two points as neither equals not hashCode can be
* implemented due to the objects high mutability. This test for equality ignores position
* (x-axis and y-axis) and focuses on the z-axis only.
* Method for testing the equality of two points as neither equals not hashCode can be implemented
* due to the objects high mutability. This test for equality ignores position (x-axis and y-axis)
* and focuses on the z-axis only.
*
* @param a
* The first point to test for equality.
* @param b
* The second point to test for equality.
* @return <code>True</code> if and only if a.agle == b.angle within the delta of a floating
* point number, and both points hold the same class of {@link CoordinateState}.
* @return <code>True</code> if and only if a.agle == b.angle within the delta of a floating point
* number, and both points hold the same class of {@link CoordinateState}.
*/
public static boolean areAnglesEqual(Point a, Point b) {
if (a.getState().getClass().equals(b.getState().getClass())) {
......@@ -428,22 +427,21 @@ public class Point extends Float implements KdComparator<Point> {
}
/**
* Method for creating a new {@link Point} from this point by adding coordinates and angle of
* the provided point. This method is primarily used to account for offsets expressed as a
* point.
* Method for creating a new {@link Point} from this point by adding coordinates and angle of the
* provided point. This method is primarily used to account for offsets expressed as a point.
*
* @param point
* The initialTranslation values to addition to this point's values.
* @return If point == null, the method will return this instance. Otherwise, a new
* {@link Point} instance such that:<br/>
* @return If point == null, the method will return this instance. Otherwise, a new {@link Point}
* instance such that:<br/>
* <code> x = this.x + point.x<br/>
* y = this.y + point.y<br/>
* angle = this.angle + point.angle<br/>
* state = this.state</code>.<br/>
* <br/>
* Note that this method will convert the coordinate system of the parameterized point,
* using {@link CoordinateState}, and as such, the resulting point will use the system
* of this instance.
* using {@link CoordinateState}, and as such, the resulting point will use the system of
* this instance.
*/
public Point add(@Nullable Point point) {
if (point == null) {
......@@ -474,15 +472,15 @@ public class Point extends Float implements KdComparator<Point> {
/**
* Method for creating a new {@link Point} from this point by subtracting coordinates and angle
* of the provided point.
* Method for creating a new {@link Point} from this point by subtracting coordinates and angle of
* the provided point.
*
* @param point
* The initialTranslation values to subtract from this point's values.
* @param subtractAngle
* Indication whether the angle shall be subtracted too or only coordinates.
* @return If point == null, the method will return this instance. Otherwise, a new
* {@link Point} instance such that:<br>
* @return If point == null, the method will return this instance. Otherwise, a new {@link Point}
* instance such that:<br>
* <code> x = this.x - point.x<br>
* y = this.y - point.y<br>
* angle = this.angle - point.angle</code>.
......@@ -504,15 +502,15 @@ public class Point extends Float implements KdComparator<Point> {
}
/**
* Method for computing the difference between two point instances. The values can be negative.
* To obtain the accurate result, the call should be made as follows:
* Method for computing the difference between two point instances. The values can be negative. To
* obtain the accurate result, the call should be made as follows:
* <code>newPoint.delta(oldPoint)</code>
*
* @param point
* The point to compute the difference to.
* @return A new {@link Point} instance with the values set to the difference between the two
* points. Should the {@link Point} given as input be null, the method returns a clone
* of this instance.
* points. Should the {@link Point} given as input be null, the method returns a clone of
* this instance.
* @see #clone()
*/
public Point delta(@Nullable Point point) {
......@@ -590,6 +588,23 @@ public class Point extends Float implements KdComparator<Point> {
return distance * distance;
}
/** {@inheritDoc} */
@Override
public int compareTo(Point o) {
int comparison = 1;
if (o != null) {
comparison = java.lang.Double.compare(this.x, o.x);
if (comparison == 0) {
comparison = java.lang.Double.compare(this.y, o.y);
if (comparison == 0) {
comparison = java.lang.Double.compare(this.angle, o.angle);
}
}
}
return comparison;
}
}
......
/**
* Copyright Luxembourg Institute of Science and Technology, 2017. All rights reserved.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.utility;
/**
* @author nico.mack@list.lu
* @since 2.5
* @version 1.0.0
*/
public interface Positionable extends Comparable<Positionable> {
public Integer getHandleId();
public Point getPosition();
}
......@@ -25,6 +25,7 @@ import lu.list.itis.dkd.dbc.annotation.Nullable;
import lu.list.itis.dkd.tui.adapter.TangibleObject;
import lu.list.itis.dkd.tui.network.adapter.NetworkAdapter;
import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.Positionable;
import lu.list.itis.dkd.tui.widget.builder.BaseBuilder;
import lu.list.itis.dkd.tui.widget.corona.Corona;
import lu.list.itis.dkd.tui.widget.touch.TouchEvent;
......@@ -61,7 +62,7 @@ import java.util.Set;
// ***************************************************************************
@NonNullByDefault
public class BaseWidget implements Touchable {
public class BaseWidget implements Positionable, Touchable {
/** Specifies the ID of the stage the widget is to be presented on. */
protected int stageId;
/** The visual components to display as part of the widget. It's background. */
......@@ -153,6 +154,26 @@ public class BaseWidget implements Touchable {
// ***************************************************************************
// * Primitive(s)
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* @return
*/
// ---------------------------------------------------------------------------
public boolean isActive() {
return this.onStage;
}
// ---------------------------------------------------------------------------
/**
* @param activateIt
*/
// ---------------------------------------------------------------------------
public void setActive(boolean activateIt) {
this.onStage = activateIt;
}
// ---------------------------------------------------------------------------
/**
* Method used to keep the conona's positions aligned with the base of the widget.
......@@ -221,7 +242,7 @@ public class BaseWidget implements Touchable {
public void actionDrop(TangibleObject tangibleObject) {
if (!tangible)
return;
onStage = true;
setActive(true);
actionMove(tangibleObject);
startDrawingIfAppropriate(tangibleObject.getObjectId());
}
......@@ -259,7 +280,7 @@ public class BaseWidget implements Touchable {
return;
actionMove(tangibleObject);
stopDrawing(tangibleObject.getObjectId());
onStage = false;
setActive(false);
}
// ---------------------------------------------------------------------------
......@@ -407,6 +428,21 @@ public class BaseWidget implements Touchable {
return position;
}
// ---------------------------------------------------------------------------
/**
* Method used for returning the main handle, i.e. the handle with the lowest ID.
*
* @return The main handle which by convention is the handle with the lowest ID.
*/
// ---------------------------------------------------------------------------
@Override
public Integer getHandleId() {
List<Integer> keys = new ArrayList<>(positions.keySet());
Collections.sort(keys, Ordering.natural());
return keys.get(0);
}
// ---------------------------------------------------------------------------
/**
* Method used for returning the {@link Point} that holds the position of the handle with the lowest
......@@ -418,10 +454,7 @@ public class BaseWidget implements Touchable {
// ---------------------------------------------------------------------------
public @Nullable Point getPosition() {
List<Integer> keys = new ArrayList<>(positions.keySet());
Collections.sort(keys, Ordering.natural());
return this.getPosition(keys.get(0));
return this.getPosition(getHandleId());
}
// ---------------------------------------------------------------------------
......@@ -572,11 +605,24 @@ public class BaseWidget implements Touchable {
// ---------------------------------------------------------------------------
/** {@inheritDoc} */
@Override
public int compareTo(Positionable o) {
int comparison = 1;
if (o != null) {
comparison = this.getHandleId().compareTo(o.getHandleId());
}
return comparison;
}
// ---------------------------------------------------------------------------
@Override
public BaseWidget clone() {
return new BaseWidget(this);
}
// ---------------------------------------------------------------------------
// ***************************************************************************
// * End of Class
......
......@@ -74,7 +74,6 @@ public class ContentWidget extends BaseWidget {
public ContentWidget(ContentWidget original) {
super(original);
listeners = new ArrayList<>(original.listeners);
}
......@@ -123,9 +122,9 @@ public class ContentWidget extends BaseWidget {
// ---------------------------------------------------------------------------
/**
* Method invoked when a handle associated with the widget was moved. This default
* implementation will set the base and angle fields to the corresponding values and update the
* coronas of the handle that the {@link TangibleObject} corresponds to.
* Method invoked when a handle associated with the widget was moved. This default implementation
* will set the base and angle fields to the corresponding values and update the coronas of the
* handle that the {@link TangibleObject} corresponds to.
*
* @param tangibleObject
* The {@link TangibleObject} that was triggering the move.
......@@ -154,30 +153,6 @@ public class ContentWidget extends BaseWidget {
notify(this, tangibleObject.getObjectId(), ContentEventType.LIFT);
}
// ---------------------------------------------------------------------------
/**
* Method used to determine which segment the rotation of a handle is in given the number of
* segments to cover by one rotation.
*
* @param totalSegments
* The number of segments to divide the rotation into.
* @param handleID
* The ID of the handle to check the rotation for.
* @return The segment the rotation is currently in given:<br>
* <code>rotation / (2*PI / totalSegments)</code>.
*/
// ---------------------------------------------------------------------------
// public int getSegment(int totalSegments, int handleID) {
// Preconditions.checkArgument(totalSegments > 0, "Number of segments MUST be greater than 0!");
// //$NON-NLS-1$
//
// double rotation = Math.abs(getPosition(handleID).getAngle() % TWO_PI);
// double segmentSize = (float) (TWO_PI / totalSegments);
//
// return (int) Math.floor(rotation / segmentSize);
// }
// ---------------------------------------------------------------------------
@Override
......
/**
* ntryntegerhintryntry Copyright Luxembohiurg Institute of Science and Technology, 2017. All rights
* reserved.
* Copyright Luxembourg Institute of Science and Technology, 2016.
*
* This file is part of TULIP.
*
* TULIP is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, version 3 of the
* License.
* TULIP is licensed under a dual-licensing scheme. For non-commercial purposes, the LGPL version 3,
* as stated below, is applicable. For all commercial purposes TULIP is licensed under a LIST
* proprietary license. Please contact LIST at tto@list.lu to obtain a commercial license.
*
* For all non-commercial purposes, TULIP is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, version 3 of the License.
*
* TULIP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
......@@ -15,6 +18,7 @@
* You should have received a copy of the GNU Lesser General Public License along with TULIP. If
* not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package lu.list.itis.dkd.tui.widget;
import lu.list.itis.dkd.tui.widget.builder.BaseModalWidgetBuilder;
......@@ -157,7 +161,7 @@ public class ModalWidget extends TetherableWidget {
synchronized (this.coronas) {
for (Entry<Integer, Corona> entry : bundledCoronas.entries()) {
if (!this.coronas.containsEntry(entry.getKey(), entry.getValue())) {
if (this.onStage)
if (this.isActive())
entry.getValue().setActive(true);
this.coronas.put(entry.getKey(), entry.getValue());
}
......@@ -168,7 +172,6 @@ public class ModalWidget extends TetherableWidget {
return activated;
}
// ---------------------------------------------------------------------------
/**
* activates the bundle with the specified name. All bundled coronas will be deactivated in the
......
......@@ -280,17 +280,10 @@ public abstract class TetherableWidget extends PointingWidget implements Tethera
return this.tetherManager.isTetheredWith(otherTetherable);
}
// ---------------------------------------------------------------------------
@Override
public boolean isActive() {
return this.onStage;
}
// ---------------------------------------------------------------------------
/**
* Method invoked when a handle associated with the widget was moved. The method issues a call
* to the super method before handling state updates.
* Method invoked when a handle associated with the widget was moved. The method issues a call to
* the super method before handling state updates.
*
* @param tangibleObject
* The {@link TuioObject} that was triggering the move.
......
......@@ -56,11 +56,11 @@ import javax.swing.text.html.StyleSheet;
@NonNullByDefault
public class HtmlBox extends FadingCorona implements InformationReceiver<String> {
private String page;
private Color fillColour;
private Color strokeColour;
private int strokeWidth;
private List<String> styleRules;
protected String htmlContent;
protected Color fillColour;
protected Color strokeColour;
protected int strokeWidth;
protected List<String> styleRules;
private Stroke borderStroke;
private Rectangle2D shapeBounds;
......@@ -92,7 +92,7 @@ public class HtmlBox extends FadingCorona implements InformationReceiver<String>
public HtmlBox(BaseHtmlBoxBuilder<?> builder) {
super(builder);
page = builder.page;
htmlContent = builder.htmlContent;
shape = builder.shape;
fillColour = builder.fillColour;
strokeColour = builder.strokeColour;
......@@ -115,7 +115,7 @@ public class HtmlBox extends FadingCorona implements InformationReceiver<String>
public HtmlBox(HtmlBox original) {
super(original);
page = original.page;
htmlContent = original.htmlContent;
shape = original.shape;
fillColour = original.fillColour;
strokeColour = original.strokeColour;
......@@ -146,8 +146,8 @@ public class HtmlBox extends FadingCorona implements InformationReceiver<String>
editor.setSize(new Dimension((int) shapeBounds.getWidth(), (int) shapeBounds.getHeight()));
editor.setOpaque(false);
if ((page != null) && !page.isEmpty())
this.setInformation(page);
if ((htmlContent != null) && !htmlContent.isEmpty())
this.setInformation(htmlContent);
}
// ---------------------------------------------------------------------------
......
......@@ -50,6 +50,7 @@ public abstract class SelectableCorona extends FadingCorona {
public SelectableCorona(BaseSelectableCoronaBuilder<?> builder) {
super(builder);
index = builder.index;
isSelected = builder.selected;
listeners = new ArrayList<>();
}
......@@ -64,6 +65,7 @@ public abstract class SelectableCorona extends FadingCorona {
public SelectableCorona(SelectableCorona original) {
super(original);
isSelected = original.isSelected;
listeners = new ArrayList<>();
}
......
......@@ -31,6 +31,8 @@ import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.StringUtils;
import lu.list.itis.dkd.tui.widget.corona.HtmlBox;
import com.google.common.base.Strings;
import org.apache.logging.log4j.core.util.IOUtils;
import org.jdom2.Element;
......@@ -57,7 +59,7 @@ import java.util.List;
public abstract class BaseHtmlBoxBuilder<B extends BaseHtmlBoxBuilder<B>> extends BaseFadingCoronaBuilder<B> {
public String page;
public String htmlContent;
public Color fillColour;
public Color strokeColour;
public int strokeWidth;
......@@ -86,15 +88,15 @@ public abstract class BaseHtmlBoxBuilder<B extends BaseHtmlBoxBuilder<B>> extend
// ---------------------------------------------------------------------------
/**
* Constructor initializing the centre of the corona as well as a possible text and the
* appropriate font size and line height ratio.
* Constructor initializing the centre of the corona as well as a possible text and the appropriate
* font size and line height ratio.
*
* @param rootElement
* The element harbouring, on child nodes, the necessary information to initialize all