// Path: kramer/src/main/java/com/chiralbehaviors/layout/flowless/Cell.java
// @FunctionalInterface
// public interface Cell<T, N extends Node> {
//     static <T, N extends Node> Cell<T, N> wrapNode(N node) {
//         return new Cell<T, N>() {
// 
//             @Override
//             public N getNode() {
//                 return node;
//             }
// 
//             @Override
//             public String toString() {
//                 return node.toString();
//             }
//         };
//     }
// 
//     default Cell<T, N> afterDispose(Runnable action) {
//         return CellWrapper.afterDispose(this, action);
//     }
// 
//     default Cell<T, N> afterReset(Runnable action) {
//         return CellWrapper.afterReset(this, action);
//     }
// 
//     default Cell<T, N> afterUpdateIndex(IntConsumer action) {
//         return CellWrapper.afterUpdateIndex(this, action);
//     }
// 
//     default Cell<T, N> afterUpdateItem(Consumer<? super T> action) {
//         return CellWrapper.afterUpdateItem(this, action);
//     }
// 
//     default Cell<T, N> beforeDispose(Runnable action) {
//         return CellWrapper.beforeDispose(this, action);
//     }
// 
//     default Cell<T, N> beforeReset(Runnable action) {
//         return CellWrapper.beforeReset(this, action);
//     }
// 
//     default Cell<T, N> beforeUpdateIndex(IntConsumer action) {
//         return CellWrapper.beforeUpdateIndex(this, action);
//     }
// 
//     default Cell<T, N> beforeUpdateItem(Consumer<? super T> action) {
//         return CellWrapper.beforeUpdateItem(this, action);
//     }
// 
//     /**
//      * Called when this cell is no longer going to be used at all.
//      * {@link #reset()} will have been called before this method is invoked.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void dispose() {
//         // do nothing by default
//     }
// 
//     N getNode();
// 
//     /**
//      * Indicates whether this cell can be reused to display different items.
//      *
//      * <p>
//      * Default implementation returns {@code false}.
//      */
//     default boolean isReusable() {
//         return false;
//     }
// 
//     /**
//      * Called when this cell is no longer used to display its item. If this cell
//      * is reusable, it may later be asked to display a different item by a call
//      * to {@link #updateItem(Object)}.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void reset() {
//         // do nothing by default
//     }
// 
//     default void setFocus() {
//         getNode().requestFocus();
//     }
// 
//     default int getIndex() {
//         throw new UnsupportedOperationException();
//     }
// 
//     /**
//      * Called to update index of a visible cell.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void updateIndex(int index) {
//         // do nothing by default
//     }
// 
//     /**
//      * If this cell is reusable (as indicated by {@link #isReusable()}), this
//      * method is called to display a different item. {@link #reset()} will have
//      * been called before a call to this method.
//      *
//      * <p>
//      * The default implementation throws {@link UnsupportedOperationException}.
//      *
//      * @param item
//      *            the new item to display
//      */
//     default void updateItem(T item) {
//         throw new UnsupportedOperationException();
//     }
// 
//     default void updateSelection(boolean selected) {
//         // do nothing
//     }
// }


import com.chiralbehaviors.layout.flowless.Cell;
import javafx.event.Event;
import javafx.event.EventType;
/**
 * Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
 *
 * 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 com.chiralbehaviors.layout.cell.control;



/**
 * @author halhildebrand
 *
 */
public class SelectionEvent extends Event {
    public static final EventType<SelectionEvent> ALL              = new EventType<SelectionEvent>("SELECT");
    public static final EventType<SelectionEvent> DOUBLE_SELECT;
    public static final EventType<SelectionEvent> SINGLE_SELECT;
    public static final EventType<SelectionEvent> TRIPLE_SELECT;

    private static final long                     serialVersionUID = 1L;
    static {
        SINGLE_SELECT = new EventType<>(ALL, "SINGLE_SELECT");
        DOUBLE_SELECT = new EventType<>(SINGLE_SELECT, "DOUBLE_SELECT");
        TRIPLE_SELECT = new EventType<>(DOUBLE_SELECT, "TRIPLE_SELECT");
    }

    private final Cell<?, ?> selected;

