TO - Type of objects to be stored.TC - Type of components to be usedpublic abstract class BaseBoxChooser<TO,TC extends Node> extends VBox implements MultipleChooser<TO>
alignmentProperty, fillWidthProperty, spacingPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthPropertyimpl_traversalEngineProperty, needsLayoutPropertyblendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<TC> |
boxes
All of the components that were created
|
protected ArrayList<ChangeListener<Boolean>> |
changeListenersForRemoval
Stored listeners for easy removal
|
protected ObservableList<StringAndObject<TO>> |
items
The stored items inside this system
|
protected ArrayList<Consumer<TO>> |
lambdaListeners
Listeners for everyone who registered to any kind of changes for this object
|
protected BooleanProperty |
nollataanko
Should the components example data be reset at start
|
protected StringProperty |
rivit
StringProperty for asking the example data from the scenebuilder
|
USE_COMPUTED_SIZE, USE_PREF_SIZEBASELINE_OFFSET_SAME_AS_HEIGHT| Constructor and Description |
|---|
BaseBoxChooser()
Initializes the control.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(StringAndObject<TO> so)
Adds the StringAndObject to the system and creates components necessary
|
void |
add(String name,
TO object)
Adds the given object with given name
|
void |
add(TO object)
Addes the given object to the list
|
protected abstract void |
addChangeListener(TC box,
ChangeListener<Boolean> listener)
Adds to the component a listener when its state is changed.
|
protected abstract TC |
addCorrectComponent(String name,
TO object)
Will give the created new component to this class so no reflection is needed.
|
void |
addExample(String text)
Adds example text to the list
|
void |
addSelectionListener(Consumer<TO> event)
Adds a selection listener to the base component so when someone does selection this event is called
|
void |
clear()
Clears the ObservableList that holds the objects
|
ObservableList<StringAndObject<TO>> |
getItems()
Returns the inner ObservableList.
|
boolean |
getNollataanko()
Returns if the component was selected to be cleared
|
String |
getRivit()
Returns the contents of the ListChooser as a multiline string.
|
int |
getSelectedIndex()
Returns the first selected index
|
List<Integer> |
getSelectedIndices()
Returns all of the selected indices
|
TO |
getSelectedObject()
Palauttaa valitun olion tai null
|
List<TO> |
getSelectedObjects()
Returns all of the selected objects from the components
|
String |
getSelectedText()
Returns the first selected text component
|
List<String> |
getSelectedTexts()
Returns all of the selected texts in the components
|
protected abstract boolean |
isComponentSelected(TC component)
Returns if the component should be selected by the baseboxchooser for getItems
|
protected abstract void |
removeListener(TC node,
ArrayList<ChangeListener<Boolean>> list)
Removes all the listeners from the node from the property they may be linked to
|
String |
removeMnemonic(String item)
Poistetaan alleviiva
|
protected abstract boolean |
setComponentSelected(TC component,
boolean value)
Sets component selected
|
void |
setNollataanko(boolean reset)
Sets the value if the component should be reset after the original example data
|
void |
setRivit(String jono)
Sets the rows.
|
void |
setRivit(String[] rivit)
Sets the rows.
|
int |
setSelectedIndex(int index)
Sets item in index selected
|
void |
UpdateComponents(ObservableList<StringAndObject<TO>> list)
Updates the components to match given list
|
alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, fillWidthProperty, getAlignment, getClassCssMetaData, getContentBias, getCssMetaData, getMargin, getSpacing, getVgrow, isFillWidth, layoutChildren, requestLayout, setAlignment, setFillWidth, setMargin, setSpacing, setVgrow, spacingPropertygetChildrenbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthPropertygetBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaddEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_geomChanged, impl_getAccessible, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertyprotected StringProperty rivit
protected BooleanProperty nollataanko
protected ObservableList<StringAndObject<TO>> items
protected ArrayList<Consumer<TO>> lambdaListeners
protected ArrayList<ChangeListener<Boolean>> changeListenersForRemoval
public BaseBoxChooser()
public void addSelectionListener(Consumer<TO> event)
addSelectionListener in interface Chooser<TO>event - what to do when event happenspublic void add(StringAndObject<TO> so)
so - object to addprotected abstract void addChangeListener(TC box, ChangeListener<Boolean> listener)
box - componetn to uselistener - function listenprotected abstract TC addCorrectComponent(String name, TO object)
name - ???object - ???public ObservableList<StringAndObject<TO>> getItems()
public void UpdateComponents(ObservableList<StringAndObject<TO>> list)
list - the objects to make the gui look likepublic void addExample(String text)
addExample in interface Chooser<TO>text - teksti joka näytetäänpublic void clear()
protected abstract void removeListener(TC node, ArrayList<ChangeListener<Boolean>> list)
node - ???list - ???public TO getSelectedObject()
getSelectedObject in interface Chooser<TO>public String getSelectedText()
getSelectedText in interface Chooser<TO>public int getSelectedIndex()
getSelectedIndex in interface Chooser<TO>public int setSelectedIndex(int index)
ChoosersetSelectedIndex in interface Chooser<TO>index - item to be selectedprotected abstract boolean isComponentSelected(TC component)
component - the generic component that we want to know if is selectedprotected abstract boolean setComponentSelected(TC component, boolean value)
component - the generic component that we want to know if is selectedvalue - value to set for componentpublic List<TO> getSelectedObjects()
MultipleChoosergetSelectedObjects in interface MultipleChooser<TO>public List<String> getSelectedTexts()
MultipleChoosergetSelectedTexts in interface MultipleChooser<TO>public List<Integer> getSelectedIndices()
MultipleChoosergetSelectedIndices in interface MultipleChooser<TO>public String getRivit()
public void setNollataanko(boolean reset)
reset - should it be resetpublic boolean getNollataanko()
public String removeMnemonic(String item)
removeMnemonic in interface Chooser<TO>item - mistä poistetaan