Skip to content

Commit

Permalink
minor commenting and formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyshard authored and lilyshard committed Nov 3, 2013
1 parent a2691e0 commit 95bfa13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,27 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;

/** create controls to monitor webview loading. */
/**
* A control to monitor worker progress.
*
* Used for showing progress of WebView loading.
*/
public class LoadingProgressDisplay extends ProgressBar {

/**
* Creates a UI display monitor for provided worker.
*
* Assumes the worker is reporting progress as work done on a scale from 0 to 100 (other values indicate indeterminate progress).
*
* @param worker the worker whose progress is to be monitored and displayed.
*/
public LoadingProgressDisplay(Worker worker) {
setMaxWidth(Double.MAX_VALUE);

ColorAdjust bleach = new ColorAdjust();
bleach.setSaturation(-0.6);
setEffect(bleach);

HBox.setHgrow(this, Priority.ALWAYS);

visibleProperty().bind(worker.runningProperty());
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/jewelsea/willow/browser/StatusDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public StatusDisplay(StringExpression statusProperty) {
Text statusText = new Text();
statusText.textProperty().bind(statusProperty);
HBox.setMargin(statusText, new Insets(1, 6, 3, 6));

setEffect(new DropShadow());
getStyleClass().add("status-background");
getChildren().add(statusText);
setVisible(false);

statusText.textProperty().addListener((observableValue, oldValue, newValue) ->
setVisible(newValue != null && !newValue.equals(""))
);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/jewelsea/willow/browser/TabManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ public Button getNewTabButton() {
return newTabButton;
}

/**
* Places a new tab under management.
* Selects the newly added tab so that it is visible.
* Updates the chrome's location field to reflect the newly managed and visible tab.
*
* @param tab the browser tab to be added to the chrome.
*/
void addTab(BrowserTab tab) {
tabPane.getTabs().add(tab);
tabPane.getSelectionModel().selectLast();
Expand Down

0 comments on commit 95bfa13

Please sign in to comment.