Class EnvironmentMonitor
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.orderedlayout.HorizontalLayout
in.virit.EnvironmentMonitor
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.orderedlayout.HorizontalLayout>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasOrderedComponents, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.orderedlayout.FlexComponent, com.vaadin.flow.component.orderedlayout.ThemableLayout, Serializable
public class EnvironmentMonitor
extends com.vaadin.flow.component.orderedlayout.HorizontalLayout
A reusable component that displays both temperature and humidity gauges
with appropriate titles. Provides methods to update the environmental values.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent
com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment, com.vaadin.flow.component.orderedlayout.FlexComponent.JustifyContentMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current humidity gauge component.Gets the current temperature gauge component.voidsetEnvironmentValues(double temperature, double humidity) Updates both temperature and humidity values.voidsetHumidity(double humidity) Updates the humidity value displayed on the gauge.voidsetTemperature(double temperature) Updates the temperature value displayed on the gauge.voidsetTemperatureRange(double minTemp, double maxTemp) Sets the temperature range for the temperature gauge.voidSets the temperature unit for the temperature gauge.Methods inherited from class com.vaadin.flow.component.orderedlayout.HorizontalLayout
add, add, addAndExpand, addComponentAtIndex, addToEnd, addToEnd, addToMiddle, addToMiddle, addToStart, addToStart, getAlignItems, getAlignSelf, getDefaultVerticalComponentAlignment, getVerticalComponentAlignment, replace, setAlignItems, setAlignSelf, setDefaultVerticalComponentAlignment, setSpacing, setVerticalComponentAlignmentMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent
expand, getFlexGrow, getFlexShrink, getJustifyContentMode, setFlexGrow, setFlexShrink, setJustifyContentModeMethods inherited from interface com.vaadin.flow.component.HasComponents
add, addComponentAsFirst, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOfMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.orderedlayout.ThemableLayout
getBoxSizing, getSpacing, getThemeList, isMargin, isPadding, isSpacing, isWrap, setBoxSizing, setMargin, setPadding, setSpacing, setSpacing, setWrap
-
Constructor Details
-
EnvironmentMonitor
public EnvironmentMonitor() -
EnvironmentMonitor
public EnvironmentMonitor(double initialTemperature, double initialHumidity)
-
-
Method Details
-
setTemperature
public void setTemperature(double temperature) Updates the temperature value displayed on the gauge.- Parameters:
temperature- the new temperature value
-
setHumidity
public void setHumidity(double humidity) Updates the humidity value displayed on the gauge.- Parameters:
humidity- the new humidity value (0-100)
-
setEnvironmentValues
public void setEnvironmentValues(double temperature, double humidity) Updates both temperature and humidity values.- Parameters:
temperature- the new temperature valuehumidity- the new humidity value (0-100)
-
getTemperatureGauge
Gets the current temperature gauge component.- Returns:
- the TemperatureGauge instance
-
getHumidityGauge
Gets the current humidity gauge component.- Returns:
- the HumidityGauge instance
-
setTemperatureUnit
Sets the temperature unit for the temperature gauge.- Parameters:
unit- the temperature unit (CELSIUS or FAHRENHEIT)
-
setTemperatureRange
public void setTemperatureRange(double minTemp, double maxTemp) Sets the temperature range for the temperature gauge.- Parameters:
minTemp- minimum temperature valuemaxTemp- maximum temperature value
-