-
Notifications
You must be signed in to change notification settings - Fork 4
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
7 changed files
with
99 additions
and
18 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
53 changes: 53 additions & 0 deletions
53
src/main/java/components/interviewPanel/ToolBar/tools/Controllers/SearchToolController.java
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,53 @@ | ||
package components.interviewPanel.ToolBar.tools.Controllers; | ||
|
||
import application.configuration.Configuration; | ||
import components.interviewPanel.ToolBar.tools.Tool; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.collections.ObservableList; | ||
import javafx.geometry.Insets; | ||
import javafx.geometry.Pos; | ||
import javafx.scene.Node; | ||
import javafx.scene.canvas.Canvas; | ||
import javafx.scene.canvas.GraphicsContext; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.image.Image; | ||
import javafx.scene.layout.Pane; | ||
import javafx.scene.layout.VBox; | ||
import javafx.scene.paint.Color; | ||
|
||
public class SearchToolController { | ||
final String iconPath = "/images/book.png"; | ||
private Label label; | ||
private VBox vbox; | ||
private Canvas canvas; | ||
private GraphicsContext gc; | ||
private SimpleBooleanProperty isSearchClicked; | ||
private ObservableList<Node> hboxChildrens; | ||
|
||
public SearchToolController(ObservableList<Node> hboxChildrens, SimpleBooleanProperty isSearchClicked) { | ||
this.hboxChildrens = hboxChildrens; | ||
label = new Label(); | ||
vbox = new VBox(); | ||
canvas = new Canvas(20, 20); | ||
this.isSearchClicked = isSearchClicked; | ||
this.initGraphic(); | ||
} | ||
|
||
public void initGraphic() { | ||
vbox.setAlignment(Pos.CENTER); | ||
vbox.setPadding(new Insets(3)); | ||
label.setText(Configuration.langBundle.getString("find")); | ||
gc = canvas.getGraphicsContext2D(); | ||
vbox.getChildren().add(canvas); | ||
vbox.getChildren().add(label); | ||
gc.setFill(Color.TRANSPARENT); | ||
gc.fillRect(0, 0, 20, 20); | ||
gc.drawImage(new Image(iconPath), 0, 0, 20, 20); | ||
vbox.setOnMouseClicked((e) -> | ||
{ | ||
isSearchClicked.set(true); | ||
}); | ||
hboxChildrens.add(vbox); | ||
} | ||
|
||
} |
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
src/main/java/models/SearchResult.java → src/main/java/utils/SearchResult.java
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package models; | ||
package utils; | ||
|
||
import javafx.beans.property.SimpleIntegerProperty; | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.