{
        return SHAPERECORD.getBounds(shapeRecords);
    }

package com.jpexs.decompiler.flash.types;

import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.exporters.shape.PathExporter;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import java.awt.Shape;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author JPEXS
 */
public class SHAPE implements NeedsCharacters, Serializable {

    @SWFType(value = BasicType.UB, count = 4)
    public int numFillBits;

    @SWFType(value = BasicType.UB, count = 4)
    public int numLineBits;

    @SWFArray(value = "record")
    public List<SHAPERECORD> shapeRecords;

    private Shape cachedOutline;

    @Override
    public void getNeededCharacters(Set<Integer> needed) {
        for (SHAPERECORD r : shapeRecords) {
            r.getNeededCharacters(needed);
        }
    }

    @Override
    public boolean replaceCharacter(int oldCharacterId, int newCharacterId) {
        boolean modified = false;
        for (SHAPERECORD r : shapeRecords) {
            modified |= r.replaceCharacter(oldCharacterId, newCharacterId);
        }
        return modified;
    }

    @Override
    public boolean removeCharacter(int characterId) {
        boolean modified = false;
        for (SHAPERECORD r : shapeRecords) {
            modified |= r.removeCharacter(characterId);
        }
        return modified;
    }

    public RECT getBounds()

    public Shape getOutline(SWF swf, boolean stroked) {
        if (cachedOutline != null) {
            return cachedOutline;
        }
        List<GeneralPath> strokes = new ArrayList<>();
        List<GeneralPath> paths = PathExporter.export(swf, this, strokes);
        Area area = new Area();
        for (GeneralPath path : paths) {
            area.add(new Area(path));
        }
        if (stroked) {
            for (GeneralPath path : strokes) {
                area.add(new Area(path));
            }
        }
        cachedOutline = area;
        return area;
    }

    public SHAPE resize(double multiplier) {
        return resize(multiplier, multiplier);
    }

    public SHAPE resize(double multiplierX, double multiplierY) {
        SHAPE ret = new SHAPE();
        ret.numFillBits = numFillBits;
        ret.numLineBits = numLineBits;
        List<SHAPERECORD> recs = new ArrayList<>();
        for (SHAPERECORD r : shapeRecords) {
            SHAPERECORD c = r.resize(multiplierX, multiplierY);
            recs.add(c);
        }
        ret.shapeRecords = recs;
        return ret;
    }

    public static SHAPE createEmpty(int shapeNum) {
        SHAPE ret = new SHAPE();
        ret.shapeRecords = new ArrayList<>();
        ret.shapeRecords.add(new EndShapeRecord());
        return ret;
    }
}


package com.jpexs.decompiler.flash.types;

import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.exporters.shape.PathExporter;
import com.jpexs.decompiler.flash.tags.base.NeedsCharacters;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.shaperecords.EndShapeRecord;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import java.awt.Shape;
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
 * @author JPEXS
 */
public class SHAPE implements NeedsCharacters, Serializable {

    @SWFType(value = BasicType.UB, count = 4)
    public int numFillBits;

    @SWFType(value = BasicType.UB, count = 4)
    public int numLineBits;

    @SWFArray(value = "record")
    public List<SHAPERECORD> shapeRecords;

    private Shape cachedOutline;

    @Override
    public void getNeededCharacters(Set<Integer> needed) {
        for (SHAPERECORD r : shapeRecords) {
            r.getNeededCharacters(needed);
        }
    }

    @Override
    public boolean replaceCharacter(int oldCharacterId, int newCharacterId) {
        boolean modified = false;
        for (SHAPERECORD r : shapeRecords) {
            modified |= r.replaceCharacter(oldCharacterId, newCharacterId);
        }
        return modified;
    }

    @Override
    public boolean removeCharacter(int characterId) {
        boolean modified = false;
        for (SHAPERECORD r : shapeRecords) {
            modified |= r.removeCharacter(characterId);
        }
        return modified;
    }

    public RECT getBounds() {
        return SHAPERECORD.getBounds(shapeRecords);
    }

    public Shape getOutline(SWF swf, boolean stroked) {
        if (cachedOutline != null) {
            return cachedOutline;
        }
        List<GeneralPath> strokes = new ArrayList<>();
        List<GeneralPath> paths = PathExporter.export(swf, this, strokes);
        Area area = new Area();
        for (GeneralPath path : paths) {
            area.add(new Area(path));
        }
        if (stroked) {
            for (GeneralPath path : strokes) {
                area.add(new Area(path));
            }
        }
        cachedOutline = area;
        return area;
    }

    public SHAPE resize(double multiplier) {
        return resize(multiplier, multiplier);
    }

    public SHAPE resize(double multiplierX, double multiplierY) {
        SHAPE ret = new SHAPE();
        ret.numFillBits = numFillBits;
        ret.numLineBits = numLineBits;
        List<SHAPERECORD> recs = new ArrayList<>();
        for (SHAPERECORD r : shapeRecords) {
            SHAPERECORD c = r.resize(multiplierX, multiplierY);
            recs.add(c);
        }
        ret.shapeRecords = recs;
        return ret;
    }

