Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SmartTime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
SmartTime
Commits
3343b2fd
Commit
3343b2fd
authored
7 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
Fixed
#16
- add time later --> button "now" for endtime
parent
16794bc0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/userInterface/InsertTimeController.java
+31
-14
31 additions, 14 deletions
src/userInterface/InsertTimeController.java
src/userInterface/InsertTimeGUI.fxml
+12
-6
12 additions, 6 deletions
src/userInterface/InsertTimeGUI.fxml
with
43 additions
and
20 deletions
src/userInterface/InsertTimeController.java
+
31
−
14
View file @
3343b2fd
...
...
@@ -14,6 +14,8 @@ import java.util.Date;
import
core.LogObject
;
import
core.SQL
;
import
fontAwesome.FontIcon
;
import
fontAwesome.FontIconType
;
import
javafx.beans.value.ChangeListener
;
import
javafx.beans.value.ObservableValue
;
import
javafx.fxml.FXML
;
...
...
@@ -25,6 +27,7 @@ import javafx.scene.control.DateCell;
import
javafx.scene.control.DatePicker
;
import
javafx.scene.control.Label
;
import
javafx.scene.image.Image
;
import
javafx.scene.paint.Color
;
import
javafx.stage.Stage
;
import
javafx.util.Callback
;
import
logger.Logger
;
...
...
@@ -33,17 +36,18 @@ import tools.ConvertTo;
public
class
InsertTimeController
{
@FXML
DatePicker
datePicker1
;
@FXML
DatePicker
datePicker2
;
@FXML
Parent
timePicker1
;
@FXML
TimePickerController
timePicker1Controller
;
@FXML
Parent
timePicker2
;
@FXML
TimePickerController
timePicker2Controller
;
@FXML
Button
buttonAdd
;
@FXML
Button
buttonCancel
;
@FXML
Label
labelDuration
;
@FXML
ComboBox
<
String
>
comboBoxProject
;
@FXML
ComboBox
<
String
>
comboBoxTask
;
@FXML
private
DatePicker
datePicker1
;
@FXML
private
DatePicker
datePicker2
;
@FXML
private
Parent
timePicker1
;
@FXML
private
TimePickerController
timePicker1Controller
;
@FXML
private
Parent
timePicker2
;
@FXML
private
TimePickerController
timePicker2Controller
;
@FXML
private
Button
buttonUseCurrentTime
;
@FXML
private
Button
buttonAdd
;
@FXML
private
Button
buttonCancel
;
@FXML
private
Label
labelDuration
;
@FXML
private
ComboBox
<
String
>
comboBoxProject
;
@FXML
private
ComboBox
<
String
>
comboBoxTask
;
private
Stage
stage
;
private
UserInterfaceController
controller
;
...
...
@@ -57,6 +61,8 @@ public class InsertTimeController
this
.
controller
=
controller
;
this
.
icon
=
icon
;
buttonUseCurrentTime
.
setGraphic
(
new
FontIcon
(
FontIconType
.
CLOCK_ALT
,
14
,
Color
.
BLACK
));
ArrayList
<
String
>
objects
=
new
ArrayList
<
String
>();
SQL
sql
=
new
SQL
(
savePath
);
...
...
@@ -159,12 +165,13 @@ public class InsertTimeController
comboBoxProject
.
requestFocus
();
}
@FXML
public
void
buttonAdd
()
{
String
project
=
comboBoxProject
.
getValue
();
String
task
=
comboBoxTask
.
getValue
();
if
(!
project
.
equals
(
""
)
&&
!
task
.
equals
(
""
))
if
(
project
!=
null
&&
!
project
.
equals
(
""
)
&&
task
!=
null
&&
!
task
.
equals
(
""
))
{
if
(
isEndDateAfterStartDate
())
{
...
...
@@ -219,11 +226,21 @@ public class InsertTimeController
}
}
@FXML
public
void
buttonCancel
()
{
stage
.
close
();
}
@FXML
public
void
useCurrentTime
()
{
LocalDateTime
now
=
LocalDateTime
.
now
();
timePicker2Controller
.
setTime
(
now
.
getHour
(),
now
.
getMinute
(),
now
.
getSecond
());
timePicker2Controller
.
init
();
setLabelDuration
();
}
public
void
refresh
(
TimePickerController
controller
,
int
hours
,
int
minutes
,
int
seconds
,
String
item
,
String
direction
)
{
if
(
controller
==
timePicker1Controller
)
...
...
This diff is collapsed.
Click to expand it.
src/userInterface/InsertTimeGUI.fxml
+
12
−
6
View file @
3343b2fd
...
...
@@ -5,9 +5,10 @@
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane
prefHeight=
"400.0"
prefWidth=
"540.0"
xmlns=
"http://javafx.com/javafx/8.0.
65
"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"userInterface.InsertTimeController"
>
<AnchorPane
prefHeight=
"400.0"
prefWidth=
"540.0"
xmlns=
"http://javafx.com/javafx/8.0.
111
"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"userInterface.InsertTimeController"
>
<children>
<Label
layoutX=
"35.0"
layoutY=
"128.0"
text=
"Startdatum:"
>
<font>
...
...
@@ -30,11 +31,16 @@
<fx:include
fx:id=
"timePicker2"
source=
"TimePicker.fxml"
/>
</children>
</AnchorPane>
<Label
layoutX=
"321.0"
layoutY=
"218.0"
text=
"Endzeit:"
>
<VBox
alignment=
"TOP_CENTER"
layoutX=
"321.0"
layoutY=
"218.0"
spacing=
"3.0"
>
<children>
<Label
text=
"Endzeit:"
>
<font>
<Font
name=
"System Bold"
size=
"18.0"
/>
</font>
</Label>
<Button
fx:id=
"buttonUseCurrentTime"
mnemonicParsing=
"false"
onAction=
"#useCurrentTime"
/>
</children>
</VBox>
<DatePicker
fx:id=
"datePicker2"
layoutX=
"154.0"
layoutY=
"219.0"
prefHeight=
"25.0"
prefWidth=
"134.0"
/>
<Label
layoutX=
"48.0"
layoutY=
"218.0"
text=
"Enddatum:"
>
<font>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment