Переделка под DB

This commit is contained in:
2023-04-21 14:01:14 +06:00
parent c119086ea4
commit 9252e2e06a
11 changed files with 1086 additions and 378 deletions

BIN
libs/ini4j-0.5.4.jar Normal file

Binary file not shown.

BIN
libs/postgresql-42.6.0.jar Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
build.xml.data.CRC32=d935f596 build.xml.data.CRC32=d935f596
build.xml.script.CRC32=b59ecd6a build.xml.script.CRC32=b59ecd6a
build.xml.stylesheet.CRC32=8064a381@1.68.1.46 build.xml.stylesheet.CRC32=f85dc8f2@1.106.0.48
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=d935f596 nbproject/build-impl.xml.data.CRC32=d935f596
nbproject/build-impl.xml.script.CRC32=da5956f2 nbproject/build-impl.xml.script.CRC32=da07b80d
nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.106.0.48

View File

View File

@ -1,2 +1,8 @@
compile.on.save=true compile.on.save=true
user.properties.file=C:\\Users\\ivanov.i.ISTT\\AppData\\Roaming\\NetBeans\\8.2\\build.properties do.depend=false
do.jar=true
do.jlink=false
javac.debug=true
javadoc.preview=true
jlink.strip=false
user.properties.file=C:\\Users\\ivanov.i\\AppData\\Roaming\\NetBeans\\17\\build.properties

View File

@ -2,6 +2,9 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/> <group>
<file>file:/O:/MyDocuments/projects/Workspace_JavaWin/GettextDB/src/potoxml/AssemblyJFrame.java</file>
<file>file:/O:/MyDocuments/projects/Workspace_JavaWin/GettextDB/src/potoxml/NewJFrame.java</file>
</group>
</open-files> </open-files>
</project-private> </project-private>

View File

@ -1,9 +1,10 @@
annotation.processing.enabled=true annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list= annotation.processing.processors.list=
annotation.processing.run.all.processors=true annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
application.title=POTOXML_JavaSE
application.vendor=ivanov.i
build.classes.dir=${build.dir}/classes build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned: # This directory is removed when the project is cleaned:
@ -18,31 +19,46 @@ build.test.results.dir=${build.dir}/test/results
#debug.transport=dt_socket #debug.transport=dt_socket
debug.classpath=\ debug.classpath=\
${run.classpath} ${run.classpath}
debug.modulepath=\
${run.modulepath}
debug.test.classpath=\ debug.test.classpath=\
${run.test.classpath} ${run.test.classpath}
debug.test.modulepath=\
${run.test.modulepath}
# This directory is removed when the project is cleaned: # This directory is removed when the project is cleaned:
dist.dir=dist dist.dir=dist
dist.jar=${dist.dir}/POTOXML_JavaSE.jar dist.jar=${dist.dir}/POTOXML_JavaSE.jar
dist.javadoc.dir=${dist.dir}/javadoc dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes= excludes=
file.reference.ini4j-0.5.4.jar=O:\\projects\\Workspace_Java\\GettextDB\\libs\\ini4j-0.5.4.jar
file.reference.postgresql-42.6.0.jar=O:\\projects\\Workspace_Java\\GettextDB\\libs\\postgresql-42.6.0.jar
includes=** includes=**
jar.compress=false jar.compress=false
javac.classpath= javac.classpath=\
${file.reference.postgresql-42.6.0.jar}:\
${file.reference.ini4j-0.5.4.jar}
# Space-separated list of extra javac options # Space-separated list of extra javac options
javac.compilerargs= javac.compilerargs=
javac.deprecation=false javac.deprecation=false
javac.external.vm=false
javac.modulepath=
javac.processormodulepath=
javac.processorpath=\ javac.processorpath=\
${javac.classpath} ${javac.classpath}
javac.source=1.6 javac.source=1.8
javac.target=1.6 javac.target=1.8
javac.test.classpath=\ javac.test.classpath=\
${javac.classpath}:\ ${javac.classpath}:\
${build.classes.dir} ${build.classes.dir}
javac.test.modulepath=\
${javac.modulepath}
javac.test.processorpath=\ javac.test.processorpath=\
${javac.test.classpath} ${javac.test.classpath}
javadoc.additionalparam= javadoc.additionalparam=
javadoc.author=false javadoc.author=false
javadoc.encoding=${source.encoding} javadoc.encoding=${source.encoding}
javadoc.html5=false
javadoc.noindex=false javadoc.noindex=false
javadoc.nonavbar=false javadoc.nonavbar=false
javadoc.notree=false javadoc.notree=false
@ -51,6 +67,8 @@ javadoc.splitindex=true
javadoc.use=true javadoc.use=true
javadoc.version=false javadoc.version=false
javadoc.windowtitle= javadoc.windowtitle=
jlink.launcher=false
jlink.launcher.name=POTOXML_JavaSE
main.class=potoxml.NewJFrame main.class=potoxml.NewJFrame
manifest.file=manifest.mf manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF meta.inf.dir=${src.dir}/META-INF
@ -63,9 +81,13 @@ run.classpath=\
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value: # To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs= run.jvmargs=
run.modulepath=\
${javac.modulepath}
run.test.classpath=\ run.test.classpath=\
${javac.test.classpath}:\ ${javac.test.classpath}:\
${build.test.classes.dir} ${build.test.classes.dir}
run.test.modulepath=\
${javac.test.modulepath}
source.encoding=UTF-8 source.encoding=UTF-8
src.dir=src src.dir=src
test.src.dir=test test.src.dir=test

2
settings.txt Normal file
View File

@ -0,0 +1,2 @@
O:\projects\Workspace_PHP\transit.istt.kz
O:\temp\1.txt

View File

@ -8,6 +8,9 @@
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
<SyntheticProperty name="generateCenter" type="boolean" value="false"/> <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties> </SyntheticProperties>
<Events>
<EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/>
</Events>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -23,29 +26,20 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="textArea2" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jButton2" max="32767" attributes="0"/>
<Component id="jButton3" max="32767" attributes="0"/>
</Group>
</Group>
<Component id="textArea1" alignment="0" max="32767" attributes="0"/> <Component id="textArea1" alignment="0" max="32767" attributes="0"/>
<Component id="jButton1" alignment="1" min="-2" max="-2" attributes="0"/> <Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/> <Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="jPanel4" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -54,22 +48,8 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="1" attributes="0"> <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0"> <EmptySpace pref="71" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
<Component id="jButton2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Component id="textArea2" min="-2" pref="118" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="textArea1" min="-2" pref="143" max="-2" attributes="0"/> <Component id="textArea1" min="-2" pref="143" max="-2" attributes="0"/>
@ -83,45 +63,6 @@
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="&#x421;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x442;&#x44c;"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x435;&#x440;&#x435;&#x431;&#x438;&#x440;&#x430;&#x435;&#x43c; &#x444;&#x430;&#x439;&#x43b;&#x44b; &#x438; &#x441;&#x43e;&#x437;&#x434;&#x430;&#x451;&#x43c; &#x435;&#x434;&#x438;&#x43d;&#x44b;&#x439; PHP &#x444;&#x430;&#x439;&#x43b;&#x438;&#x43a; &#x441; _(&#x201c;&#x441;&#x43b;&#x43e;&#x432;&#x43e;&#x201d;)."/>
</Properties>
</Component>
<Component class="java.awt.TextArea" name="textArea1">
</Component>
<Component class="java.awt.TextArea" name="textArea2">
</Component>
<Component class="javax.swing.JButton" name="jButton2">
<Properties>
<Property name="text" type="java.lang.String" value="&#x421;&#x43e;&#x445;&#x440;&#x430;&#x43d;&#x438;&#x442;&#x44c; &#x43d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x443;&#x442;&#x438; &#x434;&#x43b;&#x44f; &#x441;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x43d;&#x438;&#x44f;"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Properties>
<Property name="text" type="java.lang.String" value="&#x42d;&#x43a;&#x441;&#x43f;&#x43e;&#x440;&#x442;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> <Container class="javax.swing.JTabbedPane" name="jTabbedPane1">
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
@ -187,8 +128,8 @@
<Container class="javax.swing.JPanel" name="jPanel2"> <Container class="javax.swing.JPanel" name="jPanel2">
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x420;&#x443;&#x441;&#x441;&#x43a;&#x438;&#x439;"> <JTabbedPaneConstraints tabName="&#x41d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438; &#x43f;&#x443;&#x442;&#x435;&#x439; &#x441;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x43d;&#x438;&#x44f;">
<Property name="tabTitle" type="java.lang.String" value="&#x420;&#x443;&#x441;&#x441;&#x43a;&#x438;&#x439;"/> <Property name="tabTitle" type="java.lang.String" value="&#x41d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438; &#x43f;&#x443;&#x442;&#x435;&#x439; &#x441;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x43d;&#x438;&#x44f;"/>
</JTabbedPaneConstraints> </JTabbedPaneConstraints>
</Constraint> </Constraint>
</Constraints> </Constraints>
@ -196,16 +137,221 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="772" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="0" pref="772" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace min="0" pref="338" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="0" pref="338" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<AuxValues>
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTable" name="jTable1">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
<Table columnCount="4" rowCount="4">
<Column editable="true" title="&#x424;&#x430;&#x439;&#x43b;/&#x41f;&#x443;&#x442;&#x44c;" type="java.lang.String"/>
<Column editable="true" title="&#x420;&#x430;&#x441;&#x448;&#x438;&#x440;&#x435;&#x43d;&#x438;&#x44f; &#x444;&#x430;&#x439;&#x43b;&#x43e;&#x432;" type="java.lang.String"/>
<Column editable="true" title="&#x428;&#x430;&#x431;&#x43b;&#x43e;&#x43d; &#x43f;&#x43e;&#x438;&#x441;&#x43a;&#x430;" type="java.lang.String"/>
<Column editable="true" title="&#x428;&#x430;&#x431;&#x43b;&#x43e;&#x43d; &#x43f;&#x440;&#x43e;&#x432;&#x435;&#x440;&#x43a;&#x438;" type="java.lang.String"/>
</Table>
</Property>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
<JTabbedPaneConstraints tabName="&#x41d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438; &#x441;&#x43e;&#x435;&#x434;&#x438;&#x43d;&#x435;&#x43d;&#x438;&#x44f; &#x441; &#x431;&#x430;&#x437;&#x43e;&#x439;">
<Property name="tabTitle" type="java.lang.String" value="&#x41d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438; &#x441;&#x43e;&#x435;&#x434;&#x438;&#x43d;&#x435;&#x43d;&#x438;&#x44f; &#x441; &#x431;&#x430;&#x437;&#x43e;&#x439;"/>
</JTabbedPaneConstraints>
</Constraint>
</Constraints>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jTFDBPassword" max="32767" attributes="0"/>
<Component id="jTFDBUser" max="32767" attributes="0"/>
<Component id="jTFDBURL" pref="647" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jTFDBURL" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jTFDBUser" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jTFDBPassword" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="222" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" value="&#x421;&#x442;&#x440;&#x43e;&#x43a;&#x430; &#x441;&#x43e;&#x435;&#x434;&#x438;&#x43d;&#x435;&#x43d;&#x438;&#x44f;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTFDBURL">
<Properties>
<Property name="text" type="java.lang.String" value="jdbc:postgresql://10.1.7.74:5432/pilot"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x43e;&#x43b;&#x44c;&#x437;&#x43e;&#x432;&#x430;&#x442;&#x435;&#x43b;&#x44c;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTFDBUser">
<Properties>
<Property name="text" type="java.lang.String" value="translate"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x430;&#x440;&#x43e;&#x43b;&#x44c;"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTFDBPassword">
<Properties>
<Property name="text" type="java.lang.String" value="translate"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton5">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x440;&#x43e;&#x432;&#x435;&#x440;&#x438;&#x442;&#x44c; &#x441;&#x43e;&#x435;&#x434;&#x438;&#x43d;&#x435;&#x43d;&#x438;&#x435;"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" value="&#x421;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x442;&#x44c;"/>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x435;&#x440;&#x435;&#x431;&#x438;&#x440;&#x430;&#x435;&#x43c; &#x444;&#x430;&#x439;&#x43b;&#x44b; &#x438; &#x441;&#x43e;&#x437;&#x434;&#x430;&#x451;&#x43c; &#x435;&#x434;&#x438;&#x43d;&#x44b;&#x439; PHP &#x444;&#x430;&#x439;&#x43b;&#x438;&#x43a; &#x441; _(&#x201c;&#x441;&#x43b;&#x43e;&#x432;&#x43e;&#x201d;)."/>
</Properties>
</Component>
<Component class="java.awt.TextArea" name="textArea1">
</Component>
<Container class="javax.swing.JPanel" name="jPanel4">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jBSaveSettings" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="202" max="-2" attributes="0"/>
<Component id="jButton3" max="32767" attributes="0"/>
</Group>
<Component id="textArea2" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="textArea2" min="-2" pref="118" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jBSaveSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="&#x41f;&#x443;&#x442;&#x438; &#x434;&#x43b;&#x44f; &#x441;&#x43a;&#x430;&#x43d;&#x438;&#x440;&#x43e;&#x432;&#x430;&#x43d;&#x438;&#x44f;"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Properties>
<Property name="text" type="java.lang.String" value="&#x42d;&#x43a;&#x441;&#x43f;&#x43e;&#x440;&#x442; PO &#x438;&#x43b;&#x438; XML &#x444;&#x430;&#x439;&#x43b;&#x430;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
<Component class="java.awt.TextArea" name="textArea2">
</Component>
<Component class="javax.swing.JButton" name="jBSaveSettings">
<Properties>
<Property name="text" type="java.lang.String" value="&#x421;&#x43e;&#x445;&#x440;&#x430;&#x43d;&#x438;&#x442;&#x44c; &#x43d;&#x430;&#x441;&#x442;&#x440;&#x43e;&#x439;&#x43a;&#x438;"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jBSaveSettingsActionPerformed"/>
</Events>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
</SubComponents> </SubComponents>

