gdl.ext
Class InfoTextBox

java.lang.Object
  extended by gdl.ext.InfoTextBox

public class InfoTextBox
extends java.lang.Object

The InfoTextBox is a scrollable infopanel that can be displayed on a PCanvas: it can be closed like an 'in-canvas' window, collapsed or expanded. on initialisation, its size and transparancy is set. The InfoTextBox can be used to display text in a draggable panel on the canvas.

Author:
Martin Suntinger

Constructor Summary
InfoTextBox(GraphExplorerCanvas canvas, edu.umd.cs.piccolo.PLayer mainLayer, float posX, float posY, float boxWidth, float boxHeight, float headerHeight, float lensTransparency, java.awt.Color headerBackgroundColor, java.lang.String mainText, java.lang.String title)
           
 
Method Summary
 void collaps()
          sets the infobox to a collapsed state which means that only the title bar is shown with small buttons to expand the box again.
 void expand()
          expands the infobox
 boolean getCollapsedState()
           
 void hide()
          hides the infobox
 void scrollDown(double delta)
          scrolls down by a given delta
 void scrollUp(double delta)
          scrolls up by a given delta
 void setText(java.lang.String newText)
          Updates the text of the infobox.
 void setTitle(java.lang.String newTitle)
          Updated the title of the Infotextbox.
 void show()
          shows up the infobox
 void updateSizes()
          updates the size of all components to fit the size of the complete box
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InfoTextBox

public InfoTextBox(GraphExplorerCanvas canvas,
                   edu.umd.cs.piccolo.PLayer mainLayer,
                   float posX,
                   float posY,
                   float boxWidth,
                   float boxHeight,
                   float headerHeight,
                   float lensTransparency,
                   java.awt.Color headerBackgroundColor,
                   java.lang.String mainText,
                   java.lang.String title)
Parameters:
canvas - the PCanvas you want the InfoPanel to be inserted
mainLayer - the layer that should be used for the panel
posX - the position on the canvas (x-coordinate)
posY - the position on the canvas (Y-coordinate)
boxWidth - the width of the complete infobox
boxHeight - the height of the complete infobox
headerHeight - the height of the draggable infobox header, which can be compared to a window's titlebar
lensTransparency - the transparancy of the infotextbox, between 0 and 1
headerBackgroundColor - the backgroundcolor of the title bar (the text will be displayed in black, so choose a light color
mainText - the text that is displayed in the main panel area
title - the title of the infobox, displayed in the header
Method Detail

updateSizes

public void updateSizes()
updates the size of all components to fit the size of the complete box


scrollUp

public void scrollUp(double delta)
scrolls up by a given delta

Parameters:
delta - the amount to scroll

scrollDown

public void scrollDown(double delta)
scrolls down by a given delta

Parameters:
delta - the amount to scroll down

hide

public void hide()
hides the infobox


show

public void show()
shows up the infobox


collaps

public void collaps()
sets the infobox to a collapsed state which means that only the title bar is shown with small buttons to expand the box again.


expand

public void expand()
expands the infobox


setText

public void setText(java.lang.String newText)
Updates the text of the infobox.

Parameters:
newText - the text that should be displayed

setTitle

public void setTitle(java.lang.String newTitle)
Updated the title of the Infotextbox.

Parameters:
newTitle - the title that should be displayed in the panel's title bar

getCollapsedState

public boolean getCollapsedState()
Returns:
the current state of the panel: true: the panel is in collapsed state; false: is not in collapsed state