Style Intelligence v12.0

inetsoft.graph.aesthetic
Class GShape

java.lang.Object
  extended by inetsoft.graph.aesthetic.GShape
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
GShape.ImageShape, SVGShape

public abstract class GShape
extends Object
implements Cloneable, Serializable

The GShape class is the base class for all shape aesthetics.

See Also:
Serialized Form

Nested Class Summary
static class GShape.ImageShape
          Image fill shape.
 
Field Summary
static GShape ARROW
          A left arrow shape.
static GShape ARROWBAR
          A bar with an upward arrow.
static GShape CIRCLE
          A circle shape.
static GShape CROSS
          A cross shape.
static GShape DIAMOND
          A diamond shape.
static GShape FILLED_ARROW
          A filled left arrow shape.
static GShape FILLED_ARROWBAR
          A filled bar with an upward arrow.
static GShape FILLED_CIRCLE
          A filled circle shape.
static GShape FILLED_DIAMOND
          A filled diamond shape.
static GShape FILLED_SQUARE
          A filled square shape.
static GShape FILLED_TRIANGLE
          A filled triangle shape.
static GShape HYPHEN
          A horizontal line.
static GShape LINE
          A vertical line.
static GShape LSHAPE
          A half moon shape.
static GShape NIL
          An empty shape.
static GShape SQUARE
          A square shape.
static GShape STAR
          A star shape.
static GShape STICK
          A vertical stick with two ends.
static GShape TRIANGLE
          A triangle shape.
static GShape VSHAPE
          A V shape.
static GShape XSHAPE
          An x shape.
 
Constructor Summary
protected GShape()
          Constructor.
 
Method Summary
 Object clone()
          Clone this shape object.
 GShape create(boolean outline, boolean fill)
          Create a variation of the shape.
 boolean equals(Object obj)
          Check if equals another objects.
 Point2D getCenter(Shape shape)
          Get the center point of the shape.
 Color getLineColor()
          Get the outline color.
 double getMinSize()
          Get the minimum size (width and height) this shape needs.
abstract  Shape getShape(double x, double y, double w, double h)
           
protected  boolean isAntiAlias()
          Check if the shape should be painted with anti-aliasing on.
 boolean isFill()
          Check if the shape should be filled.
 boolean isOutline()
          Check if the outer border is drawn.
 void paint(Graphics2D g, double x, double y, double size)
           
 void paint(Graphics2D g, double x, double y, double w, double h)
           
 void paint(Graphics2D g, Shape shape)
          Paint a shape.
protected  void setFill(boolean fill)
          Set whether this shape should be filled.
 void setLineColor(Color color)
          Set the outline color.
protected  void setOutline(boolean outline)
          Set if the outer border is drawn.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CIRCLE

public static final GShape CIRCLE
A circle shape.


TRIANGLE

public static final GShape TRIANGLE
A triangle shape.


SQUARE

public static final GShape SQUARE
A square shape.


CROSS

public static final GShape CROSS
A cross shape.


STAR

public static final GShape STAR
A star shape.


DIAMOND

public static final GShape DIAMOND
A diamond shape.


XSHAPE

public static final GShape XSHAPE
An x shape.


FILLED_CIRCLE

public static final GShape FILLED_CIRCLE
A filled circle shape.


FILLED_TRIANGLE

public static final GShape FILLED_TRIANGLE
A filled triangle shape.


FILLED_SQUARE

public static final GShape FILLED_SQUARE
A filled square shape.


FILLED_DIAMOND

public static final GShape FILLED_DIAMOND
A filled diamond shape.


VSHAPE

public static final GShape VSHAPE
A V shape.


LSHAPE

public static final GShape LSHAPE
A half moon shape.


ARROW

public static final GShape ARROW
A left arrow shape.


FILLED_ARROW

public static final GShape FILLED_ARROW
A filled left arrow shape.


STICK

public static final GShape STICK
A vertical stick with two ends. Useful as interval shape.


ARROWBAR

public static final GShape ARROWBAR
A bar with an upward arrow. useful as interval shape.


FILLED_ARROWBAR

public static final GShape FILLED_ARROWBAR
A filled bar with an upward arrow. useful as interval shape.


LINE

public static final GShape LINE
A vertical line.


HYPHEN

public static final GShape HYPHEN
A horizontal line.


NIL

public static final GShape NIL
An empty shape. This shape has not visual drawing and takes up no space. It can be used to plot text as point.

Constructor Detail

GShape

protected GShape()
Constructor.

Method Detail

getCenter

public Point2D getCenter(Shape shape)
Get the center point of the shape. A shape may define a center point that is different from the center of the bounding box.


isOutline

public boolean isOutline()
Check if the outer border is drawn.


setOutline

protected void setOutline(boolean outline)
Set if the outer border is drawn. If fill is set to false, the outline is always drawn regardless of this setting.


isFill

public boolean isFill()
Check if the shape should be filled.


setFill

protected void setFill(boolean fill)
Set whether this shape should be filled.


create

public GShape create(boolean outline,
                     boolean fill)
Create a variation of the shape.

Parameters:
outline - true to force an outline even if filled.
fill - fill the shape instead of drawing the outline.

setLineColor

public void setLineColor(Color color)
Set the outline color. This color is used for the outline if both fill and outline are drawn. The fill uses the default (graphics) color, and the outline use the outline color, or a darker color of the fill color.


getLineColor

public Color getLineColor()
Get the outline color.


isAntiAlias

protected boolean isAntiAlias()
Check if the shape should be painted with anti-aliasing on.


paint

public void paint(Graphics2D g,
                  double x,
                  double y,
                  double size)

paint

public void paint(Graphics2D g,
                  double x,
                  double y,
                  double w,
                  double h)

paint

public void paint(Graphics2D g,
                  Shape shape)
Paint a shape. The shape could be from GShape.getShape() and possibly transformed.


getMinSize

public double getMinSize()
Get the minimum size (width and height) this shape needs.


clone

public Object clone()
Clone this shape object.

Overrides:
clone in class Object

getShape

public abstract Shape getShape(double x,
                               double y,
                               double w,
                               double h)

equals

public boolean equals(Object obj)
Check if equals another objects.

Overrides:
equals in class Object

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.