Class Perspective2D
- java.lang.Object
- 
- jadex.commons.SimplePropertyObject
- 
- jadex.commons.meta.TypedPropertyObject
- 
- jadex.extension.envsupport.observer.perspective.Perspective2D
 
 
 
- 
- All Implemented Interfaces:
- IPropertyObject,- ITypedPropertyObject,- IPerspective
 
 public class Perspective2D extends TypedPropertyObject implements IPerspective Perspective for viewing in 2D.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.awt.ColorbgColorThe background color.protected java.util.ComparatordisplayorderOrder in which objects are displayedprotected SimpleValueFetcherfetcherThe fetcher.protected booleaninvertxaxisFlag if the x-axis should be invertedprotected booleaninvertyaxisFlag if the y-axis should be invertedprotected DrawableCombinermarkerThe marker drawable combinerprotected java.lang.StringnameName of the presentationprotected IVector2objectShiftThe object shiftprotected IObserverCenterobscenterThe ObserverCenterstatic booleanOPENGLGlobal flag for turning off OpenGL from starter.protected Layer[]postlayersThe postlayersprotected Layer[]prelayersThe prelayersprotected intselectCycleSelection cycle for stacked objectsprotected java.lang.ObjectselectedobjectThe selected objectprotected jadex.extension.envsupport.observer.perspective.Perspective2D.SelectionControllerselectioncontrollerSelection controller.protected IVector1selectorDistanceMaximum selection distanceprotected booleantryopenglTry OpenGL if trueprotected IViewportviewportThe viewportprotected java.util.MapvisualsThe visuals (DrawableCombiners)protected doublezoomlimitThe maximum zoom- 
Fields inherited from class jadex.commons.SimplePropertyObjectpcs, properties
 
- 
 - 
Constructor SummaryConstructors Constructor Description Perspective2D()Creates a 2D-Perspective.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVisual(java.lang.Object id, java.lang.Object visual)Adds a new visual object.voidflushRenderInfo()Flushes the render information.java.util.ComparatorgetDisplayOrder()Gets the display order.SimpleValueFetchergetFetcher()Get the value fetcher.booleangetInvertXAxis()Gets x-axis inversion.booleangetInvertYAxis()Gets y-axis inversion.DrawableCombinergetMarkerDrawCombiner()Gets the drawable combiner object for the object markerjava.lang.StringgetName()Returns the name of the perspectiveIVector2getObjectShift()Gets the object shift.IObserverCentergetObserverCenter()Get the ObserverCenter.booleangetOpenGl()Gets whether to try to use OpenGL.Layer[]getPostlayers()Returns the Postlayers.Layer[]getPrelayers()Returns the prelayers.java.lang.ObjectgetProperty(java.lang.String name)Returns a property.java.lang.ObjectgetSelectedObject()Returns the currently selected object.IVector1getSelectorDistance()Gets the maximum distance for selecting objects.java.awt.ComponentgetView()Gets the view of the perspective.IViewportgetViewport()Gets the viewportdoublegetZoom()Returns the zoom factordoublegetZoomLimit()Gets the maximum zoom.doublegetZoomStepping()Returns the current zoom steppingvoidrefresh()Refreshes the perspective.voidremoveVisual(java.lang.Object id)Removes a new visual object.voidreset()Resets position and flushes render infovoidresetZoomAndPosition()Resets the zoom and position.voidsetBackground(java.awt.Color bgColor)Sets the background color.voidsetDisplayOrder(java.util.Comparator order)Sets the display order.voidsetInvertXAxis(boolean invert)Sets x-axis inversion.voidsetInvertYAxis(boolean invert)Sets y-axis inversion.voidsetMarkerDrawCombiner(DrawableCombiner marker)Sets the drawable combiner object for the object markervoidsetName(java.lang.String name)Sets the name of the perspectivevoidsetObjectShift(IVector2 shift)Sets the object shift.voidsetObserverCenter(IObserverCenter obscenter)Sets the ObserverCenter.booleansetOpenGl(boolean opengl)Sets whether to try to use OpenGL.voidsetPostlayers(Layer[] postlayers)Sets the Postlayers.voidsetPrelayers(Layer[] prelayers)Sets the prelayers.voidsetSelectedObject(java.lang.Object obj)Sets the selected object.voidsetSelectorDistance(IVector1 maxDist)Sets the maximum distance for selecting objects.voidsetZoom(double zoom)Sets a new zoom factorvoidsetZoomLimit(double zoomlimit)Sets the maximum zoom.voidshiftPosition(IVector2 shift)Shifts the viewport position.- 
Methods inherited from class jadex.commons.meta.TypedPropertyObjectgetMetaData, getMetaDatas
 - 
