text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>stratus</artifactId>
        <groupId>cloud-one</groupId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../../../stratus/pom.xml</relativePath>
    </parent>

    <artifactId>visualizer</artifactId>

    <description>
        TODO
    </description>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-sse</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <c1.applications>we.love.pluto.visualizer.VisualizerApplication</c1.applications>
    </properties>

</project>


text:
package oghamspringbootautoconfigure.it;

import static fr.sii.ogham.testing.util.ResourceUtils.resourceAsString;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertNotNull;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;

import fr.sii.ogham.core.builder.MessagingBuilder;
import fr.sii.ogham.core.builder.context.BuildContext;
import fr.sii.ogham.email.sendgrid.v4.builder.sendgrid.SendGridV4Builder;
import fr.sii.ogham.testing.extension.junit.LoggingTestRule;
import mock.MockApplication;
import oghamspringbootautoconfigure.it.PropertiesConsistencyTest.DecorateBuildContext;
import utils.properties.ConfigurationPropertiesMetadata;
import utils.properties.PropertiesAndValue;
import utils.properties.TrackConfigurationValueBuilder;

/**
 * Test that check if properties defined by Ogham are well-formed and consistent
 * with Spring properties.
 *
 * To do that, there is a script that auto-generates all properties defined by
 * Ogham
 *
 * See .tools/properties-consistency
 *
 *
 * TODO: should automate properties generation before running tests or let developer handle that manually ?
 *
 * @author Aurélien Baudet
 *
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MockApplication.class, webEnvironment = NONE)
@ActiveProfiles("consistency-check")
@Import(DecorateBuildContext.class)
public class PropertiesConsistencyTest {
	private static final Logger LOG = LoggerFactory.getLogger(PropertiesConsistencyTest.class);

	@Rule public final LoggingTestRule loggingRule = new LoggingTestRule();

	@Autowired MessagingBuilder builder;
	@Autowired ApplicationContext context;

	private static final List<String> ignoredProps = asList(
		"ogham.email.implementation-priority.javamail",
		"ogham.email.implementation-priority.sendgrid",
		"ogham.sms.implementation-priority.cloudhopper",
		"ogham.sms.implementation-priority.ovh-http2sms",
		"ogham.sms.implementation-priority.smsglobal-rest",
		"ogham.template.implementation-priority.freemarker",
		"ogham.template.implementation-priority.thymeleaf",
		"ogham.sms.smsglobal.service-provider.auto-conf.skip",
		"mail.from",
		"mail.host",
		"mail.port",
		"mail.smtp.from",
		"mail.smtp.host",
		"mail.smtp.port",
		"greenmail.smtp.port",
		"jsmpp.server.port",
		"wiremock.server.port"
	);

	private static final List<String> ignorePropertiesDefinedInOghamWithoutSpringEquivalentValue = asList(
		"ogham.freemarker.static-method-access.enable",				// used as condition
		"ogham.freemarker.static-method-access.variable-name",		// used directly FreeMarker configuration
		"ogham.email.sendgrid.unit-testing"							// uses directly the Spring SendGrid client instance
	);

	private static final List<String> ignoreValuesDefinedInSpringWihtoutOghamPropertyEquivalentForBuilderClass = asList(
		SendGridV4Builder.class.getSimpleName()						// username and password don't have properties in Ogham for SendGrid v4
	);

	@Test
	public void contextLoads() {
		assertNotNull("context can't load if one property name is malformed or if value is of wrong type", builder);
	}

	@Test
	public void oghamPropertiesShouldBeDefinedInSpringUsingConfigurationPropertiesToBenefitFromRelaxedBinding() throws Exception {
		List<String> missingProperties = new ArrayList<>();
		for (String key : getAllKeysDefinedInOghamCode()) {
			if (!ignored(key) && !existsInSpringConfigurationProperties(key)) {
				missingProperties.add(key);
			}
		}
		missingProperties.stream().sorted().forEach(p -> LOG.warn("property '{}' not defined in Spring", p));
		assertThat("all Ogham properties should be defined in Spring using @ConfigurationProperties in order to benefit from relaxed binding", missingProperties, empty());
	}

	@Test
	public void ensureThatAllPropertiesConfiguredInOghamHaveTheirEquivalentValueConfiguredInSpring() {
		for (PropertiesAndValue pv : getPropertiesAndAssociatedValue()) {
			assertThat("properties '" + pv.getProperties()+ "' defined in Ogham should have their equivalent in Spring", pv.isConsistent(), is(true));
		}
	}

	@TestConfiguration
	public static class DecorateBuildContext {
		@Bean
		public Supplier<MessagingBuilder> messagingBuilderFactory() {
			return () -> new CustomMessagingBuilder(false);
		}
	}

	private List<PropertiesAndValue> getPropertiesAndAssociatedValue() {
		return ((CustomMessagingBuilder) builder).getConfigured()
				.stream()
				.filter(this::skipPropertiesWithoutSpringEquivalent)
				.filter(this::skipValuesWithoutProperties)
				.collect(toList());
	}

	private boolean skipPropertiesWithoutSpringEquivalent(PropertiesAndValue pv) {
		return ignorePropertiesDefinedInOghamWithoutSpringEquivalentValue.stream().noneMatch(pv::containsPropertyKey);
	}

	private boolean skipValuesWithoutProperties(PropertiesAndValue pv) {
		if (pv.isOnlyDefinedInSpring()) {
			return ignoreValuesDefinedInSpringWihtoutOghamPropertyEquivalentForBuilderClass.stream().noneMatch(pv::isForBuilder);
		}
		return true;
	}

	private static class CustomMessagingBuilder extends MessagingBuilder {
		private List<PropertiesAndValue> configured;

		public CustomMessagingBuilder(boolean autoconfigure) {
			super(autoconfigure);
		}

		@Override
		protected BuildContext createBuildContext() {
			return new TrackConfigurationValueBuilder(super.createBuildContext(), getConfigured());
		}

		public List<PropertiesAndValue> getConfigured() {
			if (configured == null) {
				configured = new ArrayList<>();
			}
			return configured;
		}

	}

	private static boolean ignored(String key) {
		return ignoredProps.contains(key);
	}

	private boolean existsInSpringConfigurationProperties(String key) {
		for (ConfigurationPropertiesMetadata springProps : getAllSpringConfigurationProperties()) {
			if (springProps.exists(key)) {
				return true;
			}
		}
		return false;
	}

	private List<ConfigurationPropertiesMetadata> getAllSpringConfigurationProperties() {
		return context.getBeansWithAnnotation(ConfigurationProperties.class)
				.entrySet()
				.stream()
				.map(this::toConfigurationPropertiesBean)
				.filter(Objects::nonNull)
				.collect(toList());
	}

	private static Set<String> getAllKeysDefinedInOghamCode() throws IOException {
		return Arrays.stream(resourceAsString("config/application-consistency-check.properties").split("\r?\n"))
				.filter(PropertiesConsistencyTest::skipComments)
				.filter(PropertiesConsistencyTest::skipEmptyLines)
				.map(PropertiesConsistencyTest::extractKey)
				.collect(toSet());
	}

	private static boolean skipComments(String line) {
		return !line.startsWith("#");
	}

	private static boolean skipEmptyLines(String line) {
		return !line.trim().isEmpty();
	}

	private static String extractKey(String line) {
		return line.replaceFirst("=.+", "");
	}

	private ConfigurationPropertiesMetadata toConfigurationPropertiesBean(Entry<String, Object> entry) {
		ConfigurationProperties annotation = entry.getValue().getClass().getAnnotation(ConfigurationProperties.class);
		if (annotation == null) {
			return null;
		}
		String prefix = annotation.prefix();
		if (prefix == null || prefix.isEmpty()) {
			prefix = annotation.value();
		}
		if (prefix == null) {
			return null;
		}
		return new ConfigurationPropertiesMetadata(entry.getKey(), entry.getValue(), prefix);
	}
}

redpajama_set_name: RedPajamaGithub


text:
Factories and Fabricators have minimal energy cost.

This mod is part of the Dynamic Energy experiment.  Right now in vanilla metal and energy feel kind of the same.

## Indictments

### Most energy is spent to spend metal.

Fabricators and factories are the biggest energy consumers.  Both of these things are already limited by metal usage.  Attacking either resource has exactly the same effect: the player's build rate slows.

The mod drastically reduces fabrication energy, and might remove it if the engine ever supports build rates that are not affected by energy efficiency.

### Demand is constant.

Factories are always on and fabbers are usually fabbing.  Storage is a mostly forgotten vestige of the TA heritage; a player who builds one in competitive play gets asked about the unusual move in interviews.

I expect that this mod will be combined with another that adds a different significant use for energy, and one that is more variable, making energy storage valuable. Or you could play a game where energy is basically irrelevant.

## Development

The generated project includes a `package.json` that lists the dependencies, but you'll need to run `npm install` to download them.

PA will upload **all files** in the mod directory, including `node_modules` and maybe even `.git` - you probably don't want to use this in `server_mods` directly, unless you really like waiting.  The template is set up run to run as a project within a peer directory of `server_mods` - I use `server_mods_dev/mod_name`.  The task `grunt copy:mod` will copy the mod files to `../../server_mods/identifier`, you can change the `modPath` in the Gruntfile if you want to run it from somewhere else.

### Available Tasks

- copy:mod - copy the mod files into server_mods
- proc - Proc: read one or more files from PA and munge into one in the mod.
- default: proc, copy:mod


text:
package webapp

import (
	"context"
	. "gopkg.in/check.v1"
	"net/http"
	"testing"
)

func Test(t *testing.T) {
	TestingT(t)
}

func middlewareWriter(data string) Middleware {
	return func(next ContextHandler) ContextHandler {
		return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) {
			rw.Write([]byte(data))
			next(ctx, rw, req)
		}
	}
}

func middlewareAbort() Middleware {
	return func(_ ContextHandler) ContextHandler {
		return func(ctx context.Context, rw http.ResponseWriter, req *http.Request) {
			rw.Write([]byte("abort"))
		}
	}
}

var finalHandler = func(ctx context.Context, rw http.ResponseWriter, req *http.Request) {
	rw.Write([]byte("H"))
}


text:
<?php
/* @var $this subjectController */
/* @var $data Infosubject */
?>

	<?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:
	<?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('title')); ?>:
	<?php echo CHtml::encode($data->title); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('pid')); ?>:
	<?php echo CHtml::encode($data->pid); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('sort')); ?>:
	<?php echo CHtml::encode($data->sort); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('path')); ?>:
	<?php echo CHtml::encode($data->path); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('son')); ?>:
	<?php echo CHtml::encode($data->son); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('level')); ?>:
	<?php echo CHtml::encode($data->level); ?>

	<?php /*
	<?php echo CHtml::encode($data->getAttributeLabel('litPic')); ?>:
	<?php echo CHtml::encode($data->litPic); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('author_id')); ?>:
	<?php echo CHtml::encode($data->author_id); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('about')); ?>:
	<?php echo CHtml::encode($data->about); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('create_time')); ?>:
	<?php echo CHtml::encode($data->create_time); ?>

	<?php echo CHtml::encode($data->getAttributeLabel('update_time')); ?>:
	<?php echo CHtml::encode($data->update_time); ?>

	*/ ?>


