r2017 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator
Author: chatellier Date: 2009-03-20 10:43:28 +0000 (Fri, 20 Mar 2009) New Revision: 2017 Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx Log: Multiselection de la liste pour pouvoir arreter plusieurs simulation Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx =================================================================== --- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-03-20 10:36:30 UTC (rev 2016) +++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/simulator/QueueUI.jaxx 2009-03-20 10:43:28 UTC (rev 2017) @@ -1,6 +1,6 @@ <!-- /* *##% - * Copyright (C) 2005 + * Copyright (C) 2005 - 2009 * Ifremer, Code Lutin, Cedric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or @@ -19,7 +19,7 @@ *##%*/ /* * - * IsisFish.java + * QueueUI.java * * Created: 1 aout 2005 18:37:25 CEST * @@ -45,10 +45,11 @@ import org.jdesktop.beansbinding.Bindings; import org.jdesktop.beansbinding.ELProperty; - refresh(); + initBindings(); - public void refresh(){ + public void initBindings() { SimulationService ss = SimulationService.getService(); + BindingGroup bindingGroup = new BindingGroup(); setContextValue(new SimulationServiceTableModel(ss, true), "new"); @@ -76,28 +77,35 @@ bindingGroup.bind(); } - public QueueUI (SimulAction action){ - + public QueueUI (SimulAction action) { setContextValue(action); } + public class JProgressBarTableCellRenderer implements TableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return (JProgressBar) value; } - }// JProgressBarTableCellRenderer - protected void stopSimulation(){ - if (queueTable.getSelectedRow() >= 0){ - getContextValue(SimulAction.class).stopSimulation(getContextValue(SimulationServiceTableModel.class, "new").getJob(queueTable.getSelectedRow())); + } + + /** + * Stop simulation associated with table selected rows. + */ + protected void stopSimulation() { + int[] selectedRows = queueTable.getSelectedRows(); + for (int selectedRow : selectedRows) { + getContextValue(SimulAction.class).stopSimulation(getContextValue(SimulationServiceTableModel.class, "new").getJob(selectedRow)); } } - protected void viewLog(){ - if (queueTableDone.getSelectedRow() >= 0){ + + protected void viewLog() { + if (queueTableDone.getSelectedRow() >= 0) { getContextValue(SimulAction.class).viewLog(getContextValue(SimulationServiceTableModel.class, "done").getJob(queueTableDone.getSelectedRow())); } } - protected void clearDoneJobs(){ + + protected void clearDoneJobs() { getContextValue(SimulAction.class).clearDoneJobs(); } ]]> @@ -105,14 +113,14 @@ <row> <cell columns="4" fill="both" weightx="1.0" weighty="0.5"> <JScrollPane> - <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}'/> + <JTable id="queueTable" model='{getContextValue(SimulationServiceTableModel.class, "new")}' selectionMode="{ListSelectionModel.MULTIPLE_INTERVAL_SELECTION}"/> </JScrollPane> </cell> </row> <row> <cell columns="4" fill="both" weightx="1.0" weighty="0.5"> <JScrollPane> - <JTable id="queueTableDone" rowHeight='24' model='{getContextValue(SimulationServiceTableModel.class, "done")}'/> + <JTable id="queueTableDone" model='{getContextValue(SimulationServiceTableModel.class, "done")}'/> </JScrollPane> </cell> </row>
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org