View File

@ -17,6 +17,11 @@ import java.util.List;
import java.util.Stack; import java.util.Stack;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.table.DefaultTableModel;
import org.ini4j.Ini;
/** /**
* *
@ -60,45 +65,35 @@ public class NewJFrame extends javax.swing.JFrame
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
textArea1 = new java.awt.TextArea();
textArea2 = new java.awt.TextArea();
jButton2 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
jTabbedPane1 = new javax.swing.JTabbedPane(); jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel();
jTextField1 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel();
jButton4 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanel3 = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
jTFDBURL = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jTFDBUser = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jTFDBPassword = new javax.swing.JTextField();
jButton5 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
textArea1 = new java.awt.TextArea();
jPanel4 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jButton3 = new javax.swing.JButton();
textArea2 = new java.awt.TextArea();
jBSaveSettings = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
jButton1.setText("Сканировать"); public void windowActivated(java.awt.event.WindowEvent evt) {
jButton1.setName(""); // NOI18N formWindowActivated(evt);
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel1.setText("Перебираем файлы и создаём единый PHP файлик с _(“слово”).");
jButton2.setText("Сохранить настройки");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jLabel2.setText("Пути для сканирования");
jButton3.setText("Экспорт");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
} }
}); });
@ -139,18 +134,154 @@ public class NewJFrame extends javax.swing.JFrame
jTabbedPane1.addTab("English", jPanel1); jTabbedPane1.addTab("English", jPanel1);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Файл/Путь", "Расширения файлов", "Шаблон поиска", "Шаблон проверки"
}
) {
Class[] types = new Class [] {
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
jScrollPane1.setViewportView(jTable1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout); jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup( jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 772, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 772, Short.MAX_VALUE)
); );
jPanel2Layout.setVerticalGroup( jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 338, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE)
); );
jTabbedPane1.addTab("Русский", jPanel2); jTabbedPane1.addTab("Настройки путей сканирования", jPanel2);
jLabel4.setText("Строка соединения");
jTFDBURL.setText("jdbc:postgresql://10.1.7.74:5432/pilot");
jLabel5.setText("Пользователь");
jTFDBUser.setText("translate");
jLabel6.setText("Пароль");
jTFDBPassword.setText("translate");
jButton5.setText("Проверить соединение");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTFDBPassword)
.addComponent(jTFDBUser)
.addComponent(jTFDBURL, javax.swing.GroupLayout.DEFAULT_SIZE, 647, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton5)))
.addContainerGap())
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTFDBURL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTFDBUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTFDBPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5)
.addContainerGap(222, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Настройки соединения с базой", jPanel3);
jButton1.setText("Сканировать");
jButton1.setName(""); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel1.setText("Перебираем файлы и создаём единый PHP файлик с _(“слово”).");
jLabel2.setText("Пути для сканирования");
jButton3.setText("Экспорт PO или XML файла");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jBSaveSettings.setText("Сохранить настройки");
jBSaveSettings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jBSaveSettingsActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jBSaveSettings))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(202, 202, 202)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(textArea2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jButton3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jBSaveSettings)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout); getContentPane().setLayout(layout);
@ -159,38 +290,22 @@ public class NewJFrame extends javax.swing.JFrame
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(textArea2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(textArea1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(textArea1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING)) .addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1))
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
.addGap(24, 24, 24)
.addComponent(jButton2))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jButton3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(textArea2, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1) .addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(textArea1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -216,7 +331,8 @@ public class NewJFrame extends javax.swing.JFrame
bufferedWriter.write("<?\n"); bufferedWriter.write("<?\n");
List searchRes = null; List searchRes = null;
searchRes = finder.findAll(rootDir,"(.*\\.as$)||(.*\\.mxml$)||(.*\\.xml$)"); //searchRes = finder.findAll(rootDir,"(.*\\.as$)||(.*\\.mxml$)||(.*\\.xml$)");
searchRes = finder.findAll(rootDir,"(.*\\.php$)||(.*\\.html$)||(.*\\.xml$)||(.*\\.js$)");
//выводим результаты //выводим результаты
for (int i = 0; i < searchRes.size(); i++) for (int i = 0; i < searchRes.size(); i++)
@ -242,20 +358,22 @@ public class NewJFrame extends javax.swing.JFrame
int from=0; int from=0;
while(true) //Если несколько значений в строке while(true) //Если несколько значений в строке
{ {
int s=line.indexOf("_(", from); String pattern="trt(";
if(s>=0) //int s=line.indexOf("_(", from);
{ int s=line.indexOf(pattern, from);
from=s+2; if(s>=0)
int e=-1; {
if(line.charAt(s+2) == '"') { e=line.indexOf("\")", from); } from=s+pattern.length();
if(line.charAt(s+2) == '\'') { e = line.indexOf("')", from); } int e=-1;
if(e>=0) if(line.charAt(s+pattern.length()) == '"') { e=line.indexOf("\")", from); }
{ if(line.charAt(s+pattern.length()) == '\'') { e = line.indexOf("')", from); }
textArea1.append(line.substring(s, e + 2)+";\n"); if(e>=0)
bufferedWriter.write(" "+line.substring(s, e + 2)+";\n"); {
from=e+2; textArea1.append(line.substring(s, e + 2)+";\n");
} bufferedWriter.write(" "+line.substring(s, e + 2)+";\n");
}else { break; } from=e+2;
}
}else { break; }
} }
} }
bufferedReader.close(); bufferedReader.close();
@ -275,49 +393,69 @@ public class NewJFrame extends javax.swing.JFrame
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton1ActionPerformed
{//GEN-HEADEREND:event_jButton1ActionPerformed {//GEN-HEADEREND:event_jButton1ActionPerformed
BufferedReader reader = new BufferedReader(new StringReader(textArea2.getText())); //Подключаюсь к базе данных
String line1; String url = jTFDBURL.getText(); //"jdbc:postgresql://10.1.7.74:5432/pilot";
String line2; String user = jTFDBUser.getText(); //"translate";
try String password = jTFDBUser.getText(); //"translate";
{ Connection conn = null;
while (true) try {
{ Class.forName("org.postgresql.Driver");
line1 = reader.readLine(); conn = DriverManager.getConnection(url, user, password);
line2 = reader.readLine(); System.out.println("Connected to the PostgreSQL server successfully.");
if(line1==null || line2 == null) break; }catch(ClassNotFoundException | SQLException e){
//Парсим файлы и выписываем идентификаторы для перевода System.out.println(e.getMessage());
parse(line1, line2); //Перезаписывает файл }
}
} catch (IOException ex) BufferedReader reader = new BufferedReader(new StringReader(textArea2.getText()));
{ String line1;
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); String line2;
} try
{
while (true)
{
line1 = reader.readLine();
line2 = reader.readLine();
if(line1==null || line2 == null) break;
//Парсим файлы и выписываем идентификаторы для перевода
parse(line1, line2); //Перезаписывает файл
}
} catch (IOException ex)
{
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton1ActionPerformed }//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed private void jBSaveSettingsActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jBSaveSettingsActionPerformed
{//GEN-HEADEREND:event_jButton2ActionPerformed {//GEN-HEADEREND:event_jBSaveSettingsActionPerformed
FileWriter fileWriter = null; FileWriter fileWriter = null;
try try
{ {
fileWriter = new FileWriter("settings.txt"); Ini ini = new Ini(new File("O:\\temp\\settings.ini"));
BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); ini.put("main", "db_url", jTFDBURL.getText());
bufferedWriter.write(textArea2.getText()); ini.put("main", "db_user", jTFDBUser.getText());
bufferedWriter.close(); ini.put("main", "db_password", jTFDBPassword.getText());
} catch (IOException ex) ini.store();
{
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); fileWriter = new FileWriter("settings.txt");
} finally BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
{ bufferedWriter.write(textArea2.getText());
try bufferedWriter.close();
{ } catch (IOException ex)
fileWriter.close(); {
} catch (IOException ex) Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
{ } finally
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); {
} try
} {
}//GEN-LAST:event_jButton2ActionPerformed fileWriter.close();
} catch (IOException ex)
{
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}
}//GEN-LAST:event_jBSaveSettingsActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
@ -329,6 +467,35 @@ public class NewJFrame extends javax.swing.JFrame
// TODO add your handling code here: // TODO add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed }//GEN-LAST:event_jButton4ActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
try {
File file = new File("O:\\temp\\settings.ini");
if(file.exists()){
Ini ini = new Ini(file);
jTFDBURL.setText(ini.get("main", "db_url"));
jTFDBUser.setText(ini.get("main", "db_user"));
jTFDBPassword.setText(ini.get("main", "db_password"));
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
for(int i=0;i<100;i++){
if(ini.get("path"+i)!=null){
String path = ini.get("path"+i, "path");
String check = ini.get("path"+i, "check");
String extensions = ini.get("path"+i, "extensions");
model.addRow(new Object[]{path, extensions, check});
System.out.print(path);
}
}
//ini.store();
}
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_formWindowActivated
/** /**
* @param args the command line arguments * @param args the command line arguments
*/ */
@ -374,16 +541,27 @@ public class NewJFrame extends javax.swing.JFrame
}); });
} }
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jBSaveSettings;
private javax.swing.JButton jButton1; private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3; private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4; private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField jTFDBPassword;
private javax.swing.JTextField jTFDBURL;
private javax.swing.JTextField jTFDBUser;
private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTable jTable1;
private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField1;
private java.awt.TextArea textArea1; private java.awt.TextArea textArea1;
private java.awt.TextArea textArea2; private java.awt.TextArea textArea2;