Search in sources :

Example 1 with ScenarioGridRenderer

use of org.drools.workbench.screens.scenariosimulation.client.renderers.ScenarioGridRenderer in project drools-wb by kiegroup.

the class ScenarioGridPanelProducer method initializeGrid.

protected void initializeGrid(ScenarioGridLayer scenarioGridLayer, ScenarioGridPanel scenarioGridPanel, AbstractScesimGridModel abstractScesimGridModel, ScenarioSimulationContext scenarioSimulationContext, int defaultDataCellX, int defaultDataCellY) {
    final ScenarioGrid scenarioGrid = new ScenarioGrid(abstractScesimGridModel, scenarioGridLayer, new ScenarioGridRenderer(false), scenarioContextMenuRegistry);
    scenarioGridLayer.addScenarioGrid(scenarioGrid);
    scenarioGridPanel.add(scenarioGridLayer);
    scenarioGrid.setScenarioSimulationContext(scenarioSimulationContext);
    scenarioGrid.setDefaultSelectedDataCell(defaultDataCellX, defaultDataCellY);
    abstractScesimGridModel.setCollectionEditorSingletonDOMElementFactory(new CollectionEditorSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid(), scenarioSimulationContext, viewsProvider));
    abstractScesimGridModel.setScenarioCellTextAreaSingletonDOMElementFactory(new ScenarioCellTextAreaSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    abstractScesimGridModel.setScenarioHeaderTextBoxSingletonDOMElementFactory(new ScenarioHeaderTextBoxSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    abstractScesimGridModel.setScenarioExpressionCellTextAreaSingletonDOMElementFactory(new ScenarioExpressionCellTextAreaSingletonDOMElementFactory(scenarioGridPanel, scenarioGridLayer, scenarioGridLayer.getScenarioGrid()));
    final ScenarioSimulationKeyboardEditHandler scenarioSimulationKeyboardEditHandler = new ScenarioSimulationKeyboardEditHandler(scenarioGridLayer);
    final ScenarioInvokeContextMenuForSelectedCell invokeContextMenuKeyboardOperation = new ScenarioInvokeContextMenuForSelectedCell(scenarioGridLayer, scenarioContextMenuRegistry);
    final BaseGridWidgetKeyboardHandler handler = new BaseGridWidgetKeyboardHandler(scenarioGridLayer);
    handler.addOperation(scenarioSimulationKeyboardEditHandler, new KeyboardOperationSelectTopLeftCell(scenarioGridLayer), new KeyboardOperationMoveLeft(scenarioGridLayer), new KeyboardOperationMoveRight(scenarioGridLayer), new KeyboardOperationMoveUp(scenarioGridLayer), new KeyboardOperationMoveDown(scenarioGridLayer), new KeyboardOperationSelectBottomRightCell(scenarioGridLayer), invokeContextMenuKeyboardOperation);
    scenarioGridPanel.addKeyDownHandler(handler);
    // Hack to enable PINNED MODE i.e. not draggable
    scenarioGridLayer.enterPinnedMode(scenarioGrid, () -> {
    });
}
Also used : ScenarioGridRenderer(org.drools.workbench.screens.scenariosimulation.client.renderers.ScenarioGridRenderer) KeyboardOperationMoveUp(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveUp) BaseGridWidgetKeyboardHandler(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidgetKeyboardHandler) KeyboardOperationMoveDown(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveDown) ScenarioCellTextAreaSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioCellTextAreaSingletonDOMElementFactory) ScenarioSimulationKeyboardEditHandler(org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationKeyboardEditHandler) ScenarioExpressionCellTextAreaSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioExpressionCellTextAreaSingletonDOMElementFactory) KeyboardOperationMoveRight(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight) ScenarioGrid(org.drools.workbench.screens.scenariosimulation.client.widgets.ScenarioGrid) KeyboardOperationSelectBottomRightCell(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectBottomRightCell) KeyboardOperationSelectTopLeftCell(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectTopLeftCell) ScenarioInvokeContextMenuForSelectedCell(org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioInvokeContextMenuForSelectedCell) ScenarioHeaderTextBoxSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioHeaderTextBoxSingletonDOMElementFactory) CollectionEditorSingletonDOMElementFactory(org.drools.workbench.screens.scenariosimulation.client.factories.CollectionEditorSingletonDOMElementFactory) KeyboardOperationMoveLeft(org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveLeft)

Aggregations

CollectionEditorSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.CollectionEditorSingletonDOMElementFactory)1 ScenarioCellTextAreaSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioCellTextAreaSingletonDOMElementFactory)1 ScenarioExpressionCellTextAreaSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioExpressionCellTextAreaSingletonDOMElementFactory)1 ScenarioHeaderTextBoxSingletonDOMElementFactory (org.drools.workbench.screens.scenariosimulation.client.factories.ScenarioHeaderTextBoxSingletonDOMElementFactory)1 ScenarioInvokeContextMenuForSelectedCell (org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioInvokeContextMenuForSelectedCell)1 ScenarioSimulationKeyboardEditHandler (org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationKeyboardEditHandler)1 ScenarioGridRenderer (org.drools.workbench.screens.scenariosimulation.client.renderers.ScenarioGridRenderer)1 ScenarioGrid (org.drools.workbench.screens.scenariosimulation.client.widgets.ScenarioGrid)1 BaseGridWidgetKeyboardHandler (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.BaseGridWidgetKeyboardHandler)1 KeyboardOperationMoveDown (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveDown)1 KeyboardOperationMoveLeft (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveLeft)1 KeyboardOperationMoveRight (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveRight)1 KeyboardOperationMoveUp (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationMoveUp)1 KeyboardOperationSelectBottomRightCell (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectBottomRightCell)1 KeyboardOperationSelectTopLeftCell (org.uberfire.ext.wires.core.grids.client.widget.grid.impl.KeyboardOperationSelectTopLeftCell)1