Skip to content
Snippets Groups Projects
Commit 8a6adedd authored by Amit Kumar Mondal's avatar Amit Kumar Mondal
Browse files

Added class level comments

parent b733a9d9
No related branches found
No related tags found
No related merge requests found
Showing
with 113 additions and 23 deletions
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Represents an abstract color
*
* @author AMIT KUMAR MONDAL
*
*/
public abstract class AbstractChartColor {
public static final String ALICEBLUE = "ALICEBLUE";
......
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Represents an abstract font
*
* @author AMIT KUMAR MONDAL
*
*/
public abstract class AbstractChartFont {
public static int BOLD = 1;
......
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Represents an abstract graphics to be used in the chart
*
* @author AMIT KUMAR MONDAL
*
*/
public abstract class AbstractChartGraphics {
/** */
......
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Represents an abstract image to be used in the chart
*
* @author AMIT KUMAR MONDAL
*
*/
public abstract class AbstractChartImage {
/** disposes the image */
......
......@@ -24,6 +24,12 @@ import org.fortiss.tooling.spiderchart.gc.swt.SpiderChartSwtFont;
import org.fortiss.tooling.spiderchart.gc.swt.SpiderChartSwtGraphics;
import org.fortiss.tooling.spiderchart.gc.swt.SpiderChartSwtImage;
/**
* Represents an abstract factory for graphics to be used in the chart
*
* @author AMIT KUMAR MONDAL
*
*/
public final class AbstractGraphicsSupplier {
/** Creates an image */
......
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Enumeration of the fonts to be used in the chart
*
* @author AMIT KUMAR MONDAL
*
*/
public enum Fonts {
ARIAL("Arial"), SERIF("Serif"), VERDANA("Verdana");
......
......@@ -17,6 +17,12 @@ $Id: CLASS.java 11213 2016-03-04 16:27:08Z MONDAL $
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.spiderchart.gc;
/**
* Represents a point with the given x and y-coordinate values
*
* @author AMIT KUMAR MONDAL
*
*/
public final class Point {
/** X coordinate */
......
......@@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.gc;
import java.util.ArrayList;
import java.util.List;
/**
* Represents a polygon with the given list of points
*
* @author AMIT KUMAR MONDAL
*
*/
public final class Polygon {
/** list of points to draw the polygon */
......@@ -50,7 +56,7 @@ public final class Polygon {
|| this.getY(j) <= y
&& y < this.getY(i)
&& x < (this.getX(j) - this.getX(i)) * (y - this.getY(i))
/ (this.getY(j) - this.getY(i)) + this.getX(i)) {
/ (this.getY(j) - this.getY(i)) + this.getX(i)) {
c = !c;
}
}
......
......@@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.gc.swt;
import org.eclipse.swt.graphics.Color;
import org.fortiss.tooling.spiderchart.gc.AbstractChartColor;
/**
* Represents a color to be used in SWT
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartSwtColor extends AbstractChartColor {
/** */
......
......@@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.gc.swt;
import org.eclipse.swt.graphics.Font;
import org.fortiss.tooling.spiderchart.gc.AbstractChartFont;
/**
* Represents a font to be used in SWT
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartSwtFont extends AbstractChartFont {
/** name of the font */
......
......@@ -31,6 +31,12 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartFont;
import org.fortiss.tooling.spiderchart.gc.AbstractChartGraphics;
import org.fortiss.tooling.spiderchart.gc.AbstractChartImage;
/**
* Represents a chart graphics to be used in SWT
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartSwtGraphics extends AbstractChartGraphics {
/** */
private float alphaValue = 1.0F;
......
......@@ -29,6 +29,12 @@ import org.fortiss.tooling.spiderchart.gc.AbstractChartColor;
import org.fortiss.tooling.spiderchart.gc.AbstractChartGraphics;
import org.fortiss.tooling.spiderchart.gc.AbstractChartImage;
/**
* Represents a chart image to be used in SWT
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartSwtImage extends AbstractChartImage {
/** */
......
......@@ -20,6 +20,12 @@ package org.fortiss.tooling.spiderchart.gc.swt;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.widgets.Display;
/**
* Represents a factory for useful SWT operations
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SwtGraphicsProvider {
/** SWT Device object */
......
......@@ -25,6 +25,12 @@ import org.fortiss.tooling.spiderchart.label.api.IFloatingObject;
import org.fortiss.tooling.spiderchart.style.FillStyle;
import org.fortiss.tooling.spiderchart.style.LineStyle;
/**
* Represents a label to be used on the spider chart
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartLabel implements IFloatingObject {
/** */
......@@ -254,7 +260,7 @@ public final class SpiderChartLabel implements IFloatingObject {
if (this.anchorX <= this.positionX) {
this.lineToAnchor.draw(graphics, this.anchorX,
this.anchorY, this.positionX, this.positionY
+ this.requiredHeight - 1);
+ this.requiredHeight - 1);
} else {
this.lineToAnchor.draw(graphics, this.anchorX,
this.anchorY, this.positionX + this.requiredWidth,
......@@ -275,25 +281,25 @@ public final class SpiderChartLabel implements IFloatingObject {
if (this.borderShape == BORDER_RECT) {
this.background.draw(g, this.positionX, this.positionY,
this.positionX + this.requiredWidth - 1, this.positionY
+ this.requiredHeight - 1);
+ this.requiredHeight - 1);
}
if (this.borderShape == BORDER_ROUNDRECT) {
this.background.drawRoundRect(g, this.positionX,
this.positionY,
this.positionX + this.requiredWidth - 1, this.positionY
+ this.requiredHeight - 1);
+ this.requiredHeight - 1);
}
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
* 0.2D - 1.0D),
.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
+ this.requiredHeight * 0.3D - 1.0D),
0, 360);
0, 360);
}
g.setColor(c);
}
......@@ -311,24 +317,24 @@ public final class SpiderChartLabel implements IFloatingObject {
if (this.borderShape == BORDER_RECT) {
this.border.drawRect(g, this.positionX, this.positionY,
this.positionX + this.requiredWidth - 1, this.positionY
+ this.requiredHeight - 1);
+ this.requiredHeight - 1);
}
if (this.borderShape == BORDER_ROUNDRECT) {
this.border.drawRoundRect(g, this.positionX, this.positionY,
this.positionX + this.requiredWidth - 1, this.positionY
+ this.requiredHeight - 1);
+ this.requiredHeight - 1);
}
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
* 0.2D - 1.0D),
.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
+ this.requiredHeight * 0.3D - 1.0D),
0, 360);
0, 360);
}
}
this.clickableArea = new Polygon();
......
......@@ -39,6 +39,12 @@ import org.fortiss.tooling.spiderchart.label.SpiderChartLabel;
import org.fortiss.tooling.spiderchart.style.FillStyle;
import org.fortiss.tooling.spiderchart.style.LineStyle;
/**
* Represents legend to be used on the spider chart
*
* @author AMIT KUMAR MONDAL
*
*/
public final class SpiderChartLegend extends SpiderChartComponent {
/** Legend Background Style */
......@@ -209,7 +215,7 @@ 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;
......@@ -290,8 +296,8 @@ public final class SpiderChartLegend extends SpiderChartComponent {
l.draw(g, toCenterX + this.x, toCenterY + this.y + iconHeight
/ 2 + (i - 1) * itemHeight + this.legendOffset,
toCenterX + this.x + iconWidth - 2, toCenterY + this.y
+ iconHeight / 2 + (i - 1) * itemHeight
+ this.legendOffset);
+ iconHeight / 2 + (i - 1) * itemHeight
+ this.legendOffset);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment