|
|
|
@ -50,9 +50,12 @@ import com.fr.io.attr.ImageExportAttr;
|
|
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.report.ReportConfigManager; |
|
|
|
|
import com.fr.scheduler.tool.FineScheduler; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.os.OperatingSystem; |
|
|
|
|
import com.fr.third.apache.logging.log4j.Level; |
|
|
|
|
import com.fr.third.guava.collect.BiMap; |
|
|
|
|
import com.fr.third.guava.collect.HashBiMap; |
|
|
|
|
import com.fr.transaction.Configurations; |
|
|
|
|
import com.fr.transaction.Worker; |
|
|
|
|
import com.fr.transaction.WorkerAdaptor; |
|
|
|
@ -92,6 +95,7 @@ import java.awt.event.WindowAdapter;
|
|
|
|
|
import java.awt.event.WindowEvent; |
|
|
|
|
import java.io.File; |
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Locale; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
@ -224,6 +228,8 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
|
|
|
|
|
private JPanel saveIntervalPane; |
|
|
|
|
private JPanel autoCleanPane; |
|
|
|
|
|
|
|
|
|
private JPanel gcControlPane; |
|
|
|
|
private UICheckBox startupPageEnabledCheckBox; |
|
|
|
|
private IntegerEditor saveIntervalEditor; |
|
|
|
|
private UICheckBox gcEnableCheckBox; |
|
|
|
@ -245,7 +251,15 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
private UIRadioButton previewRenderQuality; |
|
|
|
|
private static final int DPI_SCALE_S = 1; |
|
|
|
|
private static final int DPI_SCALE_M = 2; |
|
|
|
|
|
|
|
|
|
private static final BiMap<Integer, Integer> INDEX_DAY_MAP = HashBiMap.create(new HashMap<Integer, Integer>() { |
|
|
|
|
{ |
|
|
|
|
put(ONE_DAY_INDEX, ONE_DAY_INT); |
|
|
|
|
put(ONE_WEEK_INDEX, ONE_WEEK_INT); |
|
|
|
|
put(ONE_MONTH_INDEX, ONE_MONTH_INT); |
|
|
|
|
put(SIX_MONTH_INDEX, SIX_MONTH_INT); |
|
|
|
|
put(THREE_MONTH_INDEX, THREE_MONTH_INT); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
public PreferencePane() { |
|
|
|
|
this.initComponents(); |
|
|
|
|
} |
|
|
|
@ -418,7 +432,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
savePane.add(saveIntervalPane); |
|
|
|
|
|
|
|
|
|
//gc面板
|
|
|
|
|
JPanel gcControlPane = createGcControlPane(); |
|
|
|
|
gcControlPane = createGcControlPane(); |
|
|
|
|
|
|
|
|
|
JPanel enableVcsPanel = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); |
|
|
|
|
enableVcsPanel.add(remindVcsLabel); |
|
|
|
@ -470,9 +484,14 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
private VcsMovePanel createMovePane(CardLayout cardLayout, JPanel parentPane) { |
|
|
|
|
return new VcsMovePanel(cardLayout, parentPane, new VcsMovePanel.MoveCallBack(){ |
|
|
|
|
@Override |
|
|
|
|
public void doCallBack(boolean visible) { |
|
|
|
|
saveIntervalPane.setVisible(visible); |
|
|
|
|
autoCleanPane.setVisible(visible); |
|
|
|
|
public void doCallBack(boolean useV2) { |
|
|
|
|
saveIntervalPane.setVisible(useV2); |
|
|
|
|
autoCleanPane.setVisible(useV2); |
|
|
|
|
useVcsAutoCleanScheduleCheckBox.setSelected(useV2); |
|
|
|
|
useVcsAutoSaveScheduleCheckBox.setSelected(useV2); |
|
|
|
|
gcControlPane.setVisible(!useV2); |
|
|
|
|
useVcsAutoCleanScheduleCheckBox.setEnabled(useV2 && FineScheduler.getInstance().isStarted()); |
|
|
|
|
useVcsAutoSaveScheduleCheckBox.setEnabled(useV2); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
@ -490,7 +509,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Content"))); |
|
|
|
|
autoCleanPane.add(autoCleanRetainIntervalComboBox); |
|
|
|
|
autoCleanPane.add(new UILabel(i18nText("Fine-Design_Vcs_Auto_Clean_Last"))); |
|
|
|
|
useVcsAutoCleanScheduleCheckBox.setEnabled(!VcsHelper.getInstance().isLegacyMode()); |
|
|
|
|
useVcsAutoCleanScheduleCheckBox.setEnabled(!VcsHelper.getInstance().isLegacyMode() && FineScheduler.getInstance().isStarted()); |
|
|
|
|
autoCleanPane.setVisible(false); |
|
|
|
|
return autoCleanPane; |
|
|
|
|
} |
|
|
|
@ -916,6 +935,8 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
useVcsAutoSaveScheduleCheckBox.setSelected(vcsConfigManager.isUseAutoSave()); |
|
|
|
|
useVcsAutoCleanScheduleCheckBox.setSelected(VcsConfig.getInstance().isUseV2AutoClean()); |
|
|
|
|
autoSaveIntervalEditor.setValue(vcsConfigManager.getAutoSaveInterval()); |
|
|
|
|
autoCleanIntervalComboBox.setSelectedIndex(getIndex(VcsConfig.getInstance().getV2CleanInterval())); |
|
|
|
|
autoCleanRetainIntervalComboBox.setSelectedIndex(getIndex(VcsConfig.getInstance().getV2RetainInterval())); |
|
|
|
|
|
|
|
|
|
gridLineColorTBButton.setColor(designerEnvManager.getGridLineColor()); |
|
|
|
|
paginationLineColorTBButton.setColor(designerEnvManager.getPaginationLineColor()); |
|
|
|
@ -1005,18 +1026,11 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private int getDay(int dateIndex) { |
|
|
|
|
switch (dateIndex) { |
|
|
|
|
case ONE_DAY_INDEX: |
|
|
|
|
return ONE_DAY_INT; |
|
|
|
|
case ONE_WEEK_INDEX: |
|
|
|
|
return ONE_WEEK_INT; |
|
|
|
|
case ONE_MONTH_INDEX: |
|
|
|
|
return ONE_MONTH_INT; |
|
|
|
|
case SIX_MONTH_INDEX: |
|
|
|
|
return SIX_MONTH_INT; |
|
|
|
|
default: |
|
|
|
|
return THREE_MONTH_INT; |
|
|
|
|
} |
|
|
|
|
return INDEX_DAY_MAP.getOrDefault(dateIndex, THREE_MONTH_INT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private int getIndex(int day) { |
|
|
|
|
return INDEX_DAY_MAP.inverse().getOrDefault(day, THREE_MONTH_INDEX); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|