All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cmu.owl.ui.twoD.TwoDBean

edu.cmu.owl.ui.twoD.TwoDBean

public class TwoDBean
Bean that takes care of the 2-D view of the domain

Version:
5/11/97

Constructor Index

 o TwoDBean()
Get the map data get construct the map.

Method Index

 o addObjectSelectedListener(ObjectSelectedListener)
adds the listener to lis of listeners
 o dispatchObjectSelectedEvent(MapElement)
Sends event ObjectSelectedEvent to all it's listeners for this object
 o doLayout()
Whenever layout is called (i.e.
 o getMap()
What Map is currently being displayed?
 o getOrigin()
Returns the upper-left corner coordinate of the 2-D map
 o getPreferredSize()
The preferred size of this panel--hardwired.
 o groupCalled()
This method gets called when user wants to group things
 o makeImage()
Construct an off-screen image with the Map painted on it.
 o makeTip(MapElement)
makeTip determines if a new TipBox has to be made and if so changes the tipBox coordinates to fit the element that the mouse is over right now denoted by over.
 o moveView(int, int, float)
Moves the 2-D map to reflect the change of location of window on the key Map.
 o paint(Graphics)
Draw the Map (from the offscreen image), the tooltip, and the selection box, making sure they're translated properly.
 o removeObjectSelectedListener(ObjectSelectedListener)
removes the listener to lis of listeners
 o setKeyMap(KeyMapBean)
 o setMap(Map)
Set the Map to display.
 o toUnits(int, int)
 o ungroupCalled()

Constructors

 o TwoDBean
 public TwoDBean()
Get the map data get construct the map.

Methods

 o setKeyMap
 public void setKeyMap(KeyMapBean keyMap)
 o setMap
 public void setMap(Map theMap)
Set the Map to display.

 o getMap
 public Map getMap()
What Map is currently being displayed?

 o getOrigin
 public Point getOrigin()
Returns the upper-left corner coordinate of the 2-D map

 o getPreferredSize
 public Dimension getPreferredSize()
The preferred size of this panel--hardwired. Should really be as big as possible.

 o makeImage
 protected void makeImage()
Construct an off-screen image with the Map painted on it. THis is what makes the image to display.

 o doLayout
 public void doLayout()
Whenever layout is called (i.e. this panel's size has changed), make sure the offscreen image is redrawn.

 o paint
 public void paint(Graphics g)
Draw the Map (from the offscreen image), the tooltip, and the selection box, making sure they're translated properly.

Parameters:
g - is the context in which graphical operations take place
 o makeTip
 protected void makeTip(MapElement over)
makeTip determines if a new TipBox has to be made and if so changes the tipBox coordinates to fit the element that the mouse is over right now denoted by over.

Parameters:
over - the MapElement that the mouse is over right now
 o toUnits
 protected Point toUnits(int x,
                         int y)
 o moveView
 public void moveView(int x,
                      int y,
                      float keyMapScale)
Moves the 2-D map to reflect the change of location of window on the key Map.

Parameters:
x - the x position of new location on the map
y - the y position of new location on the map
 o groupCalled
 public void groupCalled()
This method gets called when user wants to group things

 o ungroupCalled
 public void ungroupCalled()
 o addObjectSelectedListener
 public synchronized void addObjectSelectedListener(ObjectSelectedListener lis)
adds the listener to lis of listeners

Parameters:
lis - an object of type ObjectSelectedListener
 o removeObjectSelectedListener
 public synchronized void removeObjectSelectedListener(ObjectSelectedListener lis)
removes the listener to lis of listeners

Parameters:
lis - an object of type ObjectSelectedListener
 o dispatchObjectSelectedEvent
 public synchronized void dispatchObjectSelectedEvent(MapElement sel)
Sends event ObjectSelectedEvent to all it's listeners for this object

Parameters:
sel - the object that is selected

All Packages  Class Hierarchy  This Package  Previous  Next  Index