Example usage for javafx.scene.control OverrunStyle LEADING_ELLIPSIS

List of usage examples for javafx.scene.control OverrunStyle LEADING_ELLIPSIS

Introduction

In this page you can find the example usage for javafx.scene.control OverrunStyle LEADING_ELLIPSIS.

Prototype

OverrunStyle LEADING_ELLIPSIS

To view the source code for javafx.scene.control OverrunStyle LEADING_ELLIPSIS.

Click Source Link

Document

Same as ELLIPSIS but puts the "..."

Usage

From source file:org.sleuthkit.autopsy.imagegallery.gui.navpanel.GroupCellFactory.java

private <X extends Cell<?> & GroupCell<?>> X initCell(X cell) {
    /*//from   w  w w .j  a v  a  2 s  .c o m
     * reduce indent of TreeCells to 5, default is 10 which uses up a lot of
     * space. Define seen and unseen styles
     */
    cell.getStylesheets().add(GroupCellFactory.class.getResource("GroupCell.css").toExternalForm()); //NON-NLS
    cell.getStyleClass().add("groupCell"); //NON-NLS

    //since end of path is probably more interesting put ellipsis at front
    cell.setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);

    Platform.runLater(() -> cell.prefWidthProperty().bind(cell.getView().widthProperty().subtract(15)));
    return cell;
}

From source file:org.sleuthkit.autopsy.imagegallery.gui.navpanel.GroupTreeCell.java

public GroupTreeCell() {
    getStylesheets().add(GroupTreeCell.class.getResource("GroupTreeCell.css").toExternalForm());
    getStyleClass().add("groupTreeCell"); //reduce  indent to 5, default is 10 which uses up a lot of space.

    //since end of path is probably more interesting put ellipsis at front
    setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
    Platform.runLater(() -> {/*  ww w. j  ava2s  . c  o m*/
        prefWidthProperty().bind(getTreeView().widthProperty().subtract(15));
    });

}

From source file:org.sleuthkit.autopsy.timeline.ui.AbstractTimelineChart.java

/**
 * Add a Label Node to the contextual label container for the decluttered
 * axis labels./*w  ww .  j  av a  2 s .c  o  m*/
 *
 * @param labelText  The String to add.
 * @param labelWidth The width, in pixels, of the space to use for the label
 * @param labelX     The horizontal position, in pixels, in the specificPane
 *                   of the text
 */
private synchronized void addContextLabel(String labelText, double labelWidth, double labelX) {
    Label label = new Label(labelText);
    label.setAlignment(Pos.CENTER);
    label.setTextAlignment(TextAlignment.CENTER);
    label.setFont(Font.font(10));
    //use a leading ellipse since that is the lowest frequency part,
    //and can be infered more easily from other surrounding labels
    label.setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
    //force size
    label.setMinWidth(labelWidth);
    label.setPrefWidth(labelWidth);
    label.setMaxWidth(labelWidth);
    label.relocate(labelX, 0);

    if (labelX == 0) { // first label has no border
        label.setBorder(null);
    } else { // subsequent labels have border on left to create dividers
        label.setBorder(ONLY_LEFT_BORDER);
    }

    contextLabelPane.getChildren().add(label);
}

From source file:org.sleuthkit.autopsy.timeline.ui.AbstractVisualization.java

/** add a {@link Label} node to the branch container for the decluttered
 * axis labels//from   w w w .  ja v  a  2s . c o  m
 *
 * @param labelText  the string to add
 * @param labelWidth the width of the space to use for the label
 * @param labelX     the horizontal position in the partPane of the text
 */
private synchronized void assignBranchLabel(String labelText, double labelWidth, double labelX) {

    Label label = new Label(labelText);
    label.setAlignment(Pos.CENTER);
    label.setTextAlignment(TextAlignment.CENTER);
    label.setFont(Font.font(10));
    //use a leading ellipse since that is the lowest frequency part,
    //and can be infered more easily from other surrounding labels
    label.setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
    //force size
    label.setMinWidth(labelWidth);
    label.setPrefWidth(labelWidth);
    label.setMaxWidth(labelWidth);
    label.relocate(labelX, 0);

    if (labelX == 0) { // first label has no border
        label.setStyle("-fx-border-width: 0 0 0 0 ; -fx-border-color:black;"); // NON-NLS
    } else { // subsequent labels have border on left to create dividers
        label.setStyle("-fx-border-width: 0 0 0 1; -fx-border-color:black;"); // NON-NLS
    }

    branchPane.getChildren().add(label);
}

From source file:org.sleuthkit.autopsy.timeline.ui.AbstractVisualizationPane.java

/**
 * add a {@link Label} node to the branch container for the decluttered axis
 * labels/*ww  w.  j a v  a  2s.c o m*/
 *
 * @param labelText  the string to add
 * @param labelWidth the width of the space to use for the label
 * @param labelX     the horizontal position in the partPane of the text
 */
private synchronized void assignBranchLabel(String labelText, double labelWidth, double labelX) {

    Label label = new Label(labelText);
    label.setAlignment(Pos.CENTER);
    label.setTextAlignment(TextAlignment.CENTER);
    label.setFont(Font.font(10));
    //use a leading ellipse since that is the lowest frequency part,
    //and can be infered more easily from other surrounding labels
    label.setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
    //force size
    label.setMinWidth(labelWidth);
    label.setPrefWidth(labelWidth);
    label.setMaxWidth(labelWidth);
    label.relocate(labelX, 0);

    if (labelX == 0) { // first label has no border
        label.setStyle("-fx-border-width: 0 0 0 0 ; -fx-border-color:black;"); // NON-NLS //NOI18N
    } else { // subsequent labels have border on left to create dividers
        label.setStyle("-fx-border-width: 0 0 0 1; -fx-border-color:black;"); // NON-NLS //NOI18N
    }

    branchPane.getChildren().add(label);
}