text:
package moe.nightfall.instrumentality.animations

import moe.nightfall.instrumentality.PoseBoneTransform

/**
 * Created on 24/07/15.
 */
trait Animation {
    /**
     * Gets the current transform for a bone.
     * Note that this can be called from any thread, so you shouldn't change state based upon it.
     * The idea is that this is simply a getter.
     *
     * @param boneName The name of a bone.
     * @return None for no transform(optimization), or the transform to apply to the bone.
     */
    def getBoneTransform(boneName: String): Option[PoseBoneTransform]

    /**
     * Update the animation. Will be called from the "main" thread.
     * (Call them on client tick, no need to call more often, though it's ok if you do)
     *
     * @param deltaTime The amount to update by.
     */
    def update(deltaTime: Double): Unit = {}
}


text:
var patio = require("../../lib"),
    helpers = require("helpers.js"),
    express = require("express");

helpers.loadData().then(function () {
    var app = express.createServer();
    patio.getModel("flight").route(app);
    patio.getModel("airport").route(app);
    app.listen(8080, "127.0.0.1");
}, function (err) {
    err.forEach(function (err) {
        console.log(err[1]);
    });
    throw err;
});


text:
require 'spec_helper'

module QingCloud
    module SDK

        RSpec.describe IaaS::Connector do

            it 'can connect' do

                c = IaaS::Connector.init_with_config_file
            end

        end

    end
end


text:
<?php

namespace FOS\RestBundle\EventListener;

use Symfony\Component\HttpKernel\Event\FilterControllerEvent,
    Symfony\Component\HttpKernel\HttpKernelInterface,
    Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * This listener handles various setup tasks related to the query fetcher
 *
 * Setting the controller callable on the query fetcher
 * Setting the query fetcher as a request attribute
 *
 * @author Lukas Kahwe Smith <smith@pooteeweet.org>
 */
class ParamFetcherListener
{
    /**
     * @var ContainerInterface
     */
    private $container;

    private $setParamsAsAttributes;

    /**
     * Constructor.
     *
     * @param   ContainerInterface $container container
     */
    public function __construct(ContainerInterface $container, $setParamsAsAttributes = false)
    {
        $this->container = $container;
        $this->setParamsAsAttributes = $setParamsAsAttributes;
    }

    /**
     * Core controller handler
     *
     * @param   FilterControllerEvent   $event    The event
     */
    public function onKernelController(FilterControllerEvent $event)
    {
        $request = $event->getRequest();
        $paramFetcher = $this->container->get('fos_rest.request.param_fetcher');

        $paramFetcher->setController($event->getController());
        $request->attributes->set('paramFetcher', $paramFetcher);

        if ($this->setParamsAsAttributes) {
            $params = $paramFetcher->all();
            foreach ($params as $name => $param) {
                if ($request->attributes->has($name)) {
                    $msg = sprintf("ParamFetcher parameter conflicts with a path parameter '$name' for route '%s'", $request->attributes->get('_route'));
                    throw new \InvalidArgumentException($msg);
                }

                $request->attributes->set($name, $param);
            }
        }
    }
}


text:
package com.bdl.config.annotation.processor;

import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;

import com.bdl.annotation.processing.model.Visibility;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import javax.annotation.processing.Messager;
import javax.tools.Diagnostic;

/**
 * A class to hold the found configurable metadata in a tree structure.
 *
 * @author Ben Leitner
 */
class ConfigPackageTree {

  /** Interface for classes that visit the nodes and act on the configs. */
  interface Visitor<T> {
    /** Called upon visiting a node. */
    Set<T> visit(Set<T> childOutputs, String packageName, Set<ConfigMetadata> configs);
  }

  private final Node root;

  ConfigPackageTree() {
    this.root = new Node("");
  }

  void addConfig(Messager messager, ConfigMetadata config) {
    root.addConfigToPackage(messager, config.field().containingClass().packageName() + ".", config);
  }

  void pullPublicAndPrivateConfigsUp() {
    Node node = getCommonNode();
    node.moveNonPackageConfigsTo(node);
  }

  private Node getCommonNode() {
    Node common = root;
    while (common.children.size() == 1) {
      common = Iterables.getOnlyElement(common.children.values());
    }
    return common;
  }

  <T> void visit(Visitor<T> visitor) {
    root.visit(visitor);
  }

  private static class Node {
    private final String packageName;
    private final Map<String, Node> children;
    private final Set<ConfigMetadata> configs;

    private Node(String packageName) {
      this.packageName = packageName;
      children = Maps.newHashMap();
      configs = Sets.newHashSet();
    }

    private Node getChild(String packagePart) {
      Node child = children.get(packagePart);
      if (child == null) {
        String childPackage = PackageNameUtil.append(packageName, packagePart);
        child = new Node(childPackage);
        children.put(packagePart, child);
      }
      return child;
    }

    private void addConfigToPackage(
        Messager messager, String packageNameTail, ConfigMetadata config) {
      if (packageNameTail.isEmpty()) {
        messager.printMessage(
            Diagnostic.Kind.NOTE,
            String.format(
                "Adding %s config %s to package %s.",
                config.field().modifiers().visibility(), config.fullyQualifiedPathName(), this.packageName));
        configs.add(config);
        return;
      }
      String[] parts = packageNameTail.split("\\.", 2);
      getChild(parts[0]).addConfigToPackage(messager, parts[1], config);
    }

    /**
     * Moves any public or private configs from {@code this} node to the given node.
     *
     * @return {@code true} if there are no more configs in this package or any subpackage,
     *     indicating that this node can be removed from its parent.
     */
    private boolean moveNonPackageConfigsTo(Node node) {
      boolean canRemoveMe = true;
      Set<String> childrenToRemove = Sets.newHashSet();
      for (Map.Entry<String, Node> entry : children.entrySet()) {
        if (entry.getValue().moveNonPackageConfigsTo(node)) {
          childrenToRemove.add(entry.getKey());
        } else {
          canRemoveMe = false;
        }
      }
      for (String childToRemove : childrenToRemove) {
        children.remove(childToRemove);
      }
      if (this == node) {
        return false;
      }
      for (Iterator<ConfigMetadata> it = configs.iterator(); it.hasNext(); ) {
        ConfigMetadata config = it.next();
        if (config.field().modifiers().visibility() == Visibility.PUBLIC
            || config.field().modifiers().visibility() == Visibility.PRIVATE) {
          node.configs.add(config);
          it.remove();
        }
      }

      return canRemoveMe && configs.isEmpty();
    }

    private <T> Set<T> visit(Visitor<T> visitor) {
      Set<T> childOutputs = Sets.newHashSet();
      for (Map.Entry<String, Node> entry : children.entrySet()) {
        childOutputs.addAll(entry.getValue().visit(visitor));
      }
      return visitor.visit(childOutputs, packageName, configs);
    }
  }
}


text:
package de.tum.in.www1.artemis.service;

import static org.assertj.core.api.Assertions.assertThat;

import java.time.ZonedDateTime;
import java.util.List;
import java.util.Optional;
import java.util.Set;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;

