no message
This commit is contained in:
@@ -415,8 +415,8 @@ public class DBProjectFile extends ProjectFile {
|
||||
break;
|
||||
}
|
||||
languageName = parent.languageName;
|
||||
if (sapforStyle) style = Global.mainModule.getProject().sapforProperties.FREE_FORM? LanguageStyle.free : LanguageStyle.fixed;
|
||||
|
||||
if (sapforStyle)
|
||||
style = Global.mainModule.getProject().sapforProperties.FREE_FORM ? LanguageStyle.free : LanguageStyle.fixed;
|
||||
else style = parent.style;
|
||||
}
|
||||
public void importSourceCodeSettings(DBProjectFile parent, boolean sapforStyle) throws Exception {
|
||||
@@ -430,7 +430,8 @@ public class DBProjectFile extends ProjectFile {
|
||||
break;
|
||||
}
|
||||
languageName = parent.languageName;
|
||||
if (sapforStyle) style = Global.mainModule.getProject().sapforProperties.FREE_FORM? LanguageStyle.free : LanguageStyle.fixed;
|
||||
if (sapforStyle)
|
||||
style = Global.mainModule.getProject().sapforProperties.FREE_FORM ? LanguageStyle.free : LanguageStyle.fixed;
|
||||
else style = parent.style;
|
||||
}
|
||||
//------------------
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package _VisualDVM.ProjectData.Files.UI.Editor;
|
||||
import Common.MainModule_;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Editor.BaseEditor;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
@@ -8,10 +10,10 @@ import _VisualDVM.ProjectData.Files.FileState;
|
||||
import _VisualDVM.ProjectData.Files.UI.Editor.AutoComplete.SAPFOR.SapforAutoComplete;
|
||||
import _VisualDVM.ProjectData.SapforData.Loops.Loop;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Visual.Editor.BaseEditor;
|
||||
import _VisualDVM.Visual.Editor.CaretInfo;
|
||||
import _VisualDVM.Visual.Interface.SPFEditorInterface;
|
||||
import _VisualDVM.Visual.Menus.MainEditorMenu;
|
||||
import _VisualDVM.Visual.Syntax.SPFEditorTheme;
|
||||
import javafx.util.Pair;
|
||||
import org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaHighlighter;
|
||||
|
||||
@@ -204,4 +206,12 @@ public class SPFEditor extends BaseEditor implements SPFEditorInterface {
|
||||
public int getCurrentSymbol() {
|
||||
return getCaretOffsetFromLineStart() + 1;
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
float font_size = (float) getFont().getSize();
|
||||
((SPFEditorTheme) MainModule_.instance.getUI().getTheme()).getEditorTheme().apply(this);
|
||||
setFont(getFont().deriveFont(font_size));
|
||||
menu.applyTheme();
|
||||
//меню связано с редактором. поэтому тема меняется только вместе с ним.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ public class Message extends FileObject {
|
||||
codedMessages.put("R202", "Ссылка '%s' имеет отличный от оригинального массива размер");
|
||||
//2025
|
||||
codedMessages.put("R203", "Нельзя удалить приватную переменную '%s' - она используется в вызове функции %s");
|
||||
codedMessages.put("R205","Массив '%s' состоящий в common блоке '%s' должен иметь описание в главной программной единице для объявления в директиве DECLARE");
|
||||
codedMessages.put("R205", "Массив '%s' состоящий в common блоке '%s' должен иметь описание в главной программной единице для объявления в директиве DECLARE");
|
||||
//3002
|
||||
//3001
|
||||
codedMessages.put("R108", "Добавлена across-зависимость к массиву '%s' в цикле.");
|
||||
|
||||
@@ -147,28 +147,8 @@ public class db_project_info extends DBObject {
|
||||
public DefaultMutableTreeNode filesTreeRoot = null;
|
||||
public ProjectDatabase db = null;
|
||||
public LinkedHashMap<String, DBProjectFile> allIncludes = new LinkedHashMap<>();
|
||||
public SapforProperties sapforProperties = null;
|
||||
DBLastProject info = null; //обновляется при открытии проекта.
|
||||
public SapforProperties sapforProperties=null;
|
||||
public void SynchronizeSapforProperties() throws Exception{
|
||||
if (sapforProperties==null) {
|
||||
File propertiesFile = getPropertiesFile();
|
||||
if (propertiesFile.exists()) {
|
||||
sapforProperties = Utils_.ReadProperties(propertiesFile,SapforProperties.class);
|
||||
} else {
|
||||
SapforProfile defaultProfile = Global.mainModule.getDb().getDefaultSapforProfile();
|
||||
if (defaultProfile == null) {
|
||||
sapforProperties = new SapforProperties(propertiesFile);
|
||||
Utils_.jsonToFile(sapforProperties, propertiesFile);
|
||||
} else {
|
||||
sapforProperties = new SapforProperties(getPropertiesFile());
|
||||
sapforProperties.applyProfile(Global.mainModule.getDb().getVectorByFK(defaultProfile, SapforProfileSetting.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public File getPropertiesFile(){
|
||||
return new File(getDataDirectory(), "properties");
|
||||
}
|
||||
public db_project_info() {
|
||||
}
|
||||
//----------------------------------
|
||||
@@ -239,6 +219,26 @@ public class db_project_info extends DBObject {
|
||||
public static void sortVersionsByNumber(Vector<db_project_info> versions) {
|
||||
versions.sort(Comparator.comparingInt(db_project_info::extractVersionNumber));
|
||||
}
|
||||
public void SynchronizeSapforProperties() throws Exception {
|
||||
if (sapforProperties == null) {
|
||||
File propertiesFile = getPropertiesFile();
|
||||
if (propertiesFile.exists()) {
|
||||
sapforProperties = Utils_.ReadProperties(propertiesFile, SapforProperties.class);
|
||||
} else {
|
||||
SapforProfile defaultProfile = Global.mainModule.getDb().getDefaultSapforProfile();
|
||||
if (defaultProfile == null) {
|
||||
sapforProperties = new SapforProperties(propertiesFile);
|
||||
Utils_.jsonToFile(sapforProperties, propertiesFile);
|
||||
} else {
|
||||
sapforProperties = new SapforProperties(getPropertiesFile());
|
||||
sapforProperties.applyProfile(Global.mainModule.getDb().getVectorByFK(defaultProfile, SapforProfileSetting.class));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public File getPropertiesFile() {
|
||||
return new File(getDataDirectory(), "properties");
|
||||
}
|
||||
//-
|
||||
public void Open() throws Exception {
|
||||
db.Connect();
|
||||
@@ -376,8 +376,8 @@ public class db_project_info extends DBObject {
|
||||
return null;
|
||||
}
|
||||
public DBProjectFile getLastOpenedFile() {
|
||||
Vector<DBProjectFile> sorted_= new Vector<>();
|
||||
for (DBProjectFile f: db.files.Data.values()){
|
||||
Vector<DBProjectFile> sorted_ = new Vector<>();
|
||||
for (DBProjectFile f : db.files.Data.values()) {
|
||||
if (!f.state.equals(FileState.Excluded) && !f.fileType.equals(FileType.forbidden)) {
|
||||
sorted_.add(f);
|
||||
}
|
||||
@@ -389,17 +389,17 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
}.reversed());
|
||||
LinkedHashMap<FileType, DBProjectFile> matches = new LinkedHashMap<>();
|
||||
DBProjectFile sorceFile= null;
|
||||
DBProjectFile sorceFile = null;
|
||||
DBProjectFile headerFile = null;
|
||||
for (DBProjectFile f: sorted_){
|
||||
if (!matches.containsKey(f.fileType)){
|
||||
for (DBProjectFile f : sorted_) {
|
||||
if (!matches.containsKey(f.fileType)) {
|
||||
matches.put(f.fileType, f);
|
||||
}
|
||||
}
|
||||
Vector<FileType> priority = new Vector_<>(FileType.program, FileType.header, FileType.data, FileType.none);
|
||||
for (FileType type: priority){
|
||||
for (FileType type : priority) {
|
||||
if (matches.containsKey(type))
|
||||
return matches.get(type);
|
||||
return matches.get(type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -1533,9 +1533,9 @@ public class db_project_info extends DBObject {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public DBProjectFile getMainProgramUnit(){
|
||||
for (DBProjectFile file: db.files.Data.values()){
|
||||
if (file.isMain!=0)
|
||||
public DBProjectFile getMainProgramUnit() {
|
||||
for (DBProjectFile file : db.files.Data.values()) {
|
||||
if (file.isMain != 0)
|
||||
return file;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ProjectArraysForm extends DataSetControlForm<ProjectArray> {
|
||||
}
|
||||
@Override
|
||||
public int getMaxWidth() {
|
||||
return Global.normalProperties.ShowFullArraysDeclarations ? CommonConstants.Nan : 200;
|
||||
return Global.normalProperties.ShowFullArraysDeclarations ? CommonConstants.Nan : 200;
|
||||
}
|
||||
},
|
||||
new ColumnInfo<ProjectArray>("Размерность") {
|
||||
|
||||
@@ -58,28 +58,6 @@ public class SapforProperties extends Properties {
|
||||
public int GCOVLimit = 10;
|
||||
@Expose
|
||||
public String DVMConvertationOptions = " ";
|
||||
public String pack() {
|
||||
Vector<String> res = new Vector_<String>(
|
||||
STATIC_SHADOW_ANALYSIS ? "1" : "0",
|
||||
STATIC_PRIVATE_ANALYSIS ? "1" : "0",
|
||||
FREE_FORM ? "1" : "0",
|
||||
KEEP_DVM_DIRECTIVES ? "1" : "0",
|
||||
KEEP_SPF_DIRECTIVES ? "1" : "0",
|
||||
PARALLELIZE_FREE_LOOPS ? "1" : "0",
|
||||
String.valueOf(MAX_SHADOW_WIDTH),
|
||||
OUTPUT_UPPER ? "1" : "0",
|
||||
TRANSLATE_MESSAGES ? "1" : "0",
|
||||
KEEP_LOOPS_CLOSE_NESTING ? "1" : "0",
|
||||
KEEP_GCOV ? "1" : "0",
|
||||
ANALYSIS_OPTIONS,
|
||||
DEBUG_PRINT_ON ? "1" : "0",
|
||||
MPI_PROGRAM ? "1" : "0",
|
||||
IGNORE_IO_SAPFOR ? "1" : "0",
|
||||
KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS ? "1" : "0",
|
||||
PARSE_FOR_INLINE ? "1" : "0"
|
||||
);
|
||||
return String.join("|", res);
|
||||
}
|
||||
//-
|
||||
public SapforProperties(File file_in) {
|
||||
super(file_in);
|
||||
@@ -110,6 +88,28 @@ public class SapforProperties extends Properties {
|
||||
this.KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS = src.KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS;
|
||||
this.PARSE_FOR_INLINE = src.PARSE_FOR_INLINE;
|
||||
}
|
||||
public String pack() {
|
||||
Vector<String> res = new Vector_<String>(
|
||||
STATIC_SHADOW_ANALYSIS ? "1" : "0",
|
||||
STATIC_PRIVATE_ANALYSIS ? "1" : "0",
|
||||
FREE_FORM ? "1" : "0",
|
||||
KEEP_DVM_DIRECTIVES ? "1" : "0",
|
||||
KEEP_SPF_DIRECTIVES ? "1" : "0",
|
||||
PARALLELIZE_FREE_LOOPS ? "1" : "0",
|
||||
String.valueOf(MAX_SHADOW_WIDTH),
|
||||
OUTPUT_UPPER ? "1" : "0",
|
||||
TRANSLATE_MESSAGES ? "1" : "0",
|
||||
KEEP_LOOPS_CLOSE_NESTING ? "1" : "0",
|
||||
KEEP_GCOV ? "1" : "0",
|
||||
ANALYSIS_OPTIONS,
|
||||
DEBUG_PRINT_ON ? "1" : "0",
|
||||
MPI_PROGRAM ? "1" : "0",
|
||||
IGNORE_IO_SAPFOR ? "1" : "0",
|
||||
KEEP_SPF_DIRECTIVES_AMONG_TRANSFORMATIONS ? "1" : "0",
|
||||
PARSE_FOR_INLINE ? "1" : "0"
|
||||
);
|
||||
return String.join("|", res);
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
public String getFieldDescription(String fieldName) {
|
||||
@@ -268,10 +268,10 @@ public class SapforProperties extends Properties {
|
||||
public LinkedHashMap<String, String> toMap() {
|
||||
LinkedHashMap<String, String> res = new LinkedHashMap<>();
|
||||
Vector<String> forbidden = new Vector_<String>(
|
||||
// "Precompilation",
|
||||
// "SaveModifications",
|
||||
// "GCOVLimit",
|
||||
// "DVMConvertationOptions",
|
||||
// "Precompilation",
|
||||
// "SaveModifications",
|
||||
// "GCOVLimit",
|
||||
// "DVMConvertationOptions",
|
||||
"PARSE_FOR_INLINE",
|
||||
"STATIC_PRIVATE_ANALYSIS",
|
||||
"PARALLELIZE_FREE_LOOPS"
|
||||
|
||||
Reference in New Issue
Block a user