-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from TFyre/controls
Various Changes
- Loading branch information
Showing
15 changed files
with
468 additions
and
106 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
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
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,36 @@ | ||
package com.tfyre.bambu.view; | ||
|
||
import com.tfyre.bambu.printer.BambuPrinter; | ||
import com.vaadin.flow.component.Unit; | ||
import com.vaadin.flow.component.button.Button; | ||
import com.vaadin.flow.component.button.ButtonVariant; | ||
import com.vaadin.flow.component.dialog.Dialog; | ||
import com.vaadin.flow.component.textfield.TextArea; | ||
|
||
/** | ||
* | ||
* @author Francois Steyn - ([email protected]) | ||
*/ | ||
public class GCodeDialog { | ||
|
||
public static void show(final BambuPrinter printer) { | ||
final Dialog d = new Dialog(); | ||
d.setHeaderTitle("Send GCode (No Validation!!)"); | ||
final TextArea text = new TextArea(); | ||
text.setWidthFull(); | ||
text.setHeight(95, Unit.PERCENTAGE); | ||
d.add(text); | ||
final Button cancel = new Button("Cancel", e -> d.close()); | ||
cancel.addThemeVariants(ButtonVariant.LUMO_ERROR); | ||
final Button ok = new Button("OK", e -> { | ||
d.close(); | ||
printer.commandPrintGCodeLine(text.getValue().trim().replaceAll("\n", "\\\n")); | ||
}); | ||
ok.addThemeVariants(ButtonVariant.LUMO_PRIMARY); | ||
d.getFooter().add(cancel, ok); | ||
d.setWidth(80, Unit.PERCENTAGE); | ||
d.setHeight(80, Unit.PERCENTAGE); | ||
d.open(); | ||
} | ||
|
||
} |
Oops, something went wrong.