import de.tum.in.www1.artemis.AbstractSpringIntegrationBambooBitbucketJiraTest;
import de.tum.in.www1.artemis.domain.Course;
import de.tum.in.www1.artemis.domain.User;
import de.tum.in.www1.artemis.domain.enumeration.InitializationState;
import de.tum.in.www1.artemis.domain.exam.Exam;
import de.tum.in.www1.artemis.domain.exam.ExerciseGroup;
import de.tum.in.www1.artemis.domain.exam.StudentExam;
import de.tum.in.www1.artemis.domain.participation.StudentParticipation;
import de.tum.in.www1.artemis.domain.quiz.*;
import de.tum.in.www1.artemis.repository.*;
import de.tum.in.www1.artemis.service.exam.StudentExamService;
import de.tum.in.www1.artemis.util.ModelFactory;

public class ExamQuizServiceTest extends AbstractSpringIntegrationBambooBitbucketJiraTest {

    @Autowired
    private StudentExamService studentExamService;

    @Autowired
    private ExamRepository examRepository;

    @Autowired
    private StudentParticipationRepository studentParticipationRepository;

    @Autowired
    private QuizSubmissionRepository quizSubmissionRepository;

    @Autowired
    private ExerciseGroupRepository exerciseGroupRepository;

    @Autowired
    private QuizExerciseService quizExerciseService;

    @Autowired
    private UserRepository userRepository;

    @Autowired
    private QuizExerciseRepository quizExerciseRepository;

    @Autowired
    private StudentExamRepository studentExamRepository;

    private QuizExercise quizExercise;

    private Course course;

    private Exam exam;

    private ExerciseGroup exerciseGroup;

    private List<User> users;

    private final int numberOfParticipants = 12;

    @BeforeEach
    public void init() {
        users = database.addUsers(numberOfParticipants, 1, 0, 1);
        course = database.addEmptyCourse();
        exam = database.addExamWithExerciseGroup(course, true);
        exam.setStartDate(ZonedDateTime.now().minusHours(1));
        exam.setEndDate(ZonedDateTime.now().plusHours(1));
        exam.setNumberOfExercisesInExam(1);
        exerciseGroup = exam.getExerciseGroups().get(0);

        quizExercise = database.createQuizForExam(exerciseGroup);
        exerciseGroup.addExercise(quizExercise);

        // Add an instructor who is not in the course
        userRepository.save(ModelFactory.generateActivatedUser("instructor6"));
    }

    @AfterEach
    public void tearDown() {
        database.resetDatabase();
    }

    @Test
    @WithMockUser(username = "student1", roles = "USER")
    public void evaluateQuiz_asTutor_PreAuth_forbidden() throws Exception {
        evaluateQuiz_authorization_forbidden();
    }

    @Test
    @WithMockUser(username = "tutor1", roles = "TA")
    public void evaluateQuiz_asStudent_PreAuth_forbidden() throws Exception {
        evaluateQuiz_authorization_forbidden();
    }

    @Test
    @WithMockUser(username = "instructor6", roles = "INSTRUCTOR")
    public void evaluateQuiz_asInstructorNotInCourse_forbidden() throws Exception {
        evaluateQuiz_authorization_forbidden();
    }

    @Test
    @WithMockUser(username = "student1", roles = "USER")
    public void evaluateQuiz_authorization_forbidden() throws Exception {
        exam = examRepository.save(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);

        request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises", Optional.empty(), Integer.class,
                HttpStatus.FORBIDDEN);
    }

    @Test
    @WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
    public void evaluateQuiz_notOver_forbidden() throws Exception {
        exam = examRepository.save(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);

        request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises", Optional.empty(), Integer.class,
                HttpStatus.FORBIDDEN);
    }

    @Test
    @WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
    public void evaluateQuiz() throws Exception {
        for (int i = 0; i < numberOfParticipants; i++) {
            exam.addRegisteredUser(users.get(i));
        }

        exam = examRepository.save(exam);
        exerciseGroup.setExam(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        exam.setExerciseGroups(List.of(exerciseGroup));
        quizExercise.setExerciseGroup(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);
        exerciseGroup.setExercises(Set.of(quizExercise));

        assertThat(studentExamRepository.generateStudentExams(exam)).hasSize(numberOfParticipants);
        assertThat(studentExamRepository.findByExamId(exam.getId())).hasSize(numberOfParticipants);
        assertThat(studentExamService.startExercises(exam.getId())).isEqualTo(numberOfParticipants);

        for (int i = 0; i < numberOfParticipants; i++) {
            database.changeUser("student" + (i + 1));
            QuizSubmission quizSubmission = database.generateSubmissionForThreeQuestions(quizExercise, i + 1, true, ZonedDateTime.now());
            request.put("/api/exercises/" + quizExercise.getId() + "/submissions/exam", quizSubmission, HttpStatus.OK);
        }

        database.changeUser("instructor1");
        // All exams should be over before evaluation
        for (StudentExam studentExam : studentExamRepository.findByExamId(exam.getId())) {
            studentExam.setWorkingTime(0);
            studentExamRepository.save(studentExam);
        }

        Integer numberOfEvaluatedExercises = request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises",
                Optional.empty(), Integer.class, HttpStatus.OK);

        assertThat(numberOfEvaluatedExercises).isEqualTo(1);

        checkStatistics(quizExercise);

        studentExamRepository.deleteAll();

        // Make sure delete also works if so many objects have been created before
        request.delete("/api/courses/" + course.getId() + "/exams/" + exam.getId(), HttpStatus.OK);

        userRepository.deleteAll();
    }

    @Test
    @WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
    public void evaluateQuizWithNoSubmissions() throws Exception {
        for (int i = 0; i < numberOfParticipants; i++) {
            exam.addRegisteredUser(users.get(i));
        }

        exam = examRepository.save(exam);
        exerciseGroup.setExam(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        exam.setExerciseGroups(List.of(exerciseGroup));
        quizExercise.setExerciseGroup(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);
        exerciseGroup.setExercises(Set.of(quizExercise));

        assertThat(studentExamRepository.generateStudentExams(exam)).hasSize(numberOfParticipants);
        assertThat(studentExamRepository.findByExamId(exam.getId())).hasSize(numberOfParticipants);

        // add participations with no submissions
        for (int i = 0; i < numberOfParticipants; i++) {
            final var user = database.getUserByLogin("student" + (i + 1));
            var participation = new StudentParticipation();
            participation.setExercise(quizExercise);
            participation.setParticipant(user);
            participation.setInitializationDate(ZonedDateTime.now());
            participation.setInitializationState(InitializationState.INITIALIZED);
            studentParticipationRepository.save(participation);
        }

        database.changeUser("instructor1");
        // All exams should be over before evaluation
        for (StudentExam studentExam : studentExamRepository.findByExamId(exam.getId())) {
            studentExam.setWorkingTime(0);
            studentExamRepository.save(studentExam);
        }

        Integer numberOfEvaluatedExercises = request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises",
                Optional.empty(), Integer.class, HttpStatus.OK);

        assertThat(numberOfEvaluatedExercises).isEqualTo(1);

        studentExamRepository.deleteAll();

        // Make sure delete also works if so many objects have been created before
        request.delete("/api/courses/" + course.getId() + "/exams/" + exam.getId(), HttpStatus.OK);

        userRepository.deleteAll();
    }

    @Test
    @WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
    public void evaluateQuizWithMultipleSubmissions() throws Exception {
        for (int i = 0; i < numberOfParticipants; i++) {
            exam.addRegisteredUser(users.get(i));
        }

        exam = examRepository.save(exam);
        exerciseGroup.setExam(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        exam.setExerciseGroups(List.of(exerciseGroup));
        quizExercise.setExerciseGroup(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);
        exerciseGroup.setExercises(Set.of(quizExercise));

        assertThat(studentExamRepository.generateStudentExams(exam)).hasSize(numberOfParticipants);
        assertThat(studentExamRepository.findByExamId(exam.getId())).hasSize(numberOfParticipants);
        assertThat(studentExamService.startExercises(exam.getId())).isEqualTo(numberOfParticipants);

        for (int i = 0; i < numberOfParticipants; i++) {
            final var user = database.getUserByLogin("student" + (i + 1));
            database.changeUser(user.getLogin());
            QuizSubmission quizSubmission = database.generateSubmissionForThreeQuestions(quizExercise, i + 1, true, ZonedDateTime.now());
            request.put("/api/exercises/" + quizExercise.getId() + "/submissions/exam", quizSubmission, HttpStatus.OK);

            // add another submission manually to trigger multiple submission branch of evaluateQuizSubmission
            final var studentParticipation = studentParticipationRepository.findWithEagerLegalSubmissionsByExerciseIdAndStudentLogin(quizExercise.getId(), user.getLogin()).get();
            QuizSubmission quizSubmission2 = database.generateSubmissionForThreeQuestions(quizExercise, i + 1, true, ZonedDateTime.now());
            quizSubmission2.setParticipation(studentParticipation);
            quizSubmissionRepository.save(quizSubmission2);
        }

        database.changeUser("instructor1");
        // All exams should be over before evaluation
        for (StudentExam studentExam : studentExamRepository.findByExamId(exam.getId())) {
            studentExam.setWorkingTime(0);
            studentExamRepository.save(studentExam);
        }

        Integer numberOfEvaluatedExercises = request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises",
                Optional.empty(), Integer.class, HttpStatus.OK);

        assertThat(numberOfEvaluatedExercises).isEqualTo(1);

        checkStatistics(quizExercise);

        studentExamRepository.deleteAll();

        // Make sure delete also works if so many objects have been created before
        request.delete("/api/courses/" + course.getId() + "/exams/" + exam.getId(), HttpStatus.OK);

        userRepository.deleteAll();
    }

    @Test
    @WithMockUser(username = "instructor1", roles = "INSTRUCTOR")
    public void evaluateQuiz_twice() throws Exception {
        for (int i = 0; i < numberOfParticipants; i++) {
            exam.addRegisteredUser(users.get(i));
        }

        exam = examRepository.save(exam);
        exerciseGroup.setExam(exam);
        exerciseGroup = exerciseGroupRepository.save(exerciseGroup);
        exam.setExerciseGroups(List.of(exerciseGroup));
        quizExercise.setExerciseGroup(exerciseGroup);
        quizExercise = quizExerciseService.save(quizExercise);
        exerciseGroup.setExercises(Set.of(quizExercise));

        assertThat(studentExamRepository.generateStudentExams(exam)).hasSize(numberOfParticipants);
        assertThat(studentExamRepository.findByExamId(exam.getId())).hasSize(numberOfParticipants);
        assertThat(studentExamService.startExercises(exam.getId())).isEqualTo(numberOfParticipants);

        for (int i = 0; i < numberOfParticipants; i++) {
            database.changeUser("student" + (i + 1));
            QuizSubmission quizSubmission = database.generateSubmissionForThreeQuestions(quizExercise, i + 1, true, ZonedDateTime.now());
            request.put("/api/exercises/" + quizExercise.getId() + "/submissions/exam", quizSubmission, HttpStatus.OK);
        }

        database.changeUser("instructor1");
        // All exams should be over before evaluation
        for (StudentExam studentExam : studentExamRepository.findByExamId(exam.getId())) {
            studentExam.setWorkingTime(0);
            studentExamRepository.save(studentExam);
        }

        Integer numberOfEvaluatedExercises = request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises",
                Optional.empty(), Integer.class, HttpStatus.OK);

        assertThat(numberOfEvaluatedExercises).isEqualTo(1);

        // Evaluate quiz twice
        numberOfEvaluatedExercises = request.postWithResponseBody("/api/courses/" + course.getId() + "/exams/" + exam.getId() + "/student-exams/evaluate-quiz-exercises",
                Optional.empty(), Integer.class, HttpStatus.OK);

        assertThat(numberOfEvaluatedExercises).isEqualTo(1);

        checkStatistics(quizExercise);

        studentExamRepository.deleteAll();

        // Make sure delete also works if so many objects have been created before
        request.delete("/api/courses/" + course.getId() + "/exams/" + exam.getId(), HttpStatus.OK);

        userRepository.deleteAll();
    }

    private void checkStatistics(QuizExercise quizExercise) {
        QuizExercise quizExerciseWithStatistic = quizExerciseRepository.findOneWithQuestionsAndStatistics(quizExercise.getId());
        assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsUnrated()).isZero();
        assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getParticipantsRated()).isEqualTo(numberOfParticipants);

        int questionScore = quizExerciseWithStatistic.getQuizQuestions().stream().map(QuizQuestion::getPoints).reduce(0, Integer::sum);
        assertThat(quizExerciseWithStatistic.getMaxPoints()).isEqualTo(questionScore);
        assertThat(quizExerciseWithStatistic.getQuizPointStatistic().getPointCounters()).hasSize(questionScore + 1);
        // check general statistics
        for (var pointCounter : quizExerciseWithStatistic.getQuizPointStatistic().getPointCounters()) {
            if (pointCounter.getPoints() == 0.0) {
                assertThat(pointCounter.getRatedCounter()).isEqualTo(Math.round(numberOfParticipants / 3.0));
                assertThat(pointCounter.getUnRatedCounter()).isZero();
            }
            else if (pointCounter.getPoints() == 3.0 || pointCounter.getPoints() == 4.0 || pointCounter.getPoints() == 6.0) {
                assertThat(pointCounter.getRatedCounter()).isEqualTo(Math.round(numberOfParticipants / 6.0));
                assertThat(pointCounter.getUnRatedCounter()).isZero();
            }
            else if (pointCounter.getPoints() == 7.0 || pointCounter.getPoints() == 9.0) {
                assertThat(pointCounter.getRatedCounter()).isEqualTo(Math.round(numberOfParticipants / 12.0));
                assertThat(pointCounter.getUnRatedCounter()).isZero();
            }
            else {
                assertThat(pointCounter.getRatedCounter()).isZero();
                assertThat(pointCounter.getUnRatedCounter()).isZero();
            }
        }
        // check statistic for each question
        for (var question : quizExerciseWithStatistic.getQuizQuestions()) {
            if (question instanceof MultipleChoiceQuestion) {
                assertThat(question.getQuizQuestionStatistic().getRatedCorrectCounter()).isEqualTo(Math.round(numberOfParticipants / 2.0));
            }
            else if (question instanceof DragAndDropQuestion) {
                assertThat(question.getQuizQuestionStatistic().getRatedCorrectCounter()).isEqualTo(Math.round(numberOfParticipants / 3.0));
            }
            else {
                assertThat(question.getQuizQuestionStatistic().getRatedCorrectCounter()).isEqualTo(Math.round(numberOfParticipants / 4.0));
            }
            assertThat(question.getQuizQuestionStatistic().getUnRatedCorrectCounter()).isZero();
            assertThat(question.getQuizQuestionStatistic().getParticipantsRated()).isEqualTo(numberOfParticipants);
            assertThat(question.getQuizQuestionStatistic().getParticipantsUnrated()).isZero();
        }
    }
}


