- java.lang.Object
-
- javafx.stage.Window
-
- javafx.stage.PopupWindow
-
- javafx.scene.control.PopupControl
-
- org.tentackle.fx.component.Note
-
- All Implemented Interfaces:
javafx.css.Styleable,javafx.event.EventTarget,javafx.scene.control.Skinnable
public class Note extends javafx.scene.control.PopupControlA note control.
Notes display information related to another linkedNode. Tentackle uses notes to display errors due to bad user input in a linkedNode, e.g. after a ParseException.A note is displayed "near by" its linkedNode. The default position is to the right side of the linkedNode. However, if there is not enough space left on the screen, the note may be displayed below, left or on top of its linkedNode.
The link between the note and its linkedNode is visualized by a straight line and a circle above the linkedNode's border.
Notes come in 3 categories:
- error (background colored light-red, link red, text red and bold)
- info (standard colors, link green)
- sticky (yellow background, black text, link gray)
- Author:
- harald
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNote.Positiondisplay position relative to linked node.static classNote.TypeThe note type.
-
Constructor Summary
Constructors Constructor Description Note(Note.Position position, Note.Type type)Creates a note.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<javafx.scene.Node>contentNodeProperty()Returns the content shown by the pop over.protected javafx.scene.control.Skin<?>createDefaultSkin()javafx.scene.NodegetContentNode()Gets the content node displayed by this note.Note.PositiongetPosition()Gets the position.javafx.scene.layout.StackPanegetRootPane()Gets the root pane of this note.Note.TypegetType()Gets the note type.voidsetContentNode(javafx.scene.Node contentNode)Sets the content node displayed by this note.voidsetText(java.lang.String text)Sets the text to be shown.voidshow(javafx.scene.Node ownerNode)Shows the note popup.-
Methods inherited from class javafx.scene.control.PopupControl
getClassCssMetaData, getCssMetaData, getId, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getPseudoClassStates, getSkin, getStyle, getStyleableNode, getStyleableParent, getStyleClass, getTypeSelector, idProperty, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, pseudoClassStateChanged, setId, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setStyle, skinProperty, styleProperty
-
Methods inherited from class javafx.stage.PopupWindow
anchorLocationProperty, anchorXProperty, anchorYProperty, autoFixProperty, autoHideProperty, consumeAutoHidingEventsProperty, getAnchorLocation, getAnchorX, getAnchorY, getConsumeAutoHidingEvents, getOnAutoHide, getOwnerNode, getOwnerWindow, hide, hideOnEscapeProperty, isAutoFix, isAutoHide, isHideOnEscape, onAutoHideProperty, ownerNodeProperty, ownerWindowProperty, setAnchorLocation, setAnchorX, setAnchorY, setAutoFix, setAutoHide, setConsumeAutoHidingEvents, setHideOnEscape, setOnAutoHide, setScene, show, show, show
-
Methods inherited from class javafx.stage.Window
addEventFilter, addEventHandler, buildEventDispatchChain, centerOnScreen, eventDispatcherProperty, fireEvent, focusedProperty, forceIntegerRenderScaleProperty, getEventDispatcher, getHeight, getOnCloseRequest, getOnHidden, getOnHiding, getOnShowing, getOnShown, getOpacity, getOutputScaleX, getOutputScaleY, getProperties, getRenderScaleX, getRenderScaleY, getScene, getUserData, getWidth, getWindows, getX, getY, hasProperties, heightProperty, isFocused, isForceIntegerRenderScale, isShowing, onCloseRequestProperty, onHiddenProperty, onHidingProperty, onShowingProperty, onShownProperty, opacityProperty, outputScaleXProperty, outputScaleYProperty, removeEventFilter, removeEventHandler, renderScaleXProperty, renderScaleYProperty, requestFocus, sceneProperty, setEventDispatcher, setEventHandler, setForceIntegerRenderScale, setHeight, setOnCloseRequest, setOnHidden, setOnHiding, setOnShowing, setOnShown, setOpacity, setRenderScaleX, setRenderScaleY, setUserData, setWidth, setX, setY, show, showingProperty, sizeToScene, widthProperty, xProperty, yProperty
-
-
-
-
Constructor Detail
-
Note
public Note(Note.Position position, Note.Type type)
Creates a note.- Parameters:
position- the positiontype- the note type
-
-
Method Detail
-
createDefaultSkin
protected javafx.scene.control.Skin<?> createDefaultSkin()
- Overrides:
createDefaultSkinin classjavafx.scene.control.PopupControl
-
getPosition
public Note.Position getPosition()
Gets the position.- Returns:
- the position
-
getType
public Note.Type getType()
Gets the note type.- Returns:
- the type
-
getRootPane
public javafx.scene.layout.StackPane getRootPane()
Gets the root pane of this note.- Returns:
- the root pane
-
contentNodeProperty
public javafx.beans.property.ObjectProperty<javafx.scene.Node> contentNodeProperty()
Returns the content shown by the pop over.- Returns:
- the content linkedNode property
-
getContentNode
public javafx.scene.Node getContentNode()
Gets the content node displayed by this note.- Returns:
- the content node
-
setContentNode
public void setContentNode(javafx.scene.Node contentNode)
Sets the content node displayed by this note.- Parameters:
contentNode- the content node
-
show
public void show(javafx.scene.Node ownerNode)
Shows the note popup.- Parameters:
ownerNode- the owner node
-
setText
public void setText(java.lang.String text)
Sets the text to be shown.- Parameters:
text- the text
-
-