Class ProfileDefaultGUI
- java.lang.Object
-
- io.github.oliviercailloux.j_voting.profiles.gui.ProfileDefaultGUI
-
- Direct Known Subclasses:
ColumnsDefaultGUI
,SOCRowsGUI
,SOIRowsGUI
public class ProfileDefaultGUI extends Object
Generalization of profile displaying GUIs
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.eclipse.swt.widgets.Button
columnsButton
protected static org.eclipse.swt.widgets.Display
display
protected static org.eclipse.swt.widgets.Shell
mainShell
protected static OldLinearPreferenceImpl
newpref
protected static ProfileBuilder
profileBuilder
protected static org.eclipse.swt.widgets.Button
rowsButton
protected static org.eclipse.swt.widgets.Table
table
protected static org.eclipse.jface.viewers.TableViewer
tableViewer
protected static Integer
voterToModify
protected static org.eclipse.swt.widgets.Button
wrapButton
-
Constructor Summary
Constructors Constructor Description ProfileDefaultGUI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkRadioButton()
Checks the right radio button.void
createColumns()
void
displayProfileWindow(String[] args)
Displays the window : the table containing the profile as well as the buttons.void
displayRadioButtons(String[] args)
Displays the radio buttons to choose the layout of the profile.void
editStrictPreference(String arg)
Displays the editButton window, where you can choose to modify/add a StrictPreference of a votervoid
emptyTable()
Empties the table : removes all data and columns.void
modif()
Edits the profile with the given informationvoid
populateRows()
Fills the table of the profile with the alternatives : by default, each column contains the preference of a votervoid
save(String outputFile)
Saves the changes to the file containing the profile.void
tableDisplay()
Displays the table containing the profile
-
-
-
Field Detail
-
display
protected static final org.eclipse.swt.widgets.Display display
-
mainShell
protected static final org.eclipse.swt.widgets.Shell mainShell
-
columnsButton
protected static org.eclipse.swt.widgets.Button columnsButton
-
rowsButton
protected static org.eclipse.swt.widgets.Button rowsButton
-
wrapButton
protected static org.eclipse.swt.widgets.Button wrapButton
-
tableViewer
protected static org.eclipse.jface.viewers.TableViewer tableViewer
-
table
protected static org.eclipse.swt.widgets.Table table
-
voterToModify
protected static Integer voterToModify
-
newpref
protected static OldLinearPreferenceImpl newpref
-
profileBuilder
protected static ProfileBuilder profileBuilder
-
-
Method Detail
-
displayProfileWindow
public void displayProfileWindow(String[] args) throws IOException
Displays the window : the table containing the profile as well as the buttons.- Parameters:
args
-- Throws:
IOException
-
tableDisplay
public void tableDisplay()
Displays the table containing the profile
-
displayRadioButtons
public void displayRadioButtons(String[] args)
Displays the radio buttons to choose the layout of the profile. This method works for both SOC and SOI.- Parameters:
args
- contains the name of the file with the profile
-
checkRadioButton
public void checkRadioButton()
Checks the right radio button.
-
createColumns
public void createColumns()
-
populateRows
public void populateRows()
Fills the table of the profile with the alternatives : by default, each column contains the preference of a voter
-
editStrictPreference
public void editStrictPreference(String arg)
Displays the editButton window, where you can choose to modify/add a StrictPreference of a voter- Parameters:
arg
- notnull
-
modif
public void modif()
Edits the profile with the given information
-
save
public void save(String outputFile)
Saves the changes to the file containing the profile.- Parameters:
outputFile
-
-
emptyTable
public void emptyTable()
Empties the table : removes all data and columns. Removes the saveButton button if it isn't disposed yet.
-
-