    public static SHAPE createEmpty(int shapeNum) {
        SHAPE ret = new SHAPE();
        ret.shapeRecords = new ArrayList<>();
        ret.shapeRecords.add(new EndShapeRecord());
        retu


public StateInteractive swap_pin(PlaPointFloat p_location)

package interactive.state;

import freert.planar.PlaPointFloat;
import interactive.Actlog;
import interactive.IteraBoard;
import interactive.LogfileScope;
import java.util.Collection;
import java.util.Set;
import board.BrdLayerStructure;
import board.items.BrdItem;
import board.varie.ItemSelectionChoice;
import board.varie.ItemSelectionFilter;

/**
 * Common base class for the main menus, which can be selected in the tool bar.
 *
 * @author Alfons Wirtz
 */
public class StateMenu extends StateInteractive {

    public StateMenu(IteraBoard p_board_handle, Actlog p_logfile) {
        super(null, p_board_handle, p_logfile);
        this.return_state = this;
    }

    public javax.swing.JPopupMenu get_popup_menu() {
        return i_brd.get_panel().popup_menu_main;
    }

    /**
     * Selects items at p_location. Returns a new instance of SelectedItemState with the selected items, if something was selected.
     */
    public StateInteractive select_items(PlaPointFloat p_location) {
        i_brd.display_layer_messsage();
        Set<BrdItem> picked_items = i_brd.pick_items(p_location);
        boolean something_found = (picked_items.size() > 0);
        StateInteractive result;
        if (something_found) {
            result = StateSelectedItem.get_instance(picked_items, this, i_brd, this.actlog);
            i_brd.screen_messages.set_status_message(resources.getString("in_select_mode"));
            actlog_start_scope(LogfileScope.START_SELECT, p_location);
        } else {
            result = this;
        }
        i_brd.repaint();
        return result;
    }

{
        ItemSelectionFilter selection_filter = new ItemSelectionFilter(ItemSelectionChoice.PINS);
        Collection<BrdItem> picked_items = i_brd.pick_items(p_location, selection_filter);
        StateInteractive result = this;
        if (picked_items.size() > 0) {
            BrdItem first_item = picked_items.iterator().next();
            if (!(first_item instanceof board.items.BrdAbitPin)) {
                System.out.println("MenuState.swap_pin: Pin expected");
                return this;
            }
            board.items.BrdAbitPin selected_pin = (board.items.BrdAbitPin) first_item;
            result = StatePinSwap.get_instance(selected_pin, this, i_brd, this.actlog);
        } else {
            i_brd.screen_messages.set_status_message(resources.getString("no_pin_selected"));
        }
        i_brd.repaint();
        return result;
    }

    private void change_layer_next(int delta) {
        if (delta == 0)
            return;
        // increase the current layer to the next signal layer
        BrdLayerStructure layer_structure = r_brd.layer_structure;
        int current_layer_no = i_brd.itera_settings.layer_no;
        int layer_count = layer_structure.size();
        for (int index = 0; index < layer_count; index++) {
            current_layer_no += delta;
            // if we are going up and we went above the maximum, get back to a safe value
            if (delta > 0 && current_layer_no >= layer_count)
                current_layer_no = 0;
            // if we are going down and we went below, go back to the top
            if (delta < 0 && current_layer_no < 0)
                current_layer_no = layer_count - 1;
            // if the layer is good, then we are done
            if (layer_structure.is_signal(current_layer_no))
                break;
        }
        i_brd.set_current_layer(current_layer_no);
    }

    /**
     * Action to be taken when a key shortcut is pressed.
     */
    public StateInteractive key_typed(char p_key_char) {
        StateInteractive curr_return_state = this;
        if (p_key_char == 'b') {
            i_brd.redo();
        } else if (p_key_char == 'd') {
            return new StateMenuDrag(i_brd, actlog);
        } else if (p_key_char == 'e') {
            // It seems to me that this is quite useful to understand what is happening... damiano
            StateExpandTest expand = new StateExpandTest(this, i_brd);
            expand.expand_test_init(i_brd.get_current_mouse_position());
            return expand;
        } else if (p_key_char == 'g') {
            i_brd.toggle_ratsnest();
        } else if (p_key_char == 'i') {
            curr_return_state = select_items(i_brd.get_current_mouse_position());
        } else if (p_key_char == 'p') {
            i_brd.itera_settings.set_push_enabled(!i_brd.itera_settings.push_enabled);
            i_brd.get_panel().board_frame.refresh_windows();
        } else if (p_key_char == 'r') {
            curr_return_state = new StateMenuRoute(i_brd, actlog);
        } else if (p_key_char == 's') {
            curr_return_state = new StateMenuSelect(i_brd, actlog);
        } else if (p_key_char == 't') {
            curr_return_state = StateRoute.get_instance(i_brd.get_current_mouse_position(), this, i_brd, actlog);
        } else if (p_key_char == 'u') {
            i_brd.undo();
        } else if (p_key_char == 'v') {
            i_brd.toggle_clearance_violations();
        } else if (p_key_char == 'w') {
            curr_return_state = swap_pin(i_brd.get_current_mouse_position());
        } else if (p_key_char == '+') {
            change_layer_next(1);
        } else if (p_key_char == '-') {
            change_layer_next(-1);
        } else {
            curr_return_state = super.key_typed(p_key_char);
        }
        return curr_return_state;
    }

    /**
     * Do nothing on complete.
     */
    @Override
    public StateInteractive complete() {
        return this;
    }

    /**
     * Do nothing on cancel.
     */
    @Override
    public StateInteractive cancel() {
        return this;
    }

    @Override
    public void set_toolbar() {
        i_brd.get_panel().board_frame.set_menu_toolbar();
    }
}


{
        i_brd.get_panel().board_frame.set_menu_toolbar();
    }

package interactive.state;

import freert.planar.PlaPointFloat;
import interactive.Actlog;
import interactive.IteraBoard;
import interactive.LogfileScope;
import java.util.Collection;
import java.util.Set;
import board.BrdLayerStructure;
import board.items.BrdItem;
import board.varie.ItemSelectionChoice;
import board.varie.ItemSelectionFilter;

/**
 * Common base class for the main menus, which can be selected in the tool bar.
 *
 * @author Alfons Wirtz
 */
public class StateMenu extends StateInteractive {

    public StateMenu(IteraBoard p_board_handle, Actlog p_logfile) {
        super(null, p_board_handle, p_logfile);
        this.return_state = this;
    }

    public javax.swing.JPopupMenu get_popup_menu() {
        return i_brd.get_panel().popup_menu_main;
    }

    /**
     * Selects items at p_location. Returns a new instance of SelectedItemState with the selected items, if something was selected.
     */
    public StateInteractive select_items(PlaPointFloat p_location) {
        i_brd.display_layer_messsage();
        Set<BrdItem> picked_items = i_brd.pick_items(p_location);
        boolean something_found = (picked_items.size() > 0);
        StateInteractive result;
        if (something_found) {
            result = StateSelectedItem.get_instance(picked_items, this, i_brd, this.actlog);
            i_brd.screen_messages.set_status_message(resources.getString("in_select_mode"));
            actlog_start_scope(LogfileScope.START_SELECT, p_location);
        } else {
            result = this;
        }
        i_brd.repaint();
        return result;
    }

    public StateInteractive swap_pin(PlaPointFloat p_location) {
        ItemSelectionFilter selection_filter = new ItemSelectionFilter(ItemSelectionChoice.PINS);
        Collection<BrdItem> picked_items = i_brd.pick_items(p_location, selection_filter);
        StateInteractive result = this;
        if (picked_items.size() > 0) {
            BrdItem first_item = picked_items.iterator().next();
            if (!(first_item instanceof board.items.BrdAbitPin)) {
                System.out.println("MenuState.swap_pin: Pin expected");
                return this;
            }
            board.items.BrdAbitPin selected_pin = (board.items.BrdAbitPin) first_item;
            result = StatePinSwap.get_instance(selected_pin, this, i_brd, this.actlog);
        } else {
            i_brd.screen_messages.set_status_message(resources.getString("no_pin_selected"));
        }
        i_brd.repaint();
        return result;
    }

    private void change_layer_next(int delta) {
        if (delta == 0)
            return;
        // increase the current layer to the next signal layer
        BrdLayerStructure layer_structure = r_brd.layer_structure;
        int current_layer_no = i_brd.itera_settings.layer_no;
        int layer_count = layer_structure.size();
        for (int index = 0; index < layer_count; index++) {
            current_layer_no += delta;
            // if we are going up and we went above the maximum, get back to a safe value
            if (delta > 0 && current_layer_no >= layer_count)
                current_layer_no = 0;
            // if we are going down and we went below, go back to the top
            if (delta < 0 && current_layer_no < 0)
                current_layer_no = layer_count - 1;
            // if the layer is good, then we are done
            if (layer_structure.is_signal(current_layer_no))
                break;
        }
        i_brd.set_current_layer(current_layer_no);
    }

    /**
     * Action to be taken when a key shortcut is pressed.
     */
    public StateInteractive key_typed(char p_key_char) {
        StateInteractive curr_return_state = this;
        if (p_key_char == 'b') {
            i_brd.redo();
        } else if (p_key_char == 'd') {
            return new StateMenuDrag(i_brd, actlog);
        } else if (p_key_char == 'e') {
            // It seems to me that this is quite useful to understand what is happening... damiano
            StateExpandTest expand = new StateExpandTest(this, i_brd);
            expand.expand_test_init(i_brd.get_current_mouse_position());
            return expand;
        } else if (p_key_char == 'g') {
            i_brd.toggle_ratsnest();
        } else if (p_key_char == 'i') {
            curr_return_state = select_items(i_brd.get_current_mouse_position());
        } else if (p_key_char == 'p') {
            i_brd.itera_settings.set_push_enabled(!i_brd.itera_settings.push_enabled);
            i_brd.get_panel().board_frame.refresh_windows();
        } else if (p_key_char == 'r') {
            curr_return_state = new StateMenuRoute(i_brd, actlog);
        } else if (p_key_char == 's') {
            curr_return_state = new StateMenuSelect(i_brd, actlog);
        } else if (p_key_char == 't') {
            curr_return_state = StateRoute.get_instance(i_brd.get_current_mouse_position(), this, i_brd, actlog);
        } else if (p_key_char == 'u') {
            i_brd.undo();
        } else if (p_key_char == 'v') {
            i_brd.toggle_clearance_violations();
        } else if (p_key_char == 'w') {
            curr_return_state = swap_pin(i_brd.get_current_mouse_position());
        } else if (p_key_char == '+') {
            change_layer_next(1);
        } else if (p_key_char == '-') {
            change_layer_next(-1);
        } else {
            curr_return_state = super.key_typed(p_key_char);
        }
        return curr_return_state;
    }

    /**
     * Do nothing on complete.
     */
    @Override
    public StateInteractive complete() {
        return this;
    }

    /**
     * Do nothing on cancel.
     */
    @Override
    public StateInteractive cancel() {
        return this;
    }

    @Override
    public void set_toolbar()


BrdItem> picked_items = i_brd.pick_items(p_location, selection_filter);

package interactive.state;

import freert.planar.PlaPointFloat;
import interactive.Actlog;
import interactive.IteraBoard;
import interactive.LogfileScope;
import java.util.Collection;
import java.util.Set;
import board.BrdLayerStructure;
import board.items.BrdItem;
import board.varie.ItemSelectionChoice;
import board.varie.ItemSelectionFilter;

/**
 * Common base class for the main menus, which can be selected in the tool bar.
 *
 * @author Alfons Wirtz
 */
public class StateMenu extends StateInteractive {

    public StateMenu(IteraBoard p_board_handle, Actlog p_logfile) {
        super(null, p_board_handle, p_logfile);
        this.return_state = this;
    }

    public javax.swing.JPopupMenu get_popup_menu() {
        return i_brd.get_panel().popup_menu_main;
    }

    /**
     * Selects items at p_location. Returns a new instance of SelectedItemState with the selected items, if something was selected.
     */
    public StateInteractive select_items(PlaPointFloat p_location) {
        i_brd.display_layer_messsage();
        Set<BrdItem> picked_items = i_brd.pick_items(p_location);
        boolean something_found = (picked_items.size() > 0);
        StateInteractive result;
        if (something_found) {
            result = StateSelectedItem.get_instance(picked_items, this, i_brd, this.actlog);
            i_brd.screen_messages.set_status_message(resources.getString("in_select_mode"));
            actlog_start_scope(LogfileScope.START_SELECT, p_location);
        } else {
            result = this;
        }
        i_brd.repaint();
        return result;
    }

    public StateInteractive swap_pin(PlaPointFloat p_location) {
        ItemSelectionFilter selection_filter = new ItemSelectionFilter(ItemSelectionChoice.PINS);
        Collection<

        StateInteractive result = this;
        if (picked_items.size() > 0) {
            BrdItem first_item = picked_items.iterator().next();
            if (!(first_item instanceof board.items.BrdAbitPin)) {
                System.out.println("MenuState.swap_pin: Pin expected");
                return this;
            }
            board.items.BrdAbitPin selected_pin = (board.items.BrdAbitPin) first_item;
            result = StatePinSwap.get_instance(selected_pin, this, i_brd, this.actlog);
        } else {
            i_brd.screen_messages.set_status_message(resources.getString("no_pin_selected"));
        }
        i_brd.repaint();
        return result;
    }

    private void change_layer_next(int delta) {
        if (delta == 0)
            return;
        // increase the current layer to the next signal layer
        BrdLayerStructure layer_structure = r_brd.layer_structure;
        int current_layer_no = i_brd.itera_settings.layer_no;
        int layer_count = layer_structure.size();
        for (int index = 0; index < layer_count; index++) {
            current_layer_no += delta;
            // if we are going up and we went above the maximum, get back to a safe value
            if (delta > 0 && current_layer_no >= layer_count)
                current_layer_no = 0;
            // if we are going down and we went below, go back to the top
            if (delta < 0 && current_layer_no < 0)
                current_layer_no = layer_count - 1;
            // if the layer is good, then we are done
            if (layer_structure.is_signal(current_layer_no))
                break;
        }
        i_brd.set_current_layer(current_layer_no);
    }

    /**
     * Action to be taken when a key shortcut is pressed.
     */
    public StateInteractive key_typed(char p_key_char) {
        StateInteractive curr_return_state = this;
        if (p_key_char == 'b') {
            i_brd.redo();
        } else if (p_key_char == 'd') {
            return new StateMenuDrag(i_brd, actlog);
        } else if (p_key_char == 'e') {
            // It seems to me that this is quite useful to understand what is happening... damiano
            StateExpandTest expand = new StateExpandTest(this, i_brd);
            expand.expand_test_init(i_brd.get_current_mouse_position());
            return expand;
        } else if (p_key_char == 'g') {
            i_brd.toggle_ratsnest();
        } else if (p_key_char == 'i') {
            curr_return_state = select_items(i_brd.get_current_mouse_position());
        } else if (p_key_char == 'p') {
            i_brd.itera_settings.set_push_enabled(!i_brd.itera_settings.push_enabled);
            i_brd.get_panel().board_frame.refresh_windows();
        } else if (p_key_char == 'r') {
            curr_return_state = new StateMenuRoute(i_brd, actlog);
        } else if (p_key_char == 's') {
            curr_return_state = new StateMenuSelect(i_brd, actlog);
        } else if (p_key_char == 't') {
            curr_return_state = StateRoute.get_instance(i_brd.get_current_mouse_position(), this, i_brd, actlog);
        } else if (p_key_char == 'u') {
            i_brd.undo();
        } else if (p_key_char == 'v') {
            i_brd.toggle_clearance_violations();
        } else if (p_key_char == 'w') {
            curr_return_state = swap_pin(i_brd.get_current_mouse_position());
        } else if (p_key_char == '+') {
            change_layer_next(1);
        } else if (p_key_char == '-') {
            change_layer_next(-1);
        } else {
            curr_return_state = super.key_typed(p_key_char);
        }
        return curr_return_state;
    }

    /**
     * Do nothing on complete.
     */
    @Override
    public StateInteractive complete() {
        return this;
    }

    /**
     * Do nothing on cancel.
     */
    @Override
    public StateInteractive cancel() {
        return this;
    }

    @Override
    public void set_toolbar() {
        i_brd.get_panel().board_frame.set_menu_toolbar();
    }
}


@Override
    public StateInteractive complete() {
        return this;
    }

package interactive.state;

import freert.planar.PlaPointFloat;
import interactive.Actlog;
import interactive.IteraBoard;
import interactive.LogfileScope;
import java.util.Collection;
import java.util.Set;
import board.BrdLayerStructure;
import board.items.BrdItem;
import board.varie.ItemSelectionChoice;
import board.varie.ItemSelectionFilter;

/**
 * Common base class for the main menus, which can be selected in the tool bar.
 *
 * @author Alfons Wirtz
 */
public class StateMenu extends StateInteractive {

    public StateMenu(IteraBoard p_board_handle, Actlog p_logfile) {
        super(null, p_board_handle, p_logfile);
        this.return_state = this;
    }

    public javax.swing.JPopupMenu get_popup_menu() {
        return i_brd.get_panel().popup_menu_main;
    }

    /**
     * Selects items at p_location. Returns a new instance of SelectedItemState with the selected items, if something was selected.
     */
    public StateInteractive select_items(PlaPointFloat p_location) {
        i_brd.display_layer_messsage();
        Set<BrdItem> picked_items = i_brd.pick_items(p_location);
        boolean something_found = (picked_items.size() > 0);
        StateInteractive result;
        if (something_found) {
            result = StateSelectedItem.get_instance(picked_items, this, i_brd, this.actlog);
            i_brd.screen_messages.set_status_message(resources.getString("in_select_mode"));
            actlog_start_scope(LogfileScope.START_SELECT, p_location);
        } else {
            result = this;
        }
        i_brd.repaint();
        return result;
    }

    public StateInteractive swap_pin(PlaPointFloat p_location) {
        ItemSelectionFilter selection_filter = new ItemSelectionFilter(ItemSelectionChoice.PINS);
        Collection<BrdItem> picked_items = i_brd.pick_items(p_location, selection_filter);
        StateInteractive result = this;
        if (picked_items.size() > 0) {
            BrdItem first_item = picked_items.iterator().next();
            if (!(first_item instanceof board.items.BrdAbitPin)) {
                System.out.println("MenuState.swap_pin: Pin expected");
                return this;
            }
            board.items.BrdAbitPin selected_pin = (board.items.BrdAbitPin) first_item;
            result = StatePinSwap.get_instance(selected_pin, this, i_brd, this.actlog);
        } else {
            i_brd.screen_messages.set_status_message(resources.getString("no_pin_selected"));
        }
        i_brd.repaint();
        return result;
    }

    private void change_layer_next(int delta) {
        if (delta == 0)
            return;
        // increase the current layer to the next signal layer
        BrdLayerStructure layer_structure = r_brd.layer_structure;
        int current_layer_no = i_brd.itera_settings.layer_no;
        int layer_count = layer_structure.size();
        for (int index = 0; index < layer_count; index++) {
            current_layer_no += delta;
            // if we are going up and we went above the maximum, get back to a safe value
            if (delta > 0 && current_layer_no >= layer_count)
                current_layer_no = 0;
            // if we are going down and we went below, go back to the top
            if (delta < 0 && current_layer_no < 0)
                current_layer_no = layer_count - 1;
            // if the layer is good, then we are done
            if (layer_structure.is_signal(current_layer_no))
                break;
        }
        i_brd.set_current_layer(current_layer_no);
    }

    /**
     * Action to be taken when a key shortcut is pressed.
     */
    public StateInteractive key_typed(char p_key_char) {
        StateInteractive curr_return_state = this;
        if (p_key_char == 'b') {
            i_brd.redo();
        } else if (p_key_char == 'd') {
            return new StateMenuDrag(i_brd, actlog);
        } else if (p_key_char == 'e') {
            // It seems to me that this is quite useful to understand what is happening... damiano
            StateExpandTest expand = new StateExpandTest(this, i_brd);
            expand.expand_test_init(i_brd.get_current_mouse_position());
            return expand;
        } else if (p_key_char == 'g') {
            i_brd.toggle_ratsnest();
        } else if (p_key_char == 'i') {
            curr_return_state = select_items(i_brd.get_current_mouse_position());
        } else if (p_key_char == 'p') {
            i_brd.itera_settings.set_push_enabled(!i_brd.itera_settings.push_enabled);
            i_brd.get_panel().board_frame.refresh_windows();
        } else if (p_key_char == 'r') {
            curr_return_state = new StateMenuRoute(i_brd, actlog);
        } else if (p_key_char == 's') {
            curr_return_state = new StateMenuSelect(i_brd, actlog);
        } else if (p_key_char == 't') {
            curr_return_state = StateRoute.get_instance(i_brd.get_current_mouse_position(), this, i_brd, actlog);
        } else if (p_key_char == 'u') {
            i_brd.undo();
        } else if (p_key_char == 'v') {
            i_brd.toggle_clearance_violations();
        } else if (p_key_char == 'w') {
            curr_return_state = swap_pin(i_brd.get_current_mouse_position());
        } else if (p_key_char == '+') {
            change_layer_next(1);
        } else if (p_key_char == '-') {
            change_layer_next(-1);
        } else {
            curr_return_state = super.key_typed(p_key_char);
        }
        return curr_return_state;
    }

    /**
     * Do nothing on complete.
     */

    /**
     * Do nothing on cancel.
     */
    @Override
    public StateInteractive cancel() {
        return this;
    }

    @Override
    public void set_toolbar() {
        i_brd.get_panel().board_frame.set_menu_toolbar();
    }
}


@Override
    public void writeByte(byte b)

package tools.data.output;

import java.io.ByteArrayOutputStream;

/**
 * Uses a byte array to output a stream of bytes.
 *
 * @author Frz
 * @version 1.0
 * @since Revision 352
 */
public class BAOSByteOutputStream implements ByteOutputStream {

    private final ByteArrayOutputStream baos;

    /**
     * Class constructor - Wraps the stream around a Java BAOS.
     *
     * @param baos The ByteArrayOutputStream to wrap this around.
     */
    public BAOSByteOutputStream(ByteArrayOutputStream baos) {
        super();
        this.baos = baos;
    }

    /**
     * Writes a byte to the stream.
     *
     * @param b The byte to write to the stream.
     * @see tools.data.output.ByteOutputStream#writeByte(byte)
     */


package tools.data.output;

import java.io.ByteArrayOutputStream;

/**
 * Uses a byte array to output a stream of bytes.
 *
 * @author Frz
 * @version 1.0
 * @since Revision 352
 */
public class BAOSByteOutputStream implements ByteOutputStream {

    private final ByteArrayOutputStream baos;

    /**
     * Class constructor - Wraps the stream around a Java BAOS.
     *
     * @param baos The ByteArrayOutputStream to wrap this around.
     */
    public BAOSByteOutputStream(ByteArrayOutputStream baos) {
        super();
        this.baos = baos;
    }

    /**
     * Writes a byte to the stream.
     *
     * @param b The byte to write to the stream.
     * @see tools.data.output.ByteOutputStream#writeByte(byte)
     */
    @Override
    public void writeByte(byte b)


package tools.data.output;

import java.io.ByteArrayOutputStream;

/**
 * Uses a byte array to output a stream of bytes.
 *
 * @author Frz
 * @version 1.0
 * @since Revision 352
 */
public class BAOSByteOutputStream implements ByteOutputStream {

    private final ByteArrayOutputStream baos;

    /**
     * Class constructor - Wraps the stream around a Java BAOS.
     *
     * @param baos The ByteArrayOutputStream to wrap this around.
     */
    public BAOSByteOutputStream(ByteArrayOutputStream baos) {
        super();
        this.baos = baos;
    }

    /**
     * Writes a byte to the stream.
     *
     * @param b The byte to write to the stream.
     * @see tools.data.output.ByteOutputStream#writeByte(byte)
     */
    @Override
    public void writeByte(byte b) {
        b


@Override
    public void writeByte(byte b) {
        baos.write(b);
    }


void warDeploy(File warFile, String appName);

package com.azure.resourcemanager.appservice.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.appservice.AppServiceManager;
import com.azure.resourcemanager.appservice.fluent.models.SiteInner;
import com.azure.resourcemanager.resources.fluentcore.arm.models.HasParent;
import com.azure.resourcemanager.resources.fluentcore.arm.models.IndependentChildResource;
import com.azure.resourcemanager.resources.fluentcore.model.Creatable;
import com.azure.resourcemanager.resources.fluentcore.model.Updatable;
import java.io.File;
import java.io.InputStream;
import reactor.core.publisher.Mono;

/**
 * An immutable client-side representation of an Azure Web App deployment slot.
 */
@Fluent
public interface DeploymentSlot extends IndependentChildResource<AppServiceManager, SiteInner>, WebDeploymentSlotBasic, SupportsOneDeploy, DeploymentSlotBase<DeploymentSlot>, Updatable<DeploymentSlotBase.Update<DeploymentSlot>>, HasParent<WebApp> {

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     */
    void warDeploy(File warFile);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @return a completable of the operation
     */
    Mono<Void> warDeployAsync(File warFile);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param length the length of the file
     */
    void warDeploy(InputStream warFile, long length);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param length the length of the file
     * @return a completable of the operation
     */
    Mono<Void> warDeployAsync(InputStream warFile, long length);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param appName the name of the app, default to "ROOT" when not provided
     */

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param appName the name of the app, default to "ROOT" when not provided
     * @return a completable of the operation
     */
    Mono<Void> warDeployAsync(File warFile, String appName);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param length the length of the file
     * @param appName the name of the app, default to "ROOT" when not provided
     */
    void warDeploy(InputStream warFile, long length, String appName);

    /**
     * Deploys a WAR file onto the Azure specialized Tomcat on this web app.
     *
     * @param warFile the WAR file to upload
     * @param length the length of the file
     * @param appName the name of the app, default to "ROOT" when not provided
     * @return a completable of the operation
     */
    Mono<Void> warDeployAsync(InputStream warFile, long length, String appName);

    /**
     * ***********************************************************
     *  Fluent interfaces to provision a deployment slot
     * ************************************************************
     */
    /**
     * Container interface for all the definitions that need to be implemented.
     */
    interface Definition extends DefinitionStages.Blank, DefinitionStages.WithConfiguration, DefinitionStages.WithCreate {
    }

    /**
     * Grouping of all the deployment slot definition stages.
     */
    interface DefinitionStages {

        /**
         * The first stage of the deployment slot definition.
         */
        interface Blank extends WithConfiguration {
        }

        /**
         * A deployment slot definition allowing the configuration to clone from to be specified.
         */
        interface WithConfiguration {

            /**
             * Creates the deployment slot with brand new site configurations.
             *
             * @return the next stage of the definition
             */
            WithCreate withBrandNewConfiguration();

            /**
             * Copies the site configurations from the web app the deployment slot belongs to.
             *
             * @return the next stage of the definition
             */
            WithCreate withConfigurationFromParent();

            /**
             * Copies the site configurations from a given web app.
             *
             * @param webApp the web app to copy the configurations from
             * @return the next stage of the definition
             */
            WithCreate withConfigurationFromWebApp(WebApp webApp);

            /**
             * Copies the site configurations from a given deployment slot.
             *
             * @param deploymentSlot the deployment slot to copy the configurations from
             * @return the next stage of the definition
             */
            WithCreate withConfigurationFromDeploymentSlot(DeploymentSlot deploymentSlot);
        }

        /**
         * A site definition with sufficient inputs to create a new web app / deployments slot in the cloud, but
         * exposing additional optional inputs to specify.
         */
        interface WithCreate extends Creatable<DeploymentSlot>, WebAppBase.DefinitionStages.WithCreate<DeploymentSlot> {
        }
    }
}


private static void generic(Exchange exchange) throws IOException

package org.knowm.xchange.examples.btctrade.trade;

import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.btctrade.BTCTradeExchange;
import org.knowm.xchange.btctrade.dto.trade.BTCTradeOrder;
import org.knowm.xchange.btctrade.service.BTCTradeTradeServiceRaw;
import org.knowm.xchange.dto.marketdata.Trades;
import org.knowm.xchange.dto.trade.OpenOrders;
import org.knowm.xchange.service.trade.TradeService;

public class TradeHistoryDemo {

    public static void main(String[] args) throws IOException {
        // API key with Read Only Permission or All Permissions.
        String publicKey = args[0];
        String privateKey = args[1];
        ExchangeSpecification spec = new ExchangeSpecification(BTCTradeExchange.class);
        spec.setApiKey(publicKey);
        spec.setSecretKey(privateKey);
        Exchange btcTrade = ExchangeFactory.INSTANCE.createExchange(spec);
        generic(btcTrade);
        raw(btcTrade);
    }

{
        TradeService tradeService = exchange.getTradeService();
        OpenOrders openOrders = tradeService.getOpenOrders();
        System.out.println("Open orders: " + openOrders);
        Trades trades = tradeService.getTradeHistory(tradeService.createTradeHistoryParams());
        System.out.println("Trades: " + trades);
    }

    private static void raw(Exchange exchange) throws IOException {
        BTCTradeTradeServiceRaw tradeService = (BTCTradeTradeServiceRaw) exchange.getTradeService();
        BTCTradeOrder[] orders = tradeService.getBTCTradeOrders(0, "open");
        System.out.println("Open orders: " + orders.length);
        String orderId = orders.length > 0 ? orders[0].getId() : "1";
        BTCTradeOrder order = tradeService.getBTCTradeOrder(orderId);
        System.out.println("Order status: " + order.getStatus());
    }
}


{
        BTCTradeTradeServiceRaw tradeService = (BTCTradeTradeServiceRaw) exchange.getTradeService();
        BTCTradeOrder[] orders = tradeService.getBTCTradeOrders(0, "open");
        System.out.println("Open orders: " + orders.length);
        String orderId = orders.length > 0 ? orders[0].getId() : "1";
        BTCTradeOrder order = tradeService.getBTCTradeOrder(orderId);
        System.out.println("Order status: " + order.getStatus());
    }

package org.knowm.xchange.examples.btctrade.trade;

import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.btctrade.BTCTradeExchange;
import org.knowm.xchange.btctrade.dto.trade.BTCTradeOrder;
import org.knowm.xchange.btctrade.service.BTCTradeTradeServiceRaw;
import org.knowm.xchange.dto.marketdata.Trades;
import org.knowm.xchange.dto.trade.OpenOrders;
import org.knowm.xchange.service.trade.TradeService;

public class TradeHistoryDemo {

    public static void main(String[] args) throws IOException {
        // API key with Read Only Permission or All Permissions.
        String publicKey = args[0];
        String privateKey = args[1];
        ExchangeSpecification spec = new ExchangeSpecification(BTCTradeExchange.class);
        spec.setApiKey(publicKey);
        spec.setSecretKey(privateKey);
        Exchange btcTrade = ExchangeFactory.INSTANCE.createExchange(spec);
        generic(btcTrade);
        raw(btcTrade);
    }

    private static void generic(Exchange exchange) throws IOException {
        TradeService tradeService = exchange.getTradeService();
        OpenOrders openOrders = tradeService.getOpenOrders();
        System.out.println("Open orders: " + openOrders);
        Trades trades = tradeService.getTradeHistory(tradeService.createTradeHistoryParams());
        System.out.println("Trades: " + trades);
    }

    private static void raw(Exchange exchange) throws IOException


package org.knowm.xchange.examples.btctrade.trade;

import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.ExchangeSpecification;
import org.knowm.xchange.btctrade.BTCTradeExchange;
import org.knowm.xchange.btctrade.dto.trade.BTCTradeOrder;
import org.knowm.xchange.btctrade.service.BTCTradeTradeServiceRaw;
import org.knowm.xchange.dto.marketdata.Trades;
import org.knowm.xchange.dto.trade.OpenOrders;
import org.knowm.xchange.service.trade.TradeService;

public class TradeHistoryDemo {

    public static void main(String[] args) throws IOException {
        // API key with Read Only Permission or All Permissions.
        String publicKey = args[0];
        String privateKey = args[1];
        ExchangeSpecification spec = new ExchangeSpecification(BTCTradeExchange.class);
        spec.setApiKey(publicKey);
        spec.setSecretKey(privateKey);
        Exchange btcTrade = ExchangeFactory.INSTANCE.createExchange(spec);
        generic(btcTrad

        raw(btcTrade);
    }

    private static void generic(Exchange exchange) throws IOException {
        TradeService tradeService = exchange.getTradeService();
        OpenOrders openOrders = tradeService.getOpenOrders();
        System.out.println("Open orders: " + openOrders);
        Trades trades = tradeService.getTradeHistory(tradeService.createTradeHistoryParams());
        System.out.println("Trades: " + trades);
    }

    private static void raw(Exchange exchange) throws IOException {
        BTCTradeTradeServiceRaw tradeService = (BTCTradeTradeServiceRaw) exchange.getTradeService();
        BTCTradeOrder[] orders = tradeService.getBTCTradeOrders(0, "open");
        System.out.println("Open orders: " + orders.length);
        String orderId = orders.length > 0 ? orders[0].getId() : "1";
        BTCTradeOrder order = tradeService.getBTCTradeOrder(orderId);
        System.out.println("Order status: " + order.getStatus());
    }
}


public void setAccessibilityServiceEnabled(boolean enabled)

package com.hrs.filltheform.main;

import android.os.Parcel;
import android.os.Parcelable;
import com.hrs.filltheform.common.PropertyChangedListener;
import java.util.List;

/**
 * This model class holds the state and manages behavior of the MainActivity.
 */
public class MainActivityModel implements Parcelable {

    public static final String PROPERTY_PERMISSIONS_HEADER = "property_permissions_header";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER = "property_system_alert_window_container";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION = "property_system_alert_window_permission";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER = "property_read_external_storage_container";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION = "property_read_external_storage_permission";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER = "property_load_configuration_file_container";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON = "property_load_configuration_file_button";

    public static final String PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON = "property_select_configuration_file_button";

    public static final String PROPERTY_CONFIGURATION_FILE_ATTRIBUTES = "property_configuration_file_attributes";

    public static final String PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES = "property_save_configuration_file_attributes";

    public static final String PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS = "property_configuration_loading_in_progress";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER = "property_accessibility_service_container";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_BUTTON = "property_accessibility_service_button";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER = "property_loaded_package_names_container";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_EMPTY = "property_loaded_package_names_empty";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_LIST = "property_loaded_package_names_list";

    private PropertyChangedListener propertyChangedListener;

    private boolean permissionsHeaderVisible = true;

    private boolean systemAlertWindowContainerVisible = true;

    private boolean readExternalStorageContainerVisible = true;

    private boolean accessibilityServiceContainerVisible = true;

    private boolean loadConfigurationFileContainerVisible = false;

    private String configurationFilePath;

    private String configurationFileName;

    private boolean loadedPackageNamesContainerVisible = false;

    private boolean loadedPackageNamesEmptyVisible = false;

    private boolean loadedPackageNamesListVisible = false;

    private List<String> loadedPackageNames;

    private boolean configurationLoadingInProgress = false;

    public MainActivityModel() {
    }

    // Permissions header
    public boolean isPermissionsHeaderVisible() {
        return permissionsHeaderVisible;
    }

    private void setPermissionHeaderVisible(boolean permissionHeaderVisible) {
        this.permissionsHeaderVisible = permissionHeaderVisible;
        notifyPropertyChanged(PROPERTY_PERMISSIONS_HEADER);
    }

    // Permission buttons
    public void onEnableSystemAlertWindowContainerButtonClicked() {
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION);
    }

    public void onEnableReadExternalStorageButtonClicked() {
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION);
    }

    // Permissions enable/disable
    public void setSystemAlertWindowPermissionEnabled(boolean enabled) {
        setSystemAlertWindowContainerVisible(!enabled);
    }

    public void setReadExternalStorageEnabled(boolean enabled) {
        setReadExternalStorageContainerVisible(!enabled);
    }

    // Permission view containers
    public boolean isSystemAlertWindowContainerVisible() {
        return systemAlertWindowContainerVisible;
    }

    private void setSystemAlertWindowContainerVisible(boolean systemAlertWindowContainerVisible) {
        this.systemAlertWindowContainerVisible = systemAlertWindowContainerVisible;
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER);
    }

    public boolean isReadExternalStorageContainerVisible() {
        return readExternalStorageContainerVisible;
    }

    private void setReadExternalStorageContainerVisible(boolean readExternalStorageContainerVisible) {
        this.readExternalStorageContainerVisible = readExternalStorageContainerVisible;
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER);
    }

    // Load configuration file
    public void checkIfLoadingOfConfigurationFileIsAllowed() {
        boolean allowed;
        allowed = !(systemAlertWindowContainerVisible || accessibilityServiceContainerVisible || readExternalStorageContainerVisible);
        setLoadConfigurationFileContainerVisible(allowed);
        setLoadedPackageNamesContainerVisible(allowed);
        setPermissionHeaderVisible(!allowed);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    public boolean isLoadConfigurationFileContainerVisible() {
        return loadConfigurationFileContainerVisible;
    }

    private void setLoadConfigurationFileContainerVisible(boolean loadConfigurationFileContainerVisible) {
        this.loadConfigurationFileContainerVisible = loadConfigurationFileContainerVisible;
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER);
    }

    public void onLoadConfigurationFileButtonClicked() {
        setLoadedPackageNamesListVisible(false);
        setConfigurationLoadingInProgress(true);
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON);
    }

    public void onSelectConfigurationFileButtonClicked() {
        notifyPropertyChanged(PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON);
    }

    public String getConfigurationFilePath() {
        return configurationFilePath;
    }

    public String getConfigurationFileName() {
        return configurationFileName;
    }

    public void setConfigurationFileAttributes(String configurationFilePath, String configurationFileName) {
        this.configurationFilePath = configurationFilePath;
        this.configurationFileName = configurationFileName;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public void saveConfigurationFileAttributes() {
        notifyPropertyChanged(PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public boolean isConfigurationLoadingInProgress() {
        return configurationLoadingInProgress;
    }

    private void setConfigurationLoadingInProgress(boolean configurationLoadingInProgress) {
        this.configurationLoadingInProgress = configurationLoadingInProgress;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    // Accessibility service
    public void onEnableAccessibilityServiceButtonClicked() {
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_BUTTON);
    }

{
        setAccessibilityServiceContainerVisible(!enabled);
    }

    public boolean isAccessibilityServiceContainerVisible() {
        return accessibilityServiceContainerVisible;
    }

    private void setAccessibilityServiceContainerVisible(boolean accessibilityServiceContainerVisible) {
        this.accessibilityServiceContainerVisible = accessibilityServiceContainerVisible;
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER);
    }

    // Package names
    public List<String> getLoadedPackageNames() {
        return loadedPackageNames;
    }

    public void onPackageNamesLoaded(List<String> loadedPackageNames) {
        this.loadedPackageNames = loadedPackageNames;
        setConfigurationLoadingInProgress(false);
        if (loadedPackageNames == null || loadedPackageNames.isEmpty()) {
            setLoadedPackageNamesEmptyVisible(true);
            setLoadedPackageNamesListVisible(false);
        } else {
            setLoadedPackageNamesEmptyVisible(false);
            setLoadedPackageNamesListVisible(true);
        }
    }

    public boolean isLoadedPackageNamesListVisible() {
        return loadedPackageNamesListVisible;
    }

    private void setLoadedPackageNamesListVisible(boolean loadedPackageNamesListVisible) {
        this.loadedPackageNamesListVisible = loadedPackageNamesListVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_LIST);
    }

    public boolean isLoadedPackageNamesContainerVisible() {
        return loadedPackageNamesContainerVisible;
    }

    private void setLoadedPackageNamesContainerVisible(boolean loadedPackageNamesContainerVisible) {
        this.loadedPackageNamesContainerVisible = loadedPackageNamesContainerVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER);
    }

    // Property changes
    public void setPropertyChangedListener(PropertyChangedListener propertyChangedListener) {
        this.propertyChangedListener = propertyChangedListener;
    }

    private void notifyPropertyChanged(String property) {
        if (propertyChangedListener != null) {
            propertyChangedListener.onPropertyChanged(property);
        }
    }

    public boolean isLoadedPackageNamesEmptyVisible() {
        return loadedPackageNamesEmptyVisible;
    }

    private void setLoadedPackageNamesEmptyVisible(boolean loadedPackageNamesEmptyVisible) {
        this.loadedPackageNamesEmptyVisible = loadedPackageNamesEmptyVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_EMPTY);
    }

    // Parcelable
    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(permissionsHeaderVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(systemAlertWindowContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(readExternalStorageContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(accessibilityServiceContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadConfigurationFileContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeString(this.configurationFilePath);
        dest.writeString(this.configurationFileName);
        dest.writeByte(loadedPackageNamesContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesEmptyVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesListVisible ? (byte) 1 : (byte) 0);
        dest.writeStringList(this.loadedPackageNames);
        dest.writeByte(configurationLoadingInProgress ? (byte) 1 : (byte) 0);
    }

    @SuppressWarnings("WeakerAccess")
    protected MainActivityModel(Parcel in) {
        this.permissionsHeaderVisible = in.readByte() != 0;
        this.systemAlertWindowContainerVisible = in.readByte() != 0;
        this.readExternalStorageContainerVisible = in.readByte() != 0;
        this.accessibilityServiceContainerVisible = in.readByte() != 0;
        this.loadConfigurationFileContainerVisible = in.readByte() != 0;
        this.configurationFilePath = in.readString();
        this.configurationFileName = in.readString();
        this.loadedPackageNamesContainerVisible = in.readByte() != 0;
        this.loadedPackageNamesEmptyVisible = in.readByte() != 0;
        this.loadedPackageNamesListVisible = in.readByte() != 0;
        this.loadedPackageNames = in.createStringArrayList();
        this.configurationLoadingInProgress = in.readByte() != 0;
    }

    public static final Creator<MainActivityModel> CREATOR = new Creator<MainActivityModel>() {

        public MainActivityModel createFromParcel(Parcel source) {
            return new MainActivityModel(source);
        }

        public MainActivityModel[] newArray(int size) {
            return new MainActivityModel[size];
        }
    };
}


{
        if (propertyChangedListener != null) {
            propertyChangedListener.onPropertyChanged(property);
        }
    }

package com.hrs.filltheform.main;

import android.os.Parcel;
import android.os.Parcelable;
import com.hrs.filltheform.common.PropertyChangedListener;
import java.util.List;

/**
 * This model class holds the state and manages behavior of the MainActivity.
 */
public class MainActivityModel implements Parcelable {

    public static final String PROPERTY_PERMISSIONS_HEADER = "property_permissions_header";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER = "property_system_alert_window_container";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION = "property_system_alert_window_permission";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER = "property_read_external_storage_container";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION = "property_read_external_storage_permission";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER = "property_load_configuration_file_container";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON = "property_load_configuration_file_button";

    public static final String PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON = "property_select_configuration_file_button";

    public static final String PROPERTY_CONFIGURATION_FILE_ATTRIBUTES = "property_configuration_file_attributes";

    public static final String PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES = "property_save_configuration_file_attributes";

    public static final String PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS = "property_configuration_loading_in_progress";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER = "property_accessibility_service_container";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_BUTTON = "property_accessibility_service_button";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER = "property_loaded_package_names_container";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_EMPTY = "property_loaded_package_names_empty";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_LIST = "property_loaded_package_names_list";

    private PropertyChangedListener propertyChangedListener;

    private boolean permissionsHeaderVisible = true;

    private boolean systemAlertWindowContainerVisible = true;

    private boolean readExternalStorageContainerVisible = true;

    private boolean accessibilityServiceContainerVisible = true;

    private boolean loadConfigurationFileContainerVisible = false;

    private String configurationFilePath;

    private String configurationFileName;

    private boolean loadedPackageNamesContainerVisible = false;

    private boolean loadedPackageNamesEmptyVisible = false;

    private boolean loadedPackageNamesListVisible = false;

    private List<String> loadedPackageNames;

    private boolean configurationLoadingInProgress = false;

    public MainActivityModel() {
    }

    // Permissions header
    public boolean isPermissionsHeaderVisible() {
        return permissionsHeaderVisible;
    }

    private void setPermissionHeaderVisible(boolean permissionHeaderVisible) {
        this.permissionsHeaderVisible = permissionHeaderVisible;
        notifyPropertyChanged(PROPERTY_PERMISSIONS_HEADER);
    }

    // Permission buttons
    public void onEnableSystemAlertWindowContainerButtonClicked() {
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION);
    }

    public void onEnableReadExternalStorageButtonClicked() {
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION);
    }

    // Permissions enable/disable
    public void setSystemAlertWindowPermissionEnabled(boolean enabled) {
        setSystemAlertWindowContainerVisible(!enabled);
    }

    public void setReadExternalStorageEnabled(boolean enabled) {
        setReadExternalStorageContainerVisible(!enabled);
    }

    // Permission view containers
    public boolean isSystemAlertWindowContainerVisible() {
        return systemAlertWindowContainerVisible;
    }

    private void setSystemAlertWindowContainerVisible(boolean systemAlertWindowContainerVisible) {
        this.systemAlertWindowContainerVisible = systemAlertWindowContainerVisible;
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER);
    }

    public boolean isReadExternalStorageContainerVisible() {
        return readExternalStorageContainerVisible;
    }

    private void setReadExternalStorageContainerVisible(boolean readExternalStorageContainerVisible) {
        this.readExternalStorageContainerVisible = readExternalStorageContainerVisible;
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER);
    }

    // Load configuration file
    public void checkIfLoadingOfConfigurationFileIsAllowed() {
        boolean allowed;
        allowed = !(systemAlertWindowContainerVisible || accessibilityServiceContainerVisible || readExternalStorageContainerVisible);
        setLoadConfigurationFileContainerVisible(allowed);
        setLoadedPackageNamesContainerVisible(allowed);
        setPermissionHeaderVisible(!allowed);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    public boolean isLoadConfigurationFileContainerVisible() {
        return loadConfigurationFileContainerVisible;
    }

    private void setLoadConfigurationFileContainerVisible(boolean loadConfigurationFileContainerVisible) {
        this.loadConfigurationFileContainerVisible = loadConfigurationFileContainerVisible;
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER);
    }

    public void onLoadConfigurationFileButtonClicked() {
        setLoadedPackageNamesListVisible(false);
        setConfigurationLoadingInProgress(true);
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON);
    }

    public void onSelectConfigurationFileButtonClicked() {
        notifyPropertyChanged(PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON);
    }

    public String getConfigurationFilePath() {
        return configurationFilePath;
    }

    public String getConfigurationFileName() {
        return configurationFileName;
    }

    public void setConfigurationFileAttributes(String configurationFilePath, String configurationFileName) {
        this.configurationFilePath = configurationFilePath;
        this.configurationFileName = configurationFileName;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public void saveConfigurationFileAttributes() {
        notifyPropertyChanged(PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public boolean isConfigurationLoadingInProgress() {
        return configurationLoadingInProgress;
    }

    private void setConfigurationLoadingInProgress(boolean configurationLoadingInProgress) {
        this.configurationLoadingInProgress = configurationLoadingInProgress;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    // Accessibility service
    public void onEnableAccessibilityServiceButtonClicked() {
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_BUTTON);
    }

    public void setAccessibilityServiceEnabled(boolean enabled) {
        setAccessibilityServiceContainerVisible(!enabled);
    }

    public boolean isAccessibilityServiceContainerVisible() {
        return accessibilityServiceContainerVisible;
    }

    private void setAccessibilityServiceContainerVisible(boolean accessibilityServiceContainerVisible) {
        this.accessibilityServiceContainerVisible = accessibilityServiceContainerVisible;
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER);
    }

    // Package names
    public List<String> getLoadedPackageNames() {
        return loadedPackageNames;
    }

    public void onPackageNamesLoaded(List<String> loadedPackageNames) {
        this.loadedPackageNames = loadedPackageNames;
        setConfigurationLoadingInProgress(false);
        if (loadedPackageNames == null || loadedPackageNames.isEmpty()) {
            setLoadedPackageNamesEmptyVisible(true);
            setLoadedPackageNamesListVisible(false);
        } else {
            setLoadedPackageNamesEmptyVisible(false);
            setLoadedPackageNamesListVisible(true);
        }
    }

    public boolean isLoadedPackageNamesListVisible() {
        return loadedPackageNamesListVisible;
    }

    private void setLoadedPackageNamesListVisible(boolean loadedPackageNamesListVisible) {
        this.loadedPackageNamesListVisible = loadedPackageNamesListVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_LIST);
    }

    public boolean isLoadedPackageNamesContainerVisible() {
        return loadedPackageNamesContainerVisible;
    }

    private void setLoadedPackageNamesContainerVisible(boolean loadedPackageNamesContainerVisible) {
        this.loadedPackageNamesContainerVisible = loadedPackageNamesContainerVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER);
    }

    // Property changes
    public void setPropertyChangedListener(PropertyChangedListener propertyChangedListener) {
        this.propertyChangedListener = propertyChangedListener;
    }

    private void notifyPropertyChanged(String property)

    public boolean isLoadedPackageNamesEmptyVisible() {
        return loadedPackageNamesEmptyVisible;
    }

    private void setLoadedPackageNamesEmptyVisible(boolean loadedPackageNamesEmptyVisible) {
        this.loadedPackageNamesEmptyVisible = loadedPackageNamesEmptyVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_EMPTY);
    }

    // Parcelable
    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(permissionsHeaderVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(systemAlertWindowContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(readExternalStorageContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(accessibilityServiceContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadConfigurationFileContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeString(this.configurationFilePath);
        dest.writeString(this.configurationFileName);
        dest.writeByte(loadedPackageNamesContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesEmptyVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesListVisible ? (byte) 1 : (byte) 0);
        dest.writeStringList(this.loadedPackageNames);
        dest.writeByte(configurationLoadingInProgress ? (byte) 1 : (byte) 0);
    }

    @SuppressWarnings("WeakerAccess")
    protected MainActivityModel(Parcel in) {
        this.permissionsHeaderVisible = in.readByte() != 0;
        this.systemAlertWindowContainerVisible = in.readByte() != 0;
        this.readExternalStorageContainerVisible = in.readByte() != 0;
        this.accessibilityServiceContainerVisible = in.readByte() != 0;
        this.loadConfigurationFileContainerVisible = in.readByte() != 0;
        this.configurationFilePath = in.readString();
        this.configurationFileName = in.readString();
        this.loadedPackageNamesContainerVisible = in.readByte() != 0;
        this.loadedPackageNamesEmptyVisible = in.readByte() != 0;
        this.loadedPackageNamesListVisible = in.readByte() != 0;
        this.loadedPackageNames = in.createStringArrayList();
        this.configurationLoadingInProgress = in.readByte() != 0;
    }

    public static final Creator<MainActivityModel> CREATOR = new Creator<MainActivityModel>() {

        public MainActivityModel createFromParcel(Parcel source) {
            return new MainActivityModel(source);
        }

        public MainActivityModel[] newArray(int size) {
            return new MainActivityModel[size];
        }
    };
}


package com.hrs.filltheform.main;

import android.os.Parcel;
import android.os.Parcelable;
import com.hrs.filltheform.common.PropertyChangedListener;
import java.util.List;

/**
 * This model class holds the state and manages behavior of the MainActivity.
 */
public class MainActivityModel implements Parcelable {

    public static final String PROPERTY_PERMISSIONS_HEADER = "property_permissions_header";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER = "property_system_alert_window_container";

    public static final String PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION = "property_system_alert_window_permission";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER = "property_read_external_storage_container";

    public static final String PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION = "property_read_external_storage_permission";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER = "property_load_configuration_file_container";

    public static final String PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON = "property_load_configuration_file_button";

    public static final String PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON = "property_select_configuration_file_button";

    public static final String PROPERTY_CONFIGURATION_FILE_ATTRIBUTES = "property_configuration_file_attributes";

    public static final String PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES = "property_save_configuration_file_attributes";

    public static final String PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS = "property_configuration_loading_in_progress";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER = "property_accessibility_service_container";

    public static final String PROPERTY_ACCESSIBILITY_SERVICE_BUTTON = "property_accessibility_service_button";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER = "property_loaded_package_names_container";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_EMPTY = "property_loaded_package_names_empty";

    public static final String PROPERTY_LOADED_PACKAGE_NAMES_LIST = "property_loaded_package_names_list";

    private PropertyChangedListener propertyChangedListener;

    private boolean permissionsHeaderVisible = true;

    private boolean systemAlertWindowContainerVisible = true;

    private boolean readExternalStorageContainerVisible = true;

    private boolean accessibilityServiceContainerVisible = true;

    private boolean loadConfigurationFileContainerVisible = false;

    private String configurationFilePath;

    private String configurationFileName;

    private boolean loadedPackageNamesContainerVisible = false;

    private boolean loadedPackageNamesEmptyVisible = false;

    private boolean loadedPackageNamesListVisible = false;

    private List<String> loadedPackageNames;

    private boolean configurationLoadingInProgress = false;

    public MainActivityModel() {
    }

    // Permissions header
    public boolean isPermissionsHeaderVisible() {
        return permissionsHeaderVisible;
    }

    private void setPermissionHeaderVisible(boolean permissionHeaderVisible) {
        this.permissionsHeaderVisible = permissionHeaderVisible;
        notifyPropertyChanged(PROPERTY_PERMISSIONS_HEADER);
    }

    // Permission buttons
    public void onEnableSystemAlertWindowContainerButtonClicked() {
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_PERMISSION);
    }

    public void onEnableReadExternalStorageButtonClicked() {
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_PERMISSION);
    }

    // Permissions enable/disable
    public void setSystemAlertWindowPermissionEnabled(boolean enabled) {
        setSystemAlertWindowContainerVisible(!enabled);
    }

    public void setReadExternalStorageEnabled(boolean enabled) {
        setReadExternalStorageContainerVisible(!enabled);
    }

    // Permission view containers
    public boolean isSystemAlertWindowContainerVisible() {
        return systemAlertWindowContainerVisible;
    }

    private void setSystemAlertWindowContainerVisible(boolean systemAlertWindowContainerVisible) {
        this.systemAlertWindowContainerVisible = systemAlertWindowContainerVisible;
        notifyPropertyChanged(PROPERTY_SYSTEM_ALERT_WINDOW_CONTAINER);
    }

    public boolean isReadExternalStorageContainerVisible() {
        return readExternalStorageContainerVisible;
    }

    private void setReadExternalStorageContainerVisible(boolean readExternalStorageContainerVisible) {
        this.readExternalStorageContainerVisible = readExternalStorageContainerVisible;
        notifyPropertyChanged(PROPERTY_READ_EXTERNAL_STORAGE_CONTAINER);
    }

    // Load configuration file
    public void checkIfLoadingOfConfigurationFileIsAllowed() {
        boolean allowed;
        allowed = !(systemAlertWindowContainerVisible || accessibilityServiceContainerVisible || readExternalStorageContainerVisible);
        setLoad

        setLoadedPackageNamesContainerVisible(allowed);
        setPermissionHeaderVisible(!allowed);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    public boolean isLoadConfigurationFileContainerVisible() {
        return loadConfigurationFileContainerVisible;
    }

    private void setLoadConfigurationFileContainerVisible(boolean loadConfigurationFileContainerVisible) {
        this.loadConfigurationFileContainerVisible = loadConfigurationFileContainerVisible;
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_CONTAINER);
    }

    public void onLoadConfigurationFileButtonClicked() {
        setLoadedPackageNamesListVisible(false);
        setConfigurationLoadingInProgress(true);
        notifyPropertyChanged(PROPERTY_LOAD_CONFIGURATION_FILE_BUTTON);
    }

    public void onSelectConfigurationFileButtonClicked() {
        notifyPropertyChanged(PROPERTY_SELECT_CONFIGURATION_FILE_BUTTON);
    }

    public String getConfigurationFilePath() {
        return configurationFilePath;
    }

    public String getConfigurationFileName() {
        return configurationFileName;
    }

    public void setConfigurationFileAttributes(String configurationFilePath, String configurationFileName) {
        this.configurationFilePath = configurationFilePath;
        this.configurationFileName = configurationFileName;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public void saveConfigurationFileAttributes() {
        notifyPropertyChanged(PROPERTY_SAVE_CONFIGURATION_FILE_ATTRIBUTES);
    }

    public boolean isConfigurationLoadingInProgress() {
        return configurationLoadingInProgress;
    }

    private void setConfigurationLoadingInProgress(boolean configurationLoadingInProgress) {
        this.configurationLoadingInProgress = configurationLoadingInProgress;
        notifyPropertyChanged(PROPERTY_CONFIGURATION_LOADING_IN_PROGRESS);
    }

    // Accessibility service
    public void onEnableAccessibilityServiceButtonClicked() {
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_BUTTON);
    }

    public void setAccessibilityServiceEnabled(boolean enabled) {
        setAccessibilityServiceContainerVisible(!enabled);
    }

    public boolean isAccessibilityServiceContainerVisible() {
        return accessibilityServiceContainerVisible;
    }

    private void setAccessibilityServiceContainerVisible(boolean accessibilityServiceContainerVisible) {
        this.accessibilityServiceContainerVisible = accessibilityServiceContainerVisible;
        notifyPropertyChanged(PROPERTY_ACCESSIBILITY_SERVICE_CONTAINER);
    }

    // Package names
    public List<String> getLoadedPackageNames() {
        return loadedPackageNames;
    }

    public void onPackageNamesLoaded(List<String> loadedPackageNames) {
        this.loadedPackageNames = loadedPackageNames;
        setConfigurationLoadingInProgress(false);
        if (loadedPackageNames == null || loadedPackageNames.isEmpty()) {
            setLoadedPackageNamesEmptyVisible(true);
            setLoadedPackageNamesListVisible(false);
        } else {
            setLoadedPackageNamesEmptyVisible(false);
            setLoadedPackageNamesListVisible(true);
        }
    }

    public boolean isLoadedPackageNamesListVisible() {
        return loadedPackageNamesListVisible;
    }

    private void setLoadedPackageNamesListVisible(boolean loadedPackageNamesListVisible) {
        this.loadedPackageNamesListVisible = loadedPackageNamesListVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_LIST);
    }

