|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGLCanvas
gui.Canvas
public class Canvas
A canvas is used to draw the objects in a map and handlers the translation between virtual and screen coordinates.
Nested Class Summary | |
---|---|
(package private) class |
Canvas.CallBack
Callback class for polygon tesselation. |
Field Summary | |
---|---|
private boolean |
distanceRelationsVisible
specifies if distance relations should be drawn |
(package private) GLU |
glu
|
(package private) GLUT |
glut
|
private Grid |
grid
the gird |
private InteractionHandler |
interactionHandler
the interaction handler |
private java.awt.geom.AffineTransform |
inverseTransform
the transform for screen to virtual coordinates |
private Map |
map
the map to display |
private MessageBar |
messageBar
the message bar |
private boolean |
orientationRelationsVisible
specifies if orientation relations should be drawn |
(package private) GLUquadric |
quadratic
|
private double |
rotation
the rotation of the map |
private double |
scale
the scale of the map |
private boolean |
showAbstractions
specifies if abstract objects should be displayed |
private boolean |
showObjects
specifies if constructed objects should be displayed |
private java.awt.Dimension |
size
the current size of the panel |
(package private) Canvas.CallBack |
tessCallback
|
(package private) GLUtessellator |
tobj
|
private boolean |
topologyRelationsVisible
specifies if topology relations should be drawn |
private java.awt.geom.AffineTransform |
transform
the transform for virtual to screen coordinates |
private double |
translationX
the x translation of the map |
private double |
translationY
the y translation of the map |
Constructor Summary | |
---|---|
Canvas(int width,
int height)
Constructs a canvas object. |
Method Summary | |
---|---|
private void |
buildTransforms()
Rebuilds the view transform and the inverse view transforms. |
void |
display(GLAutoDrawable drawable)
Displays the map. |
void |
displayChanged(GLAutoDrawable arg0,
boolean arg1,
boolean arg2)
Not implemented. |
void |
drawObject(GL gl,
OntologyObject object)
Draws an ontology object. |
void |
drawText(GL gl,
java.lang.String text,
double x,
double y,
float size,
float width)
Utility function for drawing text |
boolean |
getAbstractionsVisible()
Gets if abstract objects are visible. |
boolean |
getDistanceRelationsVisible()
Sets if distance relations are visible. |
Grid |
getGrid()
Gets the grid. |
Map |
getMap()
Gets the map. |
MessageBar |
getMessageBar()
Gets the message bar. |
boolean |
getObjectsVisible()
Gets if constructed objects are visible. |
boolean |
getOrientationRelationsVisible()
Sets if orientation relations are visible. |
OntologyObject |
getPickedObject(double x,
double y,
boolean toggleSelected)
Returns the object at the specified virtual coordiantes or null if no object is located at the specified coordinates. |
GLUquadric |
getQuadratic()
Gets the quadratic object used for drawing circles. |
double |
getRotation()
Gets the rotation. |
double |
getScale()
Gets the scale scale. |
java.awt.geom.Point2D |
getScreenCoordinates(double x,
double y)
Converts virtual coordinates to screen coordinates. |
boolean |
getTopologyRelationsVisible()
Sets if topology relations are visible. |
java.awt.geom.AffineTransform |
getTransform()
Gets the view transform. |
double |
getTranslationX()
Gets the tranlation in the x direction. |
double |
getTranslationY()
Gets the tranlation in the y direction. |
java.awt.geom.Point2D |
getVirtualCoordinates(double x,
double y)
Converts screen coordinates to virtual coordinates. |
void |
init(GLAutoDrawable drawable)
Initializes JOGL parameters. |
void |
reshape(GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
Updates the viewport when the window is resized. |
void |
setAbstractionsVisible(boolean visible)
Sets if abstract objects are visible. |
void |
setDistanceRelationsVisible(boolean visible)
Sets if distance relations are visible. |
void |
setInteractionHandler(InteractionHandler handler)
Sets the interaction handler. |
void |
setMap(Map map)
Sets the map to display and resets the view transform. |
void |
setObjectsVisible(boolean visible)
Sets if constructed objects are visible. |
void |
setOrientationRelationsVisible(boolean visible)
Sets if orientation relations are visible. |
void |
setRotation(double rotation)
Sets the rotation and rebuilds the affine transforms. |
void |
setScale(double scale)
Sets the scale and rebuilds the affine transforms. |
void |
setTopologyRelationsVisible(boolean visible)
Sets if topology relations are visible. |
void |
setTranslationX(double translationX)
Sets the translation in the x direction and rebuilds the transforms. |
void |
setTranslationY(double translationY)
Sets the translation in the y direction and rebuilds the transforms. |
void |
zoomAll()
Zooms to the boundries of the current map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean distanceRelationsVisible
private boolean orientationRelationsVisible
private boolean topologyRelationsVisible
private boolean showObjects
private boolean showAbstractions
private Map map
private double translationX
private double translationY
private double scale
private double rotation
private InteractionHandler interactionHandler
private java.awt.geom.AffineTransform transform
private java.awt.geom.AffineTransform inverseTransform
private java.awt.Dimension size
private Grid grid
private MessageBar messageBar
GLU glu
GLUT glut
Canvas.CallBack tessCallback
GLUtessellator tobj
GLUquadric quadratic
Constructor Detail |
---|
public Canvas(int width, int height)
width
- - the prefered canvas widthheight
- - the prefered canvas heightMethod Detail |
---|
public MessageBar getMessageBar()
private void buildTransforms()
public OntologyObject getPickedObject(double x, double y, boolean toggleSelected)
x
- - the x value in virutal coordinatesy
- - the y value in virtual coordinates
public void setMap(Map map)
map
- - the new mappublic void zoomAll()
public java.awt.geom.Point2D getVirtualCoordinates(double x, double y)
x
- - the x component of the screen coordinatey
- - the y component of the screen coordinate
public java.awt.geom.Point2D getScreenCoordinates(double x, double y)
x
- - the x component of the virtual coordinatey
- - the y component of the virtual coordinate
public Grid getGrid()
public void setObjectsVisible(boolean visible)
public boolean getObjectsVisible()
public void setAbstractionsVisible(boolean visible)
public boolean getAbstractionsVisible()
public void setDistanceRelationsVisible(boolean visible)
public boolean getDistanceRelationsVisible()
public void setOrientationRelationsVisible(boolean visible)
public boolean getOrientationRelationsVisible()
public void setTopologyRelationsVisible(boolean visible)
public boolean getTopologyRelationsVisible()
public void setInteractionHandler(InteractionHandler handler)
public double getTranslationX()
public void setTranslationX(double translationX)
public double getTranslationY()
public void setTranslationY(double translationY)
public double getRotation()
public void setRotation(double rotation)
public double getScale()
public void setScale(double scale)
public Map getMap()
public java.awt.geom.AffineTransform getTransform()
public void init(GLAutoDrawable drawable)
public void display(GLAutoDrawable drawable)
public GLUquadric getQuadratic()
public void drawText(GL gl, java.lang.String text, double x, double y, float size, float width)
gl
- - the JOGL contexttext
- 0 the text to drawx
- - the x positiony
- - the y positionsize
- - the size of the textwidth
- - the width of the letterspublic void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2)
public void drawObject(GL gl, OntologyObject object)
gl
- - the JOGL contextobject
- - the object to draw
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |