Compare commits
No commits in common. 'master' and 'main' have entirely different histories.
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ApifoxUploaderProjectSetting">
|
||||
<option name="apiAccessToken" value="APS-0h30zU15dOXO0wzAOMobz5KkObv1VMtg" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="AdditionalModuleElements">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="calculator" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/calculator/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/calculator/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/calculator/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="workspaceImportForciblyTurnedOn" value="true" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/calculator.iml" filepath="$PROJECT_DIR$/.idea/calculator.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@ -1,173 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="8c5319c4-45be-44e7-82ff-de33082344b1" name="Changes" comment="fix: 删除不需要文件" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="localRepository" value="D:\repo" />
|
||||
<option name="mavenHome" value="D:\Java_Tool\apache-maven-3.8.2" />
|
||||
<option name="userSettingsFile" value="D:\Java_Tool\apache-maven-3.8.2\conf\settings.xml" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2
|
||||
}</component>
|
||||
<component name="ProjectId" id="2nD2V0NJd67qrFRydtu9yDmaIr9" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/下载/work_calculator",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "MavenSettings",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="DjangoTestsConfigurationType">
|
||||
<module name="work_calculator" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="TARGET" value="" />
|
||||
<option name="SETTINGS_FILE" value="" />
|
||||
<option name="CUSTOM_SETTINGS" value="false" />
|
||||
<option name="USE_OPTIONS" value="false" />
|
||||
<option name="OPTIONS" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="JetRunConfigurationType">
|
||||
<module name="work_calculator" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="KotlinStandaloneScriptRunConfigurationType">
|
||||
<module name="work_calculator" />
|
||||
<option name="filePath" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration default="true" type="PyBehaveRunConfigurationType" factoryName="Behave">
|
||||
<module name="work_calculator" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="ADDITIONAL_ARGS" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
|
||||
<module name="work_calculator" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="false" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
<option name="REDIRECT_INPUT" value="false" />
|
||||
<option name="INPUT_FILE" value="" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Python.FlaskServer">
|
||||
<module name="work_calculator" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="launchJavascriptDebuger" value="false" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Tox" factoryName="Tox">
|
||||
<module name="work_calculator" />
|
||||
<option name="ENV_FILES" value="" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="8c5319c4-45be-44e7-82ff-de33082344b1" name="Changes" comment="" />
|
||||
<created>1711175723986</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1711175723986</updated>
|
||||
<workItem from="1728493346536" duration="215000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="fix: 删除不需要文件">
|
||||
<option name="closed" value="true" />
|
||||
<created>1728493504621</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1728493504621</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="fix: 删除不需要文件" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="fix: 删除不需要文件" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,38 +0,0 @@
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ApifoxUploaderProjectSetting">
|
||||
<option name="apiAccessToken" value="APS-0h30zU15dOXO0wzAOMobz5KkObv1VMtg" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="workspaceImportForciblyTurnedOn" value="true" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -1,18 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>calculator</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@ -1,34 +0,0 @@
|
||||
package org.example;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.net.URL;
|
||||
|
||||
public class Calculator extends Application {
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
|
||||
// 使用相对路径加载 FXML 文件
|
||||
URL fxmlLocation = getClass().getResource("/org/example/CalculatorView.fxml");
|
||||
if (fxmlLocation == null) {
|
||||
throw new RuntimeException("FXML 文件未找到!");
|
||||
}
|
||||
System.out.println("尝试加载 FXML 文件: " + fxmlLocation);
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(fxmlLocation);
|
||||
BorderPane root = loader.load();
|
||||
|
||||
Scene scene = new Scene(root, 300, 400); // 窗口大小
|
||||
primaryStage.setTitle("计算器");
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show();
|
||||
}
|
||||
}
|
||||
@ -1,225 +0,0 @@
|
||||
package org.example;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
import java.util.Stack;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CalculatorController {
|
||||
@FXML
|
||||
private TextField display;
|
||||
|
||||
private StringBuilder expression = new StringBuilder();
|
||||
private BigDecimal lastResult; // 存储上一次的结果
|
||||
private boolean isResultDisplayed = false; // 标志是否显示结果
|
||||
|
||||
@FXML
|
||||
private void handleButtonAction(ActionEvent event) {
|
||||
String buttonText = ((Button) event.getSource()).getText();
|
||||
|
||||
if (buttonText.equals("=")) {
|
||||
handleEqualsAction(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttonText.equals("AC")) {
|
||||
handleClearAction(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (buttonText.equals("删除")) {
|
||||
handleDeleteAction(event);
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果结果已经显示
|
||||
if (isResultDisplayed) {
|
||||
if (Character.isDigit(buttonText.charAt(0))) {
|
||||
// 输入数字,重新开始新的计算
|
||||
expression.setLength(0);
|
||||
expression.append(buttonText);
|
||||
} else if (isOperator(buttonText.charAt(0))) {
|
||||
// 继续使用上次结果进行运算
|
||||
expression.setLength(0);
|
||||
expression.append(lastResult).append(buttonText); // 附加运算符
|
||||
}
|
||||
isResultDisplayed = false; // 重置标志
|
||||
} else {
|
||||
// 处理小数点
|
||||
if (buttonText.equals(".")) {
|
||||
if (expression.length() > 0) {
|
||||
char lastChar = expression.charAt(expression.length() - 1);
|
||||
if (Character.isDigit(lastChar) || lastChar == '.') {
|
||||
expression.append(buttonText);
|
||||
}
|
||||
} else {
|
||||
expression.append("0.");
|
||||
}
|
||||
}
|
||||
// 处理运算符
|
||||
else if (isOperator(buttonText.charAt(0))) {
|
||||
// 检查表达式是否为空,并且是否输入的是 + 或 - 之外的运算符
|
||||
if (expression.length() == 0 && (buttonText.equals("*") || buttonText.equals("/") || buttonText.equals("%"))) {
|
||||
display.setText("错误"); // 显示错误提示
|
||||
return; // 直接退出,防止后续逻辑覆盖错误提示
|
||||
} else {
|
||||
if (expression.length() > 0) {
|
||||
char lastChar = expression.charAt(expression.length() - 1);
|
||||
if (isOperator(lastChar)) {
|
||||
// 替换最后一个运算符
|
||||
expression.setCharAt(expression.length() - 1, buttonText.charAt(0));
|
||||
} else {
|
||||
expression.append(buttonText);
|
||||
}
|
||||
} else {
|
||||
// 处理在表达式为空时输入 + 或 - 的情况
|
||||
expression.append(buttonText.equals("-") ? "-" : lastResult + buttonText);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 处理数字
|
||||
else {
|
||||
expression.append(buttonText);
|
||||
}
|
||||
}
|
||||
|
||||
display.setText(expression.toString());
|
||||
}
|
||||
|
||||
private boolean isOperator(char ch) {
|
||||
return ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%';
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleEqualsAction(ActionEvent event) {
|
||||
if (expression.length() == 0 || isOperator(expression.charAt(expression.length() - 1))) {
|
||||
display.setText("错误");
|
||||
return; // 如果表达式为空或以运算符结尾,显示错误并返回
|
||||
}
|
||||
|
||||
String result;
|
||||
try {
|
||||
result = calculateExpression(expression.toString());
|
||||
} catch (ArithmeticException e) {
|
||||
display.setText("错误");
|
||||
return;
|
||||
}
|
||||
|
||||
display.setText(result);
|
||||
|
||||
// 更新上次结果,准备继续运算
|
||||
lastResult = new BigDecimal(result);
|
||||
isResultDisplayed = true; // 设置标志,表明结果已显示
|
||||
expression.setLength(0); // 清空表达式
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleClearAction(ActionEvent event) {
|
||||
// 清空表达式和显示框
|
||||
expression.setLength(0);
|
||||
display.setText("");
|
||||
|
||||
// 重置上次结果和标志
|
||||
lastResult = BigDecimal.valueOf(0); // 清空上次结果
|
||||
isResultDisplayed = false; // 重置标志
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleDeleteAction(ActionEvent event) {
|
||||
if (expression.length() > 0) {
|
||||
expression.deleteCharAt(expression.length() - 1);
|
||||
display.setText(expression.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private int precedence(char op) {
|
||||
switch (op) {
|
||||
case '+':
|
||||
case '-':
|
||||
return 1;
|
||||
case '*':
|
||||
case '/':
|
||||
case '%':
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private String calculateExpression(String expression) {
|
||||
Stack<BigDecimal> numbers = new Stack<>();
|
||||
Stack<Character> operators = new Stack<>();
|
||||
|
||||
StringBuilder numberBuffer = new StringBuilder();
|
||||
boolean lastWasOperator = true;
|
||||
|
||||
for (char ch : expression.toCharArray()) {
|
||||
if (Character.isDigit(ch) || ch == '.') {
|
||||
numberBuffer.append(ch);
|
||||
lastWasOperator = false;
|
||||
} else if (ch == '-' && lastWasOperator) {
|
||||
// 处理负数
|
||||
numberBuffer.append(ch);
|
||||
} else {
|
||||
if (numberBuffer.length() > 0) {
|
||||
numbers.push(new BigDecimal(numberBuffer.toString()));
|
||||
numberBuffer.setLength(0);
|
||||
}
|
||||
|
||||
// 避免运算符栈为空时抛出异常
|
||||
while (!operators.isEmpty() && precedence(ch) <= precedence(operators.peek())) {
|
||||
if (numbers.size() < 2) {
|
||||
display.setText("错误");
|
||||
return "错误";
|
||||
}
|
||||
BigDecimal b = numbers.pop();
|
||||
BigDecimal a = numbers.pop();
|
||||
char op = operators.pop();
|
||||
numbers.push(applyOperation(a, b, op));
|
||||
}
|
||||
operators.push(ch);
|
||||
lastWasOperator = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (numberBuffer.length() > 0) {
|
||||
numbers.push(new BigDecimal(numberBuffer.toString()));
|
||||
}
|
||||
|
||||
while (!operators.isEmpty()) {
|
||||
if (numbers.size() < 2) {
|
||||
display.setText("错误");
|
||||
return "错误";
|
||||
}
|
||||
BigDecimal b = numbers.pop();
|
||||
BigDecimal a = numbers.pop();
|
||||
char op = operators.pop();
|
||||
numbers.push(applyOperation(a, b, op));
|
||||
}
|
||||
|
||||
return numbers.pop().toString();
|
||||
}
|
||||
|
||||
|
||||
private BigDecimal applyOperation(BigDecimal a, BigDecimal b, char op) {
|
||||
switch (op) {
|
||||
case '+': return a.add(b);
|
||||
case '-': return a.subtract(b);
|
||||
case '*': return a.multiply(b);
|
||||
case '/':
|
||||
if (b.compareTo(BigDecimal.ZERO) == 0) {
|
||||
throw new ArithmeticException("Division by zero");
|
||||
}
|
||||
BigDecimal result = a.divide(b, 8, BigDecimal.ROUND_HALF_UP);
|
||||
if (result.stripTrailingZeros().scale() <= 0) {
|
||||
return result.setScale(0, BigDecimal.ROUND_HALF_UP);
|
||||
} else {
|
||||
return result.stripTrailingZeros();
|
||||
}
|
||||
case '%': return a.remainder(b);
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="300.0"
|
||||
xmlns="http://javafx.com/javafx/8.0.171"
|
||||
xmlns:fx="http://javafx.com/fxml/1"
|
||||
fx:controller="org.example.CalculatorController">
|
||||
<center>
|
||||
<GridPane BorderPane.alignment="CENTER" hgap="10" vgap="10">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="50.0" prefWidth="75.0" />
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="50.0" prefWidth="75.0" />
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="50.0" prefWidth="75.0" />
|
||||
<ColumnConstraints hgrow="ALWAYS" minWidth="50.0" prefWidth="75.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="60.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<TextField fx:id="display" editable="false" GridPane.columnSpan="4"
|
||||
style="-fx-font-size: 24px; -fx-background-color: #f9f9f9; -fx-border-color: #ccc; -fx-padding: 10px;"/>
|
||||
<Button text="7" onAction="#handleButtonAction" GridPane.rowIndex="1" GridPane.columnIndex="0" />
|
||||
<Button text="8" onAction="#handleButtonAction" GridPane.rowIndex="1" GridPane.columnIndex="1" />
|
||||
<Button text="9" onAction="#handleButtonAction" GridPane.rowIndex="1" GridPane.columnIndex="2" />
|
||||
<Button text="/" onAction="#handleButtonAction" GridPane.rowIndex="1" GridPane.columnIndex="3" />
|
||||
|
||||
<Button text="4" onAction="#handleButtonAction" GridPane.rowIndex="2" GridPane.columnIndex="0" />
|
||||
<Button text="5" onAction="#handleButtonAction" GridPane.rowIndex="2" GridPane.columnIndex="1" />
|
||||
<Button text="6" onAction="#handleButtonAction" GridPane.rowIndex="2" GridPane.columnIndex="2" />
|
||||
<Button text="*" onAction="#handleButtonAction" GridPane.rowIndex="2" GridPane.columnIndex="3" />
|
||||
|
||||
<Button text="1" onAction="#handleButtonAction" GridPane.rowIndex="3" GridPane.columnIndex="0" />
|
||||
<Button text="2" onAction="#handleButtonAction" GridPane.rowIndex="3" GridPane.columnIndex="1" />
|
||||
<Button text="3" onAction="#handleButtonAction" GridPane.rowIndex="3" GridPane.columnIndex="2" />
|
||||
<Button text="-" onAction="#handleButtonAction" GridPane.rowIndex="3" GridPane.columnIndex="3" />
|
||||
|
||||
<Button text="." onAction="#handleButtonAction" GridPane.rowIndex="4" GridPane.columnIndex="0" />
|
||||
<Button text="0" onAction="#handleButtonAction" GridPane.rowIndex="4" GridPane.columnIndex="1" GridPane.columnSpan="2" />
|
||||
<Button text="\%" onAction="#handleButtonAction" GridPane.rowIndex="4" GridPane.columnIndex="2" />
|
||||
<Button text="+" onAction="#handleButtonAction" GridPane.rowIndex="4" GridPane.columnIndex="3" />
|
||||
|
||||
<!-- 将 AC 按钮放在最后一行 -->
|
||||
<Button text="AC" onAction="#handleClearAction" GridPane.rowIndex="5" GridPane.columnSpan="4" style="-fx-font-size: 24px;"/>
|
||||
<Button text="删除" onAction="#handleDeleteAction" GridPane.rowIndex="5" GridPane.columnIndex="1" />
|
||||
<Button text="=" onAction="#handleEqualsAction" GridPane.rowIndex="5" GridPane.columnIndex="3" />
|
||||
|
||||
</children>
|
||||
</GridPane>
|
||||
</center>
|
||||
</BorderPane>
|
||||
Loading…
Reference in new issue