Methods inherited from class jadex.commons.SimplePropertyObjectaddPropertyChangeListener, getProperties, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty, toString
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jadex.commons.IPropertyObjectgetPropertyNames, hasProperty, setProperty
 - 
Methods inherited from interface jadex.commons.meta.ITypedPropertyObjectgetMetaData, getMetaDatas
 
- 
 
- 
- 
- 
Field Detail- 
OPENGLpublic static boolean OPENGL Global flag for turning off OpenGL from starter.
 - 
nameprotected java.lang.String name Name of the presentation
 - 
obscenterprotected IObserverCenter obscenter The ObserverCenter
 - 
viewportprotected IViewport viewport The viewport
 - 
selectioncontrollerprotected jadex.extension.envsupport.observer.perspective.Perspective2D.SelectionController selectioncontroller Selection controller.
 - 
selectedobjectprotected java.lang.Object selectedobject The selected object
 - 
selectCycleprotected int selectCycle Selection cycle for stacked objects
 - 
displayorderprotected java.util.Comparator displayorder Order in which objects are displayed
 - 
objectShiftprotected IVector2 objectShift The object shift
 - 
selectorDistanceprotected IVector1 selectorDistance Maximum selection distance
 - 
invertxaxisprotected boolean invertxaxis Flag if the x-axis should be inverted
 - 
invertyaxisprotected boolean invertyaxis Flag if the y-axis should be inverted
 - 
tryopenglprotected boolean tryopengl Try OpenGL if true
 - 
bgColorprotected java.awt.Color bgColor The background color.
 - 
visualsprotected java.util.Map visuals The visuals (DrawableCombiners)
 - 
prelayersprotected Layer[] prelayers The prelayers
 - 
postlayersprotected Layer[] postlayers The postlayers
 - 
markerprotected DrawableCombiner marker The marker drawable combiner
 - 
zoomlimitprotected double zoomlimit The maximum zoom
 - 
fetcherprotected SimpleValueFetcher fetcher The fetcher.
 
- 
 - 
Method Detail- 
getPropertypublic java.lang.Object getProperty(java.lang.String name) Returns a property.- Specified by:
- getPropertyin interface- IPropertyObject
- Overrides:
- getPropertyin class- SimplePropertyObject
- Parameters:
- name- name of the property
- Returns:
- the property
 
 - 
getFetcherpublic SimpleValueFetcher getFetcher() Get the value fetcher.- Returns:
- The fetcher.
 
 - 
getNamepublic java.lang.String getName() Returns the name of the perspective- Specified by:
- getNamein interface- IPerspective
- Returns:
- name of the perspective
 
 - 
setNamepublic void setName(java.lang.String name) Sets the name of the perspective- Specified by:
- setNamein interface- IPerspective
- Parameters:
- name- name of the perspective
 
 - 
getSelectedObjectpublic java.lang.Object getSelectedObject() Returns the currently selected object.- Specified by:
- getSelectedObjectin interface- IPerspective
- Returns:
- currently selected object
 
 - 
setSelectedObjectpublic void setSelectedObject(java.lang.Object obj) Sets the selected object.- Specified by:
- setSelectedObjectin interface- IPerspective
- Parameters:
- obj- selected object
 
 - 
setObserverCenterpublic void setObserverCenter(IObserverCenter obscenter) Sets the ObserverCenter.- Specified by:
- setObserverCenterin interface- IPerspective
- Parameters:
- obscenter- the ObserverCenter
 
 - 
getObserverCenterpublic IObserverCenter getObserverCenter() Get the ObserverCenter.- Specified by:
- getObserverCenterin interface- IPerspective
- Returns:
- The observer center.
 
 - 
addVisualpublic void addVisual(java.lang.Object id, java.lang.Object visual)Adds a new visual object.- Specified by:
- addVisualin interface- IPerspective
- Parameters:
- id- identifier of the object
- visual- the visual object
 
 - 
removeVisualpublic void removeVisual(java.lang.Object id) Removes a new visual object.- Specified by:
- removeVisualin interface- IPerspective
- Parameters:
- id- identifier of the object
 
 - 
getPrelayerspublic Layer[] getPrelayers() Returns the prelayers.- Returns:
- the prelayers
 
 - 