    public SelectionEvent(Cell<?, ?> selected,
                          EventType<? extends Event> eventType) {
        super(null, null, eventType);
        this.selected = selected;
    }

// Path: kramer/src/main/java/com/chiralbehaviors/layout/flowless/Cell.java
// @FunctionalInterface
// public interface Cell<T, N extends Node> {
//     static <T, N extends Node> Cell<T, N> wrapNode(N node) {
//         return new Cell<T, N>() {
// 
//             @Override
//             public N getNode() {
//                 return node;
//             }
// 
//             @Override
//             public String toString() {
//                 return node.toString();
//             }
//         };
//     }
// 
//     default Cell<T, N> afterDispose(Runnable action) {
//         return CellWrapper.afterDispose(this, action);
//     }
// 
//     default Cell<T, N> afterReset(Runnable action) {
//         return CellWrapper.afterReset(this, action);
//     }
// 
//     default Cell<T, N> afterUpdateIndex(IntConsumer action) {
//         return CellWrapper.afterUpdateIndex(this, action);
//     }
// 
//     default Cell<T, N> afterUpdateItem(Consumer<? super T> action) {
//         return CellWrapper.afterUpdateItem(this, action);
//     }
// 
//     default Cell<T, N> beforeDispose(Runnable action) {
//         return CellWrapper.beforeDispose(this, action);
//     }
// 
//     default Cell<T, N> beforeReset(Runnable action) {
//         return CellWrapper.beforeReset(this, action);
//     }
// 
//     default Cell<T, N> beforeUpdateIndex(IntConsumer action) {
//         return CellWrapper.beforeUpdateIndex(this, action);
//     }
// 
//     default Cell<T, N> beforeUpdateItem(Consumer<? super T> action) {
//         return CellWrapper.beforeUpdateItem(this, action);
//     }
// 
//     /**
//      * Called when this cell is no longer going to be used at all.
//      * {@link #reset()} will have been called before this method is invoked.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void dispose() {
//         // do nothing by default
//     }
// 
//     N getNode();
// 
//     /**
//      * Indicates whether this cell can be reused to display different items.
//      *
//      * <p>
//      * Default implementation returns {@code false}.
//      */
//     default boolean isReusable() {
//         return false;
//     }
// 
//     /**
//      * Called when this cell is no longer used to display its item. If this cell
//      * is reusable, it may later be asked to display a different item by a call
//      * to {@link #updateItem(Object)}.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void reset() {
//         // do nothing by default
//     }
// 
//     default void setFocus() {
//         getNode().requestFocus();
//     }
// 
//     default int getIndex() {
//         throw new UnsupportedOperationException();
//     }
// 
//     /**
//      * Called to update index of a visible cell.
//      *
//      * <p>
//      * Default implementation does nothing.
//      */
//     default void updateIndex(int index) {
//         // do nothing by default
//     }
// 
//     /**
//      * If this cell is reusable (as indicated by {@link #isReusable()}), this
//      * method is called to display a different item. {@link #reset()} will have
//      * been called before a call to this method.
//      *
//      * <p>
//      * The default implementation throws {@link UnsupportedOperationException}.
//      *
//      * @param item
//      *            the new item to display
//      */
//     default void updateItem(T item) {
//         throw new UnsupportedOperationException();
//     }
// 
//     default void updateSelection(boolean selected) {
//         // do nothing
//     }
// }


// Path: kramer/src/main/java/com/chiralbehaviors/layout/cell/control/SelectionEvent.java
import com.chiralbehaviors.layout.flowless.Cell;
import javafx.event.Event;
import javafx.event.EventType;

/**
 * Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
 *
 * 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 com.chiralbehaviors.layout.cell.control;



/**
 * @author halhildebrand
 *
 */
public class SelectionEvent extends Event {
    public static final EventType<SelectionEvent> ALL              = new EventType<SelectionEvent>("SELECT");
    public static final EventType<SelectionEvent> DOUBLE_SELECT;
    public static final EventType<SelectionEvent> SINGLE_SELECT;
    public static final EventType<SelectionEvent> TRIPLE_SELECT;

    private static final long                     serialVersionUID = 1L;
    static {
        SINGLE_SELECT = new EventType<>(ALL, "SINGLE_SELECT");
        DOUBLE_SELECT = new EventType<>(SINGLE_SELECT, "DOUBLE_SELECT");
        TRIPLE_SELECT = new EventType<>(DOUBLE_SELECT, "TRIPLE_SELECT");
    }

    private final Cell<?, ?> selected;

    public SelectionEvent(Cell<?, ?> selected,
                          EventType<? extends Event> eventType) {
        super(null, null, eventType);
        this.selected = selected;
    }

    public Cell<?, ?> getSelected() {