diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/SpiderChartComponent.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/SpiderChartComponent.java index 2050dd3f85d6fcd4a1c4e6651be1d7874ed27e7c..b8bf48e5d632975821e167aaebe433b293487840 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/SpiderChartComponent.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/SpiderChartComponent.java @@ -17,17 +17,28 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.spiderchart; +/** + * Every Spider Chart Canvas must extend this class to adapt to the Spider Chart + * Component Description + * + * @author AMIT KUMAR MONDAL + * + */ public abstract class SpiderChartComponent { - /** */ + /** The Actual Spider Chart Diagram */ protected SpiderChart chart; - /** */ + + /** The height of the component */ protected int height; - /** */ + + /** the width of the component */ protected int width; - /** */ + + /** the screen x-axis value */ protected int x; - /** */ + + /** the screen y-axis value */ protected int y; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/api/annotations/processor/SpiderChartAnnotationProcessor.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/api/annotations/processor/SpiderChartAnnotationProcessor.java index 5519cf83b82c03341e6bece990339956d7bae4e6..b3e713034bb59b182e563f560f783098f1f11651 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/api/annotations/processor/SpiderChartAnnotationProcessor.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/api/annotations/processor/SpiderChartAnnotationProcessor.java @@ -24,6 +24,12 @@ import java.util.Optional; import org.fortiss.tooling.spiderchart.api.annotations.DataPoints; import org.fortiss.tooling.spiderchart.api.annotations.SpiderChartPlot; +/** + * Spider Chart Data Point Provider POJO Annotation Processor + * + * @author AMIT KUMAR MONDAL + * + */ public final class SpiderChartAnnotationProcessor { /** diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxesConfigurer.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxesConfigurer.java index 36d2975526cd11cc4faa5f31072ba0bfeaefc18e..2ddbd3bb4c00491c50d8a87388783c0b6942b20d 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxesConfigurer.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxesConfigurer.java @@ -23,18 +23,26 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +/** + * Used to configure the axes for the spider chart diagram + * + * @author AMIT KUMAR MONDAL + * + */ public final class AxesConfigurer { public static class Builder { - /** */ + /** Maximum Scales */ private final List<Double> maxScales; - /** */ + + /** Minimum Scales */ private final List<Double> minScales; - /** */ + + /** Scaling Labels */ private final List<String> scalesNames; - /** */ + /** Scaling Label Formats */ private final List<Object> scalingLabelFormats; /** Constructor */ @@ -45,7 +53,16 @@ public final class AxesConfigurer { this.scalingLabelFormats = new ArrayList<>(); } - /** */ + /** + * Adds a new Axis to the Spider Chart + * + * @param name + * Name of the axis + * @param value + * Currently only Enum class object needs to be provided to + * use its constants as labels + * @return the Builder object for method chaining + */ public <E extends Enum<E>> Builder addAxis(final String name, final Class<E> value) { final double[] doubleValues = new double[value.getEnumConstants().length]; @@ -61,7 +78,17 @@ public final class AxesConfigurer { return this; } - /** */ + /** + * Adds a new Axis to the Spider Chart + * + * @param name + * name of the axis + * @param maxScale + * maximum scale of axis + * @param minScale + * minimum scale of axis + * @return the Builder object for method chaining + */ public Builder addAxis(final String name, final double maxScale, final double minScale) { this.maxScales.add(maxScale); @@ -71,7 +98,19 @@ public final class AxesConfigurer { return this; } - /** */ + /** + * Adds a new Axis to the Spider Chart + * + * @param name + * name of the axis + * @param maxScale + * maximum scale of axis + * @param minScale + * minimum scale of axis + * @param scalingLabelFormat + * the scaling label format + * @return the Builder object for method chaining + */ public Builder addAxis(final String name, final double maxScale, final double minScale, final Object scalingLabelFormat) { this.scalingLabelFormats.add(scalingLabelFormat); @@ -81,7 +120,7 @@ public final class AxesConfigurer { return this; } - /** */ + /** Builder */ public AxesConfigurer build() { return new AxesConfigurer(this.maxScales, this.minScales, this.scalesNames, this.scalingLabelFormats); @@ -110,24 +149,24 @@ public final class AxesConfigurer { this.scalingLabelFormats = scalingLabelFormats; } - /** */ + /** getter for the axes names */ public String[] axesNames() { final String[] axesNames = new String[this.scalesNames.size()]; return this.scalesNames.toArray(axesNames); } - /** */ + /** getter for the scaling label formats */ public Object[] axesScalingLabelFormats() { return this.scalingLabelFormats.toArray(); } - /** */ + /** getter for the max scales */ public double[] maxScales() { final Double[] maxScales = new Double[this.maxScales.size()]; return toDoublePrimitiveArray(this.maxScales.toArray(maxScales)); } - /** */ + /** getter for min scales */ public double[] minScales() { final Double[] minScales = new Double[this.minScales.size()]; return toDoublePrimitiveArray(this.minScales.toArray(minScales)); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxisDataBuilder.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxisDataBuilder.java index bea0b9ae3a18e5e1842e219209338bf467a7a0de..22f1b066594f9f786394b1b2fc670c811aadd6f0 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxisDataBuilder.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/AxisDataBuilder.java @@ -27,17 +27,25 @@ import java.util.Optional; import java.util.function.Supplier; import org.fortiss.tooling.spiderchart.SpiderChart; +import org.fortiss.tooling.spiderchart.api.annotations.DataPoints; +import org.fortiss.tooling.spiderchart.api.annotations.SpiderChartPlot; import org.fortiss.tooling.spiderchart.builder.model.AxisData; +/** + * Used to provide the data to be used in the spider chart diagram + * + * @author AMIT KUMAR MONDAL + * + */ public final class AxisDataBuilder { - /** */ + /** list of axis container */ private final List<AxisData> axesData = new ArrayList<>(); - /** */ + /** axis description */ private final AxisData axisData; - /** */ + /** the spider chart diagram */ private final SpiderChart chart; /** Constructor */ @@ -53,7 +61,13 @@ public final class AxisDataBuilder { this.chart.addSeq(this.axisData.getData()); } - /** */ + /** + * Used to provide the class object to used as data points provider. The + * class needs to be annotated with {@link SpiderChartPlot} and it must + * contain a method annotated with {@link DataPoints} + * + * @param drawableData + */ public void inject(final Supplier<Object> drawableData) { requireNonNull(drawableData); final Object data = drawableData.get(); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartBuilder.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartBuilder.java index 4789a243b7c1ceba587f1fdf92ec8f445a212c9b..f902ab79feff64ceb8a56fa7361b48d47447c319 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartBuilder.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartBuilder.java @@ -32,14 +32,21 @@ import org.fortiss.tooling.spiderchart.SpiderChart; import org.fortiss.tooling.spiderchart.style.FillStyle; import org.fortiss.tooling.spiderchart.swt.SpiderChartViewer; +/** + * Used to build the complete spider chart + * + * @author AMIT KUMAR MONDAL + * + */ public final class SpiderChartBuilder { - /** */ + /** Spider Chart Configuration Builder Ref */ private static SpiderChartConfigurationBuilder chartConfiguration; - /** */ + + /** Chart Viewer Builder */ private static SpiderChartBuilder chartViewerBuilder; - /** */ + /** Configuration for the Spider Chart */ public static SpiderChartBuilder config(final Composite parent, final Consumer<SpiderChartConfigurationBuilder> settings) { requireNonNull(parent); @@ -50,9 +57,10 @@ public final class SpiderChartBuilder { return chartViewerBuilder; } - /** */ + /** Actual Spider Chart to be used */ private SpiderChart chart; - /** */ + + /** Actual Spider Chart Viewer */ private final SpiderChartViewer chartViewer; /** Constructor */ @@ -62,7 +70,7 @@ public final class SpiderChartBuilder { this.prepareChartViewer(parent); } - /** */ + /** The datapoints provider */ public SpiderChartBuilder data( final Consumer<AxisDataBuilder> dataBuilderConsumer) { requireNonNull(dataBuilderConsumer); @@ -72,7 +80,7 @@ public final class SpiderChartBuilder { return this; } - /** */ + /** Configuration for the spider chart */ private void prepareChartViewer(final Composite parent) { this.chartViewer.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); @@ -94,7 +102,7 @@ public final class SpiderChartBuilder { this.chart.setActivateSelection(true); } - /** */ + /** Builds the viewer */ public SpiderChartViewer viewer( final Consumer<SpiderChartBuilder> chartBuilderConsumer) { requireNonNull(chartBuilderConsumer); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartConfigurationBuilder.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartConfigurationBuilder.java index 6ca6ffbf0fa93865de26115a8a07a3f967b8e466..a3939d9b1b98b6dcceb853810f6f3fa833b6257c 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartConfigurationBuilder.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/SpiderChartConfigurationBuilder.java @@ -37,31 +37,39 @@ import org.fortiss.tooling.spiderchart.style.FillStyle; import org.fortiss.tooling.spiderchart.style.LineStyle; import org.fortiss.tooling.spiderchart.title.SpiderChartTitle; +/** + * Used to configure the Spider Chart Legend, Plotter and title + * + * @author AMIT KUMAR MONDAL + * + */ public final class SpiderChartConfigurationBuilder { - /** */ + /** The Legend */ private SpiderChartLegend legend; - /** */ + + /** The plotter */ private SpiderChartPlotter plotter; - /** */ + + /** The title */ private SpiderChartTitle title; - /** */ + /** Returns the legend */ public SpiderChartLegend getLegend() { return this.legend; } - /** */ + /** Returns the plotter */ public SpiderChartPlotter getPlotter() { return this.plotter; } - /** */ + /** Returns the title */ public SpiderChartTitle getTitle() { return this.title; } - /** */ + /** Prepares the legend */ public SpiderChartConfigurationBuilder legend( final Consumer<SpiderChartLegend> legendBuilder) { this.legend = new SpiderChartLegend(); @@ -71,21 +79,21 @@ public final class SpiderChartConfigurationBuilder { return this; } - /** */ + /** Prepares the plotter */ public SpiderChartConfigurationBuilder plotter( final Consumer<SpiderChartPlotter> plotter) { requireNonNull(plotter); this.plotter = new SpiderChartPlotter(); this.plotter.setBackStyle(new FillStyle(getColor(PALEGREEN))); this.plotter - .setGridStyle(new LineStyle(1, getColor(TELA), NORMAL_LINE)); + .setGridStyle(new LineStyle(1, getColor(TELA), NORMAL_LINE)); this.plotter.setGridFont(getFont(ARIAL, PLAIN, 10)); this.plotter.setGridFontColor(getColor(BLUE)); plotter.accept(this.plotter); return this; } - /** */ + /** Prepares the chart title */ public SpiderChartConfigurationBuilder title( final Consumer<SpiderChartTitle> titleBuilder) { requireNonNull(titleBuilder); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/model/AxisData.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/model/AxisData.java index e97bee816dda3e83eb810738ff9bc3978659a80b..89eeba8d7bec36295fa7da9f14f1f0e6630b1cee 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/model/AxisData.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/builder/model/AxisData.java @@ -27,17 +27,23 @@ import org.fortiss.tooling.spiderchart.sequence.LineDataSeq; import org.fortiss.tooling.spiderchart.style.FillStyle; import org.fortiss.tooling.spiderchart.style.LineStyle; +/** + * Axis Pojo + * + * @author AMIT KUMAR MONDAL + * + */ public final class AxisData { - /** */ + /** Line Sequence to be used for the axis */ private LineDataSeq data; - /** */ + /** getter for the axis sequence */ public LineDataSeq getData() { return this.data; } - /** */ + /** setter for axis sequence values and color */ public void setData(final double[] dataValues, final String color) { this.data = new LineDataSeq(dataValues, new LineStyle(2, getColor(color), NORMAL_LINE)); @@ -46,4 +52,4 @@ public final class AxisData { this.data.setFillStyle(new FillStyle(getColor(color), 0.5f)); } -} +} \ No newline at end of file diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartColor.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartColor.java index 1cf78a3ce8c33533182f692f27acbf211ae83f66..859d7c31657fc7bdade4471d6dd3cb505665d954 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartColor.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartColor.java @@ -95,38 +95,38 @@ public abstract class AbstractChartColor { public static final String YELLOW = "YELLOW"; public static final String YELLOWGREEN = "YELLOWGREEN"; - /** */ + /** Makes the color brighter */ public AbstractChartColor brighter() { return null; } - /** */ + /** Makes the color darker */ public AbstractChartColor darker() { return null; } - /** */ + /** Getter for the blue color in RGB */ public int getBlue() { return 0; } - /** */ + /** Getter for the green color in RGB */ public int getGreen() { return 0; } - /** */ + /** Getter for the red color in RGB */ public int getRed() { return 0; } - /** */ + /** Getter for the RGB */ public int getRGB() { return this.getRed() * 256 * 256 + this.getGreen() * 256 + this.getBlue(); } - /** */ + /** Getter for the RGB in Hex */ public String getRGBString() { return Integer.toHexString(this.getRGB()); } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartGraphics.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartGraphics.java index 19827b943f6e76bae6ac0682cd87df9843629dd4..70a2073c98fb8f84fb04b07562a5c4258ac17090 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartGraphics.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartGraphics.java @@ -36,39 +36,39 @@ public abstract class AbstractChartGraphics { /** */ protected AbstractChartImage textureImage = null; - /** */ + /** Creates fade area */ public void createFadeArea(final AbstractChartColor colorFrom, final AbstractChartColor colorUntil, final int x, final int y, final int w, final int h, final boolean vertical, final boolean cyclic) { } - /** */ + /** disposes the resource */ public void dispose() { } - /** */ + /** draws the arc as provided as inputs */ public void drawArc(final int x, final int y, final int w, final int h, final int a1, final int a2) { } - /** */ + /** draws the image */ public void drawImage(final AbstractChartImage image, final int x, final int y) { } - /** */ + /** draws the image */ public void drawImage(final AbstractChartImage image, final int x1Dest, final int y1Dest, final int x2Dest, final int y2Dest, final int x1Source, final int y1Source, final int x2Source, final int y2Source) { } - /** */ + /** draws the line */ public void drawLine(final int x1, final int y1, final int x2, final int y2) { } - /** */ + /** draws the line based on the line style provided */ public void drawLineWithStyle(final int x1, final int y1, final int x2, final int y2) { if (this.lineStyle == STROKE_NORMAL) { @@ -125,11 +125,11 @@ public abstract class AbstractChartGraphics { } } - /** */ + /** draws the polygon */ public void drawPolygon(final int[] x1, final int[] y1, final int count) { } - /** */ + /** draws the rectangle */ public void drawRect(final int x1, final int y1, final int w, final int h) { this.drawLineWithStyle(x1, y1, x1, y1 + h); this.drawLineWithStyle(x1, y1, x1 + w, y1); @@ -137,20 +137,20 @@ public abstract class AbstractChartGraphics { this.drawLineWithStyle(x1 + w, y1, x1 + w, y1 + h); } - /** */ + /** draws the text as rotated */ public boolean drawRotatedText(final AbstractChartFont descFont, final AbstractChartColor descColor, final String txt, final int angle, final int x, final int y, final boolean b) { return false; } - /** */ + /** draws the rectangle with round corners */ public void drawRoundedRect(final int x1, final int y1, final int w, final int h) { this.drawRect(x1, y1, w, h); } - /** */ + /** draws the simple line */ protected void drawSimpleLine(final int x1, final int y1, final int x2, final int y2) { int pixelsWidth = 1; @@ -199,96 +199,96 @@ public abstract class AbstractChartGraphics { } } - /** */ + /** draws the text at the provided coordinate */ public void drawText(final String s, final int x, final int y) { } - /** */ + /** Fills the arc based on the provided inputs */ public void fillArc(final int x, final int y, final int w, final int h, final int a1, final int a2) { } - /** */ + /** fills the polygon */ public void fillPolygon(final int[] x1, final int[] y1, final int count) { } - /** */ + /** fills the rectangle */ public void fillRect(final int x1, final int y1, final int w, final int h) { } - /** */ + /** fills the rectangle with round corners */ public void fillRoundRect(final int x1, final int y1, final int w, final int h) { this.fillRect(x1, y1, w, h); } - /** */ + /** Getter for alpha composite */ public Object getAlphaComposite() { return null; } - /** */ + /** Getter for color */ public AbstractChartColor getColor() { return null; } - /** */ + /** Getter for font */ public AbstractChartFont getFont() { return null; } - /** */ + /** Getter for font height */ public int getFontHeight() { return this.getFontHeight(null); } - /** */ + /** getter for the provided font height */ public int getFontHeight(final AbstractChartFont font) { return 0; } - /** */ + /** getter for the font width as provided */ public int getFontWidth(final AbstractChartFont font, final String s) { return 0; } - /** */ + /** getter for the ont width */ public int getFontWidth(final String s) { return this.getFontWidth(null, s); } - /** */ + /** paints rotated image */ public void paintRotatedImage(final AbstractChartImage srcImage, final int angle, final int x, final int y, final int alginment) { } - /** */ + /** setter for alpha value */ public void setAlpha(final float a) { } - /** */ + /** setter for alpha composite */ public void setAlphaComposite(final Object a) { } - /** */ + /** setter for color */ public void setColor(final AbstractChartColor color) { } - /** */ + /** setter for font */ public void setFont(final AbstractChartFont font) { } - /** */ + /** setter for line style */ public void setLineStyle(final int style) { this.lineStyle = style; } - /** */ + /** setter for line width */ public void setLineWidth(final int w) { this.lineWidth = w; } - /** */ + /** setter for texture */ public void setTexture(final AbstractChartImage image) { this.textureImage = image; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartImage.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartImage.java index d679aace9316be94f47fdecd4e886a4a0a9d9577..df9c23c71e9c322ac2f3177ad3a14bbf12b04040 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartImage.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractChartImage.java @@ -19,21 +19,21 @@ package org.fortiss.tooling.spiderchart.gc; public abstract class AbstractChartImage { - /** */ + /** disposes the image */ public void dispose() { } - /** */ + /** getter for the graphics */ public AbstractChartGraphics getGraphics() { return null; } - /** */ + /** getter for the height of the image */ public int getHeight() { return 0; } - /** */ + /** getter for the width of the image */ public int getWidth() { return 0; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractGraphicsSupplier.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractGraphicsSupplier.java index 9389426dcbe4d841d6b445ae0b80bd2b635b7c94..33b62db7ec91fae7a3b460c4849af1fab6cf9f55 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractGraphicsSupplier.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/AbstractGraphicsSupplier.java @@ -26,50 +26,55 @@ import org.fortiss.tooling.spiderchart.gc.swt.SpiderChartSwtImage; public final class AbstractGraphicsSupplier { - /** */ + /** Creates an image */ public static AbstractChartImage createImage(final int w, final int h) { return new SpiderChartSwtImage(w, h); } - /** */ + /** creates transparent image */ public static AbstractChartImage createTransparentImage(final int w, final int h, final AbstractChartColor transparent) { return new SpiderChartSwtImage(w, h, transparent); } - /** */ + /** Returns provided RGB color */ public static AbstractChartColor getColor(final int red, final int green, final int blue) { return new SpiderChartSwtColor(red, green, blue); } - /** */ + /** + * returns provided color + * + * @param c + * name of the color + */ public static AbstractChartColor getColor(final String c) { return new SpiderChartSwtColor(c); } - /** */ + /** returns the color from object */ public static AbstractChartColor getColorFromObject(final Object o) { return new SpiderChartSwtColor(o); } - /** */ + /** returns the font based the the provided font and style */ public static AbstractChartFont getFont(final Fonts fonts, final int style, final int size) { return new SpiderChartSwtFont(fonts.getFontName(), style, size); } - /** */ + /** returns the font from object */ public static AbstractChartFont getFontFromObject(final Object o) { return new SpiderChartSwtFont(o); } - /** */ + /** returns the graphics */ public static AbstractChartGraphics getGraphics(final Object o) { return new SpiderChartSwtGraphics(o); } - /** */ + /** returns the image */ public static AbstractChartImage getImage(final Object o) { try { return new SpiderChartSwtImage(o); @@ -79,7 +84,7 @@ public final class AbstractGraphicsSupplier { return null; } - /** */ + /** starts the paint in UI thread */ public static void startUiThread(final Runnable r) { startUIThread(r); } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Point.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Point.java index ef8c27b5e65045aae7b5b8e797c92687fc895a1f..a9bd220bb2ac5079398c4bf937595bf9612ab901 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Point.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Point.java @@ -19,9 +19,10 @@ package org.fortiss.tooling.spiderchart.gc; public final class Point { - /** */ + /** X coordinate */ private final int x; - /** */ + + /** Y coordinate */ private final int y; /** Constructor */ @@ -30,10 +31,12 @@ public final class Point { this.y = y1; } + /** */ public int getX() { return this.x; } + /** */ public int getY() { return this.y; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Polygon.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Polygon.java index f1dfa9fc3e71afe1bc4b557835045c1c02bdfe40..643c571ba1f98622fb88e17b4b92413a7efc1a4e 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Polygon.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/Polygon.java @@ -22,7 +22,7 @@ import java.util.List; public final class Polygon { - /** */ + /** list of points to draw the polygon */ private final List<Point> points; /** @@ -32,12 +32,12 @@ public final class Polygon { this.points = new ArrayList<>(); } - /** */ + /** adds the point for the polygon to be drawn */ public void addPoint(final int x, final int y) { this.points.add(new Point(x, y)); } - /** */ + /** checks for the containment of a coordinate in the polygon */ public boolean contains(final int x, final int y) { int i = 0; int j = 0; @@ -57,12 +57,12 @@ public final class Polygon { return c; } - /** */ + /** getter for the x coordinate */ public int getX(final int i) { return this.points.get(i).getX(); } - /** */ + /** getter for the y coordinate */ public int getY(final int i) { return this.points.get(i).getY(); } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtColor.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtColor.java index 35190084a6004b3aba339853f05cf4de7217d338..50ed650ba11aca5f9bee5735e88e7208b6baf751 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtColor.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtColor.java @@ -289,14 +289,14 @@ public final class SpiderChartSwtColor extends AbstractChartColor { } } - /** */ + /** setter for RGB */ private void setRGB(final int rgb) { this.red = rgb >> 16 & 0xFF; this.green = rgb >> 8 & 0xFF; this.blue = rgb & 0xFF; } - /** */ + /** setter for RGB */ private void setRGB(final int iRed, final int iGreen, final int iBlue) { this.red = iRed; this.green = iGreen; diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtFont.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtFont.java index 2c3fe482c4577af383de779ea41559f581b49416..f8954d047aeaa7c14e4d9418bad43e1813a9f46c 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtFont.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SpiderChartSwtFont.java @@ -22,11 +22,13 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartFont; public final class SpiderChartSwtFont extends AbstractChartFont { - /** */ + /** name of the font */ private String fontName = ""; - /** */ + + /** size of the font */ private int fontSize = 10; - /** */ + + /** style of the font */ private int fontStyle = PLAIN; /** Constructor */ @@ -53,7 +55,7 @@ public final class SpiderChartSwtFont extends AbstractChartFont { this.fontStyle = style; } - /** */ + /** getter for the font object used */ protected Font getFont() { int s = 0; if (this.fontStyle == BOLD) { diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SwtGraphicsProvider.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SwtGraphicsProvider.java index df7c66b1c03dfbfc8d434b1b2739c97fb06e1c30..e5feeb7d1a23959a8223f811e51f937679c76620 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SwtGraphicsProvider.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/gc/swt/SwtGraphicsProvider.java @@ -22,10 +22,10 @@ import org.eclipse.swt.widgets.Display; public final class SwtGraphicsProvider { - /** */ + /** SWT Device object */ private static Device display = null; - /** */ + /** returns the display instance */ public synchronized static Device getDisplay() { if (display == null) { display = Display.getCurrent(); @@ -33,7 +33,7 @@ public final class SwtGraphicsProvider { return display; } - /** */ + /** Starts the provided execution in UI thread */ public static void startUIThread(final Runnable r) { ((Display) getDisplay()).syncExec(r); } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/SpiderChartLabel.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/SpiderChartLabel.java index 294349caa910449f71bf47a0d9b68aa6c63ed0b8..635b03942cfd4a879dc790acc6185be1e7718c6e 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/SpiderChartLabel.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/SpiderChartLabel.java @@ -107,50 +107,62 @@ public final class SpiderChartLabel implements IFloatingObject { this.sFormat = pformat; } + /** */ public int getAlign() { return this.align; } + /** */ public int getAnchorX() { return this.anchorX; } + /** */ public int getAnchorY() { return this.anchorY; } + /** */ public FillStyle getBackground() { return this.background; } + /** */ public LineStyle getBorder() { return this.border; } + /** */ public int getBorderShape() { return this.borderShape; } + /** */ public SpiderChart getChart() { return this.chart; } + /** */ public Polygon getClickableArea() { return this.clickableArea; } + /** */ public LineStyle getLineToAnchor() { return this.lineToAnchor; } + /** */ public int[] getLineWidths() { return this.lineWidths; } + /** */ public int getMarginX() { return this.marginX; } + /** */ public int getMarginY() { return this.marginY; } @@ -172,22 +184,27 @@ public final class SpiderChartLabel implements IFloatingObject { return pol; } + /** */ public int getPositionX() { return this.positionX; } + /** */ public int getPositionY() { return this.positionY; } + /** */ public int getRequiredHeight() { return this.requiredHeight; } + /** */ public int getRequiredWidth() { return this.requiredWidth; } + /** */ public String getsFormat() { return this.sFormat; } @@ -214,6 +231,7 @@ public final class SpiderChartLabel implements IFloatingObject { this.chart = c; } + /** */ public boolean isIgnorePosition() { return this.ignorePosition; } @@ -267,15 +285,15 @@ public final class SpiderChartLabel implements IFloatingObject { } if (this.borderShape == BORDER_OVAL) { this.background - .drawArc( - g, - (int) (this.positionX - this.requiredWidth * 0.1D), - (int) (this.positionY - this.requiredHeight * 0.1D), - (int) (this.requiredWidth + this.requiredWidth + .drawArc( + g, + (int) (this.positionX - this.requiredWidth * 0.1D), + (int) (this.positionY - this.requiredHeight * 0.1D), + (int) (this.requiredWidth + this.requiredWidth * 0.2D - 1.0D), - (int) (this.requiredHeight + (int) (this.requiredHeight + this.requiredHeight * 0.3D - 1.0D), - 0, 360); + 0, 360); } g.setColor(c); } @@ -302,15 +320,15 @@ public final class SpiderChartLabel implements IFloatingObject { } if (this.borderShape == BORDER_OVAL) { this.border - .drawArc( - g, - (int) (this.positionX - this.requiredWidth * 0.1D), - (int) (this.positionY - this.requiredHeight * 0.1D), - (int) (this.requiredWidth + this.requiredWidth + .drawArc( + g, + (int) (this.positionX - this.requiredWidth * 0.1D), + (int) (this.positionY - this.requiredHeight * 0.1D), + (int) (this.requiredWidth + this.requiredWidth * 0.2D - 1.0D), - (int) (this.requiredHeight + (int) (this.requiredHeight + this.requiredHeight * 0.3D - 1.0D), - 0, 360); + 0, 360); } } this.clickableArea = new Polygon(); @@ -323,78 +341,97 @@ public final class SpiderChartLabel implements IFloatingObject { this.positionY); } + /** */ public void setAlign(final int align) { this.align = align; } + /** */ public void setAnchorX(final int anchorX) { this.anchorX = anchorX; } + /** */ public void setAnchorY(final int anchorY) { this.anchorY = anchorY; } + /** */ public void setBackground(final FillStyle background) { this.background = background; } + /** */ public void setBorder(final LineStyle border) { this.border = border; } + /** */ public void setBorderShape(final int borderShape) { this.borderShape = borderShape; } + /** */ public void setChart(final SpiderChart chart) { this.chart = chart; } + /** */ public void setClickableArea(final Polygon clickableArea) { this.clickableArea = clickableArea; } + /** */ public void setIgnorePosition(final boolean ignorePosition) { this.ignorePosition = ignorePosition; } + /** */ public void setLineToAnchor(final LineStyle lineToAnchor) { this.lineToAnchor = lineToAnchor; } + /** */ public void setMarginX(final int marginX) { this.marginX = marginX; } + /** */ public void setMarginY(final int marginY) { this.marginY = marginY; } + /** */ public void setName(final String name) { this.name = name; } + /** */ public void setPositionX(final int positionX) { this.positionX = positionX; } + /** */ public void setPositionY(final int positionY) { this.positionY = positionY; } + /** */ public void setRequiredHeight(final int requiredHeight) { this.requiredHeight = requiredHeight; } + /** */ public void setRequiredWidth(final int requiredWidth) { this.requiredWidth = requiredWidth; } + /** */ public void setsFormat(final String sFormat) { this.sFormat = sFormat; } + /** */ public void setTip(final String tip) { this.tip = tip; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/api/IFloatingObject.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/api/IFloatingObject.java index dacb142453fc29ac803101748d029e579a98f61e..40729685e4246b02f23c7c0b68ad96a52052ec9f 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/api/IFloatingObject.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/label/api/IFloatingObject.java @@ -21,21 +21,21 @@ import org.fortiss.tooling.spiderchart.gc.Polygon; public interface IFloatingObject { - /** */ + /** Layer ID to be used to identify the component */ public static final String LAYER_ID = ""; - /** */ + /** Polygon Bounds */ public abstract Polygon getObjectBounds(); - /** */ + /** returns X-Coordinate of the component */ public abstract int getX(); - /** */ + /** returns Y-coordinate of the component */ public abstract int getY(); - /** */ + /** setter for X-Coordinate of the component */ public abstract void setX(int paramInt); - /** */ + /** setter for Y-coordinate of the component */ public abstract void setY(int paramInt); } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/legend/SpiderChartLegend.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/legend/SpiderChartLegend.java index 18472c0b0c135b65076674cb1f4c4df0b82121e8..689e81205f4c5f128e0f2e6f01c394a1b11366a5 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/legend/SpiderChartLegend.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/legend/SpiderChartLegend.java @@ -95,7 +95,7 @@ public final class SpiderChartLegend extends SpiderChartComponent { this.addItem(getLegend(data), ls); } - /** */ + /** Draws the provided graphics */ public void draw(final AbstractChartGraphics g) { if (this.legendLabel != null && this.legendLabel.length() > 0) { final SpiderChartLabel cl = new SpiderChartLabel(this.legendLabel, @@ -111,7 +111,7 @@ public final class SpiderChartLegend extends SpiderChartComponent { } } - /** */ + /** draws the graphics horizontally */ public void drawHorizontal(final AbstractChartGraphics g) { g.setFont(this.font); @@ -209,14 +209,14 @@ public final class SpiderChartLegend extends SpiderChartComponent { final FillStyle f = (FillStyle) icon; f.draw(g, toCenterX + this.x + offset, toCenterY + this.y, toCenterX + this.x + offset + sidelentgh, toCenterY - + this.y + sidelentgh); + + this.y + sidelentgh); } offset = offset + iconWidth + iconSeparator + textWidth + textSeparator; } } - /** */ + /** draws the graphics vertically */ public void drawVertical(final AbstractChartGraphics g) { g.setFont(this.font); @@ -296,82 +296,102 @@ public final class SpiderChartLegend extends SpiderChartComponent { } } + /** */ public FillStyle getBackground() { return this.background; } + /** */ public LineStyle getBorder() { return this.border; } + /** */ public AbstractChartColor getChartColor() { return this.color; } + /** */ public AbstractChartFont getChartFont() { return this.font; } + /** */ public List<Object> getItems() { return this.items; } + /** */ public String getLegendLabel() { return this.legendLabel; } + /** */ public int getLegendMargin() { return this.legendMargin; } + /** */ public int getLegendOffset() { return this.legendOffset; } + /** */ public List<String> getNames() { return this.names; } + /** */ public String getTitle() { return this.title; } + /** */ public boolean isVerticalLayout() { return this.verticalLayout; } + /** */ public void setBackground(final FillStyle background) { this.background = background; } + /** */ public void setBorder(final LineStyle border) { this.border = border; } + /** */ public void setColor(final AbstractChartColor color) { this.color = color; } + /** */ public void setFont(final AbstractChartFont font) { this.font = font; } + /** */ public void setLegendLabel(final String legendLabel) { this.legendLabel = legendLabel; } + /** */ public void setLegendMargin(final int legendMargin) { this.legendMargin = legendMargin; } + /** */ public void setLegendOffset(final int legendOffset) { this.legendOffset = legendOffset; } + /** */ public void setTitle(final String title) { this.title = title; } + /** */ public void setVerticalLayout(final boolean verticalLayout) { this.verticalLayout = verticalLayout; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/listener/SpiderChartAdapter.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/listener/SpiderChartAdapter.java index d07a5d600d7a941469acd05e8cbbdb567d5c89f0..f6177c9d92c2fd49bfaa63d3921bfab7a2acaf1f 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/listener/SpiderChartAdapter.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/listener/SpiderChartAdapter.java @@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.listener; import org.fortiss.tooling.spiderchart.SpiderChart; import org.fortiss.tooling.spiderchart.gc.AbstractChartGraphics; +/** + * Default Listener Implementation + * + * @author AMIT KUMAR MONDAL + * + */ public class SpiderChartAdapter implements ISpiderChartListener { /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/plotter/AbstractPlotter.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/plotter/AbstractPlotter.java index 9c3e5dc1495b3d1393b3e9efd8d1001baf87b485..ff83cd0b62d872baf199a03deff6676d25ec50c4 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/plotter/AbstractPlotter.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/plotter/AbstractPlotter.java @@ -38,33 +38,33 @@ public abstract class AbstractPlotter extends SpiderChartComponent { /** Spider Chart Background Image */ private AbstractChartImage backgroundImage; - /** */ + /** background fill style */ private FillStyle backgroundStyle = null; - /** */ + /** depth of the component */ private int depth = 0; - /** */ + /** list of sequences to be used for plotting */ private List<DataSeq> seq = new ArrayList<>(); - /** */ + /** visible height on the canvas */ private int visibleHeight = 0; - /** */ + /** visible width on the canvas */ private int visibleWidth = 0; - /** */ + /** x-axis scaling */ private SpiderChartScale xScale; - /** */ + /** y-axis scaling */ private SpiderChartScale yScale; - /** */ + /** adds sequence to the plotter */ public void addSeq(final DataSeq s) { this.replaceSeq(-1, s); } - /** */ + /** calculates the max values in the provided scale */ private void calculateMax(final SpiderChartScale s, final double m) { if (!s.isExactMaxValue()) { s.setMax(m); @@ -82,7 +82,7 @@ public abstract class AbstractPlotter extends SpiderChartComponent { } } - /** */ + /** calculates the min values in the provided scale */ private void calculateMin(final SpiderChartScale s, final double m) { if (!s.isExactMinValue()) { s.setMin(m); @@ -100,13 +100,13 @@ public abstract class AbstractPlotter extends SpiderChartComponent { } } - /** */ + /** returns the active x scaling */ protected SpiderChartScale getActiveXScale(final DataSeq s) { final SpiderChartScale scale = this.xScale; return scale; } - /** */ + /** returns the active y scaling */ protected SpiderChartScale getActiveYScale(final DataSeq s) { final SpiderChartScale scale = this.yScale; return scale; @@ -178,7 +178,7 @@ public abstract class AbstractPlotter extends SpiderChartComponent { return this.yScale; } - /** */ + /** plots the values */ public void plot(final AbstractChartGraphics g) { for (int i = 0; i < this.seq.size(); i++) { final DataSeq s = this.seq.get(i); @@ -186,12 +186,12 @@ public abstract class AbstractPlotter extends SpiderChartComponent { } } - /** */ + /** plots the values */ protected void plot(final AbstractChartGraphics g, final DataSeq s, final int serieSec) { } - /** */ + /** plots the background of the plotting canvas */ public void plotBackground(final AbstractChartGraphics g, final int bw, final int bh, final int offsetX, final int offsetY) { if (this.backgroundStyle != null) { @@ -216,7 +216,7 @@ public abstract class AbstractPlotter extends SpiderChartComponent { } } - /** */ + /** replaces a sequence with the provided one */ public void replaceSeq(final int p, final DataSeq s) { final SpiderChartScale tmpScaleX = this.getActiveXScale(s); this.getActiveYScale(s); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/scale/SpiderChartScale.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/scale/SpiderChartScale.java index d2e5bff7bcc414f8a5391a123ee2842a85ef35a9..0c9dbf7a7faeb729b19269be8ee92eab69ac25ca 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/scale/SpiderChartScale.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/scale/SpiderChartScale.java @@ -19,26 +19,33 @@ package org.fortiss.tooling.spiderchart.scale; public final class SpiderChartScale { - /** */ + /** Scaling Max Value (shown exactly as provided) */ private boolean exactMaxValue = false; - /** */ + + /** Scaling Min Value (shown exactly as provided) */ private boolean exactMinValue = false; - /** */ + + /** Max Value Default */ private double max = -99999.0D; - /** */ + + /** Min Value Default */ private double min = 99999.0D; - /** */ + + /** Preferred Max Values */ private double[] preferred_MaxMin_values = { -1000000.0D, -500000.0D, -100000.0D, -50000.0D, -10000.0D, -5000.0D, -1000.0D, -500.0D, -250.0D, -100.0D, -50.0D, -35.0D, -5.0D, -1.0D, -0.5D, -0.1D, 0.0D, 0.1D, 0.5D, 1.0D, 5.0D, 10.0D, 25.0D, 50.0D, 100.0D, 250.0D, 500.0D, 1000.0D, 5000.0D, 10000.0D, 50000.0D, 100000.0D, 500000.0D, 1000000.0D }; - /** */ + + /** Screen Max Size */ private int screenMax; - /** */ + + /** Screen Max Margin */ private int screenMaxMargin; - /** */ + + /** Screen Min Size */ private int screenMin; /** Constructor */ diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/DataSeq.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/DataSeq.java index 86fe3d10fe4be7ea0011011bff9ec835d9fcd2ee..dbc586dd008a8878342f69ea0e0a91ab08d1c9cd 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/DataSeq.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/DataSeq.java @@ -29,21 +29,28 @@ import org.fortiss.tooling.spiderchart.SpiderChart; public class DataSeq { - /** */ + /** Data Point Labels */ private String[] dataLabels; - /** */ + + /** Areas to be used for finding the points in the chart */ private List<Object> hotAreas = new ArrayList<>(); - /** */ + + /** Label Template */ private String labelTemplate = ""; - /** */ + + /** Descriptive Name for the Data Sequence */ private String name = ""; - /** */ + + /** Tips to be used on the Data Sequence */ private String[] tips = new String[0]; - /** */ + + /** Values to be formatted for the Data Sequence */ private String valueFormat = "######.##"; - /** */ + + /** x-axis data points */ private List<Double> xData = new ArrayList<>(); - /** */ + + /** y-axis data points */ private List<Double> yData = new ArrayList<>(); /** @@ -106,7 +113,7 @@ public class DataSeq { this.yData.add((Double) y); } - /** */ + /** Converts double values to string conforming to the provided template */ public String doubleToString(final Double d) { if (this.valueFormat.compareTo("") == 0) { return d.toString(); @@ -125,81 +132,97 @@ public class DataSeq { return df.format(d.doubleValue()); } + /** Returns the Data Point labels */ public String[] getDataLabels() { return this.dataLabels; } - /** */ + /** Get element at X as provided */ public Object getElementX(final int i) { return this.xData.get(i); } - /** */ + /** Get element at Y as provided */ public Object getElementY(final int i) { return this.yData.get(i); } + /** Getter for the hot areas */ public List<Object> getHotAreas() { return this.hotAreas; } + /** Getter for the Label Template */ public String getLabelTemplate() { return this.labelTemplate; } + /** Getter for the descriptive name */ public String getName() { return this.name; } - /** */ + /** Getter for the size */ public int getSize() { return this.xData.size(); } + /** Getter for the tips */ public String[] getTips() { return this.tips; } + /** Getter for the value label format */ public String getValueFormat() { return this.valueFormat; } + /** Getter for the x data */ public List<Double> getxData() { return this.xData; } + /** Getter for the y Data */ public List<Double> getyData() { return this.yData; } + /** Setter for data labels */ public void setDataLabels(final String[] dataLabels) { this.dataLabels = dataLabels; } + /** Setter for hot areas */ public void setHotAreas(final List<Object> hotAreas) { this.hotAreas = hotAreas; } + /** Setter for label template */ public void setLabelTemplate(final String labelTemplate) { this.labelTemplate = labelTemplate; } + /** Setter for the descriptive name */ public void setName(final String name) { this.name = name; } + /** Setter for the tips */ public void setTips(final String[] tips) { this.tips = tips; } + /** Setter for the value label format */ public void setValueFormat(final String valueFormat) { this.valueFormat = valueFormat; } + /** Setter for the x data */ public void setxData(final List<Double> xData) { this.xData = xData; } + /** Setter for the y Data */ public void setyData(final List<Double> yData) { this.yData = yData; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/LineDataSeq.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/LineDataSeq.java index b51419590e81626f5794dafa6361d5e65784f23a..2b0e724915811c27777e8dd4c893e60ef53d7e5e 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/LineDataSeq.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/sequence/LineDataSeq.java @@ -59,21 +59,28 @@ public final class LineDataSeq extends DataSeq { return seq; } - /** */ + /** Draw Point Configuration */ private boolean drawPoint = false; - /** */ + + /** Fillstyle to be used */ private FillStyle fillStyle = null; - /** */ + + /** Icon to be used */ private AbstractChartImage icon = null; - /** */ + + /** Line Type */ private int lineType = 0; - /** */ + + /** Data Point Color */ private AbstractChartColor pointColor = getColor(BLACK); - /** */ + + /** Line Style */ private LineStyle style = null; - /** */ + + /** value Color */ private AbstractChartColor valueColor = getColor(BLACK); - /** */ + + /** value font */ private AbstractChartFont valueFont = null; /** */ diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/FillStyle.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/FillStyle.java index 28724178e6b25dd96638c5900a82ad3e48490d38..691a4503470d8d7905e2be95e4bb93f171e1825c 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/FillStyle.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/FillStyle.java @@ -27,27 +27,37 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartImage; public final class FillStyle { - /** */ + /** Gradient Horizontal Setting */ public static final int GRADIENT_HORIZONTAL = 1; - /** */ + + /** Gradient Vertical Setting */ public static final int GRADIENT_VERTICAL = 2; - /** */ + + /** No Gradient Setting */ public static final int NO_GRADIENT = 0; - /** */ + + /** Needed for Gradient setting */ private float alphaValue = 1.0F; - /** */ + + /** Color instance to be used for the fill style */ private final AbstractChartColor color; + /** Spider Chart Canvas Background Color */ private AbstractChartColor colorFrom = getColor(AZURE); - /** */ + + /** Gradient Color for the shadow */ private final AbstractChartColor colorUntil = getColor(WHITE); + /** */ private Object composite = null; + /** */ private final boolean gradientCyclic = false; + /** */ private int gradientType = NO_GRADIENT; - /** */ + + /** Image if needed for the texture */ private AbstractChartImage textureImage = null; /** Constructor */ @@ -67,7 +77,7 @@ public final class FillStyle { this.color = getColor(WHITE); } - /** */ + /** Draws the style */ public void draw(final AbstractChartGraphics g, int x1, int y1, int x2, int y2) { if (x1 > x2) { @@ -93,7 +103,7 @@ public final class FillStyle { } } - /** */ + /** Draws the fill style */ public void draw(final AbstractChartGraphics g, final String backgroundCanvasColor, int x1, int y1, int x2, int y2) { if (x1 > x2) { @@ -120,7 +130,7 @@ public final class FillStyle { } } - /** */ + /** Draws arc */ public void drawArc(final AbstractChartGraphics g, final int x, final int y, final int w, final int h, final int a1, final int a2) { g.setTexture(this.textureImage); @@ -130,7 +140,7 @@ public final class FillStyle { this.resetAlpha(g); } - /** */ + /** Draws Polygon */ public void drawPolygon(final AbstractChartGraphics g, final int[] x1, final int[] y1, final int num) { g.setTexture(this.textureImage); @@ -140,7 +150,7 @@ public final class FillStyle { this.resetAlpha(g); } - /** */ + /** Draws Round Rectangle */ public void drawRoundRect(final AbstractChartGraphics g, final int x1, final int y1, final int x2, final int y2) { g.setTexture(this.textureImage); @@ -157,7 +167,7 @@ public final class FillStyle { return this.gradientType; } - /** */ + /** Resets alpha for the composite */ private void resetAlpha(final AbstractChartGraphics g) { if (this.composite != null) { g.setAlphaComposite(this.composite); @@ -165,7 +175,7 @@ public final class FillStyle { this.composite = null; } - /** */ + /** Setter for alpha value */ private void setAlpha(final AbstractChartGraphics g) { if (this.alphaValue != 1.0F) { this.composite = g.getAlphaComposite(); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/LineStyle.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/LineStyle.java index 75c77851be39a2129dafb55a602e2a6bf4d17654..13ddb8db973dd185281355eb9846c90059b2dd20 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/LineStyle.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/style/LineStyle.java @@ -33,7 +33,7 @@ public final class LineStyle { /** */ public static final int NORMAL_LINE = 1; - /** */ + /** Factory method to create line */ public static LineStyle of(final float w, final AbstractChartColor c, final int t) { return new LineStyle(w, c, t); @@ -41,36 +41,36 @@ public final class LineStyle { /** */ private float alphaValue = 1.0F; - /** */ + /** color instance for the line */ private AbstractChartColor color; - /** */ + /** type of the line */ private int lineType; /** */ private float lineWidth; - /** */ + /** Constructor */ public LineStyle(final float w, final AbstractChartColor c, final int t) { this.lineType = t; this.lineWidth = w; this.color = c; } - /** */ + /** Constructor */ public LineStyle(final float w, final AbstractChartColor c, final int t, final float alpha) { this(w, c, t); } - /** */ + /** Draws the line */ public void draw(final AbstractChartGraphics g, final int x1, final int y1, final int x2, final int y2) { this.setGraphicsProperties(g); g.drawLineWithStyle(x1, y1, x2, y2); } - /** */ + /** Draws arc */ public void drawArc(final AbstractChartGraphics g, final int x, final int y, final int w, final int h, final int a1, final int a2) { this.setGraphicsProperties(g); @@ -78,7 +78,7 @@ public final class LineStyle { g.drawArc(x, y, w, h, a1, a2); } - /** */ + /** Draws open ended polygon */ public void drawOpenPolygon(final AbstractChartGraphics g, final int[] x, final int[] y, final int c) { for (int i = 1; i < c; i++) { @@ -86,7 +86,7 @@ public final class LineStyle { } } - /** */ + /** Draws polygon */ public void drawPolygon(final AbstractChartGraphics g, final int[] x, final int[] y, final int c) { for (int i = 1; i < c; i++) { @@ -95,7 +95,7 @@ public final class LineStyle { this.draw(g, x[0], y[0], x[c - 1], y[c - 1]); } - /** */ + /** Draws Rectangle */ public void drawRect(final AbstractChartGraphics g, final int x1, final int y1, final int x2, final int y2) { int iX = x1; @@ -114,7 +114,7 @@ public final class LineStyle { g.drawRect(iX, iY, w, h); } - /** */ + /** Draws Round Rectangle */ public void drawRoundRect(final AbstractChartGraphics g, final int x1, final int y1, final int x2, final int y2) { int iX = x1; @@ -140,7 +140,7 @@ public final class LineStyle { return this.alphaValue; } - /** */ + /** Getter for line color instance */ public AbstractChartColor getColor() { return this.color; } @@ -159,12 +159,12 @@ public final class LineStyle { return this.lineWidth; } - /** */ + /** Getter for the type of the line */ public int getType() { return this.lineType; } - /** */ + /** Getter for the width of the line */ public float getWidth() { return this.lineWidth; } @@ -177,12 +177,12 @@ public final class LineStyle { this.alphaValue = alphaValue; } - /** */ + /** Setter for the color instance */ public void setColor(final AbstractChartColor c) { this.color = c; } - /** */ + /** Setter for the graphics properties */ protected void setGraphicsProperties(final AbstractChartGraphics g) { g.setColor(this.color); int tmp = (int) this.lineWidth; @@ -215,12 +215,12 @@ public final class LineStyle { this.lineWidth = lWidth; } - /** */ + /** Setter for the type of the line */ public void setType(final int t) { this.lineType = t; } - /** */ + /** Setter for the width of the line */ public void setWidth(final float f) { this.lineWidth = f; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartCanvas.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartCanvas.java index c7ffebaeb3981f541873b59a88403396036dae0b..5111c53d79e7644a62edfcaaf16c117f10436d43 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartCanvas.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartCanvas.java @@ -34,9 +34,9 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartGraphics; import org.fortiss.tooling.spiderchart.listener.ISpiderChartListener; public final class SpiderChartCanvas extends Canvas implements -ISpiderChartListener { + ISpiderChartListener { - /** */ + /** Actual Spider Chart Ref */ private SpiderChart chart = null; /** Constructor */ @@ -71,19 +71,19 @@ ISpiderChartListener { }); } - /** */ + /** Returns the spider chart */ public SpiderChart getChart() { return this.chart; } - /** */ + /** Mouse Click event */ private void mouseClick() { if (this.chart != null) { this.chart.mouseClick(); } } - /** */ + /** Mouse Moved Event */ private void mouseMoved(final MouseEvent e) { if (this.chart != null) { this.chart.mouseMoved(e.x, e.y); @@ -111,7 +111,7 @@ ISpiderChartListener { final AbstractChartGraphics g) { } - /** */ + /** Draws the Spider Chart */ protected void paintChart(final PaintEvent e) { try { this.resizeChart(); @@ -123,13 +123,13 @@ ISpiderChartListener { } } - /** */ + /** Resizes the spider chart */ protected void resizeChart() { this.chart.setWidth(this.getSize().x + 1); this.chart.setHeight(this.getSize().y + 1); } - /** */ + /** Setter for Spider Chart */ public void setChart(final SpiderChart c) { if (this.chart != null) { this.chart.removeChartListener(this); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartViewer.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartViewer.java index a91a01698d67d2ca00938b84c5d3b25702f89de8..9b46d2e9a4075276ead24ee5f3091196f3a37b92 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartViewer.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/swt/SpiderChartViewer.java @@ -37,64 +37,83 @@ import org.fortiss.tooling.spiderchart.listener.SpiderChartAdapter; public final class SpiderChartViewer extends Composite { - /** */ + /** allows zoom functionality on the chart */ private boolean allowZoom = true; - /** */ + + /** the actual canvas to be used */ private SpiderChartCanvas canvas = null; - /** */ + + /** allows to change pointer on hovering data points */ private boolean changePointer = true; - /** */ + + /** Default Chart Listeners for hovering behaviours */ private final SpiderChartAdapter chartAdapter = new SpiderChartAdapter() { /** {@inheritDoc} */ @Override public void onChartEvent(final SpiderChart c, final int type) { if (type == 2) { SpiderChartViewer.this.canvas - .setCursor(SpiderChartViewer.this.pointCursor); + .setCursor(SpiderChartViewer.this.pointCursor); } if (type == 3) { SpiderChartViewer.this.canvas - .setCursor(SpiderChartViewer.this.defaultCursor); + .setCursor(SpiderChartViewer.this.defaultCursor); } } }; - /** */ + + /** Active Zoom Percentage */ private int currentZoom = 100; - /** */ + + /** Default cursor object */ private Cursor defaultCursor = null; - /** */ + + /** horizontal slider */ private Slider hSlider = null; - /** */ + + /** height of the canvas (used to restore from zoom) */ private int lastHeight = 0; - /** */ + + /** width of the canvas (used to restore from zoom) */ private int lastWidth = 0; - /** */ + + /** tracks last zoom percentage */ private int lastZoom = 0; + /** Maximum Zoom for Spider Chart */ private int maxZoom = 200; + /** Minimum Zoom for Spider Chart */ private int minZoom = 50; - /** */ + + /** Actual height of the canvas */ private int originalHeight = -1; - /** */ + + /** Actual width of the canvas */ private int originalWidth = -1; - /** */ + + /** Cursor object in use */ private Cursor pointCursor = null; - /** */ + + /** scrollbar width */ private final int scrollBarWidth = 18; - /** */ + + /** vertical slider */ private Slider vSlider = null; - /** */ + + /** zoom label */ private Label zoom; - /** */ + + /** zoom in button */ private Button zoomInButton; - /** */ + + /** zoom increment value */ private int zoomIncrement = 25; - /** */ + /** zoom out button */ private Button zoomOutButton; - /** */ + /** zoom panel composite */ private Composite zoomPanel; /** Constructor */ @@ -209,92 +228,112 @@ public final class SpiderChartViewer extends Composite { } } + /** getter for the canvas in use */ public SpiderChartCanvas getCanvas() { return this.canvas; } - /** */ + /** getter for the chart in use */ public SpiderChart getChart() { return this.canvas.getChart(); } + /** getter for the chart listener in use */ public SpiderChartAdapter getChartAdapter() { return this.chartAdapter; } + /** getter for the current zoom percentage */ public int getCurrentZoom() { return this.currentZoom; } + /** getter for the default cursor */ public Cursor getDefaultCursor() { return this.defaultCursor; } + /** getter for horizontal slider */ public Slider gethSlider() { return this.hSlider; } + /** getter for height after zoom */ public int getLastHeight() { return this.lastHeight; } + /** getter for width after zoom */ public int getLastWidth() { return this.lastWidth; } + /** getter for last zoom percentage */ public int getLastZoom() { return this.lastZoom; } + /** getter for max zoom percentage */ public int getMaxZoom() { return this.maxZoom; } + /** getter for min zoom percentage */ public int getMinZoom() { return this.minZoom; } + /** getter for original canvas height */ public int getOriginalHeight() { return this.originalHeight; } + /** getter for original canvas width */ public int getOriginalWidth() { return this.originalWidth; } + /** getter for cursor in use */ public Cursor getPointCursor() { return this.pointCursor; } + /** getter for scrollbar width */ public int getScrollBarWidth() { return this.scrollBarWidth; } + /** getter for vertical slider */ public Slider getvSlider() { return this.vSlider; } + /** getter for zoom label */ public Label getZoom() { return this.zoom; } + /** getter for zoom in button */ public Button getZoomInButton() { return this.zoomInButton; } + /** getter for zoom increment value */ public int getZoomIncrement() { return this.zoomIncrement; } + /** getter for zoom out button */ public Button getZoomOutButton() { return this.zoomOutButton; } + /** getter for zoom panel composite */ public Composite getZoomPanel() { return this.zoomPanel; } - /** */ + /** horizontal scrolling functionality */ private void hSliderScroll() { // TODO Need to refactor horizontal scrolling int newBase = 0; @@ -313,15 +352,19 @@ public final class SpiderChartViewer extends Composite { this.canvas.redraw(); } + /** getter for configuration of allowing zoom */ public boolean isAllowZoom() { return this.allowZoom; } + /** + * getter for configuration of changing pointer on data point mouse hover + */ public boolean isChangePointer() { return this.changePointer; } - /** */ + /** Placing zoom controls on the canvas */ private void placeZoomControls() { // TODO Need to refactor for ZOOM Controls int hSliderHeight = 0; @@ -363,7 +406,7 @@ public final class SpiderChartViewer extends Composite { } if (this.canvas.getChart().getVirtualWidth() > 0) { this.vSlider - .setSize(vSliderWidth, this.getSize().y - hSliderHeight); + .setSize(vSliderWidth, this.getSize().y - hSliderHeight); this.vSlider.setLocation(this.canvas.getSize().x, 0); this.vSlider.setVisible(true); this.canvas.getChart().setWithScroll(true); @@ -372,31 +415,34 @@ public final class SpiderChartViewer extends Composite { } } - /** */ + /** Redraws the chart */ public void redrawChart() { this.canvas.redraw(); } - /** */ + /** Resets the chart */ private void resetChart() { this.lastWidth = 0; this.lastHeight = 0; this.lastZoom = 0; } + /** setter for allowing zoom */ public void setAllowZoom(final boolean allowZoom) { this.allowZoom = allowZoom; } + /** setter for chart canvas */ public void setCanvas(final SpiderChartCanvas canvas) { this.canvas = canvas; } + /** setter for changing pointer */ public void setChangePointer(final boolean changePointer) { this.changePointer = changePointer; } - /** */ + /** setter for chart instance */ public void setChart(final SpiderChart c) { if (this.canvas.getChart() != null) { this.canvas.getChart().removeChartListener(this.chartAdapter); @@ -414,75 +460,92 @@ public final class SpiderChartViewer extends Composite { } } + /** setter for current zoom percentage */ public void setCurrentZoom(final int currentZoom) { this.currentZoom = currentZoom; } + /** setter for default cursor */ public void setDefaultCursor(final Cursor defaultCursor) { this.defaultCursor = defaultCursor; } + /** setter for horizontal slider */ public void sethSlider(final Slider hSlider) { this.hSlider = hSlider; } + /** setter for last height after zoom */ public void setLastHeight(final int lastHeight) { this.lastHeight = lastHeight; } + /** setter for last width after zoom */ public void setLastWidth(final int lastWidth) { this.lastWidth = lastWidth; } + /** setter for last zoom percentage */ public void setLastZoom(final int lastZoom) { this.lastZoom = lastZoom; } + /** setter for max zoom percentage */ public void setMaxZoom(final int maxZoom) { this.maxZoom = maxZoom; } + /** setter for min zoom percentage */ public void setMinZoom(final int minZoom) { this.minZoom = minZoom; } + /** setter for original height of the canvas */ public void setOriginalHeight(final int originalHeight) { this.originalHeight = originalHeight; } + /** setter for original width of the canvas */ public void setOriginalWidth(final int originalWidth) { this.originalWidth = originalWidth; } + /** setter for the cursor instance in use */ public void setPointCursor(final Cursor pointCursor) { this.pointCursor = pointCursor; } + /** setter for vertical slider */ public void setvSlider(final Slider vSlider) { this.vSlider = vSlider; } + /** setter for zoom label */ public void setZoom(final Label zoom) { this.zoom = zoom; } + /** setter for zoom in button */ public void setZoomInButton(final Button zoomInButton) { this.zoomInButton = zoomInButton; } + /** setter for zoom increment value */ public void setZoomIncrement(final int zoomIncrement) { this.zoomIncrement = zoomIncrement; } + /** setter for zoom out button */ public void setZoomOutButton(final Button zoomOutButton) { this.zoomOutButton = zoomOutButton; } + /** setter for zoom panel composite */ public void setZoomPanel(final Composite zoomPanel) { this.zoomPanel = zoomPanel; } - /** */ + /** updates the canvas size based on scrolling and zoom */ private void updateSize() { this.canvas.getChart().setRepaintAll(true); if (this.lastWidth != this.getSize().x @@ -522,7 +585,7 @@ public final class SpiderChartViewer extends Composite { } } - /** */ + /** vertical sliding functionality */ private void vSliderScroll() { // TODO Need to refactor vertical scrolling int newBase = 0; @@ -541,7 +604,7 @@ public final class SpiderChartViewer extends Composite { this.canvas.redraw(); } - /** */ + /** zooms in */ private void zoomIn() { if (this.currentZoom + this.zoomIncrement < this.maxZoom) { this.currentZoom += this.zoomIncrement; @@ -551,7 +614,7 @@ public final class SpiderChartViewer extends Composite { this.zoomUpdated(); } - /** */ + /** zooms out */ private void zoomOut() { if (this.currentZoom - this.zoomIncrement > this.minZoom) { this.currentZoom -= this.zoomIncrement; @@ -561,7 +624,7 @@ public final class SpiderChartViewer extends Composite { this.zoomUpdated(); } - /** */ + /** zoom updated */ private void zoomUpdated() { this.zoom.setText("" + this.currentZoom + " %"); this.updateSize(); diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/title/SpiderChartTitle.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/title/SpiderChartTitle.java index 274aa1acfc4b8ebf1ff43d34f21d5cbe2b98b275..d14005c4a32056b3b4e4aa805e0a1f6a0c4d1f78 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/title/SpiderChartTitle.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/title/SpiderChartTitle.java @@ -28,12 +28,20 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartColor; import org.fortiss.tooling.spiderchart.gc.AbstractChartFont; import org.fortiss.tooling.spiderchart.gc.AbstractChartGraphics; +/** + * Used to represent Spider Chart Title + * + * @author AMIT KUMAR MONDAL + * + */ public final class SpiderChartTitle extends SpiderChartComponent { /** Title Color */ private AbstractChartColor color = getColor(BLUE); + /** Title Font */ private AbstractChartFont font = getFont(VERDANA, PLAIN, 14); + /** Title Text */ private String text; @@ -41,7 +49,7 @@ public final class SpiderChartTitle extends SpiderChartComponent { public SpiderChartTitle() { } - /** */ + /** Used to draw the title */ public void draw(final AbstractChartGraphics g) { g.setColor(this.color); g.setFont(this.font); @@ -64,26 +72,32 @@ public final class SpiderChartTitle extends SpiderChartComponent { } } + /** Getter for color */ public AbstractChartColor getChartColor() { return this.color; } + /** Getter for chart font */ public AbstractChartFont getChartFont() { return this.font; } + /** Getter for chart text */ public String getText() { return this.text; } + /** Setter for color */ public void setColor(final AbstractChartColor color) { this.color = color; } + /** Setter for chart font */ public void setFont(final AbstractChartFont font) { this.font = font; } + /** Setter for chart text */ public void setText(final String text) { this.text = text; } diff --git a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/util/ChartUtil.java b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/util/ChartUtil.java index 11badea9d9ccab742a55c46836cbbed95dea940e..cc9b496efcc0111c34b1ad70a937ccab1d613625 100644 --- a/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/util/ChartUtil.java +++ b/org.fortiss.tooling.spiderchart.ui/trunk/src/org/fortiss/tooling/spiderchart/util/ChartUtil.java @@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.util; import java.util.Arrays; import java.util.List; +/** + * Utility methods for Spider Charts + * + * @author AMIT KUMAR MONDAL + * + */ public final class ChartUtil { /** @@ -35,7 +41,7 @@ public final class ChartUtil { return Arrays.asList(constants); } - /** */ + /** Returns the primitive double array from wrapper double array */ public static double[] toDoublePrimitiveArray(final Double[] wrappedArray) { final double[] array = new double[wrappedArray.length]; for (int i = 0; i < wrappedArray.length; i++) { @@ -44,7 +50,9 @@ public final class ChartUtil { return array; } - /** */ + /** + * Wraps a list of values and converts it to its corresponding double values + */ public static double[] wrapValues(final Object[] values) { final double[] wrappedValues = new double[values.length];