    public boolean isLoadedPackageNamesContainerVisible() {
        return loadedPackageNamesContainerVisible;
    }

    private void setLoadedPackageNamesContainerVisible(boolean loadedPackageNamesContainerVisible) {
        this.loadedPackageNamesContainerVisible = loadedPackageNamesContainerVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_CONTAINER);
    }

    // Property changes
    public void setPropertyChangedListener(PropertyChangedListener propertyChangedListener) {
        this.propertyChangedListener = propertyChangedListener;
    }

    private void notifyPropertyChanged(String property) {
        if (propertyChangedListener != null) {
            propertyChangedListener.onPropertyChanged(property);
        }
    }

    public boolean isLoadedPackageNamesEmptyVisible() {
        return loadedPackageNamesEmptyVisible;
    }

    private void setLoadedPackageNamesEmptyVisible(boolean loadedPackageNamesEmptyVisible) {
        this.loadedPackageNamesEmptyVisible = loadedPackageNamesEmptyVisible;
        notifyPropertyChanged(PROPERTY_LOADED_PACKAGE_NAMES_EMPTY);
    }

    // Parcelable
    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(permissionsHeaderVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(systemAlertWindowContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(readExternalStorageContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(accessibilityServiceContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadConfigurationFileContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeString(this.configurationFilePath);
        dest.writeString(this.configurationFileName);
        dest.writeByte(loadedPackageNamesContainerVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesEmptyVisible ? (byte) 1 : (byte) 0);
        dest.writeByte(loadedPackageNamesListVisible ? (byte) 1 : (byte) 0);
        dest.writeStringList(this.loadedPackageNames);
        dest.writeByte(configurationLoadingInProgress ? (byte) 1 : (byte) 0);
    }

    @SuppressWarnings("WeakerAccess")
    protected MainActivityModel(Parcel in) {
        this.permissionsHeaderVisible = in.readByte() != 0;
        this.systemAlertWindowContainerVisible = in.readByte() != 0;
        this.readExternalStorageContainerVisible = in.readByte() != 0;
        this.accessibilityServiceContainerVisible = in.readByte() != 0;
        this.loadConfigurationFileContainerVisible = in.readByte() != 0;
        this.configurationFilePath = in.readString();
        this.configurationFileName = in.readString();
        this.loadedPackageNamesContainerVisible = in.readByte() != 0;
        this.loadedPackageNamesEmptyVisible = in.readByte() != 0;
        this.loadedPackageNamesListVisible = in.readByte() != 0;
        this.loadedPackageNames = in.createStringArrayList();
        this.configurationLoadingInProgress = in.readByte() != 0;
    }

    public static final Creator<MainActivityModel> CREATOR = new Creator<MainActivityModel>() {

        public MainActivityModel createFromParcel(Parcel source) {
            return new MainActivityModel(source);
        }

        public MainActivityModel[] newArray(int size) {
            return new MainActivityModel[size];
        }
    };
}


package com.biglybt.pif.ipfilter;

/**
 * @author parg
 */
public interface IPBlocked {

    public String getBlockedIP();

    /**
     * returns the torrent name the IP was blocked trying to access
     * @return
     */

    public long getBlockedTime();

    public IPRange getBlockingRange();
}


@Override
    public void configureChannels() throws OwException

package org.openhab.binding.onewire.internal.device;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.onewire.internal.DigitalIoConfig;
import org.openhab.binding.onewire.internal.OwException;
import org.openhab.binding.onewire.internal.SensorId;
import org.openhab.binding.onewire.internal.handler.OwBaseThingHandler;
import org.openhab.binding.onewire.internal.owserver.OwserverDeviceParameter;

/**
 * The {@link DS2405} class defines an DS2405 device
 *
 * @author Jan N. Klug - Initial contribution
 */
@NonNullByDefault
public class DS2405 extends AbstractDigitalOwDevice {

    public DS2405(SensorId sensorId, OwBaseThingHandler callback) {
        super(sensorId, callback);
    }

{
        OwserverDeviceParameter inParam = new OwserverDeviceParameter("uncached/", "/sensed");
        OwserverDeviceParameter outParam = new OwserverDeviceParameter("/PIO");
        ioConfig.add(new DigitalIoConfig(callback.getThing(), 0, inParam, outParam));
        fullInParam = inParam;
        fullOutParam = outParam;
        super.configureChannels();
    }
}


{
        OwserverDeviceParameter inParam = new OwserverDeviceParameter("uncached/", "/sensed");
        OwserverDeviceParameter outParam = new OwserverDeviceParameter("/PIO");
        ioConfig.add(new DigitalIoConfig(callback.getThing(), 0, inParam, outParam));
        fullInParam = inParam;
        fullOutParam = outParam;
        super.configureChannels();
    }

package org.openhab.binding.onewire.internal.device;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.onewire.internal.DigitalIoConfig;
import org.openhab.binding.onewire.internal.OwException;
import org.openhab.binding.onewire.internal.SensorId;
import org.openhab.binding.onewire.internal.handler.OwBaseThingHandler;
import org.openhab.binding.onewire.internal.owserver.OwserverDeviceParameter;

/**
 * The {@link DS2405} class defines an DS2405 device
 *
 * @author Jan N. Klug - Initial contribution
 */
@NonNullByDefault
public class DS2405 extends AbstractDigitalOwDevice {

    public DS2405(SensorId sensorId, OwBaseThingHandler callback) {
        super(sensorId, callback);
    }

    @Override
    public void configureChannels() throws OwException


package org.openhab.binding.onewire.internal.device;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.onewire.internal.DigitalIoConfig;
import org.openhab.binding.onewire.internal.OwException;
import org.openhab.binding.onewire.internal.SensorId;
import org.openhab.binding.onewire.internal.handler.OwBaseThingHandler;
import org.openhab.binding.onewire.internal.owserver.OwserverDeviceParameter;

/**
 * The {@link DS2405} class defines an DS2405 device
 *
 * @author Jan N. Klug - Initial contribution
 */
@NonNullByDefault
public class DS2405 extends AbstractDigitalOwDevice {

    public DS2405(SensorId sensorId, OwBaseThingHandler callback) {
        super(sensorId, callback);
    }

    @Override
    public void configureChannels() throws OwException {
        OwserverDeviceParameter inParam = new OwserverDeviceParameter("uncached/", "/sensed");
        OwserverDeviceParameter outParam = new OwserverDeviceParameter("/PIO");
        ioConfig.add(new DigitalIoConfig(callback.getThing(), 0, inParam, outParam));
        fullInParam = inPar

        fullOutParam = outParam;
        super.configureChannels();
    }
}


@Override
    protected void onCreate(Bundle savedInstanceState)

package trans.miaoyongjun.ptf;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import miaoyongjun.pagetransformer.TransitionEffect;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

{
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.slowBtn).setOnClickListener(this);
        findViewById(R.id.zoom).setOnClickListener(this);
        findViewById(R.id.zoomStack).setOnClickListener(this);
        findViewById(R.id.cube).setOnClickListener(this);
        findViewById(R.id.depth).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch(v.getId()) {
            case R.id.slowBtn:
                ShowActivity.transitionEffect = TransitionEffect.SlowBackground;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.zoom:
                ShowZoomActivity.transitionEffect = TransitionEffect.Zoom;
                startActivity(new Intent(MainActivity.this, ShowZoomActivity.class));
                break;
            case R.id.zoomStack:
                ShowActivity.transitionEffect = TransitionEffect.ZoomStack;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.cube:
                ShowActivity.transitionEffect = TransitionEffect.Cube;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.depth:
                ShowActivity.transitionEffect = TransitionEffect.Depth;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
        }
    }
}


{
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.slowBtn).setOnClickListener(this);
        findViewById(R.id.zoom).setOnClickListener(this);
        findViewById(R.id.zoomStack).setOnClickListener(this);
        findViewById(R.id.cube).setOnClickListener(this);
        findViewById(R.id.depth).setOnClickListener(this);
    }

