add legal state item in factions and governments
This commit is contained in:
@@ -34,6 +34,10 @@ public class ItemsController {
|
||||
private TableColumn<ItemModel, Collection<FACTION>> factions;
|
||||
@FXML
|
||||
private TableColumn<ItemModel, Collection<GOVERNMENT>> governments;
|
||||
@FXML
|
||||
private TableColumn<ItemModel, Collection<FACTION>> legalFactions;
|
||||
@FXML
|
||||
private TableColumn<ItemModel, Collection<GOVERNMENT>> legalGovernments;
|
||||
|
||||
private ObservableList<ItemModel> items = FXCollections.observableArrayList();
|
||||
private ObservableList<GroupModel> groups = FXCollections.observableArrayList();
|
||||
@@ -49,6 +53,12 @@ public class ItemsController {
|
||||
governments.setCellFactory(CheckComboBoxTableCell.forTableColumn(governments,
|
||||
FXCollections.observableArrayList(GOVERNMENT.values()), new GovernmentStringConverter(), ItemModel::setIllegal)
|
||||
);
|
||||
legalFactions.setCellFactory(CheckComboBoxTableCell.forTableColumn(legalFactions,
|
||||
FXCollections.observableArrayList(FACTION.values()), new FactionStringConverter(), ItemModel::setLegal)
|
||||
);
|
||||
legalGovernments.setCellFactory(CheckComboBoxTableCell.forTableColumn(legalGovernments,
|
||||
FXCollections.observableArrayList(GOVERNMENT.values()), new GovernmentStringConverter(), ItemModel::setLegal)
|
||||
);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
@@ -120,10 +120,6 @@ public class ItemModel implements Comparable<ItemModel> {
|
||||
return item.getIllegalFactions();
|
||||
}
|
||||
|
||||
public void setIllegalFactions(Collection<FACTION> factions){
|
||||
LOG.debug("Set illegal factions {}", factions);
|
||||
}
|
||||
|
||||
public void setIllegal(FACTION faction, boolean illegal){
|
||||
item.setIllegal(faction, illegal);
|
||||
}
|
||||
@@ -136,6 +132,22 @@ public class ItemModel implements Comparable<ItemModel> {
|
||||
item.setIllegal(government, illegal);
|
||||
}
|
||||
|
||||
public Collection<FACTION> getLegalFactions(){
|
||||
return item.getLegalFactions();
|
||||
}
|
||||
|
||||
public void setLegal(FACTION faction, boolean legal){
|
||||
item.setLegal(faction, legal);
|
||||
}
|
||||
|
||||
public Collection<GOVERNMENT> getLegalGovernments(){
|
||||
return item.getLegalGovernments();
|
||||
}
|
||||
|
||||
public void setLegal(GOVERNMENT government, boolean legal){
|
||||
item.setLegal(government, legal);
|
||||
}
|
||||
|
||||
public void refresh(){
|
||||
LOG.trace("Refresh stats of itemDesc {}", this);
|
||||
statBuy.refresh();
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
<TableColumn fx:id="governments" minWidth="145" text="Запрещено в">
|
||||
<cellValueFactory><PropertyValueFactory property="illegalGovernments"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn fx:id="legalFactions" minWidth="145" text="Разрешено в">
|
||||
<cellValueFactory><PropertyValueFactory property="legalFactions"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
<TableColumn fx:id="legalGovernments" minWidth="145" text="Разрешено в">
|
||||
<cellValueFactory><PropertyValueFactory property="legalGovernments"/></cellValueFactory>
|
||||
</TableColumn>
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TableView fx:constant="UNCONSTRAINED_RESIZE_POLICY"/>
|
||||
|
||||
Reference in New Issue
Block a user