All Classes Namespaces Files Functions Variables
fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node > Class Referenceabstract

Base class for any single object that want to be added in multiples and then selected. More...

Inheritance diagram for fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >:

Public Member Functions

 BaseBoxChooser ()
 Initializes the control.
 
void addSelectionListener (Consumer< TO > event)
 Adds a selection listener to the base component so when someone does selection this event is called.
 
void add (String name, TO object)
 Adds the given object with given name.
 
void add (StringAndObject< TO > so)
 Adds the StringAndObject to the system and creates components necessary.
 
ObservableList
< StringAndObject< TO > > 
getItems ()
 Returns the inner ObservableList.
 
void UpdateComponents (ObservableList< StringAndObject< TO >> list)
 Updates the components to match given list.
 
void add (TO object)
 Addes the given object to the list.
 
void addExample (String text)
 Adds example text to the list.
 
void clear ()
 Clears the ObservableList that holds the objects.
 
void setRivit (String jono)
 Sets the rows.
 
void setRivit (String[] rivit)
 Sets the rows.
 
TO getSelectedObject ()
 Palauttaa valitun olion tai null.
 
String getSelectedText ()
 Returns the first selected text component.
 
int getSelectedIndex ()
 Returns the first selected index.
 
int setSelectedIndex (int index)
 
List< TO > getSelectedObjects ()
 
List< String > getSelectedTexts ()
 
List< Integer > getSelectedIndices ()
 
String getRivit ()
 Returns the contents of the ListChooser as a multiline string.
 
void setNollataanko (boolean reset)
 Sets the value if the component should be reset after the original example data.
 
boolean getNollataanko ()
 Returns if the component was selected to be cleared.
 
String removeMnemonic (String item)
 Poistetaan alleviiva.
 

Protected Member Functions

abstract void addChangeListener (TC box, ChangeListener< Boolean > listener)
 Adds to the component a listener when its state is changed.
 
abstract TC addCorrectComponent (String name, TO object)
 Will give the created new component to this class so no reflection is needed.
 
abstract void removeListener (TC node, ArrayList< ChangeListener< Boolean >> list)
 Removes all the listeners from the node from the property they may be linked to.
 
abstract boolean isComponentSelected (TC component)
 Returns if the component should be selected by the baseboxchooser for getItems.
 
abstract boolean setComponentSelected (TC component, boolean value)
 Sets component selected.
 

Protected Attributes

StringProperty rivit = new SimpleStringProperty("\n")
 StringProperty for asking the example data from the scenebuilder.
 
BooleanProperty nollataanko = new SimpleBooleanProperty(false)
 Should the components example data be reset at start.
 
ArrayList< TC > boxes = new ArrayList<TC>()
 All of the components that were created.
 
ObservableList
< StringAndObject< TO > > 
items = FXCollections.observableArrayList()
 The stored items inside this system.
 
ArrayList< Consumer< TO > > lambdaListeners = new ArrayList<Consumer<TO>>()
 Listeners for everyone who registered to any kind of changes for this object.
 
ArrayList< ChangeListener
< Boolean > > 
changeListenersForRemoval = new ArrayList<>()
 Stored listeners for easy removal.
 

Package Functions

void selectedChanged ()
 This calls the listeners in the class! Probably not useful elsewhere We scope this into the class for easier access to the baseClass instead of every this pointing to the ChangeListener-anonymous class The visibility of this should be package.
 

Private Member Functions

void setRows (String[] strings)
 

Detailed Description

Base class for any single object that want to be added in multiples and then selected.

Author
terop
Version
13.1.2017
Parameters
<TO>Type of objects to be stored.
<TC>Type of components to be used

Definition at line 27 of file BaseBoxChooser.java.

Constructor & Destructor Documentation

fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.BaseBoxChooser ( )
inline

Initializes the control.

Definition at line 57 of file BaseBoxChooser.java.

Member Function Documentation

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.add ( String  name,
TO  object 
)
inline

Adds the given object with given name.

Parameters
nameobjektin kohdalla näkyvä teksti
objecttallennettava olio

Definition at line 107 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.add ( StringAndObject< TO >  so)
inline

Adds the StringAndObject to the system and creates components necessary.

Parameters
soobject to add

Definition at line 116 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.add ( TO  object)
inline

Addes the given object to the list.

Parameters
objecttallennettava olio

Definition at line 195 of file BaseBoxChooser.java.

abstract void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.addChangeListener ( TC  box,
ChangeListener< Boolean >  listener 
)
protectedpure virtual

Adds to the component a listener when its state is changed.

Base cannot know which property is to be cared about

Parameters
boxcomponetn to use
listenerfunction listen
abstract TC fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.addCorrectComponent ( String  name,
TO  object 
)
protectedpure virtual

Will give the created new component to this class so no reflection is needed.

Since the class is abstract anyways

Parameters
name???
object???
Returns
??
void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.addExample ( String  text)
inline

Adds example text to the list.

Parameters
textteksti joka näytetään

Definition at line 205 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.addSelectionListener ( Consumer< TO >  event)
inline

