All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.micromata.mgc.javafx.feedback.FeedbackPanel Maven / Gradle / Ivy

There is a newer version: 3.1.3
Show newest version
//
// Copyright (C) 2010-2016 Micromata GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

package de.micromata.mgc.javafx.feedback;

import de.micromata.genome.util.validation.ValMessage;
import de.micromata.mgc.javafx.FXGuiUtils;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.ResourceBundle;
import javafx.beans.binding.DoubleBinding;
import javafx.fxml.Initializable;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.LabelBuilder;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.ColumnConstraintsBuilder;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.HBoxBuilder;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.RowConstraints;
import javafx.scene.layout.RowConstraintsBuilder;
import javafx.scene.shape.Circle;
import javafx.scene.shape.CircleBuilder;
import javafx.stage.Window;

/**
 * A control that displays Feedback Messages.
 * 
 * Does automatically resize the owning window.
 * 
 * Style-Class: feedback
 * 
 * @author Daniel ([email protected])
 * 
 */
public class FeedbackPanel extends GridPane implements Initializable
{
  /**
   * Percent divisor...
   */
  private static final int PERC_DIV = 100;

  /**
   * Radius of circle rendered in front of messages.
   */
  private static final int LI_RADIUS = 4;

  /**
   * Spacing of hbox content.
   */
  private static final int HBOX_SPACING = 10;

  /**
   * Hbox left padding.
   */
  private static final int HBOX_PAD_LEFT = 10;

  /**
   * Style class for this control.
   */
  private static final String CSS_CLASS_FEEDBACK = "feedback";

  /**
   * Column width in percent.
   */
  private static final int COLUMN_WIDTH_PERCENT = 100;

  /**
   * Padding.
   */
  private static final int PADDING = 10;

  /**
   * Stores the size of the owning stage before rendering existing messages.
   * 
   * This value is used to resize the owning window to its initial size.
   */
  private double initialWindowHeight = -1d;

  /**
   * Required to calculate Label Heights.
   */
  private final List




© 2015 - 2025 Weber Informatics LLC | Privacy Policy