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

org.opentcs.data.model.visualization.LayoutElement Maven / Gradle / Ivy

/**
 * Copyright (c) The openTCS Authors.
 *
 * This program is free software and subject to the MIT license. (For details,
 * see the licensing information (LICENSE.txt) you should have received with
 * this copy of the software.)
 */
package org.opentcs.data.model.visualization;

import java.io.Serializable;
import java.util.Map;
import static java.util.Objects.requireNonNull;
import java.util.TreeMap;
import org.opentcs.util.annotations.ScheduledApiChange;

/**
 * A generic layout element that is to be displayed.
 *
 * @author Stefan Walter (Fraunhofer IML)
 * @deprecated Will be removed.
 */
@Deprecated
@ScheduledApiChange(details = "Will be removed.", when = "6.0")
public abstract class LayoutElement
    implements Serializable {

  /**
   * A set of generic key-value pairs associated with this layout element.
   */
  private Map properties = new TreeMap<>();
  /**
   * The layer on which this layout element is to be displayed.
   */
  private int layer;

  /**
   * Creates a new LayoutElement.
   */
  protected LayoutElement() {
    // Do nada.
  }

  /**
   * Returns the layer on which this layout element is to be displayed.
   *
   * @return The layer on which this layout element is to be displayed.
   */
  public int getLayer() {
    return layer;
  }

  /**
   * Sets the layer on which this layout element is to be displayed.
   *
   * @param layer The new layer.
   */
  public void setLayer(int layer) {
    this.layer = layer;
  }

  /**
   * Returns this layout element's properties, a generic set of key-value pairs
   * that can contain basically any information describing this element.
   *
   * @return This layout element's properties.
   */
  public Map getProperties() {
    return properties;
  }

  /**
   * Sets this layout element's properties.
   *
   * @param properties The new properties.
   */
  public void setProperties(Map properties) {
    this.properties = requireNonNull(properties, "properties");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy