mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
State if table with completed games is shown is saved in java prefs now.
This commit is contained in:
parent
a0424aec50
commit
2157c63160
4 changed files with 19 additions and 6 deletions
|
@ -135,6 +135,9 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
// Size of frame to check if divider locations should be used
|
||||
public static final String KEY_MAGE_PANEL_LAST_SIZE = "gamepanelLastSize";
|
||||
|
||||
// pref settings of table settings and filtering
|
||||
public static final String KEY_TABLES_SHOW_COMPLETED = "tablePanelShowCompleted";
|
||||
|
||||
// positions of divider bars
|
||||
public static final String KEY_TABLES_DIVIDER_LOCATION_1 = "tablePanelDividerLocation1";
|
||||
public static final String KEY_TABLES_DIVIDER_LOCATION_2 = "tablePanelDividerLocation2";
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
<Properties>
|
||||
<Property name="selected" type="boolean" value="true"/>
|
||||
<Property name="text" type="java.lang.String" value="Show Completed"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="<HTML>Toggles the visibility of the table of completed
<br>matches and tournaments in the lower area"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkShowCompletedActionPerformed"/>
|
||||
|
|
|
@ -136,7 +136,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
|
||||
jScrollPane1.getViewport().setBackground(new Color(255,255,255,50));
|
||||
jScrollPane2.getViewport().setBackground(new Color(255,255,255,50));
|
||||
|
||||
|
||||
Action openTableAction;
|
||||
openTableAction = new AbstractAction()
|
||||
{
|
||||
|
@ -247,9 +247,10 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
};
|
||||
|
||||
|
||||
// adds action buttons to the table panel (don't delete this)
|
||||
// !!!! adds action buttons to the table panel (don't delete this)
|
||||
new ButtonColumn(tableTables, openTableAction, TableTableModel.ACTION_COLUMN);
|
||||
new ButtonColumn(tableCompleted, closedTableAction, MatchesTableModel.ACTION_COLUMN);
|
||||
// !!!!
|
||||
}
|
||||
|
||||
|
||||
|
@ -274,10 +275,16 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
if (location != null && jSplitPane1 != null) {
|
||||
jSplitPane1.setDividerLocation(Integer.parseInt(location));
|
||||
}
|
||||
location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2, null);
|
||||
if (location != null && jSplitPane2 != null) {
|
||||
jSplitPane2.setDividerLocation(Integer.parseInt(location));
|
||||
this.chkShowCompleted.setSelected(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_SHOW_COMPLETED, "Yes").equals("Yes"));
|
||||
if (this.chkShowCompleted.isSelected()) {
|
||||
this.jSplitPane2.setDividerLocation(-1);
|
||||
}
|
||||
else {
|
||||
location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_2, null);
|
||||
if (location != null && jSplitPane2 != null) {
|
||||
jSplitPane2.setDividerLocation(Integer.parseInt(location));
|
||||
}
|
||||
}
|
||||
location = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_DIVIDER_LOCATION_3, null);
|
||||
if (location != null && chatPanel != null) {
|
||||
chatPanel.setSplitDividerLocation(Integer.parseInt(location));
|
||||
|
@ -486,6 +493,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
|
||||
chkShowCompleted.setSelected(true);
|
||||
chkShowCompleted.setText("Show Completed");
|
||||
chkShowCompleted.setToolTipText("<HTML>Toggles the visibility of the table of completed\n<br>matches and tournaments in the lower area");
|
||||
chkShowCompleted.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
chkShowCompletedActionPerformed(evt);
|
||||
|
@ -677,6 +685,7 @@ private void chkShowCompletedActionPerformed(java.awt.event.ActionEvent evt) {//
|
|||
else {
|
||||
this.jSplitPane2.setDividerLocation(this.jPanel3.getHeight());
|
||||
}
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_TABLES_SHOW_COMPLETED, (chkShowCompleted.isSelected()?"Yes":"No"));
|
||||
this.startTasks();
|
||||
}//GEN-LAST:event_chkShowCompletedActionPerformed
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import javax.swing.table.TableRowSorter;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MageTableRowSorter extends TableRowSorter {
|
||||
public class MageTableRowSorter extends TableRowSorter<TableModel> {
|
||||
|
||||
public MageTableRowSorter(TableModel m) {
|
||||
super(m);
|
||||
|
|
Loading…
Reference in a new issue