<commit_before>package org.percepta.mgrankvi.demo;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import org.percepta.mgrankvi.FloorMap;
import org.percepta.mgrankvi.Room;
import org.percepta.mgrankvi.SeatingMap;
import org.percepta.mgrankvi.Table;
import org.percepta.mgrankvi.client.geometry.Line;
import org.percepta.mgrankvi.client.geometry.Point;
import org.percepta.mgrankvi.util.ImageToLines;

import javax.servlet.annotation.WebServlet;
import java.util.List;

@Theme("demo")
@SpringUI(path = "")
@SuppressWarnings("serial")
public class DemoUI extends UI {

  @WebServlet(value = "/*", asyncSupported = true)
  @VaadinServletConfiguration(productionMode = false, ui = DemoUI.class)
  public static class Servlet extends VaadinServlet {
  }

  @Override
  protected void init(VaadinRequest request) {

    // Initialize our new UI component
    final SeatingMap component = new SeatingMap();
    component.setSizeFull();

    ImageToLines imageToLines = new ImageToLines();
    List<Line> thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorMarketing.png",new Point(150,150));
    component.addRoom(1, thirdLines);
    thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales.png",new Point(150,150));
    Room room = component.addRoom(1, thirdLines);
    Table table = new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t1.png", new Point(150, 150)));
    table.setName("<NAME>");
    room.addComponent(table);
    room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t2.png",new Point(150,150))));
    room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t3.png",new Point(150,150))));
    room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t4.png",new Point(150,150))));

    thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorUtilities.png",new Point(150,150));
    component.addLines(1, thirdLines);

    // Show it in the middle of the screen
    final VerticalLayout layout = new VerticalLayout();
    layout.setStyleName("demoContentLayout");
    layout.setSizeFull();
    layout.addComponent(component);
    layout.setComponentAlignment(component, Alignment.MIDDLE_CENTER);
    setContent(layout);
  }
}
<commit_msg>Format, add test image.<commit_after>package org.percepta.mgrankvi.demo;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.spring.annotation.SpringUI;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import org.percepta.mgrankvi.Room;
import org.percepta.mgrankvi.SeatingMap;
import org.percepta.mgrankvi.Table;
import org.percepta.mgrankvi.client.geometry.Line;
import org.percepta.mgrankvi.client.geometry.Point;
import org.percepta.mgrankvi.util.ImageToLines;

import javax.servlet.annotation.WebServlet;
import java.util.List;

@Theme("demo")
@SpringUI(path = "")
@SuppressWarnings("serial")
public class DemoUI extends UI {

    @WebServlet(value = "/*", asyncSupported = true)
    @VaadinServletConfiguration(productionMode = false, ui = DemoUI.class)
    public static class Servlet extends VaadinServlet {
    }

    @Override
    protected void init(VaadinRequest request) {

        // Initialize our new UI component
        final SeatingMap component = new SeatingMap();
        component.setSizeFull();

        ImageToLines imageToLines = new ImageToLines();
        List<Line> thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorMarketing.png", new Point(150, 150));
        component.addRoom(1, thirdLines);
        thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales.png", new Point(150, 150));
        Room room = component.addRoom(1, thirdLines);
        Table table = new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t1.png", new Point(150, 150)));
        table.setName("<NAME>");
        table.setImageUrl("https://vaadin.com/vaadin-theme/images/vaadin/vaadin-logo-small.png");
        room.addComponent(table);
        room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t2.png", new Point(150, 150))));
        room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t3.png", new Point(150, 150))));
        room.addComponent(new Table(imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorSales-t4.png", new Point(150, 150))));

        thirdLines = imageToLines.getLines("/org/percepta/mgrankvi/demo/ThirdFloorUtilities.png", new Point(150, 150));
        component.addLines(1, thirdLines);

        // Show it in the middle of the screen
        final VerticalLayout layout = new VerticalLayout();
        layout.setStyleName("demoContentLayout");
        layout.setSizeFull();
        layout.addComponent(component);
        layout.setComponentAlignment(component, Alignment.MIDDLE_CENTER);
        setContent(layout);
    }
}

{'fraction_non_alphanumeric': 0.125114995400184, 'fraction_numerical': 0.018031278748850046, 'mean_word_length': 4.7645811240721105, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7392312', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1745, 'n_words': 278}