|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmodel.GraphicalObject
public class GraphicalObject
A graphical object is used for drawing and enabling the selection of ontology objects.
Nested Class Summary | |
---|---|
static class |
GraphicalObject.Type
possible graphics type |
Field Summary | |
---|---|
private float[] |
coordinates
The vertices of the object. |
private java.awt.Color |
fillColor
the fill color |
private java.awt.BasicStroke |
fillStroke
the fill stroke |
private java.awt.Color |
highlightColor
the hightlight color |
private java.awt.Color |
lineColor
the outline color |
private java.awt.BasicStroke |
lineStroke
the outline stroke |
private boolean |
selected
specifies if the object is selected |
private java.awt.Shape |
shape
the shape representation of the coordinates |
private double |
size
the radius of a point |
private java.lang.String |
style
the SVG style |
private GraphicalObject.Type |
type
the graphics type |
Constructor Summary | |
---|---|
GraphicalObject(GraphicalObject.Type type,
java.lang.String style,
java.lang.String points,
double size)
Constructs a new graphical object. |
Method Summary | |
---|---|
private void |
buildShape()
Builds the shape from the coordinates of the object. |
boolean |
contains(double x,
double y)
|
boolean |
contains(double arg0,
double arg1,
double arg2,
double arg3)
|
boolean |
contains(java.awt.geom.Point2D arg0)
|
boolean |
contains(java.awt.geom.Rectangle2D arg0)
|
static double |
getArea(GraphicalObject object)
Utility method for getting the area of a graphical object. |
java.awt.Rectangle |
getBounds()
|
java.awt.geom.Rectangle2D |
getBounds2D()
|
java.awt.geom.Point2D |
getCentroid()
Gets the centroid of this shape. |
float[] |
getCoordinates()
Gets the coordinates of the object. |
static float[] |
getCoords(java.lang.String points)
Utility method for converting a string of coordinates into an array of floating point values. |
java.awt.Color |
getFillColor()
Gets the fill color. |
java.awt.Stroke |
getFillStroke()
Gets the fill stroke. |
static GraphicalObject.Type |
getGraphicsType(java.lang.String type)
Utility method for getting the graphical Type of an object from a string. |
static double |
getLength(GraphicalObject object)
Utility method for getting the length of a graphical object. |
java.awt.Color |
getLineColor()
Gets the outline color. |
java.awt.BasicStroke |
getLineStroke()
Gets the outline stroke. |
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform arg0)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform arg0,
double arg1)
|
static java.lang.String |
getPoints(GraphicalObject object)
Utility method for converting an array of floats into a string representation. |
double |
getRadius()
Gets the radius of the object. |
java.awt.Color |
getSelectedColor()
Gets the objects highlight color. |
java.lang.String |
getStyle()
Gets the SVG style of the object. |
GraphicalObject.Type |
getType()
Gets the graphics type. |
boolean |
intersects(double arg0,
double arg1,
double arg2,
double arg3)
|
boolean |
intersects(java.awt.geom.Rectangle2D arg0)
|
boolean |
isSelected()
Gets if the object is currently selected. |
private void |
parseStyle()
Parses the style of the object to determine the outline and fill colors. |
void |
setCoordinates(float[] coords)
Sets the coordinates of the graphical object and rebuilds the shape representation of the object. |
void |
setFillColor(java.awt.Color fill)
Sets the fill color. |
void |
setLineColor(java.awt.Color line)
Sets the outline color. |
void |
setRadius(double size)
Sets the radius of the object and rebuilds the shape representation of the object. |
void |
setSelected(boolean selected)
Sets if the object is selected. |
private void |
updateStyle()
Modifies the style of the object to store modifications of the fill or line color of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private GraphicalObject.Type type
private java.lang.String style
private float[] coordinates
private java.awt.Shape shape
private double size
private boolean selected
private java.awt.Color fillColor
private java.awt.Color lineColor
private java.awt.Color highlightColor
private java.awt.BasicStroke fillStroke
private java.awt.BasicStroke lineStroke
Constructor Detail |
---|
public GraphicalObject(GraphicalObject.Type type, java.lang.String style, java.lang.String points, double size)
type
- - the graphics typestyle
- - the SVG stylepoints
- - a list of coordinatessize
- - the radius of the object (for points), otherwise 0Method Detail |
---|
private void parseStyle()
private void updateStyle()
private void buildShape()
public void setCoordinates(float[] coords)
public void setRadius(double size)
public java.lang.String getStyle()
public void setSelected(boolean selected)
public boolean isSelected()
public double getRadius()
public float[] getCoordinates()
public java.awt.BasicStroke getLineStroke()
public java.awt.Color getLineColor()
public void setLineColor(java.awt.Color line)
public java.awt.Stroke getFillStroke()
public void setFillColor(java.awt.Color fill)
fill
- public java.awt.Color getFillColor()
public java.awt.Color getSelectedColor()
public GraphicalObject.Type getType()
public boolean contains(double x, double y)
contains
in interface java.awt.Shape
public java.awt.Rectangle getBounds()
getBounds
in interface java.awt.Shape
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
public boolean contains(java.awt.geom.Point2D arg0)
contains
in interface java.awt.Shape
public boolean intersects(double arg0, double arg1, double arg2, double arg3)
intersects
in interface java.awt.Shape
public boolean intersects(java.awt.geom.Rectangle2D arg0)
intersects
in interface java.awt.Shape
public boolean contains(double arg0, double arg1, double arg2, double arg3)
contains
in interface java.awt.Shape
public boolean contains(java.awt.geom.Rectangle2D arg0)
contains
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0)
getPathIterator
in interface java.awt.Shape
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform arg0, double arg1)
getPathIterator
in interface java.awt.Shape
public static float[] getCoords(java.lang.String points)
points
- - a string of space or comma delimited coordinates
public static java.lang.String getPoints(GraphicalObject object)
public static GraphicalObject.Type getGraphicsType(java.lang.String type)
public java.awt.geom.Point2D getCentroid()
public static double getArea(GraphicalObject object)
public static double getLength(GraphicalObject object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |