当前位置: 首页>>代码示例>>Java>>正文


Java ShipFilterDto类代码示例

本文整理汇总了Java中logbook.dto.ShipFilterDto的典型用法代码示例。如果您正苦于以下问题:Java ShipFilterDto类的具体用法?Java ShipFilterDto怎么用?Java ShipFilterDto使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ShipFilterDto类属于logbook.dto包,在下文中一共展示了ShipFilterDto类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createContents

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
@Override
protected void createContents() {
    TableWrapper<ItemBean> table = this.addTable(this.shell)
            .setContentSupplier(CreateReportLogic::getItemTablecontent)
            .reload()
            .update();

    table.getTable().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDoubleClick(MouseEvent e) {
            ItemBean[] selection = table.getSelection(ItemBean[]::new);
            for (ItemBean item : selection) {
                ShipFilterDto filter = new ShipFilterDto();
                filter.itemname = item.getName();
                new ShipTable(ItemTable.this.getParent(), filter).open();
            }
        }
    });
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:20,代码来源:ItemTable.java

示例2: itemFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * 装備でフィルタ
 *
 * @param ship
 * @param filter
 */
private static boolean itemFilter(ShipDto ship, ShipFilterDto filter) {
    List<ItemDto> item = ship.getItem();
    boolean hit = false;
    for (ItemDto itemDto : item) {
        if (itemDto != null) {
            if (filter.itemname.equals(itemDto.getName())) {
                hit = true;
                break;
            }
        }
    }
    if (!hit) {
        return false;
    }
    return true;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:23,代码来源:ShipFilterLogic.java

示例3: updateFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
Consumer<ShipFilterDto> updateFilter(int index) {
    return filter -> {
        this.filters.put(index, filter);
        this.tables.get(index)
                .setFilter(new ShipFilterLogic(filter))
                .reload()
                .update();
    };
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:10,代码来源:ShipTable.java

示例4: setTypeFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * 艦種のチェックボックスからフィルターを設定する
 *
 * @param checkbox 艦種のチェックボックス
 * @param dto フィルター
 */
private static void setTypeFilter(Button checkbox, ShipFilterDto dto) {
    String type = checkbox.getText();
    if (checkbox.getSelection()) {
        dto.shipType.add(type);
    } else {
        dto.shipType.remove(type);
    }
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:15,代码来源:ShipFilterDialog.java

示例5: typeFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * 艦種でフィルタ
 *
 * @param ship
 * @param filter
 */
private static boolean typeFilter(ShipDto ship, ShipFilterDto filter) {
    if (ship.getType() == null) {
        return false;
    }
    return filter.shipType.contains(ship.getType());
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:13,代码来源:ShipFilterLogic.java

示例6: ShipTable

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * @param parent
 * @param filter
 */
public ShipTable(Shell parent, ShipFilterDto filter) {
    super(parent, ShipBean.class);
    this.filters.put(0, filter);
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:9,代码来源:ShipTable.java

示例7: createContents

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
@Override
protected void createContents() {
    // メニューバーのセット
    this.setMenuBar();

    // イメージ破棄のリスナー
    this.shell.addDisposeListener(e -> this.cache.forEach((k, v) -> v.dispose()));

    // タブ
    this.tabFolder = new CTabFolder(this.shell, SWT.BORDER);
    this.tabFolder.setTabHeight(26);
    this.tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(
            SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));

    // 全ての艦娘
    CTabItem tabItem = new CTabItem(this.tabFolder, SWT.NONE);
    tabItem.setFont(SWTResourceManager.getBoldFont(this.shell.getFont()));
    tabItem.setText("全ての艦娘");

    Composite composite = new Composite(this.tabFolder, SWT.NONE);
    tabItem.setControl(composite);
    composite.setLayout(new FillLayout(SWT.HORIZONTAL));

    TableWrapper<ShipBean> table = this.addTable(composite);
    table.setContentSupplier(this::getShipContent)
            .setFilter(new ShipFilterLogic(this.filters.get(0)))
            .setDecorator(new ShipTableItemCreator(table, this.cache))
            .reload()
            .update();
    // 右クリックメニューのセット
    this.setRightClickMenu(table, 0);

    // グループ毎のタブ
    for (int i = 0; i < this.groups.size(); i++) {
        ShipGroupBean group = this.groups.get(i);

        ShipFilterDto filter = new ShipFilterDto();
        filter.group = group;
        this.filters.put(i + 1, filter);

        CTabItem tabItemSub = new CTabItem(this.tabFolder, SWT.NONE);
        tabItemSub.setText(group.getName());

        Composite compositeSub = new Composite(this.tabFolder, SWT.NONE);
        tabItemSub.setControl(compositeSub);
        compositeSub.setLayout(new FillLayout(SWT.HORIZONTAL));

        table = this.addTable(compositeSub);
        table.setContentSupplier(this::getShipContent)
                .setFilter(new ShipFilterLogic(filter))
                .setDecorator(new ShipTableItemCreator(table, this.cache))
                .reload()
                .update();
        // 右クリックメニューのセット
        this.setRightClickMenu(table, i + 1);
    }

    // 成長の余地
    final MenuItem reset = new MenuItem(this.opemenu, SWT.CHECK);
    reset.setText("成長の余地を表示");
    reset.addSelectionListener((SelectedListener) e -> {
        if (reset.getSelection()) {
            this.displayType = DisplayType.ROOM;
        } else {
            this.displayType = DisplayType.NORMAL;
        }
        this.tables.forEach(t -> t.reload().update());
    });
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:70,代码来源:ShipTable.java

示例8: getFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
Supplier<ShipFilterDto> getFilter(int index) {
    return () -> this.filters.get(index);
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:4,代码来源:ShipTable.java

示例9: createFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * フィルターを構成する
 *
 * @return フィルター
 */
private ShipFilterDto createFilter() {
    ShipFilterDto filter = this.supplier.get();
    filter.nametext = this.nametext.getText();
    filter.regexp = this.regexp.getSelection();
    // 艦種.駆逐艦
    setTypeFilter(this.destroyer, filter);
    // 艦種.軽巡洋艦
    setTypeFilter(this.lightCruiser, filter);
    // 艦種.重雷装巡洋艦
    setTypeFilter(this.torpedoCruiser, filter);
    // 艦種.重巡洋艦
    setTypeFilter(this.heavyCruiser, filter);
    // 艦種.重巡洋艦
    setTypeFilter(this.flyingDeckCruiser, filter);
    // 艦種.水上機母艦
    setTypeFilter(this.seaplaneTender, filter);
    // 艦種.軽空母
    setTypeFilter(this.escortCarrier, filter);
    // 艦種.正規空母
    setTypeFilter(this.carrier, filter);
    // 艦種.戦艦
    setTypeFilter(this.battleship, filter);
    // 艦種.航空戦艦
    setTypeFilter(this.flyingDeckBattleship, filter);
    // 艦種.潜水艦
    setTypeFilter(this.submarine, filter);
    // 艦種.潜水空母
    setTypeFilter(this.carrierSubmarine, filter);
    // 艦種.揚陸艦
    setTypeFilter(this.landingship, filter);
    // 艦種.装甲空母
    setTypeFilter(this.armoredcarrier, filter);
    // 艦種.工作艦
    setTypeFilter(this.repairship, filter);
    // 艦種.潜水母艦
    setTypeFilter(this.submarineTender, filter);
    // 艦種.練習巡洋艦
    setTypeFilter(this.trainingShip, filter);
    // 艦種.補給艦
    setTypeFilter(this.supply, filter);
    filter.group = null;
    if (ShipFilterDialog.this.group.getSelection()) {
        int idx = ShipFilterDialog.this.groupcombo.getSelectionIndex();
        if ((idx >= 0) && (idx < this.groups.size())) {
            filter.group = this.groups.get(idx);
        }
    }
    if (ShipFilterDialog.this.item.getSelection()) {
        if (ShipFilterDialog.this.itemcombo.getSelectionIndex() >= 0) {
            filter.itemname = this.itemcombo.getItem(ShipFilterDialog.this.itemcombo
                    .getSelectionIndex());
        }
    } else {
        filter.itemname = null;
    }
    filter.onfleet = this.onfleet.getSelection();
    filter.notonfleet = this.notonfleet.getSelection();
    filter.locked = this.locked.getSelection();
    filter.notlocked = this.notlocked.getSelection();

    return filter;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:68,代码来源:ShipFilterDialog.java

示例10: ShipFilterLogic

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * 艦娘フィルタ
 */
public ShipFilterLogic(ShipFilterDto filter) {
    this.filter = filter;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:7,代码来源:ShipFilterLogic.java

示例11: updateFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * フィルターを設定する
 * @param filter フィルター
 */
public void updateFilter(ShipFilterDto filter) {
    this.filter = filter;
    this.reloadTable();
    this.shell.setText(this.getTitle());
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:10,代码来源:ShipTable.java

示例12: createFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * フィルターを構成する
 * 
 * @return フィルター
 */
private ShipFilterDto createFilter() {
    ShipFilterDto filter = this.shipTable.getFilter();
    filter.nametext = this.nametext.getText();
    filter.regexp = this.regexp.getSelection();
    filter.destroyer = this.destroyer.getSelection();
    filter.lightCruiser = this.lightCruiser.getSelection();
    filter.torpedoCruiser = this.torpedoCruiser.getSelection();
    filter.heavyCruiser = this.heavyCruiser.getSelection();
    filter.flyingDeckCruiser = this.flyingDeckCruiser.getSelection();
    filter.seaplaneTender = this.seaplaneTender.getSelection();
    filter.escortCarrier = this.escortCarrier.getSelection();
    filter.carrier = this.carrier.getSelection();
    filter.battleship = this.battleship.getSelection();
    filter.flyingDeckBattleship = this.flyingDeckBattleship.getSelection();
    filter.submarine = this.submarine.getSelection();
    filter.carrierSubmarine = this.carrierSubmarine.getSelection();
    filter.landingship = this.landingship.getSelection();
    filter.armoredcarrier = this.armoredcarrier.getSelection();
    filter.repairship = this.repairship.getSelection();
    filter.submarineTender = this.submarineTender.getSelection();
    filter.trainingShip = this.trainingShip.getSelection();
    filter.group = null;
    if (ShipFilterDialog.this.group.getSelection()) {
        int idx = ShipFilterDialog.this.groupcombo.getSelectionIndex();
        if ((idx >= 0) && (idx < this.groups.size())) {
            filter.group = this.groups.get(idx);
        }
    }
    if (ShipFilterDialog.this.item.getSelection()) {
        if (ShipFilterDialog.this.itemcombo.getSelectionIndex() >= 0) {
            filter.itemname = this.itemcombo.getItem(ShipFilterDialog.this.itemcombo
                    .getSelectionIndex());
        }
    } else {
        filter.itemname = null;
    }
    filter.onfleet = this.onfleet.getSelection();
    filter.notonfleet = this.notonfleet.getSelection();
    filter.locked = this.locked.getSelection();
    filter.notlocked = this.notlocked.getSelection();

    return filter;
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:49,代码来源:ShipFilterDialog.java

示例13: ShipFilterDialog

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * Create the dialog.
 *
 * @param parent シェル
 * @param updateFunction フィルター適用関数
 * @param supplier フィルター供給関数
 */
public ShipFilterDialog(Shell parent, Consumer<ShipFilterDto> updateFunction, Supplier<ShipFilterDto> supplier) {
    super(parent, SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.RESIZE);
    this.update = updateFunction;
    this.supplier = supplier;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:13,代码来源:ShipFilterDialog.java

示例14: setTypeSelection

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * フィルターから艦種のチェックボックスを設定する
 *
 * @param checkbox 艦種のチェックボックス
 * @param dto フィルター
 */
private static void setTypeSelection(ShipFilterDto dto, Button checkbox) {
    String type = checkbox.getText();
    checkbox.setSelection(dto.shipType.contains(type));
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:11,代码来源:ShipFilterDialog.java

示例15: getFilter

import logbook.dto.ShipFilterDto; //导入依赖的package包/类
/**
 * フィルターを取得します。
 * @return フィルター
 */
public ShipFilterDto getFilter() {
    return this.filter;
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:8,代码来源:ShipTable.java


注:本文中的logbook.dto.ShipFilterDto类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。