Commit b7a7f650 authored by Eric Tobias's avatar Eric Tobias

Minor changes and advancement to version 1.3.1

parent 9dccc0ab
2.3.1
~ Renamed getCorona() to get Coronas in BaseWidget to more consistently reflect the return type in the method name.
2.3
Major license change to include a proprietary license for commercial purposes. LGPL3 for non-commercial purposes remains unchanged.
......
ALPHA_NODE=alpha
ASSET_ELEMENT=asset
BACKGROUND_COLOUR_NODE=backgroundColour
BASE_VALUE_NODE=baseValue
BLOBS_NODE=blobs
......@@ -26,7 +27,8 @@ GLOBAL_STATE_LISTENER_NODE=globalStateListener
HANDLE_NODE=handle
HANDLES_NODE=handles
HEIGHT_NODE=height
IMAGE_NODE=image
IMAGE_ELEMENT=image
IMAGES_ELEMENT=images
INFORMATION=information
INITIAL_ROTATION_NODE=initialRotation
INITIAL_TRANSLATION_NODE=initialTranslation
......@@ -64,6 +66,7 @@ STYLE_NODE=style
TEXT_NODE=text
TITLE_NODE=title
TRIGGER_CONDITION_NODE=triggerCondition
TRIGGER_ELEMENT=trigger
TYPE_NODE=type
UNIT_NODE=unit
UPPER_BOUND_NODE=upperBound
......
......@@ -34,6 +34,8 @@ public class Externalization extends NLS {
private static final String BUNDLE_NAME = "externalization"; //$NON-NLS-1$
public static String ALPHA_NODE;
public static String ASSET_ELEMENT;
public static String BACKGROUND_COLOUR_NODE;
public static String BASE_VALUE_NODE;
public static String BLOBS_NODE;
......@@ -61,7 +63,9 @@ public class Externalization extends NLS {
public static String HANDLE_NODE;
public static String HANDLES_NODE;
public static String HEIGHT_NODE;
public static String IMAGE_NODE;
public static String IMAGE_ELEMENT;
public static String IMAGES_ELEMENT;
public static String INFORMATION;
public static String INITIAL_ROTATION_NODE;
public static String INITIAL_TRANSLATION_NODE;
......@@ -99,6 +103,8 @@ public class Externalization extends NLS {
public static String TEXT_NODE;
public static String TITLE_NODE;
public static String TRIGGER_CONDITION_NODE;
public static String TRIGGER_ELEMENT;
public static String TYPE_NODE;
public static String UNIT_NODE;
public static String UPPER_BOUND_NODE;
......
......@@ -47,7 +47,7 @@ import java.util.List;
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 1.0
* @version 2.3.0
* @version 2.3.1
*/
@NonNullByDefault
public class BaseWidget {
......@@ -180,7 +180,7 @@ public class BaseWidget {
* @return A list of coronas matching the criterion.
*/
@SuppressWarnings("unchecked")
public <T> List<T> getCorona(Class<T> _class) {
public <T> List<T> getCoronas(Class<T> _class) {
List<T> results = new ArrayList<>();
for (Corona corona : coronas.values()) {
......
......@@ -147,7 +147,7 @@ public abstract class ContextAwareWidget extends BaseWidget {
protected Collection<ContextAwareCorona> retrieveCoronas(Point point) {
Collection<ContextAwareCorona> results = new Vector<>();
for (Corona corona : getCorona(ContextAwareCorona.class)) {
for (Corona corona : getCoronas(ContextAwareCorona.class)) {
if (((ContextAwareCorona) corona).includesInCorona(corona.getPointRelativeToCentre(point))) {
results.add((ContextAwareCorona) corona);
}
......@@ -162,7 +162,7 @@ public abstract class ContextAwareWidget extends BaseWidget {
* {@link ContextAwareWidget} instance.
*/
protected Collection<ContextAwareCorona> retrieveCoronas() {
return getCorona(ContextAwareCorona.class);
return getCoronas(ContextAwareCorona.class);
}
/**
......
......@@ -75,7 +75,7 @@ public class InfoWidget extends StatefulWidget {
StateManager manager = states.get(tangibleObject.getObjectId());
if (manager.isStill()) {
for (Corona corona : getCorona(InfoBox.class)) {
for (Corona corona : getCoronas(InfoBox.class)) {
corona.setActive(true);
informationProvider.getInformation(new Point(tangibleObject.getX(), tangibleObject.getY(), tangibleObject.getAngle()), (InformationReceiver<String>) corona);
......@@ -83,7 +83,7 @@ public class InfoWidget extends StatefulWidget {
}
if (manager.isMoving()) {
for (Corona corona : getCorona(InfoBox.class)) {
for (Corona corona : getCoronas(InfoBox.class)) {
corona.setActive(false);
}
}
......
......@@ -65,7 +65,7 @@ public class PieChartWidget extends ContextAwareWidget {
*/
public PieChartWidget(BaseContextAwareBuilder<?> builder) {
super(builder);
for (ContextAwareCorona corona : getCorona(ContextAwareCorona.class)) {
for (ContextAwareCorona corona : getCoronas(ContextAwareCorona.class)) {
coronaContents.put(corona, 0);
}
}
......@@ -184,7 +184,7 @@ public class PieChartWidget extends ContextAwareWidget {
}
}
for (ContextAwareCorona corona : getCorona(ContextAwareCorona.class)) {
for (ContextAwareCorona corona : getCoronas(ContextAwareCorona.class)) {
if (!count.containsKey(corona)) {
if (!coronaContents.get(corona).equals(0)) {
notifyCoronaListeners(contextEventListeners.get(corona), new ContextEvent(corona, ContextType.CURSOR_LIFT, 0));
......
......@@ -40,7 +40,7 @@ import java.awt.geom.Point2D;
* @author Eric Tobias [eric.tobias@list.lu]
* @author Valérie Maquil [valerie.maquil@list.lu]
* @since 1.0
* @version 2.3.0
* @version 2.3.1
*/
@NonNullByDefault
public abstract class Corona implements Comparable<Corona> {
......@@ -93,6 +93,16 @@ public abstract class Corona implements Comparable<Corona> {
initialRotation = builder.initialRotation;
}
/**
* Non-arg constructor for use with the decorator pattern.
*/
protected Corona() {
/**
* This constructor is only to be used when working with the decorator pattern. It shan't be
* use elsewhere.
*/
}
/**
* Abstract method specifying the signature of a paint method.
*
......
......@@ -40,7 +40,7 @@ import eu.hansolo.steelseries.tools.TickmarkType;
/**
* @author Nico Mack [nico.mack@list.lu]
* @author Eric Tobias [eric.tobias@list.lu]
* @author Valrie Maquil [valerie.maquil@list.lu]
* @author Valérie Maquil [valerie.maquil@list.lu]
* @date 27 Apr 2015
* @since 2.2
* @version 2.3.0
......
......@@ -80,7 +80,7 @@ public abstract class BaseImageBuilder<B extends BaseImageBuilder<B>> extends Co
super(rootElement);
try {
Element imageNode = rootElement.getChild(Externalization.IMAGE_NODE);
Element imageNode = rootElement.getChild(Externalization.IMAGE_ELEMENT);
if (null != imageNode) {
image = ImageIO.read(new File(imageNode.getText()));
}
......
......@@ -115,7 +115,7 @@ public abstract class BaseRadiusBuilder<B extends BaseRadiusBuilder<B>> extends
}
try {
Element imageNode = rootElement.getChild(Externalization.IMAGE_NODE);
Element imageNode = rootElement.getChild(Externalization.IMAGE_ELEMENT);
if (null != imageNode) {
backgroundImage = ImageIO.read(new File(imageNode.getText()));
}
......
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