text:
package org.workcraft.plugins.circuit.verilog;

import java.util.List;
import java.util.Map;
import java.util.Set;

public class Module {
    public final String name;
    public final List<Port> ports;
    public final List<Assign> assigns;
    public final List<Instance> instances;
    public final Map<String, Boolean> signalStates;
    public final Set<List<Instance>> groups;

    public Module(String name, List<Port> ports, List<Assign> assigns, List<Instance> instances, Map<String, Boolean> signalStates, Set<List<Instance>> groups) {
        this.name = name;
        this.ports = ports;
        this.assigns = assigns;
        this.instances = instances;
        this.signalStates = signalStates;
        this.groups = groups;
    }

    public boolean isEmpty() {
        return assigns.isEmpty() && instances.isEmpty();
    }

}


text:
@interface TestCollectionViewCell : LEBaseCollectionViewCell
@end
@implementation TestCollectionViewCell{
    UILabel *label;
}
-(void) leAdditionalInits{
    label=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self Anchor:LEAnchorInsideCenter Offset:CGPointZero CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:nil FontSize:LELayoutFontSize10 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentCenter]];
    self.backgroundView=[LEUIFramework leGetImageViewWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self EdgeInsects:UIEdgeInsetsZero] Image:[LEColorMask leImageStrechedFromSizeOne]];
    self.selectedBackgroundView=[LEUIFramework leGetImageViewWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self EdgeInsects:UIEdgeInsetsZero] Image:[LEColorTest leImageStrechedFromSizeOne]];
}
-(void) leSetData:(id)data IndexPath:(NSIndexPath *)path{
    [label leSetText:[NSString stringWithFormat:@"%@",data]];
    [self setBackgroundColor:[UIColor colorWithRed:1-0.1-0.03*path.row green:1-0.1-0.025*path.row blue:1-0.1-0.015*path.row alpha:1.0]];
}
@end
@interface TestCollectionReusableView : LEBaseCollectionReusableView
@end
@implementation TestCollectionReusableView{
    UILabel *label;
}
-(void) leAdditionalInits{
    //        [self setBackgroundColor:LEColorTest];
    label=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self Anchor:LEAnchorInsideLeftCenter Offset:CGPointMake(LELayoutSideSpace16, 0) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:nil FontSize:LELayoutFontSize10 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentCenter]];
}
-(void) leSetData:(id) data Kind:(NSString *) kind IndexPath:(NSIndexPath *) path{
    [label leSetText:[data objectForKey:kind]];
}
@end
@interface TestCollectionView : LEBaseCollectionViewWithRefresh
@end
@implementation TestCollectionView
@end

@interface TestLEbaseTableViewCell : LEBaseTableViewCell
@end
@implementation TestLEbaseTableViewCell{
    UILabel *curLabel;
}
-(void) leAdditionalInits{
    [self leAddBottomSplitWithColor:LEColorSplit Offset:CGPointZero Width:LESCREEN_WIDTH];
    curLabel=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self Anchor:LEAnchorInsideLeftCenter Offset:CGPointMake(LELayoutSideSpace, 0) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:nil FontSize:0 Font:LEBoldFont(LELayoutFontSize14) Width:LESCREEN_WIDTH-LELayoutSideSpace*2 Height:0 Color:LEColorTextBlack Line:0 Alignment:NSTextAlignmentLeft]];//Line=0表示可以换行
}
-(void) leSetData:(id)data IndexPath:(NSIndexPath *)path{
    [super leSetData:data IndexPath:path];
    [curLabel leSetText:[NSString stringWithFormat:@"%zd- %@",path.row+1,data]];//设置文字需使用le开头的方法,类似的有leSetSize、leSetFrame、leSetOffset
    [curLabel leSetLineSpace:LELayoutTextLineSpace];//设置行间距
    [self leSetCellHeight:curLabel.bounds.size.height+LELayoutSideSpace*2];//文字刷新后即可重新设置Cell的高度了
}
@end

