com.jmex.bui
Class BList

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BContainer
          extended by com.jmex.bui.BList

public class BList
extends BContainer

Displays a list of selectable entries and fires an ActionEvent when the selected value changes. Each entry is displayed as a string obtained by calling Object.toString() on the supplied values.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.bui.BContainer
BContainer.ChildOp
 
Field Summary
protected  int _selidx
          The index of the current selection (or -1 for none).
protected  ActionListener _slistener
          Listens for button selections.
protected  java.util.ArrayList<java.lang.Object> _values
          The values contained in the list.
static java.lang.String SELECT
          The action fired when the list selection changes.
 
Fields inherited from class com.jmex.bui.BContainer
_children, _layout
 
Fields inherited from class com.jmex.bui.BComponent
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Constructor Summary
BList()
          Creates an empty list.
BList(java.lang.Object[] values)
          Creates a list and populates it with the supplied values.
 
Method Summary
 void addValue(java.lang.Object value)
          Adds a value to the list.
protected  java.lang.String getDefaultStyleClass()
          Returns the default stylesheet class to be used for all instances of this component.
 java.lang.Object getSelectedValue()
          Returns the currently selected value.
 boolean removeValue(java.lang.Object value)
          Removes a value from the list, if it is present.
 void setSelectedValue(java.lang.Object value)
          Sets the selected value.
 
Methods inherited from class com.jmex.bui.BContainer
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setEnabled, setLayoutManager, setVisible, validate, wasAdded, wasRemoved
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, addListeners, applyDefaultStates, boundsToString, changeCursor, configureStyle, createTooltipComponent, dispatchEvent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getInsets, getLocation, getName, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, invalidate, isAdded, isConsumeMouseEvents, isEnabled, isHoverEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setBackground, setBounds, setConsumeMouseEvents, setCursor, setHoverEnabled, setLocation, setName, setParent, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, stateDidChange, updateCursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECT

public static final java.lang.String SELECT
The action fired when the list selection changes.

See Also:
Constant Field Values

_values

protected java.util.ArrayList<java.lang.Object> _values
The values contained in the list.


_selidx

protected int _selidx
The index of the current selection (or -1 for none).


_slistener

protected ActionListener _slistener
Listens for button selections.

Constructor Detail

BList

public BList()
Creates an empty list.


BList

public BList(java.lang.Object[] values)
Creates a list and populates it with the supplied values.

Method Detail

addValue

public void addValue(java.lang.Object value)
Adds a value to the list.


removeValue

public boolean removeValue(java.lang.Object value)
Removes a value from the list, if it is present.

Returns:
true if the value was removed, false if it was not in the list

getSelectedValue

public java.lang.Object getSelectedValue()
Returns the currently selected value.

Returns:
the selected value, or null for none

setSelectedValue

public void setSelectedValue(java.lang.Object value)
Sets the selected value.

Parameters:
value - the value to select, or null for none

getDefaultStyleClass

protected java.lang.String getDefaultStyleClass()
Description copied from class: BComponent
Returns the default stylesheet class to be used for all instances of this component. Derived classes will likely want to override this method and set up a default class for their type of component.

Overrides:
getDefaultStyleClass in class BContainer


Copyright © 2011 Michael Bayne. All Rights Reserved.