public abstract class GraphicalObserver extends java.lang.Object implements SimRunListener, IGraphicalObserver
Constructor and Description |
---|
GraphicalObserver(java.lang.String name,
GraphicalObserverContext c)
Creates a new graphical observer.
|
Modifier and Type | Method and Description |
---|---|
void |
deregister()
Deregisters the observer from the context
|
GraphicalObserverContext |
getContext()
Returns the context this observer is displayed in
|
abstract java.awt.Component |
getGUI()
Should return the graphical observer's main GUI component
|
java.lang.String |
getName()
Returns the observer's name
|
void |
register()
Registers the observer with the context
|
void |
setLocation(int x,
int y)
Sets the position of the observer's main window's upper left edge.
|
void |
setSize(int width,
int height)
Sets the observer's main window's size.
|
void |
setVisible(boolean visible)
Sets the observer visible withing the context
|
void |
update()
Requests an update of the observer's display from the context.
|
public GraphicalObserver(java.lang.String name, GraphicalObserverContext c)
name
- Name of the graphical observerc
- the context this graphical observer is displayed inpublic GraphicalObserverContext getContext()
IGraphicalObserver
getContext
in interface IGraphicalObserver
public abstract java.awt.Component getGUI()
IGraphicalObserver
getGUI
in interface IGraphicalObserver
public void register()
IGraphicalObserver
register
in interface IGraphicalObserver
public void deregister()
IGraphicalObserver
deregister
in interface IGraphicalObserver
public void setVisible(boolean visible)
IGraphicalObserver
setVisible
in interface IGraphicalObserver
public void setSize(int width, int height)
IGraphicalObserver
setSize
in interface IGraphicalObserver
width
- window widthheight
- window heightpublic void setLocation(int x, int y)
IGraphicalObserver
setLocation
in interface IGraphicalObserver
x
- horizontal positiony
- vertical positionpublic java.lang.String getName()
IGraphicalObserver
getName
in interface IGraphicalObserver
public void update()
IGraphicalObserver
update
in interface IGraphicalObserver