@interface TestExcelViewCell : LEExcelViewTableViewCell
@end
@implementation TestExcelViewCell{
    UILabel *labelLeft;
    UILabel *labelRight;
}
-(void) leAdditionalInits{
    [self.leImmovableViewContainer setBackgroundColor:[UIColor colorWithRed:0.8947 green:0.527 blue:0.3107 alpha:1.0]];
    [self.leMovableViewContainer setBackgroundColor:[UIColor colorWithRed:0.6922 green:0.4729 blue:0.6923 alpha:1.0]];
    [LEUIFramework leGetImageViewWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leMovableViewContainer EdgeInsects:UIEdgeInsetsZero] Image:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"lewave"]];
    [self leAddBottomSplitWithColor:LEColorRed Offset:CGPointZero Width:self.bounds.size.width];
    labelLeft=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leImmovableViewContainer Anchor:LEAnchorInsideCenter Offset:CGPointZero CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentCenter]];
    labelRight=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leMovableViewContainer Anchor:LEAnchorInsideLeftCenter Offset:CGPointMake(LELayoutSideSpace20, 0) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentLeft]];
}
-(void) leSetData:(id)data IndexPath:(NSIndexPath *)path{
    [super leSetData:data IndexPath:path];
    [labelLeft leSetText:[NSString stringWithFormat:@"第%zd行",path.row]];
    [labelRight leSetText:[NSString stringWithFormat:@"第%zd行右侧可移动的内容,我是第%zd行内容",path.row,path.row]];
}
@end

@interface TestExcelViewTabbar : LEExcelViewTabbar
@end
@implementation TestExcelViewTabbar
-(void) leAdditionalInits{
    [super leAdditionalInits];
    [self.leImmovableViewContainer setBackgroundColor:[UIColor colorWithRed:0.9991 green:0.5522 blue:0.9683 alpha:1.0]];
    [self.leMovableViewContainer setBackgroundColor:[UIColor colorWithRed:0.4642 green:0.6434 blue:0.9982 alpha:1.0]];
    [LEUIFramework leGetImageViewWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leMovableViewContainer EdgeInsects:UIEdgeInsetsZero] Image:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"lewave"]];
    [LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leImmovableViewContainer Anchor:LEAnchorInsideCenter Offset:CGPointZero CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"左侧行数" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentCenter]];
    [LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self.leMovableViewContainer Anchor:LEAnchorInsideLeftCenter Offset:CGPointMake(LELayoutSideSpace20, 0) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"右侧内容1        右侧内容2" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorTextBlack Line:1 Alignment:NSTextAlignmentLeft]];
}
@end

@interface TestDisplcayCell : LEBaseTableViewDisplayCell
@end
@implementation TestDisplcayCell{
    UILabel *curLabel;
}
-(void) leAdditionalInits{
    curLabel=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:self Anchor:LEAnchorInsideLeftCenter Offset:CGPointMake(LELayoutSideSpace, 0) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:nil FontSize:0 Font:LEBoldFont(LELayoutFontSize14) Width:LESCREEN_WIDTH-LELayoutSideSpace*2 Height:0 Color:LEColorTextBlack Line:0 Alignment:NSTextAlignmentLeft]];//Line=0表示可以换行
    [self leAddBottomSplitWithColor:LEColorSplit Offset:CGPointZero Width:LESCREEN_WIDTH];
}
-(void) leSetData:(id)data{
    [super leSetData:data];
    [curLabel leSetText:[NSString stringWithFormat:@"%@",data]];//设置文字需使用le开头的方法,类似的有leSetSize、leSetFrame、leSetOffset
    [curLabel leSetLineSpace:LELayoutTextLineSpace];//设置行间距
    [self leSetCellHeight:curLabel.bounds.size.height+LELayoutSideSpace*2];//文字刷新后即可重新设置Cell的高度了
}
@end

@interface TestVCPage : LEBaseView
@end
@implementation TestVCPage
{
    NSTimer *curTimer;
    UITapGestureRecognizer *tapEvent;
}
-(void) leAdditionalInits{
    [self.leViewContainer setBackgroundColor:[UIColor redColor]];
    tapEvent=[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTap)];
    [self.leViewContainer addGestureRecognizer:tapEvent];
    //    [self.leViewContainer leAddTapEventWithSEL:@selector(onTap) Target:self];
    //    curTimer=[NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(counter) userInfo:nil repeats:YES];
}
-(void)counter{
    LELogObject([NSDate new])
}
-(void) onTap{
    [self.leCurrentViewController lePopSelfAnimated];
    //    [self leReleaseView];
    //    [self removeFromSuperview];
}
-(void) dealloc{

    LELogFunc
}
-(void) leReleaseView{
    [tapEvent removeTarget:self action:@selector(onTap)];
    tapEvent=nil;
    [super leReleaseView];
    LELogFunc
}
@end
@interface TestVC : LEBaseViewController
@end
@implementation TestVC{
    TestVCPage *page;
}

-(void) leAdditionalInits{
    page=[[TestVCPage alloc] initWithViewController:self];
}

-(void) dealloc{
    [page leReleaseView];
    page=nil;
    LELogFunc
}
@end

