jadex.application.space.envsupport.observer.perspective
Class Perspective2D

java.lang.Object
  extended by jadex.commons.SimplePropertyObject
      extended by jadex.commons.meta.TypedPropertyObject
          extended by jadex.application.space.envsupport.observer.perspective.Perspective2D
All Implemented Interfaces:
IPerspective, IPropertyObject, ITypedPropertyObject

public class Perspective2D
extends TypedPropertyObject
implements IPerspective

Perspective for viewing in 2D.


Field Summary
protected  Color bgColor
          The background color.
protected  Comparator displayorder
          Order in which objects are displayed
protected  SimpleValueFetcher fetcher
          The fetcher.
protected  boolean invertxaxis
          Flag if the x-axis should be inverted
protected  boolean invertyaxis
          Flag if the y-axis should be inverted
protected  DrawableCombiner marker
          The marker drawable combiner
protected  String name
          Name of the presentation
protected  IVector2 objectShift
          The object shift
protected  ObserverCenter obscenter
          The ObserverCenter
protected  Layer[] postlayers
          The postlayers
protected  Layer[] prelayers
          The prelayers
protected  int selectCycle
          Selection cycle for stacked objects
protected  Object selectedobject
          The selected object
protected  jadex.application.space.envsupport.observer.perspective.Perspective2D.SelectionController selectioncontroller
          Selection controller.
protected  IVector1 selectorDistance
          Maximum selection distance
protected  boolean tryopengl
          Try OpenGL if true
protected  IViewport viewport
          The viewport
protected  Map visuals
          The visuals (DrawableCombiners)
protected  double zoomlimit
          The maximum zoom
 
Fields inherited from class jadex.commons.SimplePropertyObject
pcs, properties
 
Constructor Summary
Perspective2D()
          Creates a 2D-Perspective.
 
Method Summary
 void addVisual(Object id, Object visual)
          Adds a new visual object.
 void flushRenderInfo()
          Flushes the render information.
 Comparator getDisplayOrder()
          Gets the display order.
 SimpleValueFetcher getFetcher()
          Get the value fetcher.
 boolean getInvertXAxis()
          Gets x-axis inversion.
 boolean getInvertYAxis()
          Gets y-axis inversion.
 DrawableCombiner getMarkerDrawCombiner()
          Gets the drawable combiner object for the object marker
 String getName()
          Returns the name of the perspective
 IVector2 getObjectShift()
          Gets the object shift.
 ObserverCenter getObserverCenter()
          Get the ObserverCenter.
 boolean getOpenGl()
          Gets whether to try to use OpenGL.
 Layer[] getPostlayers()
          Returns the Postlayers.
 Layer[] getPrelayers()
          Returns the prelayers.
 Object getProperty(String name)
          Returns a property.
 Object getSelectedObject()
          Returns the currently selected object.
 IVector1 getSelectorDistance()
          Gets the maximum distance for selecting objects.
 Component getView()
          Gets the view of the perspective.
 IViewport getViewport()
          Gets the viewport
 double getZoom()
          Returns the zoom factor
 double getZoomLimit()
          Gets the maximum zoom.
 double getZoomStepping()
          Returns the current zoom stepping
 void refresh()
          Refreshes the perspective.
 void removeVisual(Object id)
          Removes a new visual object.
 void reset()
          Resets position and flushes render info
 void resetZoomAndPosition()
          Resets the zoom and position.
 void setBackground(Color bgColor)
          Sets the background color.
 void setDisplayOrder(Comparator order)
          Sets the display order.
 void setInvertXAxis(boolean invert)
          Sets x-axis inversion.
 void setInvertYAxis(boolean invert)
          Sets y-axis inversion.
 void setMarkerDrawCombiner(DrawableCombiner marker)
          Sets the drawable combiner object for the object marker
 void setName(String name)
          Sets the name of the perspective
 void setObjectShift(IVector2 shift)
          Sets the object shift.
 void setObserverCenter(ObserverCenter obscenter)
          Sets the ObserverCenter.
 boolean setOpenGl(boolean opengl)
          Sets whether to try to use OpenGL.
 void setPostlayers(Layer[] postlayers)
          Sets the Postlayers.
 void setPrelayers(Layer[] prelayers)
          Sets the prelayers.
 void setSelectedObject(Object obj)
          Sets the selected object.
 void setSelectorDistance(IVector1 maxDist)
          Sets the maximum distance for selecting objects.
 void setZoom(double zoom)
          Sets a new zoom factor
 void setZoomLimit(double zoomlimit)
          Sets the maximum zoom.
 void shiftPosition(IVector2 shift)
          Shifts the viewport position.
 
