org.equanda.util.swing
Class ScreenButtonContainer

java.lang.Object
  extended by org.equanda.util.swing.ScreenButtonContainer

public abstract class ScreenButtonContainer
extends Object

Container panel for Screen buttons.

Author:
Joachim Van der Auwera, NetRom team

Field Summary
protected  ActionListener buttonListener
           
protected  JPanel buttonPanel
           
protected  ArrayList<ScreenButtonListener> listeners
           
protected  JScrollPane scrollPane
           
protected  int selectedButton
           
 
Constructor Summary
ScreenButtonContainer()
           
 
Method Summary
 void addListener(ScreenButtonListener listener)
           
 JComponent getButtonsPanel()
           
protected  ScreenButton newScreenButton(int idx, String text)
          Factory method used to create a new ScreenButton.
protected abstract  void onButtonSelect(int buttonIndex)
          Called when a new button has been selected
 void refresh(Map txtMap)
          Create new buttons, recycling existing buttons as much as possible
 boolean removeListener(ScreenButtonListener listener)
           
 void setSelectedButton(int newValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buttonPanel

protected JPanel buttonPanel

scrollPane

protected JScrollPane scrollPane

selectedButton

protected int selectedButton

listeners

protected ArrayList<ScreenButtonListener> listeners

buttonListener

protected ActionListener buttonListener
Constructor Detail

ScreenButtonContainer

public ScreenButtonContainer()
Method Detail

setSelectedButton

public void setSelectedButton(int newValue)

addListener

public void addListener(ScreenButtonListener listener)

removeListener

public boolean removeListener(ScreenButtonListener listener)

refresh

public void refresh(Map txtMap)
Create new buttons, recycling existing buttons as much as possible

Parameters:
txtMap - map with texts to put in buttons

getButtonsPanel

public JComponent getButtonsPanel()

onButtonSelect

protected abstract void onButtonSelect(int buttonIndex)
Called when a new button has been selected

Parameters:
buttonIndex - button index

newScreenButton

protected ScreenButton newScreenButton(int idx,
                                       String text)
Factory method used to create a new ScreenButton. May be overrided to provide custom buttons.

Parameters:
idx - index
text - text
Returns:
a new ScreenButton


Copyright © 2007-2009. All Rights Reserved.