@interface ViewControllerPage : LEBaseView<LETableViewDataSourceDelegate,LETableViewCellSelectionDelegate,LELineChartDelegate,LEBarChartDelegate,LECollectionViewDataSourceDelegate,LECollectionViewCellSelectionDelegate,LENavigationDelegate>
@end
@implementation ViewControllerPage{
    LEBaseNavigation *navigationView;
    UIButton *autoLayoutTopButton;
    int autoLayoutCounter;
    UILabel *autoLayoutLabel;
    UILabel *autoLayoutMultiLineLabel;

    //测试所需临时变量
    LEBaseTableViewWithRefresh *curTableView;
    LEBaseTableViewV2WithRefresh *curTableViewV2;
    UILabel *labelBarChart;
    UILabel *labelLineChart;
    LEWaveProgressView *curWaveProgressView;
    LECurveProgressView *curveProgress;
    LEExcelView *curExcelView;
    //
    LEBaseCollectionViewWithRefresh *collectionView;
    LEVerticalFlowLayout *flowLayout;
    //
    BOOL isLeft;
    BOOL isRight;
}
-(void) leAdditionalInits{
    navigationView=[[LEBaseNavigation alloc] initWithSuperViewAsDelegate:self Title:@"LEFrameworks 测试"];
    [navigationView leSetLeftNavigationItemWith:nil Image:nil Color:nil];
    UISwitch *swi=[UISwitch new].leSuperView(navigationView).leAnchor(LEAnchorInsideRightCenter).leOffset(CGPointMake(-LELayoutSideSpace, 0)).leAutoLayout.leType;
    [swi addTarget:self action:@selector(onSwitch:) forControlEvents:UIControlEventTouchUpInside];
    [swi leSetSize:swi.bounds.size];
    //    [navigationView leSetLeftNavigationItemWith:@"取消" Image:nil Color:nil];
    //    [navigationView leSetRightNavigationItemWith:@"确定" Image:nil];
    //    [navigationView.leTitleViewContainer leAddTapEventWithSEL:@selector(onTestTitle) Target:self];
    //    [self onTestLEBaseTableView];
    [self onTestLEBaseTableViewV2];
    //    [self onTestAutoLayout];
    //    [self onTestCollectionView];

//    [self.leCurrentViewController leThroughNavigationAnimatedPush:[[LERecordVideo alloc] initWithDelegate:nil]];
    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(onTest) userInfo:nil repeats:NO];
}
-(void) onTest{
    [self.leCurrentViewController leThroughNavigationAnimatedPush:[LeaderBoard new]];
}
-(void) onSwitch:(UISwitch *) swi{
    //    [self.leCurrentViewController leThroughNavigationAnimatedPush:[TestVC new]];
    //    if(YES)return;
    if(swi.isOn){
        if(curTableViewV2){
            [curTableViewV2 removeFromSuperview];
            [self onTestLEBaseTableView];
        }
    }else{
        if(curTableView){
            [curTableView removeFromSuperview];
            [self onTestLEBaseTableViewV2];
        }
    }
}
-(void) onTestTitle{
    NSString *str=@"LE Frame works";
    NSArray *array=@[@"爱上",@"阿斯达",@"啊啊撒打算的",@"啊",@"爱上谁打扫打扫",@"阿诗丹顿"];
    for (NSInteger i=0; i<rand()%6; i++) {
        str=[NSString stringWithFormat:@"Index:%zd - %@",i,[str stringByAppendingString:[array objectAtIndex:i]]];
    }
    [navigationView leSetNavigationTitle:str];
}
-(void) leNavigationLeftButtonTapped{
    isLeft=!isLeft;
    [navigationView leSetRightNavigationItemWith:isLeft?nil: @"测试" Image:nil];
}
-(void) leNavigationRightButtonTapped{
    isRight=!isRight;
    [navigationView leSetLeftNavigationItemWith:isRight?@"阿达达":nil Image:isRight?[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_emoji_smileface"]:nil Color:nil];
}
-(void) leNavigationNotifyTitleViewContainerWidth:(int)width{
    //    LELogInt(width);
}
//===================测试 LEBaseTableView TableView的封装
-(void) onTestLEBaseTableViewV2{
    curTableViewV2=[[LEBaseTableViewV2WithRefresh alloc] initWithSettings:[[LETableViewSettings alloc] initWithSuperViewContainer:self ParentView:self.leViewBelowCustomizedNavigation TableViewCell:@"TestDisplcayCell" EmptyTableViewCell:nil GetDataDelegate:self TableViewCellSelectionDelegate:self AutoRefresh:YES]];
    //        [curTableViewV2 leSetBottomRefresh:NO];
}
-(void) onTestLEBaseTableView{
    curTableView=[[LEBaseTableViewWithRefresh alloc] initWithSettings:[[LETableViewSettings alloc] initWithSuperViewContainer:self ParentView:self.leViewBelowCustomizedNavigation TableViewCell:@"TestLEbaseTableViewCell" EmptyTableViewCell:nil GetDataDelegate:self TableViewCellSelectionDelegate:self AutoRefresh:YES]];
    //    [curTableView leSetBottomRefresh:NO];
}
-(void) leOnLoadMore{
    NSMutableArray *muta=[[NSMutableArray alloc] init];
    NSString *tmp=@"这是一段测试用字符串,根据随机获得的数字对其进行截取,并作为列表Cell的内容展示";
    for (NSInteger i=0; i<100+random()%100; i++) {
        [muta addObject:[NSString stringWithFormat:@"Index %zd : %@",i,[tmp substringToIndex:rand()%tmp.length]]];
    }
    if(curTableView){
        [curTableView leOnLoadedMoreWithData:muta];
    }
    if(curTableViewV2){
        [curTableViewV2 leOnLoadedMoreWithData:muta];
    }
}
-(void) leOnRefreshData{
    NSMutableArray *muta=[[NSMutableArray alloc] init];

    [muta addObject:@"LEFrameworks测试 之 LESegmentView"];
    [muta addObject:@"LEFrameworks测试 之 LEWebView"];
    [muta addObject:@"LEFrameworks测试 之 圆弧进度条 LECurveProgressView"];
    [muta addObject:@"LEFrameworks测试 之 折线走势图 LELineChart"];
    [muta addObject:@"LEFrameworks测试 之 柱状走势图 LEBarChart"];
    [muta addObject:@"LEFrameworks测试 之 波浪滚动上涨下落进度球 LEWaveProgressView"];
    [muta addObject:@"LEFrameworks测试 之 Excel表格化查阅框架 LEExcelView"];
    [muta addObject:@"LEFrameworks测试 之 自动排版 LEUIFramework"];
    [muta addObject:@"LEFrameworks测试 之 图片多选 LEMultiImagePicker"];
    [muta addObject:@"LEFrameworks测试 之 CollectionView封装 LEBaseCollectionViewWithRefresh"];
    [muta addObject:@"LEFrameworks测试 之 自动排版V2 LEUIViewFrameWorksExtra"];
    [muta addObject:@"LEFrameworks测试 之 LERecordVideo"];
    if(curTableView){
        [curTableView leOnRefreshedWithData:muta];
    }
    if(curTableViewV2){
        [curTableViewV2 leOnRefreshedWithData:muta];
    }
}
-(void) leOnTableViewCellSelectedWithInfo:(NSDictionary *)info{
    NSIndexPath *index=[info objectForKey:LEKeyOfIndexPath];
    switch (index.row) {
        case 0:
            [self onTestSegmentView];
            break;
        case 1:
            [self onTestWebview];
            break;
        case 2:
            [self onTestCurveProgressView];
            break;
        case 3:
            [self onTestLELineChart];
            break;
        case 4:
            [self onTestBarChart];
            break;
        case 5:
            [self onTestWaveProgressView];
            break;
        case 6:
            [self onTestExcelView];
            break;
        case 7:
            [self onTestAutoLayout];
            break;
        case 8:
        {
            LEMultiImagePicker *vc=[[LEMultiImagePicker alloc] initWithImagePickerDelegate:nil RootVC:self.leCurrentViewController];
            [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 9:
            [self onTestCollectionView];
            break;
        case 10:
            [self onTestAutoLayoutV2];
        case 11:
        {
            [self.leCurrentViewController.navigationController pushViewController:[[LERecordVideo alloc] initWithDelegate:nil] animated:YES];
        }

            break;
        default:
            break;
    }
}
//===================测试CollectionView
-(void) onTestCollectionView{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[LEColorBlue leImageWithSize:LESquareSize(20)]];
    [navi leSetNavigationTitle:@"垂直不等高Layout"];
    //    UICollectionViewFlowLayout *layout=[[UICollectionViewFlowLayout alloc] init];
    //    //        layout.itemSize=CGSizeMake((LESCREEN_WIDTH-LELayoutSideSpace16*4)*1.0/3, LENavigationBarHeight);
    //    layout.itemSize=CGSizeMake(LESCREEN_WIDTH, LENavigationBarHeight);
    //    //    layout.estimatedItemSize=CGSizeMake(LESCREEN_WIDTH, LENavigationBarHeight);
    //    layout.scrollDirection=UICollectionViewScrollDirectionVertical;
    //    //    layout.minimumLineSpacing=LELayoutSideSpace;
    //    layout.minimumInteritemSpacing=0;
    //    layout.headerReferenceSize=CGSizeMake(LESCREEN_WIDTH, LEStatusBarHeight+LENavigationBarHeight);
    //    layout.footerReferenceSize=CGSizeMake(LESCREEN_WIDTH, LEStatusBarHeight);
    //    layout.sectionInset=UIEdgeInsetsMake(LELayoutSideSpace16, LELayoutSideSpace16, LELayoutSideSpace16, LELayoutSideSpace16);

    flowLayout=[[LEVerticalFlowLayout alloc] init];
    collectionView=[[LEBaseCollectionViewWithRefresh alloc] initWithSettings:[[LECollectionViewSettings alloc] initWithAutoLayoutSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation EdgeInsects:UIEdgeInsetsZero] CollectionLayout:flowLayout CellClassname:@"TestCollectionViewCell" ReusableView:@"TestCollectionReusableView"DataSource:self CellSelectionDelegate:self]];
    [flowLayout leSetCollectionView:collectionView CellHeightGetter:^CGFloat(id data, NSIndexPath *index) {
        return [[data objectAtIndex:index.row] floatValue];
        //        return [[[data objectAtIndex:index.section] objectAtIndex:index.row] floatValue];
    }];
    //    [collectionView setBackgroundColor:LEColorClear];
    //    [collectionView leOnSetContentInsects:flowLayout.sectionInset];
    //    [collectionView leOnSetContentInsects:UIEdgeInsetsMake(0, LELayoutSideSpace16, 0, LELayoutSideSpace16)];
    [collectionView setLeSectionHeaderArray:[@[
                                               //                                               @{UICollectionElementKindSectionHeader:@"Header",UICollectionElementKindSectionFooter:@"Footer"},
                                               //                                               @{UICollectionElementKindSectionHeader:@"Header2",UICollectionElementKindSectionFooter:@"Footer2"},
                                               //                                               @{UICollectionElementKindSectionHeader:@"Header3",UICollectionElementKindSectionFooter:@"Footer3"}
                                               ]mutableCopy]];
    [self.leCurrentViewController leThroughNavigationAnimatedPush:vc];
    [self leOnRefreshDataForCollection];
}
-(void) leOnRefreshDataForCollection{
    NSMutableArray *data=[
                          //                          @[
                          @[@"40",@"50",@"60",@"70",@"40",@"30"]
                          //                                             @[@"0 - 0",@"0 - 1",@"0 - 2",@"0 - 3",@"0 - 4",@"0 - 5",@"0 - 6",@"0 - 7",@"0 - 8",@"0 - 9",@"0 - 10",@"0 - 11"]
                          //                                             ,@[@"sec2_1",@"sec2_2"]
                          //                            ]
                          mutableCopy];
    [collectionView leOnRefreshedWithData:data];
}
-(void) leOnLoadMoreForCollection{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.4 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [collectionView leOnLoadedMoreWithData:[@[LEIntToString(20+rand()%100)] mutableCopy]];
    });
}
-(void) leOnCollectionCellSelectedWithInfo:(NSDictionary *)info{
    LELogObject(info);
    [self leAddLocalNotification:[[info objectForKey:LEKeyOfIndexPath] leStringValue]];
}
//===================测试Webview
-(void) onTestWebview{
    LEWebView *vc=[[LEWebView alloc] initWithURLString:@"http://www.baidu.com"];
    [vc leSetNavigationTitle:@"LEWebView"];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
//===================测试SegmentView
-(void) onTestSegmentView{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LESegmentView"];
    UIView *v1=[[UIView alloc] init];
    [v1 setBackgroundColor:[UIColor colorWithRed:1.0 green:0.5216 blue:0.563 alpha:1.0]];
    UIView *v2=[[UIView alloc] init];
    [v2 setBackgroundColor:[UIColor colorWithRed:0.7397 green:1.0 blue:0.795 alpha:1.0]];
    UIView *v3=[[UIView alloc] init];
    [v3 setBackgroundColor:[UIColor colorWithRed:0.6962 green:0.7723 blue:1.0 alpha:1.0]];
    UIView *v4=[[UIView alloc] init];
    [v4 setBackgroundColor:[UIColor colorWithRed:1.0 green:0.7302 blue:0.9259 alpha:1.0]];
    UIView *v5=[[UIView alloc] init];
    [v5 setBackgroundColor:[UIColor colorWithRed:0.9925 green:0.909 blue:0.7724 alpha:1.0]];
    LESegmentView *segment=[[LESegmentView alloc] initWithTitles:nil Pages:nil ViewContainer:view.leViewBelowCustomizedNavigation SegmentHeight:40 Indicator:[LEColorRed leImageWithSize:CGSizeMake(20, 6)] SegmentSpace:20];
    [segment leOnSetTitles:@[@"One",@"第二页",@"再来一个",@"这一个应该可以超出屏幕宽了吧",@"好了可以结束了"]];
    [segment leOnSetPages:@[v1,v2,v3,v4,v5]];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
//===================测试CurveProgressView
-(void) onTestCurveProgressView{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LECurveProgressView"];
    curveProgress=[[LECurveProgressView alloc] initWithAutoLayoutSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideBottomCenter Offset:CGPointMake(0, LEStatusBarHeight) CGSize:CGSizeMake(240, 240)] MinAngle:-225 MaxAngle:45 Color:[UIColor colorWithRed:0.345 green:0.748 blue:0.885 alpha:1.000] ShadowColor:[UIColor colorWithRed:0.271 green:0.496 blue:0.712 alpha:1.000] LineWidth:12 ShadowLineWidth:6 Progrss:12];
    [curveProgress leStrokeChart];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(onCheckCurveProgressView) userInfo:nil repeats:YES];
}
-(void) onCheckCurveProgressView{
    [curveProgress leGrowChartByAmount:12];
}
//===================测试折线走势图
-(void) onTestLELineChart{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LELineChart"];
    LELineChart *line=[[LELineChart alloc] initWithAutoLayoutSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideTopCenter Offset:CGPointZero CGSize:CGSizeMake(self.leCurrentFrameWidth, self.leCurrentFrameWidth/2)] LineWidth:2 RulerLineWidth:1 Color:LEColorRed RulerColor:[UIColor greenColor] Padding:14 VerticalPadding:20 Target:self];
    labelLineChart=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorOutsideBottomCenter RelativeView:line Offset:CGPointMake(0, LELayoutSideSpace) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorRed Line:1 Alignment:NSTextAlignmentCenter]];
    [line leOnSetValues:@[@"10",@"100",@"50",@"60",@"20",@"5",@"90",@"100",@"40",@"80"] Min:5 Max:100];
    [line setBackgroundColor:[UIColor colorWithRed:0.4686 green:0.7222 blue:0.8368 alpha:1.0]];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