package trans.miaoyongjun.ptf;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import miaoyongjun.pagetransformer.TransitionEffect;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState)

    @Override
    public void onClick(View v) {
        switch(v.getId()) {
            case R.id.slowBtn:
                ShowActivity.transitionEffect = TransitionEffect.SlowBackground;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.zoom:
                ShowZoomActivity.transitionEffect = TransitionEffect.Zoom;
                startActivity(new Intent(MainActivity.this, ShowZoomActivity.class));
                break;
            case R.id.zoomStack:
                ShowActivity.transitionEffect = TransitionEffect.ZoomStack;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.cube:
                ShowActivity.transitionEffect = TransitionEffect.Cube;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.depth:
                ShowActivity.transitionEffect = TransitionEffect.Depth;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
        }
    }
}


package trans.miaoyongjun.ptf;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import miaoyongjun.pagetransformer.TransitionEffect;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.slowBtn).setOn

        findViewById(R.id.zoom).setOnClickListener(this);
        findViewById(R.id.zoomStack).setOnClickListener(this);
        findViewById(R.id.cube).setOnClickListener(this);
        findViewById(R.id.depth).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch(v.getId()) {
            case R.id.slowBtn:
                ShowActivity.transitionEffect = TransitionEffect.SlowBackground;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.zoom:
                ShowZoomActivity.transitionEffect = TransitionEffect.Zoom;
                startActivity(new Intent(MainActivity.this, ShowZoomActivity.class));
                break;
            case R.id.zoomStack:
                ShowActivity.transitionEffect = TransitionEffect.ZoomStack;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.cube:
                ShowActivity.transitionEffect = TransitionEffect.Cube;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
            case R.id.depth:
                ShowActivity.transitionEffect = TransitionEffect.Depth;
                startActivity(new Intent(MainActivity.this, ShowActivity.class));
                break;
        }
    }
}


