jaron.gui
Class Panel

java.lang.Object
  extended by jaron.gui.Panel
Direct Known Subclasses:
ArtificialHorizon, Display, Graph

public class Panel
extends java.lang.Object

The Panel class is a helper class for a graphical component that consists of an outer frame and the content where the drawing is done.
The panel can furthermore have up to four labels that can be added to the top, the bottom, the left and the right side of the content. Adding those labels is done by setting their height (top and bottom label) or their width respectively (right and left label).

Since:
1.0
Version:
1.2
Author:
jarontec gmail com

Field Summary
 Rect content
          A Rect that encloses the panel's content.
 Rect frame
          A Rect that represents the panel's frame.
 Rect labelBottom
          A Rect that encloses the panel's bottom label.
 Rect labelLeft
          A Rect that encloses the panel's left label.
 Rect labelRight
          A Rect that encloses the panel's right label.
 Rect labelTop
          A Rect that encloses the panel's top label.
 
Constructor Summary
Panel(int left, int top, int width, int height)
          Creates a new Panel object at a certain position and with a certain width and height.
 
Method Summary
 Rect getContent()
          Returns the panels content Rect.
 Rect getFrame()
          Returns the panels frame Rect.
 Rect getLabelBottom()
          Returns the panels bottom label Rect.
 Rect getLabelLeft()
          Returns the panels left label Rect.
 Rect getLabelRight()
          Returns the panels right label Rect.
 Rect getLabelTop()
          Returns the panels top label Rect.
 void setContent(Rect content)
          Sets a new content Rect for this panel.
 void setFrame(Rect frame)
          Sets a new frame Rect for this panel.
 void setLabelBottomHeight(int height)
          Sets the panel's bottom label height.
 void setLabelLeftWidth(int width)
          Sets the panel's left label width.
 void setLabelRightWidth(int width)
          Sets the panel's right label width.
 void setLabelTopHeight(int height)
          Sets the panel's top label height.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

public Rect frame
A Rect that represents the panel's frame.


content

public Rect content
A Rect that encloses the panel's content.


labelBottom

public Rect labelBottom
A Rect that encloses the panel's bottom label.


labelLeft

public Rect labelLeft
A Rect that encloses the panel's left label.


labelRight

public Rect labelRight
A Rect that encloses the panel's right label.


labelTop

public Rect labelTop
A Rect that encloses the panel's top label.

Constructor Detail

Panel

public Panel(int left,
             int top,
             int width,
             int height)
Creates a new Panel object at a certain position and with a certain width and height.

Parameters:
left - the left coordinate
top - the top coordinate
width - the width of the panel
height - the height of the panel
Method Detail

getContent

public Rect getContent()
Returns the panels content Rect.

Returns:
the Rect that encloses the panel's content

getFrame

public Rect getFrame()
Returns the panels frame Rect.

Returns:
the Rect that represents the panel's frame

getLabelBottom

public Rect getLabelBottom()
Returns the panels bottom label Rect.

Returns:
the Rect that encloses the panel's bottom label

getLabelLeft

public Rect getLabelLeft()
Returns the panels left label Rect.

Returns:
the Rect that encloses the panel's left label

getLabelRight

public Rect getLabelRight()
Returns the panels right label Rect.

Returns:
the Rect that encloses the panel's right label

getLabelTop

public Rect getLabelTop()
Returns the panels top label Rect.

Returns:
the Rect that encloses the panel's top label

setContent

public void setContent(Rect content)
Sets a new content Rect for this panel. By altering the content, all the calculations like adding labels is done to the new content Rect.

Parameters:
content - the new content Rect to be used

setFrame

public void setFrame(Rect frame)
Sets a new frame Rect for this panel.

Parameters:
frame - the new frame Rect to be used

setLabelBottomHeight

public void setLabelBottomHeight(int height)
Sets the panel's bottom label height. Initially the height is set to 0.

Parameters:
height - the label's new height

setLabelLeftWidth

public void setLabelLeftWidth(int width)
Sets the panel's left label width. Initially the width is set to 0.

Parameters:
width - the label's new width

setLabelRightWidth

public void setLabelRightWidth(int width)
Sets the panel's right label width. Initially the width is set to 0.

Parameters:
width - the label's new width

setLabelTopHeight

public void setLabelTopHeight(int height)
Sets the panel's top label height. Initially the height is set to 0.

Parameters:
height - the label's new height