framework
Class MapLayout

java.lang.Object
  extended by framework.MapLayout
All Implemented Interfaces:
no.tellu.cdlc.gui.LayoutManager

public class MapLayout
extends java.lang.Object
implements no.tellu.cdlc.gui.LayoutManager

MapLayout.java

Handles the layout of a panel containing a map and POIs.


Field Summary
 
Fields inherited from interface no.tellu.cdlc.gui.LayoutManager
CENTER, LEFT, RIGHT
 
Constructor Summary
MapLayout()
           
 
Method Summary
 void addLayoutComponent(no.tellu.cdlc.gui.GuiElement comp, int constraint)
          Empty.
 int getConstraint(no.tellu.cdlc.gui.GuiElement comp)
          Get the constraint applied when the component was added.
 int getHorizontalGap()
          Get horizontal spacing between layed out elements.
 int getVerticalGap()
          Get vertical spacing between layed out elements.
 void layoutContainer(no.tellu.cdlc.gui.GuiPanel parent)
          Sets the x and y coordinates of the MapElement and POIElement.
 no.tellu.cdlc.gui.Dimension minimumLayoutSize(no.tellu.cdlc.gui.GuiPanel parent)
          Calculates the size dimensions for the specified container, given the components it contains.
 no.tellu.cdlc.gui.Dimension preferredLayoutSize(no.tellu.cdlc.gui.GuiPanel parent)
          Calculates the preferred size dimensions for the specified container, given the components it contains.
 void removeLayoutComponent(no.tellu.cdlc.gui.GuiElement comp)
          Empty.
 void setHorizontalGap(int horizontalSpacing)
          Empty.
 void setVerticalGap(int verticalSpacing)
          Empty.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapLayout

public MapLayout()
Method Detail

addLayoutComponent

public void addLayoutComponent(no.tellu.cdlc.gui.GuiElement comp,
                               int constraint)
Empty. MapLayout must implement the inherited abstract method LayoutManager.addLayoutComponent(GuiElement, int).

Specified by:
addLayoutComponent in interface no.tellu.cdlc.gui.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(no.tellu.cdlc.gui.GuiElement comp)
Empty. MapLayout must implement the inherited abstract method LayoutManager.removeLayoutComponent(GuiElement).

Specified by:
removeLayoutComponent in interface no.tellu.cdlc.gui.LayoutManager

minimumLayoutSize

public no.tellu.cdlc.gui.Dimension minimumLayoutSize(no.tellu.cdlc.gui.GuiPanel parent)
Calculates the size dimensions for the specified container, given the components it contains.

Specified by:
minimumLayoutSize in interface no.tellu.cdlc.gui.LayoutManager
Parameters:
parent - the container to be laid out
Returns:
the layout size to be paintend

preferredLayoutSize

public no.tellu.cdlc.gui.Dimension preferredLayoutSize(no.tellu.cdlc.gui.GuiPanel parent)
Calculates the preferred size dimensions for the specified container, given the components it contains.

Specified by:
preferredLayoutSize in interface no.tellu.cdlc.gui.LayoutManager
Parameters:
parent - the container to be laid out
Returns:
the layout size to be paintend

layoutContainer

public void layoutContainer(no.tellu.cdlc.gui.GuiPanel parent)
Sets the x and y coordinates of the MapElement and POIElement.

Specified by:
layoutContainer in interface no.tellu.cdlc.gui.LayoutManager
Parameters:
parent - the specified component being laid out

setVerticalGap

public void setVerticalGap(int verticalSpacing)
Empty. MapLayout must implement the inherited abstract method LayoutManager.setVerticalGap(int).

Specified by:
setVerticalGap in interface no.tellu.cdlc.gui.LayoutManager

getVerticalGap

public int getVerticalGap()
Get vertical spacing between layed out elements.

Specified by:
getVerticalGap in interface no.tellu.cdlc.gui.LayoutManager
Returns:
0

setHorizontalGap

public void setHorizontalGap(int horizontalSpacing)
Empty. MapLayout must implement the inherited abstract method LayoutManager.setHorizontalGap(int).

Specified by:
setHorizontalGap in interface no.tellu.cdlc.gui.LayoutManager

getHorizontalGap

public int getHorizontalGap()
Get horizontal spacing between layed out elements.

Specified by:
getHorizontalGap in interface no.tellu.cdlc.gui.LayoutManager
Returns:
0

getConstraint

public int getConstraint(no.tellu.cdlc.gui.GuiElement comp)
Get the constraint applied when the component was added.

Specified by:
getConstraint in interface no.tellu.cdlc.gui.LayoutManager
Parameters:
comp - component
Returns:
constraint return -1 if not available