public void setExpectedValueJSON(String expectedValueJSON)

package io.irontest.models.assertion;

import com.fasterxml.jackson.annotation.JsonView;
import io.irontest.models.Properties;
import io.irontest.resources.ResourceJsonViews;

@JsonView({ ResourceJsonViews.TeststepEdit.class, ResourceJsonViews.TestcaseExport.class })
public class JSONPathAssertionProperties extends Properties {

    private String jsonPath;

    private String expectedValueJSON;

    public String getJsonPath() {
        return jsonPath;
    }

    public void setJsonPath(String jsonPath) {
        this.jsonPath = jsonPath;
    }

    public String getExpectedValueJSON() {
        return expectedValueJSON;
    }

{
        this.expectedValueJSON = expectedValueJSON;
    }
}


{
        this.jsonPath = jsonPath;
    }

package io.irontest.models.assertion;

import com.fasterxml.jackson.annotation.JsonView;
import io.irontest.models.Properties;
import io.irontest.resources.ResourceJsonViews;

@JsonView({ ResourceJsonViews.TeststepEdit.class, ResourceJsonViews.TestcaseExport.class })
public class JSONPathAssertionProperties extends Properties {

    private String jsonPath;

    private String expectedValueJSON;

    public String getJsonPath() {
        return jsonPath;
    }

