-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
60 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tructure/GraphicalTemperatureSource.scala → ...adapters/GraphicalTemperatureSource.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
...hub/infrastructure/MockedHubManager.scala → ...iLuca/hub/adapters/MockedHubManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...astructure/MockedLightingHubManager.scala → ...b/adapters/MockedLightingHubManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tructure/MockedThermostatHubManager.scala → ...adapters/MockedThermostatHubManager.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
smart-hub/src/main/scala/io/github/tassiLuca/hub/adapters/ui/DashboardUI.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.github.tassiLuca.hub.adapters.ui | ||
|
||
import io.github.tassiLuca.utils.ScalaSwingFacade.{*, given} | ||
|
||
import java.awt.{Font, GridLayout} | ||
import javax.swing.* | ||
import javax.swing.table.DefaultTableModel | ||
|
||
class DashboardUI extends JFrame: | ||
private val biggerFont = Font("Arial", Font.BOLD, 20) | ||
|
||
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) | ||
setTitle("Smart hub dashboard") | ||
setSize(915, 460) | ||
setLocationRelativeTo(null) | ||
setLayout(GridLayout(1, 2)) | ||
val temperatureLabel: JLabel = JLabel("00°C") | ||
temperatureLabel.setFont(biggerFont) | ||
val heaterLabel: JLabel = JLabel("Off") | ||
heaterLabel.setFont(biggerFont) | ||
val luminosityLabel: JLabel = JLabel("--") | ||
luminosityLabel.setFont(biggerFont) | ||
private val infos = createPanel( | ||
createPanel(), | ||
createPanel(JLabel("Current Temperature:"), temperatureLabel), | ||
createPanel(JLabel("Heater Status:"), heaterLabel), | ||
createPanel(JLabel("Current Luminosity:"), luminosityLabel), | ||
) | ||
infos.setLayout(BoxLayout(infos, BoxLayout.PAGE_AXIS)) | ||
val alertsModel: DefaultTableModel = DefaultTableModel(Array[AnyRef]("Alert Messages"), 0) | ||
private val alertsLog: JTable = JTable(alertsModel) | ||
private val alerts = createPanel(JScrollPane(alertsLog)) | ||
getContentPane.add(infos) | ||
getContentPane.add(alerts) | ||
setVisible(true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
smart-hub/src/main/scala/io/github/tassiLuca/hub/infrastructure/ui/DashboardUI.scala
This file was deleted.
Oops, something went wrong.