Methods inherited from class jadex.commons.meta.TypedPropertyObject
getMetaData, getMetaDatas
 
Methods inherited from class jadex.commons.SimplePropertyObject
addPropertyChangeListener, getProperties, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jadex.commons.meta.ITypedPropertyObject
getMetaData, getMetaDatas
 
Methods inherited from interface jadex.commons.IPropertyObject
getPropertyNames, hasProperty, setProperty
 

Field Detail

name

protected String name
Name of the presentation


obscenter

protected ObserverCenter obscenter
The ObserverCenter


viewport

protected IViewport viewport
The viewport


selectioncontroller

protected jadex.application.space.envsupport.observer.perspective.Perspective2D.SelectionController selectioncontroller
Selection controller.


selectedobject

protected Object selectedobject
The selected object


selectCycle

protected int selectCycle
Selection cycle for stacked objects


displayorder

protected Comparator displayorder
Order in which objects are displayed


objectShift

protected IVector2 objectShift
The object shift


selectorDistance

protected IVector1 selectorDistance
Maximum selection distance


invertxaxis

protected boolean invertxaxis
Flag if the x-axis should be inverted


invertyaxis

protected boolean invertyaxis
Flag if the y-axis should be inverted


tryopengl

protected boolean tryopengl
Try OpenGL if true


bgColor

protected Color bgColor
The background color.


visuals

protected Map visuals
The visuals (DrawableCombiners)


prelayers

protected Layer[] prelayers
The prelayers


postlayers

protected Layer[] postlayers
The postlayers


marker

protected DrawableCombiner marker
The marker drawable combiner


zoomlimit

protected double zoomlimit
The maximum zoom


fetcher

protected SimpleValueFetcher fetcher
The fetcher.

Constructor Detail

Perspective2D

public Perspective2D()
Creates a 2D-Perspective.

Method Detail

getProperty

public Object getProperty(String name)
Returns a property.

Specified by:
getProperty in interface IPropertyObject
Overrides:
getProperty in class SimplePropertyObject
Parameters:
name - name of the property
Returns:
the property

getFetcher

public SimpleValueFetcher getFetcher()
Get the value fetcher.

Returns:
The fetcher.

getName

public String getName()
Returns the name of the perspective

Specified by:
getName in interface IPerspective
Returns:
name of the perspective

setName

public void setName(String name)
Sets the name of the perspective

Specified by:
setName in interface IPerspective
Parameters:
name - name of the perspective

getSelectedObject

public Object getSelectedObject()
Returns the currently selected object.

Specified by:
getSelectedObject in interface IPerspective
Returns:
currently selected object

setSelectedObject

public void setSelectedObject(Object obj)
Sets the selected object.

Specified by:
setSelectedObject in interface IPerspective
Parameters:
obj - selected object

setObserverCenter

public void setObserverCenter(ObserverCenter obscenter)
Sets the ObserverCenter.

Specified by:
setObserverCenter in interface IPerspective
Parameters:
obscenter - the ObserverCenter

getObserverCenter

public ObserverCenter getObserverCenter()
Get the ObserverCenter.

Specified by:
getObserverCenter in interface IPerspective
Returns:
The observer center.

addVisual

public void addVisual(Object id,
                      Object visual)
Adds a new visual object.

Specified by:
addVisual in interface IPerspective
Parameters:
id - identifier of the object
visual - the visual object

removeVisual

public void removeVisual(Object id)
Removes a new visual object.

Specified by:
removeVisual in interface IPerspective
Parameters:
id - identifier of the object