-(void) leOnLineChartSelection:(NSUInteger)index{
    [labelLineChart leSetText:[NSString stringWithFormat:@"当前移动到了第%zd个位置",index+1]];
}
//===================测试测试柱状走势图
-(void) onTestBarChart{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LEBarChart"];
    LEBarChart *bar=[[LEBarChart alloc] initWithAutoLayoutSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideTopCenter Offset:CGPointZero CGSize:CGSizeMake(self.leCurrentFrameWidth, self.leCurrentFrameWidth/2)] BarChartSettings:[[LEBarChartSettings alloc] init] Delegate:self];
    labelBarChart=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorOutsideBottomCenter RelativeView:bar Offset:CGPointMake(0, LELayoutSideSpace) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:LELayoutFontSize14 Font:nil Width:0 Height:0 Color:LEColorRed Line:1 Alignment:NSTextAlignmentCenter]];
    [bar leOnSetValues:@[@"10",@"100",@"50",@"60",@"20",@"5",@"90",@"100",@"40",@"80"] Tags:@[@"One",@"Two",@"Three",@"Four",@"Five",@"Six",@"Seven",@"Eight",@"Nine",@"Ten"]];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
-(void) leOnBarSelectedWithIndex:(int)index{
    [labelBarChart leSetText:[NSString stringWithFormat:@"当前点击了第%d个bar",index+1]];
}
//===================测试 波浪滚动上涨下落进度球
-(void) onTestWaveProgressView{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LEWaveProgressView"];
    curWaveProgressView=[[LEWaveProgressView alloc] initWithAutoLayoutSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideTopCenter Offset:CGPointMake(0, LENavigationBarHeight) CGSize:CGSizeMake(250, 260)]];
    [curWaveProgressView setBackgroundColor:[UIColor colorWithRed:0.3515 green:0.7374 blue:1.0 alpha:1.0]];
    [curWaveProgressView leSetPercentage:0];
    [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(onWaveTimer) userInfo:nil repeats:YES];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