    public void setJsonPath(String jsonPath)

    public String getExpectedValueJSON() {
        return expectedValueJSON;
    }

    public void setExpectedValueJSON(String expectedValueJSON) {
        this.expectedValueJSON = expectedValueJSON;
    }
}


package io.irontest.models.assertion;

import com.fasterxml.jackson.annotation.JsonView;
import io.irontest.models.Properties;
import io.irontest.resources.ResourceJsonViews;

@JsonView({ ResourceJsonViews.TeststepEdit.class, ResourceJsonViews.TestcaseExport.class })
public class JSONPathAssertionProperties extends Properties {

    private String jsonPath;

    private String expectedValueJSON;

    public String getJsonPath() {
        retu

    }

    public void setJsonPath(String jsonPath) {
        this.jsonPath = jsonPath;
    }

    public String getExpectedValueJSON() {
        return expectedValueJSON;
    }

    public void setExpectedValueJSON(String expectedValueJSON) {
        this.expectedValueJSON = expectedValueJSON;
    }
}


@Override
    public Observable<FilterResult<ConnectionRef>> call(final Observable<FilterResult<Id>> filterResultObservable)

package org.apache.usergrid.corepersistence.pipeline.read.collect;

import org.apache.usergrid.corepersistence.pipeline.read.AbstractFilter;
import org.apache.usergrid.corepersistence.pipeline.read.EdgePath;
import org.apache.usergrid.corepersistence.pipeline.read.FilterResult;
import org.apache.usergrid.persistence.ConnectionRef;
import org.apache.usergrid.persistence.cassandra.ConnectionRefImpl;
import org.apache.usergrid.persistence.model.entity.Id;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import rx.Observable;

