diff --git a/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxCostSelectionView.java b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxCostSelectionView.java index 1f9cdea3aa..f83449eb9e 100644 --- a/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxCostSelectionView.java +++ b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxCostSelectionView.java @@ -9,7 +9,7 @@ import net.sf.anathema.character.equipment.item.view.CostSelectionView; import net.sf.anathema.lib.control.ObjectValueListener; import net.sf.anathema.lib.gui.selection.ISelectionIntValueChangedListener; -import net.sf.anathema.platform.fx.ComboBoxSelectionView; +import net.sf.anathema.platform.fx.FxObjectSelectionView; import org.jmock.example.announcer.Announcer; import org.tbee.javafx.scene.layout.MigPane; @@ -17,7 +17,8 @@ public class FxCostSelectionView implements CostSelectionView { - private ComboBoxSelectionView selection; + private final SelectionViewFactory selectionViewFactory = new SelectionViewFactory(); + private FxObjectSelectionView selection; private ListSpinner spinner; private final MigPane pane = new MigPane(withoutInsets()); private final Announcer announcer = new Announcer<>( @@ -29,7 +30,7 @@ public FxCostSelectionView(final String text) { Platform.runLater(new Runnable() { @Override public void run() { - selection = new ComboBoxSelectionView<>(text, new SimpleUiConfiguration()); + selection = selectionViewFactory.create(text, new SimpleUiConfiguration()); spinner = new ListSpinner<>(0, 5); spinner.getStyleClass().add("dots"); pane.add(selection.getNode()); diff --git a/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxEquipmentDescriptionPanel.java b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxEquipmentDescriptionPanel.java index b90bddc069..fc5aa5b325 100644 --- a/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxEquipmentDescriptionPanel.java +++ b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/FxEquipmentDescriptionPanel.java @@ -12,13 +12,13 @@ import net.sf.anathema.lib.gui.AgnosticUIConfiguration; import net.sf.anathema.lib.gui.selection.IObjectSelectionView; import net.sf.anathema.lib.workflow.textualdescription.ITextView; -import net.sf.anathema.platform.fx.ComboBoxSelectionView; import net.sf.anathema.platform.fx.FxObjectSelectionView; import net.sf.anathema.platform.fx.FxTextView; import org.tbee.javafx.scene.layout.MigPane; public class FxEquipmentDescriptionPanel implements EquipmentDescriptionPanel { + private final SelectionViewFactory selectionViewFactory = new SelectionViewFactory(); private MigPane pane; public FxEquipmentDescriptionPanel() { @@ -57,7 +57,7 @@ public void run() { @Override public IObjectSelectionView addCompositionView(String label, AgnosticUIConfiguration ui) { - final FxObjectSelectionView selectionView = createSelectionView(label, ui); + final FxObjectSelectionView selectionView = selectionViewFactory.create(label, ui); Platform.runLater(new Runnable() { @Override public void run() { @@ -70,7 +70,7 @@ public void run() { @Override public IObjectSelectionView addMaterialView(String label, AgnosticUIConfiguration ui) { - final FxObjectSelectionView selectionView = createSelectionView(label, ui); + final FxObjectSelectionView selectionView = selectionViewFactory.create(label, ui); Platform.runLater(new Runnable() { @Override public void run() { @@ -95,8 +95,4 @@ public void run() { public Node getNode() { return pane; } - - private FxObjectSelectionView createSelectionView(String label, AgnosticUIConfiguration ui) { - return new ComboBoxSelectionView<>(label, ui); - } } \ No newline at end of file diff --git a/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/SelectionViewFactory.java b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/SelectionViewFactory.java new file mode 100644 index 0000000000..f09adc8fd3 --- /dev/null +++ b/Character_Equipment/src/net/sf/anathema/character/equipment/item/view/fx/SelectionViewFactory.java @@ -0,0 +1,12 @@ +package net.sf.anathema.character.equipment.item.view.fx; + +import net.sf.anathema.lib.gui.AgnosticUIConfiguration; +import net.sf.anathema.platform.fx.ComboBoxSelectionView; +import net.sf.anathema.platform.fx.FxObjectSelectionView; + +public class SelectionViewFactory { + + public FxObjectSelectionView create(String label, AgnosticUIConfiguration ui) { + return new ComboBoxSelectionView<>(label, ui); + } +} \ No newline at end of file