getPrelayers

public Layer[] getPrelayers()
Returns the prelayers.

Returns:
the prelayers

setPrelayers

public void setPrelayers(Layer[] prelayers)
Sets the prelayers.

Parameters:
prelayers - the prelayers

getPostlayers

public Layer[] getPostlayers()
Returns the Postlayers.

Returns:
the Postlayers

setPostlayers

public void setPostlayers(Layer[] postlayers)
Sets the Postlayers.

Parameters:
Postlayers - the Postlayers

getMarkerDrawCombiner

public DrawableCombiner getMarkerDrawCombiner()
Gets the drawable combiner object for the object marker

Returns:
the marker drawable

setMarkerDrawCombiner

public void setMarkerDrawCombiner(DrawableCombiner marker)
Sets the drawable combiner object for the object marker

Parameters:
marker - the marker drawable

getView

public Component getView()
Gets the view of the perspective.

Specified by:
getView in interface IPerspective
Returns:
the view

getViewport

public IViewport getViewport()
Gets the viewport

Returns:
the viewport

getOpenGl

public boolean getOpenGl()
Gets whether to try to use OpenGL.

Specified by:
getOpenGl in interface IPerspective
Returns:
true, if attempt should be made to use OpenGL

setOpenGl

public boolean setOpenGl(boolean opengl)
Sets whether to try to use OpenGL.

Specified by:
setOpenGl in interface IPerspective
Parameters:
opengl - true, if attempt should be made to use OpenGL

getInvertXAxis

public boolean getInvertXAxis()
Gets x-axis inversion.

Returns:
true, if the x-axis should be inverted.

setInvertXAxis

public void setInvertXAxis(boolean invert)
Sets x-axis inversion.

Parameters:
invert - true, if the x-axis should be inverted.

getInvertYAxis

public boolean getInvertYAxis()
Gets y-axis inversion.

Returns:
true, if the y-axis should be inverted.

setInvertYAxis

public void setInvertYAxis(boolean invert)
Sets y-axis inversion.

Parameters:
invert - true, if the y-axis should be inverted.

setBackground

public void setBackground(Color bgColor)
Sets the background color.

Parameters:
bgColor - the background color

setSelectorDistance

public void setSelectorDistance(IVector1 maxDist)
Sets the maximum distance for selecting objects.

Parameters:
maxDist - selections distance

getSelectorDistance

public IVector1 getSelectorDistance()
Gets the maximum distance for selecting objects.


getDisplayOrder

public Comparator getDisplayOrder()
Gets the display order.

Returns:
the display order

setDisplayOrder

public void setDisplayOrder(Comparator order)
Sets the display order.

Parameters:
order - the display order

getObjectShift

public IVector2 getObjectShift()
Gets the object shift.

Returns:
the object shift

setObjectShift

public void setObjectShift(IVector2 shift)
Sets the object shift.

Parameters:
shift - the object shift

getZoomLimit

public double getZoomLimit()
Gets the maximum zoom.

Returns:
the zoom limit

setZoomLimit

public void setZoomLimit(double zoomlimit)
Sets the maximum zoom.

Parameters:
zoomlimit - the zoom limit

getZoomStepping

public double getZoomStepping()
Returns the current zoom stepping

Returns:
the zoom stepping

getZoom

public double getZoom()
Returns the zoom factor

Returns:
the zoom factor

setZoom

public void setZoom(double zoom)
Sets a new zoom factor

Parameters:
zoom - new zoom factor

shiftPosition

public void shiftPosition(IVector2 shift)
Shifts the viewport position.

Parameters:
shift - relative (to current zoom/size) shift vector

reset

public void reset()
Resets position and flushes render info

Specified by:
reset in interface IPerspective

resetZoomAndPosition

public void resetZoomAndPosition()
Resets the zoom and position.

Specified by:
resetZoomAndPosition in interface IPerspective

flushRenderInfo

public void flushRenderInfo()
Flushes the render information.


refresh

public void refresh()
Refreshes the perspective.

Specified by:
refresh in interface IPerspective


Copyright © 2010. All Rights Reserved.