/**
 * This class only exists for 1.0 compatibility, remove once services no longer need connection refs
 */
public class ConnectionRefFilter extends AbstractFilter<FilterResult<Id>, FilterResult<ConnectionRef>> {

    private final Id sourceId;

    private final String connectionType;

    @Inject
    public ConnectionRefFilter(@Assisted("sourceId") final Id sourceId, @Assisted("connectionType") final String connectionType) {
        this.sourceId = sourceId;
        this.connectionType = connectionType;
    }

{
        return filterResultObservable.map(targetResult -> {
            final Id targetId = targetResult.getValue();
            final ConnectionRef ref = new ConnectionRefImpl(sourceId.getType(), sourceId.getUuid(), connectionType, targetId.getType(), targetId.getUuid());
            return new FilterResult<>(ref, Optional.<EdgePath>absent());
        });
    }
}


{
        return filterResultObservable.map(targetResult -> {
            final Id targetId = targetResult.getValue();
            final ConnectionRef ref = new ConnectionRefImpl(sourceId.getType(), sourceId.getUuid(), connectionType, targetId.getType(), targetId.getUuid());
            return new FilterResult<>(ref, Optional.<EdgePath>absent());
        });
    }

package org.apache.usergrid.corepersistence.pipeline.read.collect;

import org.apache.usergrid.corepersistence.pipeline.read.AbstractFilter;
import org.apache.usergrid.corepersistence.pipeline.read.EdgePath;
import org.apache.usergrid.corepersistence.pipeline.read.FilterResult;
import org.apache.usergrid.persistence.ConnectionRef;
import org.apache.usergrid.persistence.cassandra.ConnectionRefImpl;
import org.apache.usergrid.persistence.model.entity.Id;
import com.google.common.base.Optional;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import rx.Observable;

/**
 * This class only exists for 1.0 compatibility, remove once services no longer need connection refs
 */
public class ConnectionRefFilter extends AbstractFilter<FilterResult<Id>, FilterResult<ConnectionRef>> {

    private final Id sourceId;

    private final String connectionType;

    @Inject
    public ConnectionRefFilter(@Assisted("sourceId") final Id sourceId, @Assisted("connectionType") final String connectionType) {
        this.sourceId = sourceId;
        this.connectionType = connectionType;
    }

    @Override
    public Observable<FilterResult<ConnectionRef>> call(final Observable<FilterResult<Id>> filterResultObservable)


@Override
    public boolean equals(Object objectToCompare)

/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.frameworks.governanceaction.search;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;

/**
 * The SearchClassifications class provides support for searching against one or more classifications using a variety of
 * comparison mechanisms.
 */
@JsonAutoDetect(getterVisibility = PUBLIC_ONLY, setterVisibility = PUBLIC_ONLY, fieldVisibility = NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class SearchClassifications implements Serializable {

    private static final long serialVersionUID = 1L;

    private List<ClassificationCondition> conditions;

    private MatchCriteria matchCriteria;

    public SearchClassifications() {
        super();
        // Setup defaults
        matchCriteria = MatchCriteria.ALL;
    }

    /**
     * Copy/clone constructor.
     *
     * @param templateProperties template object to copy.
     */
    public SearchClassifications(SearchClassifications templateProperties) {
        /*
         * An empty properties object is created in the private variable declaration so nothing to do.
         */
        if (templateProperties != null) {
            this.matchCriteria = templateProperties.getMatchCriteria();
            this.conditions = new ArrayList<>();
            this.conditions.addAll(templateProperties.getConditions());
        }
    }

    /**
     * Retrieve the classification conditions against which to match.
     *
     * @return {@code List<ClassificationCondition>}
     */
    public List<ClassificationCondition> getConditions() {
        return conditions;
    }

    /**
     * Set the classification conditions against which to match.
     *
     * @param conditions against which to match
     */
    public void setConditions(List<ClassificationCondition> conditions) {
        this.conditions = conditions;
    }

    /**
     * Retrieve the criteria against which to match the classifications.
     *
     * @return MatchCriteria
     */
    public MatchCriteria getMatchCriteria() {
        return matchCriteria;
    }

    /**
     * Set the criteria against which to match the classifications.
     *
     * @param matchCriteria against which to match the classifications
     */
    public void setMatchCriteria(MatchCriteria matchCriteria) {
        this.matchCriteria = matchCriteria;
    }

    /**
     * Standard toString method.
     *
     * @return JSON style description of variables.
     */
    @Override
    public String toString() {
        return "SearchClassifications{" + "matchCriteria=" + matchCriteria + ", conditions=" + conditions + '}';
    }

    /**
     * Validate that an object is equal depending on their stored values.
     *
     * @param objectToCompare object
     * @return boolean result
     */

{
        if (this == objectToCompare) {
            return true;
        }
        if (!(objectToCompare instanceof SearchClassifications)) {
            return false;
        }
        SearchClassifications that = (SearchClassifications) objectToCompare;
        return getMatchCriteria() == that.getMatchCriteria() && Objects.equals(getConditions(), that.getConditions());
    }

    /**
     * Return a hash code based on the property values
     *
     * @return int hash code
     */
    @Override
    public int hashCode() {
        return Objects.hash(getMatchCriteria(), getConditions());
    }
}