setPrelayerspublic void setPrelayers(Layer[] prelayers) Sets the prelayers.- Parameters:
- prelayers- the prelayers
 
 - 
getPostlayerspublic Layer[] getPostlayers() Returns the Postlayers.- Returns:
- the Postlayers
 
 - 
setPostlayerspublic void setPostlayers(Layer[] postlayers) Sets the Postlayers.- Parameters:
- Postlayers- the Postlayers
 
 - 
getMarkerDrawCombinerpublic DrawableCombiner getMarkerDrawCombiner() Gets the drawable combiner object for the object marker- Returns:
- the marker drawable
 
 - 
setMarkerDrawCombinerpublic void setMarkerDrawCombiner(DrawableCombiner marker) Sets the drawable combiner object for the object marker- Parameters:
- marker- the marker drawable
 
 - 
getViewpublic java.awt.Component getView() Gets the view of the perspective.- Specified by:
- getViewin interface- IPerspective
- Returns:
- the view
 
 - 
getViewportpublic IViewport getViewport() Gets the viewport- Returns:
- the viewport
 
 - 
getOpenGlpublic boolean getOpenGl() Gets whether to try to use OpenGL.- Specified by:
- getOpenGlin interface- IPerspective
- Returns:
- true, if attempt should be made to use OpenGL
 
 - 
setOpenGlpublic boolean setOpenGl(boolean opengl) Sets whether to try to use OpenGL.- Specified by:
- setOpenGlin interface- IPerspective
- Parameters:
- opengl- true, if attempt should be made to use OpenGL
 
 - 
getInvertXAxispublic boolean getInvertXAxis() Gets x-axis inversion.- Returns:
- true, if the x-axis should be inverted.
 
 - 
setInvertXAxispublic void setInvertXAxis(boolean invert) Sets x-axis inversion.- Parameters:
- invert- true, if the x-axis should be inverted.
 
 - 
getInvertYAxispublic boolean getInvertYAxis() Gets y-axis inversion.- Returns:
- true, if the y-axis should be inverted.
 
 - 
setInvertYAxispublic void setInvertYAxis(boolean invert) Sets y-axis inversion.- Parameters:
- invert- true, if the y-axis should be inverted.
 
 - 
setBackgroundpublic void setBackground(java.awt.Color bgColor) Sets the background color.- Parameters:
- bgColor- the background color
 
 - 
setSelectorDistancepublic void setSelectorDistance(IVector1 maxDist) Sets the maximum distance for selecting objects.- Parameters:
- maxDist- selections distance
 
 - 
getSelectorDistancepublic IVector1 getSelectorDistance() Gets the maximum distance for selecting objects.- Returns:
- selections distance
 
 - 
getDisplayOrderpublic java.util.Comparator getDisplayOrder() Gets the display order.- Returns:
- the display order
 
 - 
setDisplayOrderpublic void setDisplayOrder(java.util.Comparator order) Sets the display order.- Parameters:
- order- the display order
 
 - 
getObjectShiftpublic IVector2 getObjectShift() Gets the object shift.- Returns:
- the object shift
 
 - 
setObjectShiftpublic void setObjectShift(IVector2 shift) Sets the object shift.- Parameters:
- shift- the object shift
 
 - 
getZoomLimitpublic double getZoomLimit() Gets the maximum zoom.- Returns:
- the zoom limit
 
 - 
setZoomLimitpublic void setZoomLimit(double zoomlimit) Sets the maximum zoom.- Parameters:
- zoomlimit- the zoom limit
 
 - 
getZoomSteppingpublic double getZoomStepping() Returns the current zoom stepping- Returns:
- the zoom stepping
 
 - 
getZoompublic double getZoom() Returns the zoom factor- Returns:
- the zoom factor
 
 - 
setZoompublic void setZoom(double zoom) Sets a new zoom factor- Parameters:
- zoom- new zoom factor
 
 - 
shiftPositionpublic void shiftPosition(IVector2 shift) Shifts the viewport position.- Parameters:
- shift- relative (to current zoom/size) shift vector
 
 - 
resetpublic void reset() Resets position and flushes render info- Specified by:
- resetin interface- IPerspective
 
 - 
resetZoomAndPositionpublic void resetZoomAndPosition() Resets the zoom and position.- Specified by:
- resetZoomAndPositionin interface- IPerspective
 
 - 
flushRenderInfopublic void flushRenderInfo() Flushes the render information.
 - 
refreshpublic void refresh() Refreshes the perspective.- Specified by:
- refreshin interface- IPerspective
 
 
- 
 
-