-(void) onWaveTimer{
    [curWaveProgressView leSetPercentage:rand()%10*1.0/10];
}
//===================测试 Excel表格化查阅框架
-(void) onTestExcelView{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LEExcelView"];
    curExcelView=[[LEExcelView alloc] initWithSettings:[[LETableViewSettings alloc] initWithSuperViewContainer:view ParentView:view.leViewBelowCustomizedNavigation TableViewCell:@"TestExcelViewCell" EmptyTableViewCell:nil GetDataDelegate:self TableViewCellSelectionDelegate:self] ImmovableViewWidth:120 MovableViewWidth:300 TabbarHeight:LEBottomTabbarHeight TabbarClassname:@"TestExcelViewTabbar"];
    [curExcelView leOnRefreshedWithData:[@[@"",@"",@"",@"",@"",@"",@"",@""]mutableCopy]];
    [[curExcelView leGetTableView] setScrollIndicatorInsets:UIEdgeInsetsMake(0, 0, 0, LENavigationBarHeight)];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
}
//===================测试 自动排版
-(void) onTestAutoLayout{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"LEUIFramework 自动排版"];
    [view.leViewBelowCustomizedNavigation leAddTapEventWithSEL:@selector(leEndEdit)];
    autoLayoutCounter=0;
    autoLayoutTopButton=[LEUIFramework leGetButtonWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideTopCenter Offset:CGPointMake(0, 10) CGSize:CGSizeMake(60, 100)] ButtonSettings:[[LEAutoLayoutUIButtonSettings alloc] initWithTitle:@"点击改变大小" FontSize:10 Font:nil Image:[[UIColor redColor] leImageWithSize:CGSizeMake(20, 20)] BackgroundImage:[[[UIColor yellowColor] leImageWithSize:CGSizeMake(1,1)] leMiddleStrechedImage] Color:LEColorBlack SelectedColor:LEColorMask5 MaxWidth:120 SEL:@selector(onClickForAutoLayout) Target:self]];
    autoLayoutLabel=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorOutsideBottomCenter RelativeView:autoLayoutTopButton Offset:CGPointMake(0, 10) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:10 Font:nil Width:0 Height:0 Color:LEColorBlack Line:1 Alignment:NSTextAlignmentCenter]];
    autoLayoutMultiLineLabel=[LEUIFramework leGetLabelWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorInsideBottomCenter  Offset:CGPointMake(0, -10) CGSize:CGSizeZero] LabelSettings:[[LEAutoLayoutLabelSettings alloc] initWithText:@"" FontSize:15 Font:nil Width:self.leCurrentFrameWidth-20 Height:0 Color:LEColorBlack Line:0 Alignment:NSTextAlignmentCenter]];
    [LEUIFramework leGetButtonWithSettings:[[LEAutoLayoutSettings alloc] initWithSuperView:view.leViewBelowCustomizedNavigation Anchor:LEAnchorOutsideTopCenter RelativeView:autoLayoutMultiLineLabel Offset:CGPointMake(0, -10) CGSize:CGSizeMake(0, 30)] ButtonSettings:[[LEAutoLayoutUIButtonSettings alloc] initWithTitle:@"Label会把我顶上去" FontSize:10 Font:nil Image:[[UIColor redColor] leImageWithSize:CGSizeMake(20, 20)] BackgroundImage:[[[UIColor yellowColor] leImageWithSize:CGSizeMake(1,1)] leMiddleStrechedImage] Color:LEColorBlack SelectedColor:LEColorMask5 MaxWidth:0 SEL:@selector(onClickForAutoLayout) Target:self HorizontalSpace:10]];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
    //    UIView *test=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
    //测试LEUIFrameworkExtra
    [[UIView new].leBackground(LEColorRed).leRelativeView(autoLayoutTopButton).leSize(CGSizeMake(30, 30)).leAutoLayout leAddTapEventWithSEL:@selector(onClickForAutoLayout) Target:self];
    UILabel *label=nil;
    [label=(LEFormatAsLabel [UILabel new].leBackground(LEColorRed).leRelativeView(view.leViewBelowCustomizedNavigation).leOffset(CGPointMake(LELayoutSideSpace16, 0)).leUserInteraction(YES)).leText(@"asdasdasda阿斯达达到爱上as爱上sdasdas").leFont(LEBoldFont(LELayoutFontSize12)).leWidth(100).leColor(LEColorBlue).leAlignment(NSTextAlignmentRight).leLine(2) leLabelLayout];
    [(LEFormatAsButton [UIButton new].leRelativeView(label).leEdgeInsects(UIEdgeInsetsZero)).leTapEvent(@selector(onClickForAutoLayout),self).leBackgroundImageHighlighted([LEColorRed leImageStrechedFromSizeOne]) leButtonLayout];
    UIView *bg=[UIView new].leSuperView(view.leViewBelowCustomizedNavigation).leRelativeView(autoLayoutTopButton).leAnchor(LEAnchorOutsideBottomCenter).leSize(CGSizeMake(LESCREEN_WIDTH-LENavigationBarHeight, LENavigationBarHeight)).leBackground(LEColorMask2).leAutoLayout;
    [(LEFormatAsTextField[UITextField new].leSuperView(bg).leEdgeInsects(UIEdgeInsetsMake(0, LELayoutSideSpace, 0, LELayoutSideSpace)).leAutoLayout).lePlaceHolder(@"PlaceHolder") setClearButtonMode:UITextFieldViewModeAlways];
}
-(void) onClickForAutoLayout{
    autoLayoutCounter++;
    CGSize size=autoLayoutTopButton.bounds.size;
    size.width+=5;
    size.height+=5;
    [autoLayoutTopButton leSetSize:size];
    [autoLayoutLabel leSetText:[NSString stringWithFormat:@"点击了第%d次,目前按钮大小为%@",autoLayoutCounter,NSStringFromCGSize(size)]];
    NSString *text=@"";
    for (int i=0; i<autoLayoutCounter; i++) {
        text=[text stringByAppendingString:@"测试的句子"];
    }
    [autoLayoutMultiLineLabel leSetText:text];
}
//==================测试 自动排版V2
-(void) onTestAutoLayoutV2{
    LEBaseViewController *vc=[[LEBaseViewController alloc] init];
    [self.leCurrentViewController.navigationController pushViewController:vc animated:YES];
    LEBaseView *view=[[LEBaseView alloc] initWithViewController:vc];
    LEBaseNavigation *navi=[[LEBaseNavigation alloc] initWithDelegate:nil ViewController:vc SuperView:view.leViewContainer Offset:LEStatusBarHeight BackgroundImage:[LEColorWhite leImageStrechedFromSizeOne] TitleColor:LEColorTextBlack LeftItemImage:[[LEUIFramework sharedInstance] leGetImageFromLEFrameworksWithName:@"LE_web_icon_backward_on"]];
    [navi leSetNavigationTitle:@"自动排版V2"];
    UIView *BG=[UIView new].leSuperView(view.leViewBelowCustomizedNavigation).leEdgeInsects(UIEdgeInsetsMake(10, 10, 10, 10)).leBackground(LEColorMask).leRoundCorner(8).leAutoLayout;
    autoLayoutLabel=[UILabel new].leSuperView(BG).leAnchor(LEAnchorInsideTopCenter).leOffset(CGPointMake(0, LELayoutSideSpace)).leSize(CGSizeMake(BG.bounds.size.width-LELayoutSideSpace, 0)).leWidth(BG.bounds.size.width-LELayoutSideSpace).leAlignment(NSTextAlignmentCenter).leFont(LEFont(LELayoutFontSize14)).leColor([UIColor colorWithRed:0.0879 green:0.6668 blue:0.079 alpha:1.0]).leAutoLayout.leType;
    UIView *split=[UIView new].leSuperView(BG).leRelativeView(autoLayoutLabel).leAnchor(LEAnchorOutsideBottomCenter).leOffset(CGPointMake(0, LELayoutSideSpace)).leBackground(LEColorBlack).leSize(CGSizeMake(BG.bounds.size.width-LELayoutSideSpace, 1)).leAutoLayout;
    UIButton *btnLeft=[UIButton new].leSuperView(BG).leRelativeView(split).leAnchor(LEAnchorOutsideBottomLeft).leOffset(CGPointMake(LELayoutSideSpace, LELayoutSideSpace)).leBackgroundImage([LEColorBlue leImageStrechedFromSizeOne]).leBackgroundImageHighlighted([LEColorMask leImageStrechedFromSizeOne]).leColor(LEColorWhite).leHighlightedColor(LEColorTextGray).leText(@"左侧按钮追加").leTapEvent(@selector(onClickForAppenddingPathComponent),self).leAutoLayout.leType;
    [[UIButton new].leSuperView(BG).leRelativeView(split).leAnchor(LEAnchorOutsideBottomRight).leOffset(CGPointMake(-LELayoutSideSpace, LELayoutSideSpace)).leBackgroundImage([LEColorRed leImageStrechedFromSizeOne]).leBackgroundImageHighlighted([LEColorMask leImageStrechedFromSizeOne]).leColor(LEColorWhite).leHighlightedColor(LEColorTextGray).leText(@"右侧按钮删除").leTapEvent(@selector(onClickForDeletingLastPathComponent),self).leAutoLayout leExecAutoLayout];
    UIView *viewGroup=[UIView new].leSuperView(BG).leRelativeView(btnLeft).leAnchor(LEAnchorOutsideBottomLeft).leSize(CGSizeMake(BG.bounds.size.width-LELayoutSideSpace*3, 80)).leOffset(CGPointMake(0, LELayoutSideSpace)).leBackground(LEColorWhite).leRoundCorner(8).leAutoLayout;
    [[UIButton new].leSuperView(viewGroup).leEdgeInsects(UIEdgeInsetsZero).leTapEvent(@selector(onClickForDeletingLastPathComponent),self).leBackgroundImageHighlighted([LEColorMask leImageStrechedFromSizeOne]).leAutoLayout leExecAutoLayout];
    UIImageView *icon=[UIImageView new].leSuperView(viewGroup).leAnchor(LEAnchorInsideLeftCenter).leOffset(CGPointMake(LELayoutSideSpace, 0)).leSize(LESquareSize(viewGroup.bounds.size.height-LELayoutSideSpace*2)).leBackground(LEColorMask2).leUserInteraction(YES).leRoundCorner(6).leAutoLayout.leType;
    UIButton *iconTap=[UIButton new].leSuperView(icon).leEdgeInsects(UIEdgeInsetsZero).leAutoLayout.leType;
    [iconTap leSetForTapEventWithSel:@selector(onClickForAppenddingPathComponent) Target:self];
    autoLayoutMultiLineLabel=[UILabel new].leSuperView(viewGroup).leRelativeView(icon).leAnchor(LEAnchorOutsideRightTop).leOffset(CGPointMake(LELayoutSideSpace, 0)).leLine(2).leWidth(viewGroup.bounds.size.width-LELayoutSideSpace*3-icon.bounds.size.width).leFont(LEBoldFont(LELayoutFontSize14)).leAutoLayout.leType;
    [[UILabel new].leSuperView(viewGroup).leRelativeView(icon).leAnchor(LEAnchorOutsideRightBottom).leOffset(CGPointMake(LELayoutSideSpace, 0)).leColor(LEColorTextGray).leText(@"副标题").leAutoLayout leExecAutoLayout];
    [[UILabel new].leSuperView(BG).leWidth(BG.bounds.size.width-LELayoutSideSpace).leAnchor(LEAnchorInsideBottomCenter).leOffset(CGPointMake(0, -LELayoutSideSpace)).leText(@"一、自动排版V2的主要特点有:\n1)-1行代码创建一个view,包括label、imageview、button、textfield。顶部绿色label举例:[UILabel new].leSuperView(xx).leAnchor(LEAnchorInsideTopCenter).leOffset(Point).leSize(size).leWidth(width).leAlignment(Alignment).leFont(font).leColor(color).leAutoLayout;\n2)-创建完成后的view可以自动排版,无需繁杂的计算。\n3)更多功能请查看文档\n二、UI说明:\n1)-绿色字体部分会自动根据内容撑开下方的内容,并且居中显示。\n2)-左侧蓝色按钮及灰色矩形框点击后,会追加一段文字,右侧红色按钮及白色矩形框点击后删除最后追加的一段文字").leAutoLayout leExecAutoLayout];
}
-(void) onClickForAppenddingPathComponent{
    [autoLayoutLabel.leText([autoLayoutLabel.text stringByAppendingPathComponent:@"新建文件夹"]) leLabelLayout];
    [autoLayoutMultiLineLabel.leText(autoLayoutLabel.text) leLabelLayout];
    [autoLayoutMultiLineLabel leSetLineSpace:4];
}
-(void) onClickForDeletingLastPathComponent{
    [autoLayoutLabel.leText([autoLayoutLabel.text stringByDeletingLastPathComponent]) leLabelLayout];
    [autoLayoutMultiLineLabel.leText(autoLayoutLabel.text) leLabelLayout];
    [autoLayoutMultiLineLabel leSetLineSpace:4];
}
@end
@implementation ViewController
@end


text:
import BaseCtrl = require('./baseCtrl');

/**
 * @cass MainCtrl
 * @extends BaseCtrl
 */
class MainCtrl extends BaseCtrl {

    /**
     * @param {ng.IScope} $scope
     * @constructor
     */
    constructor($scope) {
        super($scope, 'main');
    }

}

export = MainCtrl;