Adds a selection listener to the base component so when someone does selection this event is called.

Parameters
eventwhat to do when event happens

Definition at line 96 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.clear ( )
inline

Clears the ObservableList that holds the objects.

Definition at line 214 of file BaseBoxChooser.java.

ObservableList<StringAndObject<TO> > fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getItems ( )
inline

Returns the inner ObservableList.

Will break functionality. You have been warned

Returns
the inner observableList

Definition at line 173 of file BaseBoxChooser.java.

boolean fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getNollataanko ( )
inline

Returns if the component was selected to be cleared.

Returns
should it be cleared

Definition at line 411 of file BaseBoxChooser.java.

String fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getRivit ( )
inline

Returns the contents of the ListChooser as a multiline string.

Returns
The contents of the ListChooser as a multiline string.

Definition at line 393 of file BaseBoxChooser.java.

int fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedIndex ( )
inline

Returns the first selected index.

Definition at line 312 of file BaseBoxChooser.java.

List<Integer> fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedIndices ( )
inline

Definition at line 376 of file BaseBoxChooser.java.

TO fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedObject ( )
inline

Palauttaa valitun olion tai null.

Returns
valittu olio tai null

Definition at line 282 of file BaseBoxChooser.java.

List<TO> fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedObjects ( )
inline

Definition at line 350 of file BaseBoxChooser.java.

String fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedText ( )
inline

Returns the first selected text component.

Definition at line 297 of file BaseBoxChooser.java.

List<String> fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.getSelectedTexts ( )
inline

Definition at line 363 of file BaseBoxChooser.java.

abstract boolean fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.isComponentSelected ( TC  component)
protectedpure virtual

Returns if the component should be selected by the baseboxchooser for getItems.

Parameters
componentthe generic component that we want to know if is selected
Returns
if the component is selected or not
abstract void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.removeListener ( TC  node,
ArrayList< ChangeListener< Boolean >>  list 
)
protectedpure virtual

Removes all the listeners from the node from the property they may be linked to.

Parameters
node???
list???
String fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.removeMnemonic ( String  item)
inline

Poistetaan alleviiva.

Parameters
itemmistä poistetaan
Returns
ilman 1. alleviivaa

Definition at line 422 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.selectedChanged ( )
inlinepackage

This calls the listeners in the class! Probably not useful elsewhere We scope this into the class for easier access to the baseClass instead of every this pointing to the ChangeListener-anonymous class The visibility of this should be package.

NOT public or private. Java seems to do this by not having a keyword at all! We don't what this definitely as public but nor do we want to create synthetic accessor(which might be preferred over public still)

Parameters
boxthe box that was selected

Definition at line 143 of file BaseBoxChooser.java.

abstract boolean fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setComponentSelected ( TC  component,
boolean  value 
)
protectedpure virtual

Sets component selected.

Parameters
componentthe generic component that we want to know if is selected
valuevalue to set for component
Returns
if the component was selected or not
void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setNollataanko ( boolean  reset)
inline

Sets the value if the component should be reset after the original example data.

Parameters
resetshould it be reset

Definition at line 402 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setRivit ( String  jono)
inline

Sets the rows.

Parameters
jonoA multiline string, each line representing a single row.

Definition at line 254 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setRivit ( String[]  rivit)
inline

Sets the rows.

Parameters
rivitA string arrays, each line representing a single row.

Definition at line 268 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setRows ( String[]  strings)
inlineprivate

Definition at line 238 of file BaseBoxChooser.java.

int fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.setSelectedIndex ( int  index)
inline

Definition at line 324 of file BaseBoxChooser.java.

void fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.UpdateComponents ( ObservableList< StringAndObject< TO >>  list)
inline

Updates the components to match given list.

Parameters
listthe objects to make the gui look like

Definition at line 182 of file BaseBoxChooser.java.

Member Data Documentation

ArrayList<TC> fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.boxes = new ArrayList<TC>()
protected

All of the components that were created.

Definition at line 39 of file BaseBoxChooser.java.

ArrayList<ChangeListener<Boolean> > fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.changeListenersForRemoval = new ArrayList<>()
protected

Stored listeners for easy removal.

Definition at line 51 of file BaseBoxChooser.java.

ObservableList<StringAndObject<TO> > fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.items = FXCollections.observableArrayList()
protected

The stored items inside this system.

Definition at line 43 of file BaseBoxChooser.java.

ArrayList<Consumer<TO> > fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.lambdaListeners = new ArrayList<Consumer<TO>>()
protected

Listeners for everyone who registered to any kind of changes for this object.

Definition at line 47 of file BaseBoxChooser.java.

BooleanProperty fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.nollataanko = new SimpleBooleanProperty(false)
protected

Should the components example data be reset at start.

Definition at line 35 of file BaseBoxChooser.java.

StringProperty fi.jyu.mit.fxgui.BaseBoxChooser< TO, TC extends Node >.rivit = new SimpleStringProperty("\n")
protected

StringProperty for asking the example data from the scenebuilder.

Definition at line 31 of file BaseBoxChooser.java.


The documentation for this class was generated from the following file: